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