Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame^] | 1 | Content: |
| 2 | 1. Introduction |
| 3 | 2. Necessary arguments for "configure" |
| 4 | 3. Necessary environment variables for "configure" |
| 5 | 4. Example |
| 6 | |
| 7 | |
| 8 | 1. INTRODUCTION |
| 9 | =============== |
| 10 | |
| 11 | This document discusses cross-compiling VIM on Unix-like systems. We assume |
| 12 | you are already familiar with cross-compiling and have a working cross-compile |
| 13 | environment with at least the following components: |
| 14 | |
| 15 | * a cross-compiler |
| 16 | * a libc to link against |
| 17 | * ncurses library to link against |
| 18 | |
| 19 | Discussing how to set up a cross-compile environment would go beyond the scope |
| 20 | of this document. See http://www.kegel.com/crosstool/ for more information and |
| 21 | a script that aids in setting up such an environment. |
| 22 | |
| 23 | |
| 24 | The problem is that "configure" needs to compile and run small test programs |
| 25 | to check for certain features. Running these test programs can't be done when |
| 26 | cross-compiling so we need to pass the results these checks would produce via |
| 27 | environment variables. See the list of variables and the examples at the end of |
| 28 | this document. |
| 29 | |
| 30 | |
| 31 | 2. NECESSARY ARGUMENTS FOR "configure" |
| 32 | ====================================== |
| 33 | |
| 34 | You 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 | |
| 55 | 3. NECESSARY ENVIRONMENT VARIABLES FOR "configure" |
| 56 | ================================================== |
| 57 | |
| 58 | Additionally to the variables listed here you might want to set the CPPFLAGS |
| 59 | environment variable to enable optimization for your target system (e.g. |
| 60 | "CPPFLAGS=-march=arm5te"). |
| 61 | |
| 62 | The following variables need to be set: |
| 63 | |
| 64 | ac_cv_sizeof_int: |
| 65 | The size of an "int" C type in bytes. Should be "4" on all 32bit |
| 66 | machines. |
| 67 | |
| 68 | vi_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 | |
| 74 | vi_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 | |
| 81 | vi_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 | |
| 87 | vi_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 | |
| 93 | vim_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 | |
| 99 | vim_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 | |
| 104 | vim_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 | |
| 110 | vim_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 | |
| 114 | vim_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 | |
| 119 | vim_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 | |
| 124 | vim_cv_terminfo: |
| 125 | Whether the environment has terminfo support. Set to "yes" if so, |
| 126 | otherwise set to "no". |
| 127 | |
| 128 | vim_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 | |
| 132 | vim_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 | |
| 136 | vim_cv_tty_mode: |
| 137 | The default mode of pseudo terminals if they are not world accessable. |
| 138 | Most propably the value "0620". |
| 139 | |
| 140 | |
| 141 | 4. EXAMPLE: |
| 142 | =========== |
| 143 | |
| 144 | Assuming the target system string is "armeb-xscale-linux-gnu" (a Intel XScale |
| 145 | system) with glibc and ncurses, the call to configure would look like this: |
| 146 | |
| 147 | ac_cv_sizeof_int=4 \ |
| 148 | vim_cv_getcwd_broken=no \ |
| 149 | vim_cv_memmove_handles_overlap=yes \ |
| 150 | vim_cv_stat_ignores_slash=yes \ |
| 151 | vim_cv_tgetent=zero \ |
| 152 | vim_cv_terminfo=yes \ |
| 153 | vim_cv_toupper_broken=no \ |
| 154 | vim_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 | |
| 163 | Written 2007 by Marc Haisenko <marc@darkdust.net> for the VIM project. |