aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/3_Compiling.md
blob: ed007d612ed05939acad97e3f11594618f50b987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Compiling

## Requirements

The requirements for building Textadept are not quite so minimal.

#### Linux & BSD

Linux systems will need the GTK+ development libraries. Your package manager
should allow you to install them. For Debian-based distributions, the package is
typically called `libgtk2.0-dev`. Otherwise, compile and install it from the
[GTK+ website][GTK-Linux]. Additionally you will need the [GNU C compiler][GCC]
(`gcc`) and [GNU Make][Make] (`make`). Both should be available for your Linux
distribution through its package manager.

[GTK-Linux]: http://www.gtk.org/download-linux.html
[GCC]: http://gcc.gnu.org
[Make]: http://www.gnu.org/software/make/

#### Windows

Compiling Textadept on Windows is no longer supported. If you wish to do so
however, you will need a C compiler that supports the C99 standard (Microsoft's
does not) and the [GTK+ for Windows bundle][GTK-Win32] (2.16 is recommended).

The preferred way to compile for Windows is cross-compiling from Linux. To do
so, in addition to the GTK bundle mentioned above, you will need [MinGW][MinGW]
with the Windows header files. They should be available from your package
manager.

[GTK-Win32]: http://www.gtk.org/download-windows.html
[MinGW]: http://mingw.org

#### Mac OSX

[XCode][XCode] is needed for Mac OSX as well as [jhbuild][GTK-OSX]. After
building `meta-gtk-osx-bootstrap` and `meta-gtk-osx-core`, you will need to
build `meta-gtk-osx-themes`. Note that the entire compiling process can easily
take 30 minutes or more and ultimately consume nearly 1GB of disk space.

[XCode]: http://developer.apple.com/TOOLS/xcode/
[GTK-OSX]: http://sourceforge.net/apps/trac/gtk-osx/wiki/Build

## Download

Download the `textadept_x.x.src.zip`, regardless of what platform you are on.

## Compiling

#### Linux & BSD

For Linux systems, simply run `make` in the `src/` directory. The `textadept`
executable will be created in the root directory. You can make a symlink from
it to `/usr/bin/` or elsewhere in your `PATH`.

BSD users please run `make BSD=1`.

#### Windows (Cross-Compiling from Linux)

When cross-compiling from within Linux, first unzip the GTK+ for Windows bundle
into a new `src/win32gtk` directory. Then modify the `CC`, `CPP`, and `WINDRES`
variables in the `WIN32` block of `src/Makefile` to match your MinGW
installation and run `make WIN32=1` to build `../textadept.exe`.

#### Mac OSX

After using `jhbuild`, GTK is in `~/gtk` so make a symlink from `~/gtk/inst` to
`src/gtkosx` in Textadept. Then run `make OSX=1` to build `../textadept.osx`. At
this point it is recommended to build a new `textadept.app` from an existing
one. Download the most recent app and replace `Contents/MacOS/textadept.osx`,
all `.dylib` files in `Contents/Resources/lib`, and all `.so` files in
`Contents/Resources/lib/gtk-2.0/[version]/{engines,immodules,loaders}` with your
own versions in `src/gtkosx/lib`. If you wish, you may also replace the files
in `Contents/Resources/{etc,share}`, but these rarely change.

## Problems

#### Mac OSX

In Mac OSX, if the build fails because of a

    `redefinition of 'struct Sci_TextRange'`

error, you will need to open `src/scintilla/include/Scintilla.h` and comment
out the following lines (put `//` at the start of the line):

    #define CharacterRange Sci_CharacterRange
    #define TextRange Sci_TextRange
    #define TextToFind Sci_TextToFind