blob: 0ba6a776e0844a414a28c8896faff2286be51035 [file] [log] [blame]
Bram Moolenaar446cb832008-06-24 21:56:24 +00001Content:
2 1. Introduction
3 2. Necessary arguments for "configure"
4 3. Necessary environment variables for "configure"
5 4. Example
6
7
81. INTRODUCTION
9===============
10
11This document discusses cross-compiling VIM on Unix-like systems. We assume
12you are already familiar with cross-compiling and have a working cross-compile
13environment with at least the following components:
14
15 * a cross-compiler
16 * a libc to link against
17 * ncurses library to link against
18
19Discussing how to set up a cross-compile environment would go beyond the scope
20of this document. See http://www.kegel.com/crosstool/ for more information and
21a script that aids in setting up such an environment.
22
23
24The problem is that "configure" needs to compile and run small test programs
25to check for certain features. Running these test programs can't be done when
26cross-compiling so we need to pass the results these checks would produce via
27environment variables. See the list of variables and the examples at the end of
28this document.
29
30
312. NECESSARY ARGUMENTS FOR "configure"
32======================================
33
34You need to set the following "configure" command line switches:
35
36--build=... :
37 The build system (i.e. the platform name of the system you compile on
38 right now).
39 For example, "i586-linux".
40
41--host=... :
42 The system on which VIM will be run. Quite often this the name of your
43 cross-compiler without the "-gcc".
44 For example, "powerpc-603-linux-gnu".
45
46--target=... :
47 Only relevant for compiling compilers. Set this to the same value as
48 --host.
49
50--with-tlib=... :
51 Which terminal library to.
52 For example, "ncurses".
53
54
553. NECESSARY ENVIRONMENT VARIABLES FOR "configure"
56==================================================
57
58Additionally to the variables listed here you might want to set the CPPFLAGS
59environment variable to enable optimization for your target system (e.g.
60"CPPFLAGS=-march=arm5te").
61
62The following variables need to be set:
63
64ac_cv_sizeof_int:
65 The size of an "int" C type in bytes. Should be "4" on all 32bit
66 machines.
67
68vi_cv_path_python_conf:
69 If Python support is enabled, set this variables to the path for
70 Python's library implementation. This is a path like
71 "/usr/lib/pythonX.Y/config" (the directory contains a file
72 "config.c").
73
74vi_cv_var_python_epfx:
75 If Python support is enabled, set this variables to the execution
76 prefix of your Python interpreter (that is, where it thinks it is
77 running).
78 This is the output of the following Python script:
79 import sys; print sys.exec_prefix
80
81vi_cv_var_python_pfx:
82 If Python support is enabled, set this variables to the prefix of your
83 Python interpreter (that is, where was installed).
84 This is the output of the following Python script:
85 import sys; print sys.prefix
86
87vi_cv_var_python_version:
88 If Python support is enabled, set this variables to the version of the
89 Python interpreter that will be used.
90 This is the output of the following Python script:
91 import sys; print sys.version[:3]
92
93vim_cv_bcopy_handles_overlap:
94 Whether the "memmove" C library call is able to copy overlapping
95 memory regions. Set to "yes" if it does or "no" if it does not.
96 You only need to set this if vim_cv_memmove_handles_overlap is set
97 to "no".
98
99vim_cv_getcwd_broken:
100 Whether the "getcwd" C library call is broken. Set to "yes" if you
101 know that "getcwd" is implemented as 'system("sh -c pwd")', set to
102 "no" otherwise.
103
104vim_cv_memcpy_handles_overlap:
105 Whether the "memcpy" C library call is able to copy overlapping
106 memory regions. Set to "yes" if it does or "no" if it does not.
107 You only need to set this if both vim_cv_memmove_handles_overlap
108 and vim_cv_bcopy_handles_overlap are set to "no".
109
110vim_cv_memmove_handles_overlap:
111 Whether the "memmove" C library call is able to copy overlapping
112 memory regions. Set to "yes" if it does or "no" if it does not.
113
114vim_cv_stat_ignores_slash:
115 Whether the "stat" C library call ignores trailing slashes in the path
116 name. Set to "yes" if it ignores them or "no" if it does not ignore
117 them.
118
119vim_cv_tgetent:
120 Whether the "tgetent" terminal library call returns a zero or non-zero
121 value when it encounters an unknown terminal. Set to either the string
122 "zero" or "non-zero", corresponding.
123
124vim_cv_terminfo:
125 Whether the environment has terminfo support. Set to "yes" if so,
126 otherwise set to "no".
127
128vim_cv_toupper_broken:
129 Whether the "toupper" C library function works correctly. Set to "yes"
130 if you know it's broken, otherwise set to "no".
131
132vim_cv_tty_group:
133 The default group of pseudo terminals. Either set to the numeric value
134 of the your tty group or to "world" if they are world accessable.
135
136vim_cv_tty_mode:
137 The default mode of pseudo terminals if they are not world accessable.
138 Most propably the value "0620".
139
140
1414. EXAMPLE:
142===========
143
144Assuming the target system string is "armeb-xscale-linux-gnu" (a Intel XScale
145system) with glibc and ncurses, the call to configure would look like this:
146
147ac_cv_sizeof_int=4 \
148vim_cv_getcwd_broken=no \
149vim_cv_memmove_handles_overlap=yes \
150vim_cv_stat_ignores_slash=yes \
151vim_cv_tgetent=zero \
152vim_cv_terminfo=yes \
153vim_cv_toupper_broken=no \
154vim_cv_tty_group=world \
155./configure \
156 --build=i586-linux \
157 --host=armeb-xscale-linux-gnu \
158 --target=armeb-xscale-linux-gnu \
159 --with-tlib=ncurses
160
161
162
163Written 2007 by Marc Haisenko <marc@darkdust.net> for the VIM project.