Mercurial > vim
annotate src/configure.in @ 5413:3109053ce4e3 v7.4.057
updated for version 7.4.057
Problem: byteidx() does not work for composing characters.
Solution: Add byteidxcomp().
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 02 Nov 2013 23:29:26 +0100 |
parents | 38a755adc580 |
children | 739074bdceb8 |
rev | line source |
---|---|
7 | 1 dnl configure.in: autoconf script for Vim |
2 | |
3 dnl Process this file with autoconf 2.12 or 2.13 to produce "configure". | |
4 dnl Should also work with autoconf 2.54 and later. | |
5 | |
6 AC_INIT(vim.h) | |
7 AC_CONFIG_HEADER(auto/config.h:config.h.in) | |
8 | |
9 dnl Being able to run configure means the system is Unix (compatible). | |
10 AC_DEFINE(UNIX) | |
11 AC_PROG_MAKE_SET | |
12 | |
13 dnl Checks for programs. | |
14 AC_PROG_CC dnl required by almost everything | |
15 AC_PROG_CPP dnl required by header file checks | |
16 AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP | |
17 AC_ISC_POSIX dnl required by AC_C_CROSS | |
18 AC_PROG_AWK dnl required for "make html" in ../doc | |
19 | |
20 dnl Don't strip if we don't have it | |
21 AC_CHECK_PROG(STRIP, strip, strip, :) | |
22 | |
14 | 23 dnl Check for extension of executables |
7 | 24 AC_EXEEXT |
25 | |
1621 | 26 dnl Check for standard headers. We don't use this in Vim but other stuff |
27 dnl in autoconf needs it, where it uses STDC_HEADERS. | |
28 AC_HEADER_STDC | |
29 AC_HEADER_SYS_WAIT | |
30 | |
3222 | 31 dnl Check for the flag that fails if stuff are missing. |
32 | |
33 AC_MSG_CHECKING(--enable-fail-if-missing argument) | |
34 AC_ARG_ENABLE(fail_if_missing, | |
35 [ --enable-fail-if-missing Fail if dependencies on additional features | |
36 specified on the command line are missing.], | |
37 [fail_if_missing="yes"], | |
38 [fail_if_missing="no"]) | |
39 AC_MSG_RESULT($fail_if_missing) | |
40 | |
7 | 41 dnl Set default value for CFLAGS if none is defined or it's empty |
42 if test -z "$CFLAGS"; then | |
43 CFLAGS="-O" | |
44 test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" | |
45 fi | |
46 if test "$GCC" = yes; then | |
819 | 47 dnl method that should work for nearly all versions |
48 gccversion=`"$CC" -dumpversion` | |
49 if test "x$gccversion" = "x"; then | |
50 dnl old method; fall-back for when -dumpversion doesn't work | |
51 gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` | |
52 fi | |
557 | 53 dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki |
54 if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then | |
697 | 55 echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"' |
7 | 56 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'` |
57 else | |
58 if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then | |
59 echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"' | |
60 CFLAGS="$CFLAGS -fno-strength-reduce" | |
61 fi | |
62 fi | |
63 fi | |
64 | |
5394 | 65 dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a |
66 dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on | |
67 dnl the version number of the clang in use. | |
68 dnl Note that this does not work to get the version of clang 3.1 or 3.2. | |
69 AC_MSG_CHECKING(for recent clang version) | |
70 CLANG_VERSION_STRING=`"$CC" --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'` | |
71 if test x"$CLANG_VERSION_STRING" != x"" ; then | |
72 CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'` | |
73 CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'` | |
74 CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'` | |
75 CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION` | |
76 AC_MSG_RESULT($CLANG_VERSION) | |
77 dnl If you find the same issue with versions earlier than 500.2.75, | |
78 dnl change the constant 500002075 below appropriately. To get the | |
79 dnl integer corresponding to a version number, refer to the | |
80 dnl definition of CLANG_VERSION above. | |
81 if test "$CLANG_VERSION" -ge 500002075 ; then | |
82 CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'` | |
83 fi | |
84 else | |
85 AC_MSG_RESULT(no) | |
86 fi | |
87 | |
1621 | 88 dnl If configure thinks we are cross compiling, there might be something |
89 dnl wrong with the CC or CFLAGS settings, give a useful warning message | |
7 | 90 if test "$cross_compiling" = yes; then |
1621 | 91 AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS]) |
7 | 92 fi |
93 | |
548 | 94 dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies. |
95 dnl But gcc 3.1 changed the meaning! See near the end. | |
7 | 96 test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM) |
97 | |
98 if test -f ./toolcheck; then | |
99 AC_CHECKING(for buggy tools) | |
100 sh ./toolcheck 1>&AC_FD_MSG | |
101 fi | |
102 | |
103 OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" | |
104 | |
105 dnl Check for BeOS, which needs an extra source file | |
106 AC_MSG_CHECKING(for BeOS) | |
107 case `uname` in | |
108 BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o | |
109 BEOS=yes; AC_MSG_RESULT(yes);; | |
110 *) BEOS=no; AC_MSG_RESULT(no);; | |
111 esac | |
112 | |
113 dnl If QNX is found, assume we don't want to use Xphoton | |
114 dnl unless it was specifically asked for (--with-x) | |
115 AC_MSG_CHECKING(for QNX) | |
116 case `uname` in | |
117 QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o | |
118 test -z "$with_x" && with_x=no | |
119 QNX=yes; AC_MSG_RESULT(yes);; | |
120 *) QNX=no; AC_MSG_RESULT(no);; | |
121 esac | |
122 | |
123 dnl Check for Darwin and MacOS X | |
124 dnl We do a check for MacOS X in the very beginning because there | |
125 dnl are a lot of other things we need to change besides GUI stuff | |
126 AC_MSG_CHECKING([for Darwin (Mac OS X)]) | |
127 if test "`(uname) 2>/dev/null`" = Darwin; then | |
128 AC_MSG_RESULT(yes) | |
129 | |
130 AC_MSG_CHECKING(--disable-darwin argument) | |
131 AC_ARG_ENABLE(darwin, | |
132 [ --disable-darwin Disable Darwin (Mac OS X) support.], | |
133 , [enable_darwin="yes"]) | |
134 if test "$enable_darwin" = "yes"; then | |
135 AC_MSG_RESULT(no) | |
136 AC_MSG_CHECKING(if Darwin files are there) | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
137 if test -f os_macosx.m; then |
7 | 138 AC_MSG_RESULT(yes) |
139 else | |
140 AC_MSG_RESULT([no, Darwin support disabled]) | |
141 enable_darwin=no | |
142 fi | |
143 else | |
144 AC_MSG_RESULT([yes, Darwin support excluded]) | |
145 fi | |
146 | |
692 | 147 AC_MSG_CHECKING(--with-mac-arch argument) |
809 | 148 AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], |
692 | 149 MACARCH="$withval"; AC_MSG_RESULT($MACARCH), |
809 | 150 MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) |
692 | 151 |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
152 AC_MSG_CHECKING(--with-developer-dir argument) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
153 AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
154 DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
155 DEVELOPER_DIR=""; AC_MSG_RESULT(not present)) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
156 |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
157 if test "x$DEVELOPER_DIR" = "x"; then |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
158 AC_PATH_PROG(XCODE_SELECT, xcode-select) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
159 if test "x$XCODE_SELECT" != "x"; then |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
160 AC_MSG_CHECKING(for developer dir using xcode-select) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
161 DEVELOPER_DIR=`$XCODE_SELECT -print-path` |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
162 AC_MSG_RESULT([$DEVELOPER_DIR]) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
163 else |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
164 DEVELOPER_DIR=/Developer |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
165 fi |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
166 fi |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
167 |
692 | 168 if test "x$MACARCH" = "xboth"; then |
697 | 169 AC_MSG_CHECKING(for 10.4 universal SDK) |
170 dnl There is a terrible inconsistency (but we appear to get away with it): | |
171 dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS | |
172 dnl doesn't, because "gcc -E" doesn't grok it. That means the configure | |
173 dnl tests using the preprocessor are actually done with the wrong header | |
174 dnl files. $LDFLAGS is set at the end, because configure uses it together | |
175 dnl with $CFLAGS and we can only have one -sysroot argument. | |
692 | 176 save_cppflags="$CPPFLAGS" |
697 | 177 save_cflags="$CFLAGS" |
692 | 178 save_ldflags="$LDFLAGS" |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
179 CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
692 | 180 AC_TRY_LINK([ ], [ ], |
697 | 181 AC_MSG_RESULT(found, will make universal binary), |
692 | 182 |
697 | 183 AC_MSG_RESULT(not found) |
716 | 184 CFLAGS="$save_cflags" |
697 | 185 AC_MSG_CHECKING(if Intel architecture is supported) |
186 CPPFLAGS="$CPPFLAGS -arch i386" | |
187 LDFLAGS="$save_ldflags -arch i386" | |
188 AC_TRY_LINK([ ], [ ], | |
189 AC_MSG_RESULT(yes); MACARCH="intel", | |
190 AC_MSG_RESULT(no, using PowerPC) | |
856 | 191 MACARCH="ppc" |
697 | 192 CPPFLAGS="$save_cppflags -arch ppc" |
193 LDFLAGS="$save_ldflags -arch ppc")) | |
194 elif test "x$MACARCH" = "xintel"; then | |
195 CPPFLAGS="$CPPFLAGS -arch intel" | |
196 LDFLAGS="$LDFLAGS -arch intel" | |
818 | 197 elif test "x$MACARCH" = "xppc"; then |
697 | 198 CPPFLAGS="$CPPFLAGS -arch ppc" |
199 LDFLAGS="$LDFLAGS -arch ppc" | |
692 | 200 fi |
201 | |
7 | 202 if test "$enable_darwin" = "yes"; then |
203 MACOSX=yes | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
204 OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; |
18 | 205 OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" |
685 | 206 dnl TODO: use -arch i386 on Intel machines |
697 | 207 CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" |
7 | 208 |
5409 | 209 dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon |
210 dnl so we need to include it to have access to version macros. | |
211 AC_CHECK_HEADER(AvailabilityMacros.h, [AC_DEFINE(HAVE_AVAILABILITYMACROS_H, 1, [ Define if we have AvailabilityMacros.h on Mac OS X ])]) | |
212 | |
7 | 213 dnl If Carbon is found, assume we don't want X11 |
214 dnl unless it was specifically asked for (--with-x) | |
18 | 215 dnl or Motif, Athena or GTK GUI is used. |
7 | 216 AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) |
217 if test "x$CARBON" = "xyes"; then | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
218 if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then |
7 | 219 with_x=no |
220 fi | |
221 fi | |
222 fi | |
692 | 223 |
798 | 224 dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double |
699 | 225 dnl free. This happens in expand_filename(), because the optimizer swaps |
798 | 226 dnl two blocks of code, both using "repl", that can't be swapped. |
697 | 227 if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then |
228 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` | |
229 fi | |
230 | |
7 | 231 else |
232 AC_MSG_RESULT(no) | |
233 fi | |
234 | |
235 AC_SUBST(OS_EXTRA_SRC) | |
236 AC_SUBST(OS_EXTRA_OBJ) | |
237 | |
238 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS. | |
239 dnl Only when the directory exists and it wasn't there yet. | |
240 dnl For gcc don't do this when it is already in the default search path. | |
1621 | 241 dnl Skip all of this when cross-compiling. |
242 if test "$cross_compiling" = no; then | |
1668 | 243 AC_MSG_CHECKING(--with-local-dir argument) |
1621 | 244 have_local_include='' |
245 have_local_lib='' | |
1668 | 246 AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries. |
247 --without-local-dir do not search /usr/local for local libraries.], [ | |
248 local_dir="$withval" | |
249 case "$withval" in | |
250 */*) ;; | |
251 no) | |
252 # avoid adding local dir to LDFLAGS and CPPFLAGS | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
253 have_local_include=yes |
1668 | 254 have_local_lib=yes |
255 ;; | |
256 *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;; | |
257 esac | |
258 AC_MSG_RESULT($local_dir) | |
259 ], [ | |
260 local_dir=/usr/local | |
261 AC_MSG_RESULT(Defaulting to $local_dir) | |
262 ]) | |
263 if test "$GCC" = yes -a "$local_dir" != no; then | |
1621 | 264 echo 'void f(){}' > conftest.c |
265 dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler) | |
1668 | 266 have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"` |
267 have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` | |
1621 | 268 rm -f conftest.c conftest.o |
7 | 269 fi |
1668 | 270 if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then |
271 tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"` | |
1621 | 272 if test "$tt" = "$LDFLAGS"; then |
1668 | 273 LDFLAGS="$LDFLAGS -L${local_dir}/lib" |
1621 | 274 fi |
275 fi | |
1668 | 276 if test -z "$have_local_include" -a -d "${local_dir}/include"; then |
277 tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"` | |
1621 | 278 if test "$tt" = "$CPPFLAGS"; then |
1668 | 279 CPPFLAGS="$CPPFLAGS -I${local_dir}/include" |
1621 | 280 fi |
7 | 281 fi |
282 fi | |
283 | |
284 AC_MSG_CHECKING(--with-vim-name argument) | |
285 AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable], | |
286 VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME), | |
502 | 287 VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME)) |
7 | 288 AC_SUBST(VIMNAME) |
289 AC_MSG_CHECKING(--with-ex-name argument) | |
290 AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable], | |
291 EXNAME="$withval"; AC_MSG_RESULT($EXNAME), | |
292 EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex)) | |
293 AC_SUBST(EXNAME) | |
294 AC_MSG_CHECKING(--with-view-name argument) | |
295 AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable], | |
296 VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME), | |
297 VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view)) | |
298 AC_SUBST(VIEWNAME) | |
299 | |
300 AC_MSG_CHECKING(--with-global-runtime argument) | |
301 AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'], | |
302 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"), | |
303 AC_MSG_RESULT(no)) | |
304 | |
305 AC_MSG_CHECKING(--with-modified-by argument) | |
306 AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version], | |
307 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"), | |
308 AC_MSG_RESULT(no)) | |
309 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
310 dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix |
7 | 311 AC_MSG_CHECKING(if character set is EBCDIC) |
312 AC_TRY_COMPILE([ ], | |
313 [ /* TryCompile function for CharSet. | |
314 Treat any failure as ASCII for compatibility with existing art. | |
315 Use compile-time rather than run-time tests for cross-compiler | |
316 tolerance. */ | |
317 #if '0'!=240 | |
318 make an error "Character set is not EBCDIC" | |
319 #endif ], | |
320 [ # TryCompile action if true | |
321 cf_cv_ebcdic=yes ], | |
322 [ # TryCompile action if false | |
323 cf_cv_ebcdic=no]) | |
324 # end of TryCompile ]) | |
325 # end of CacheVal CvEbcdic | |
326 AC_MSG_RESULT($cf_cv_ebcdic) | |
327 case "$cf_cv_ebcdic" in #(vi | |
328 yes) AC_DEFINE(EBCDIC) | |
329 line_break='"\\n"' | |
330 ;; | |
331 *) line_break='"\\012"';; | |
332 esac | |
333 AC_SUBST(line_break) | |
334 | |
335 if test "$cf_cv_ebcdic" = "yes"; then | |
4352 | 336 dnl If we have EBCDIC we most likely have z/OS Unix, let's test it! |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
337 AC_MSG_CHECKING(for z/OS Unix) |
7 | 338 case `uname` in |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
339 OS/390) zOSUnix="yes"; |
7 | 340 dnl If using cc the environment variable _CC_CCMODE must be |
341 dnl set to "1", so that some compiler extensions are enabled. | |
342 dnl If using c89 the environment variable is named _CC_C89MODE. | |
343 dnl Note: compile with c89 never tested. | |
344 if test "$CC" = "cc"; then | |
345 ccm="$_CC_CCMODE" | |
346 ccn="CC" | |
347 else | |
348 if test "$CC" = "c89"; then | |
349 ccm="$_CC_C89MODE" | |
350 ccn="C89" | |
351 else | |
352 ccm=1 | |
353 fi | |
354 fi | |
355 if test "$ccm" != "1"; then | |
356 echo "" | |
357 echo "------------------------------------------" | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
358 echo " On z/OS Unix, the environment variable" |
3590 | 359 echo " _CC_${ccn}MODE must be set to \"1\"!" |
7 | 360 echo " Do:" |
361 echo " export _CC_${ccn}MODE=1" | |
362 echo " and then call configure again." | |
363 echo "------------------------------------------" | |
364 exit 1 | |
365 fi | |
3590 | 366 # Set CFLAGS for configure process. |
367 # This will be reset later for config.mk. | |
368 # Use haltonmsg to force error for missing H files. | |
369 CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; | |
370 LDFLAGS="$LDFLAGS -Wl,EDIT=NO" | |
7 | 371 AC_MSG_RESULT(yes) |
372 ;; | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
373 *) zOSUnix="no"; |
7 | 374 AC_MSG_RESULT(no) |
375 ;; | |
376 esac | |
377 fi | |
378 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
379 dnl Set QUOTESED. Needs additional backslashes on zOS |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
380 if test "$zOSUnix" = "yes"; then |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
381 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
382 else |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
383 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
384 fi |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
385 AC_SUBST(QUOTESED) |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
386 |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
387 |
1583 | 388 dnl Link with -lselinux for SELinux stuff; if not found |
389 AC_MSG_CHECKING(--disable-selinux argument) | |
390 AC_ARG_ENABLE(selinux, | |
391 [ --disable-selinux Don't check for SELinux support.], | |
392 , enable_selinux="yes") | |
393 if test "$enable_selinux" = "yes"; then | |
394 AC_MSG_RESULT(no) | |
395 AC_CHECK_LIB(selinux, is_selinux_enabled, | |
396 [LIBS="$LIBS -lselinux" | |
397 AC_DEFINE(HAVE_SELINUX)]) | |
398 else | |
399 AC_MSG_RESULT(yes) | |
400 fi | |
7 | 401 |
402 dnl Check user requested features. | |
403 | |
404 AC_MSG_CHECKING(--with-features argument) | |
405 AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)], | |
406 features="$withval"; AC_MSG_RESULT($features), | |
407 features="normal"; AC_MSG_RESULT(Defaulting to normal)) | |
408 | |
409 dovimdiff="" | |
410 dogvimdiff="" | |
411 case "$features" in | |
412 tiny) AC_DEFINE(FEAT_TINY) ;; | |
413 small) AC_DEFINE(FEAT_SMALL) ;; | |
414 normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff"; | |
415 dogvimdiff="installgvimdiff" ;; | |
416 big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff"; | |
417 dogvimdiff="installgvimdiff" ;; | |
418 huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff"; | |
419 dogvimdiff="installgvimdiff" ;; | |
420 *) AC_MSG_RESULT([Sorry, $features is not supported]) ;; | |
421 esac | |
422 | |
423 AC_SUBST(dovimdiff) | |
424 AC_SUBST(dogvimdiff) | |
425 | |
426 AC_MSG_CHECKING(--with-compiledby argument) | |
427 AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message], | |
428 compiledby="$withval"; AC_MSG_RESULT($withval), | |
429 compiledby=""; AC_MSG_RESULT(no)) | |
430 AC_SUBST(compiledby) | |
431 | |
432 AC_MSG_CHECKING(--disable-xsmp argument) | |
433 AC_ARG_ENABLE(xsmp, | |
434 [ --disable-xsmp Disable XSMP session management], | |
435 , enable_xsmp="yes") | |
436 | |
437 if test "$enable_xsmp" = "yes"; then | |
438 AC_MSG_RESULT(no) | |
439 AC_MSG_CHECKING(--disable-xsmp-interact argument) | |
440 AC_ARG_ENABLE(xsmp-interact, | |
441 [ --disable-xsmp-interact Disable XSMP interaction], | |
442 , enable_xsmp_interact="yes") | |
443 if test "$enable_xsmp_interact" = "yes"; then | |
444 AC_MSG_RESULT(no) | |
445 AC_DEFINE(USE_XSMP_INTERACT) | |
446 else | |
447 AC_MSG_RESULT(yes) | |
448 fi | |
449 else | |
450 AC_MSG_RESULT(yes) | |
451 fi | |
452 | |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
453 dnl Check for Lua feature. |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
454 AC_MSG_CHECKING(--enable-luainterp argument) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
455 AC_ARG_ENABLE(luainterp, |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
456 [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
457 [enable_luainterp="no"]) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
458 AC_MSG_RESULT($enable_luainterp) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
459 |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
460 if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
461 dnl -- find the lua executable |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
462 AC_SUBST(vi_cv_path_lua) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
463 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
464 AC_MSG_CHECKING(--with-lua-prefix argument) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
465 AC_ARG_WITH(lua_prefix, |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
466 [ --with-lua-prefix=PFX Prefix where Lua is installed.], |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
467 with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix), |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
468 with_lua_prefix="";AC_MSG_RESULT(no)) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
469 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
470 if test "X$with_lua_prefix" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
471 vi_cv_path_lua_pfx="$with_lua_prefix" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
472 else |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
473 AC_MSG_CHECKING(LUA_PREFIX environment var) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
474 if test "X$LUA_PREFIX" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
475 AC_MSG_RESULT("$LUA_PREFIX") |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
476 vi_cv_path_lua_pfx="$LUA_PREFIX" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
477 else |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
478 AC_MSG_RESULT([not set, default to /usr]) |
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
479 vi_cv_path_lua_pfx="/usr" |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
480 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
481 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
482 |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
483 AC_MSG_CHECKING(--with-luajit) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
484 AC_ARG_WITH(luajit, |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
485 [ --with-luajit Link with LuaJIT instead of Lua.], |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
486 [vi_cv_with_luajit="$withval"], |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
487 [vi_cv_with_luajit="no"]) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
488 AC_MSG_RESULT($vi_cv_with_luajit) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
489 |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
490 LUA_INC= |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
491 if test "X$vi_cv_path_lua_pfx" != "X"; then |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
492 if test "x$vi_cv_with_luajit" != "xno"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
493 dnl -- try to find LuaJIT executable |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
494 AC_PATH_PROG(vi_cv_path_luajit, luajit) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
495 if test "X$vi_cv_path_luajit" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
496 dnl -- find LuaJIT version |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
497 AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit, |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
498 [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]] .*/\1/'` ]) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
499 AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit, |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
500 [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ]) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
501 vi_cv_path_lua="$vi_cv_path_luajit" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
502 vi_cv_version_lua="$vi_cv_version_lua_luajit" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
503 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
504 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
505 dnl -- try to find Lua executable |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
506 AC_PATH_PROG(vi_cv_path_plain_lua, lua) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
507 if test "X$vi_cv_path_plain_lua" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
508 dnl -- find Lua version |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
509 AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua, |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
510 [ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ]) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
511 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
512 vi_cv_path_lua="$vi_cv_path_plain_lua" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
513 vi_cv_version_lua="$vi_cv_version_plain_lua" |
3833 | 514 fi |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
515 if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
516 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
517 if test -f $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
518 AC_MSG_RESULT(yes) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
519 LUA_INC=/luajit-$vi_cv_version_luajit |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
520 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
521 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
522 if test "X$LUA_INC" = "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
523 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
524 if test -f $vi_cv_path_lua_pfx/include/lua.h; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
525 AC_MSG_RESULT(yes) |
3833 | 526 else |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
527 AC_MSG_RESULT(no) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
528 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
529 if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
530 AC_MSG_RESULT(yes) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
531 LUA_INC=/lua$vi_cv_version_lua |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
532 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
533 AC_MSG_RESULT(no) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
534 vi_cv_path_lua_pfx= |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
535 fi |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
536 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
537 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
538 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
539 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
540 if test "X$vi_cv_path_lua_pfx" != "X"; then |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
541 if test "x$vi_cv_with_luajit" != "xno"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
542 multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
543 if test "X$multiarch" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
544 lib_multiarch="lib/${multiarch}" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
545 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
546 lib_multiarch="lib" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
547 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
548 if test "X$vi_cv_version_lua" = "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
549 LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
550 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
551 LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
552 fi |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
553 else |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
554 if test "X$LUA_INC" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
555 dnl Test alternate location using version |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
556 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
557 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
558 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
559 fi |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
560 fi |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
561 if test "$enable_luainterp" = "dynamic"; then |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
562 lua_ok="yes" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
563 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
564 AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane]) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
565 libs_save=$LIBS |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
566 LIBS="$LIBS $LUA_LIBS" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
567 AC_TRY_LINK(,[ ], |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
568 AC_MSG_RESULT(yes); lua_ok="yes", |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
569 AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="") |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
570 LIBS=$libs_save |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
571 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
572 if test "x$lua_ok" = "xyes"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
573 LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
574 LUA_SRC="if_lua.c" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
575 LUA_OBJ="objects/if_lua.o" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
576 LUA_PRO="if_lua.pro" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
577 AC_DEFINE(FEAT_LUA) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
578 fi |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
579 if test "$enable_luainterp" = "dynamic"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
580 if test "x$vi_cv_with_luajit" != "xno"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
581 luajit="jit" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
582 fi |
3833 | 583 if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then |
584 vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" | |
585 else | |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
586 if test "x$MACOSX" = "xyes"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
587 ext="dylib" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
588 indexes="" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
589 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
590 ext="so" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
591 indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
592 multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
593 if test "X$multiarch" != "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
594 lib_multiarch="lib/${multiarch}" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
595 fi |
4295 | 596 fi |
597 dnl Determine the sover for the current version, but fallback to | |
598 dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found. | |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
599 AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx) |
4295 | 600 for subdir in "${lib_multiarch}" lib64 lib; do |
601 if test -z "$subdir"; then | |
602 continue | |
603 fi | |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
604 for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \ |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
605 ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
606 for i in $indexes ""; do |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
607 if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then |
4295 | 608 sover2="$i" |
609 break 3 | |
610 fi | |
611 done | |
4103 | 612 done |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
613 sover="" |
3833 | 614 done |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
615 if test "X$sover" = "X"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
616 AC_MSG_RESULT(no) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
617 lua_ok="no" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
618 vi_cv_dll_name_lua="liblua${luajit}.${ext}" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
619 else |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
620 AC_MSG_RESULT(yes) |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
621 lua_ok="yes" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
622 vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
623 fi |
3833 | 624 fi |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
625 AC_DEFINE(DYNAMIC_LUA) |
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
626 LUA_LIBS="" |
3833 | 627 LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
628 fi |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
629 if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
630 test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
631 test "`(uname -m) 2>/dev/null`" = "x86_64"; then |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
632 dnl OSX/x64 requires these flags. See http://luajit.org/install.html |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
633 LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" |
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
634 fi |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
635 fi |
5240
da95a7f1d5a8
updated for version 7.4a.045
Bram Moolenaar <bram@vim.org>
parents:
5206
diff
changeset
|
636 if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then |
3222 | 637 AC_MSG_ERROR([could not configure lua]) |
638 fi | |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
639 AC_SUBST(LUA_SRC) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
640 AC_SUBST(LUA_OBJ) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
641 AC_SUBST(LUA_PRO) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
642 AC_SUBST(LUA_LIBS) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
643 AC_SUBST(LUA_CFLAGS) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
644 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
645 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
646 |
14 | 647 dnl Check for MzScheme feature. |
648 AC_MSG_CHECKING(--enable-mzschemeinterp argument) | |
649 AC_ARG_ENABLE(mzschemeinterp, | |
650 [ --enable-mzschemeinterp Include MzScheme interpreter.], , | |
651 [enable_mzschemeinterp="no"]) | |
652 AC_MSG_RESULT($enable_mzschemeinterp) | |
653 | |
654 if test "$enable_mzschemeinterp" = "yes"; then | |
655 dnl -- find the mzscheme executable | |
656 AC_SUBST(vi_cv_path_mzscheme) | |
657 | |
658 AC_MSG_CHECKING(--with-plthome argument) | |
659 AC_ARG_WITH(plthome, | |
856 | 660 [ --with-plthome=PLTHOME Use PLTHOME.], |
661 with_plthome="$withval"; AC_MSG_RESULT($with_plthome), | |
14 | 662 with_plthome="";AC_MSG_RESULT("no")) |
663 | |
664 if test "X$with_plthome" != "X"; then | |
665 vi_cv_path_mzscheme_pfx="$with_plthome" | |
666 else | |
667 AC_MSG_CHECKING(PLTHOME environment var) | |
668 if test "X$PLTHOME" != "X"; then | |
669 AC_MSG_RESULT("$PLTHOME") | |
856 | 670 vi_cv_path_mzscheme_pfx="$PLTHOME" |
14 | 671 else |
1894 | 672 AC_MSG_RESULT(not set) |
14 | 673 dnl -- try to find MzScheme executable |
856 | 674 AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) |
14 | 675 |
676 dnl resolve symbolic link, the executable is often elsewhere and there | |
677 dnl are no links for the include files. | |
856 | 678 if test "X$vi_cv_path_mzscheme" != "X"; then |
14 | 679 lsout=`ls -l $vi_cv_path_mzscheme` |
680 if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then | |
681 vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` | |
682 fi | |
683 fi | |
684 | |
856 | 685 if test "X$vi_cv_path_mzscheme" != "X"; then |
686 dnl -- find where MzScheme thinks it was installed | |
687 AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, | |
1894 | 688 dnl different versions of MzScheme differ in command line processing |
689 dnl use universal approach | |
690 echo "(display (simplify-path \ | |
856 | 691 (build-path (call-with-values \ |
692 (lambda () (split-path (find-system-path (quote exec-file)))) \ | |
1894 | 693 (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm |
694 dnl Remove a trailing slash | |
695 [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ | |
696 sed -e 's+/$++'` ]) | |
697 rm -f mzdirs.scm | |
856 | 698 fi |
14 | 699 fi |
700 fi | |
701 | |
1154 | 702 SCHEME_INC= |
14 | 703 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then |
704 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include) | |
705 if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then | |
1894 | 706 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include |
707 AC_MSG_RESULT(yes) | |
14 | 708 else |
1894 | 709 AC_MSG_RESULT(no) |
710 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt) | |
1154 | 711 if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then |
1894 | 712 AC_MSG_RESULT(yes) |
713 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt | |
1154 | 714 else |
1894 | 715 AC_MSG_RESULT(no) |
2628 | 716 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket) |
717 if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then | |
1894 | 718 AC_MSG_RESULT(yes) |
2628 | 719 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket |
1894 | 720 else |
721 AC_MSG_RESULT(no) | |
2628 | 722 AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) |
723 if test -f /usr/include/plt/scheme.h; then | |
724 AC_MSG_RESULT(yes) | |
725 SCHEME_INC=/usr/include/plt | |
726 else | |
727 AC_MSG_RESULT(no) | |
728 AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/) | |
729 if test -f /usr/include/racket/scheme.h; then | |
730 AC_MSG_RESULT(yes) | |
731 SCHEME_INC=/usr/include/racket | |
732 else | |
733 AC_MSG_RESULT(no) | |
734 vi_cv_path_mzscheme_pfx= | |
735 fi | |
736 fi | |
1894 | 737 fi |
1154 | 738 fi |
14 | 739 fi |
740 fi | |
741 | |
742 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then | |
1301 | 743 if test "x$MACOSX" = "xyes"; then |
4074 | 744 MZSCHEME_LIBS="-framework Racket" |
745 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
1894 | 746 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then |
747 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" | |
748 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
2628 | 749 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then |
750 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a" | |
751 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
752 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then | |
753 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" | |
754 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then | |
1264 | 755 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
14 | 756 else |
1894 | 757 dnl Using shared objects |
758 if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then | |
759 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m" | |
760 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
2628 | 761 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then |
762 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m" | |
763 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
764 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then | |
765 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc" | |
1894 | 766 else |
767 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" | |
768 fi | |
16 | 769 if test "$GCC" = yes; then |
770 dnl Make Vim remember the path to the library. For when it's not in | |
771 dnl $LD_LIBRARY_PATH. | |
1894 | 772 MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" |
17 | 773 elif test "`(uname) 2>/dev/null`" = SunOS && |
774 uname -r | grep '^5' >/dev/null; then | |
1894 | 775 MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib" |
16 | 776 fi |
14 | 777 fi |
3945 | 778 |
779 AC_MSG_CHECKING(for racket collects directory) | |
1154 | 780 if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then |
3945 | 781 SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ |
2628 | 782 else |
783 if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then | |
3945 | 784 SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ |
785 else | |
786 if test -d $vi_cv_path_mzscheme_pfx/share/racket/collects; then | |
787 SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ | |
4074 | 788 else |
789 if test -d $vi_cv_path_mzscheme_pfx/collects; then | |
790 SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/ | |
791 fi | |
3945 | 792 fi |
2628 | 793 fi |
1154 | 794 fi |
3945 | 795 if test "X$SCHEME_COLLECTS" != "X" ; then |
796 AC_MSG_RESULT(${SCHEME_COLLECTS}) | |
797 else | |
798 AC_MSG_RESULT(not found) | |
799 fi | |
800 | |
801 AC_MSG_CHECKING(for mzscheme_base.c) | |
802 if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then | |
2628 | 803 MZSCHEME_EXTRA="mzscheme_base.c" |
804 else | |
3945 | 805 if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then |
2628 | 806 MZSCHEME_EXTRA="mzscheme_base.c" |
807 fi | |
808 fi | |
809 if test "X$MZSCHEME_EXTRA" != "X" ; then | |
1894 | 810 dnl need to generate bytecode for MzScheme base |
811 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" | |
812 MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" | |
3945 | 813 AC_MSG_RESULT(needed) |
814 else | |
815 AC_MSG_RESULT(not needed) | |
1894 | 816 fi |
3945 | 817 |
5206
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
818 dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'". |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
819 AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"]) |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
820 |
1894 | 821 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ |
3945 | 822 -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" |
5206
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
823 |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
824 dnl Test that we can compile a simple program with these CFLAGS and LIBS. |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
825 AC_MSG_CHECKING([if compile and link flags for MzScheme are sane]) |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
826 cflags_save=$CFLAGS |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
827 libs_save=$LIBS |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
828 CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
829 LIBS="$LIBS $MZSCHEME_LIBS" |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
830 AC_TRY_LINK(,[ ], |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
831 AC_MSG_RESULT(yes); mzs_ok=yes, |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
832 AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no) |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
833 CFLAGS=$cflags_save |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
834 LIBS=$libs_save |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
835 if test $mzs_ok = yes; then |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
836 MZSCHEME_SRC="if_mzsch.c" |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
837 MZSCHEME_OBJ="objects/if_mzsch.o" |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
838 MZSCHEME_PRO="if_mzsch.pro" |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
839 AC_DEFINE(FEAT_MZSCHEME) |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
840 else |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
841 MZSCHEME_CFLAGS= |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
842 MZSCHEME_LIBS= |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
843 MZSCHEME_EXTRA= |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
844 MZSCHEME_MZC= |
2b58913e19a5
updated for version 7.4a.029
Bram Moolenaar <bram@vim.org>
parents:
5170
diff
changeset
|
845 fi |
14 | 846 fi |
847 AC_SUBST(MZSCHEME_SRC) | |
848 AC_SUBST(MZSCHEME_OBJ) | |
849 AC_SUBST(MZSCHEME_PRO) | |
850 AC_SUBST(MZSCHEME_LIBS) | |
851 AC_SUBST(MZSCHEME_CFLAGS) | |
1894 | 852 AC_SUBST(MZSCHEME_EXTRA) |
853 AC_SUBST(MZSCHEME_MZC) | |
14 | 854 fi |
855 | |
856 | |
7 | 857 AC_MSG_CHECKING(--enable-perlinterp argument) |
858 AC_ARG_ENABLE(perlinterp, | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
859 [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
7 | 860 [enable_perlinterp="no"]) |
861 AC_MSG_RESULT($enable_perlinterp) | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
862 if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then |
7 | 863 AC_SUBST(vi_cv_path_perl) |
864 AC_PATH_PROG(vi_cv_path_perl, perl) | |
865 if test "X$vi_cv_path_perl" != "X"; then | |
866 AC_MSG_CHECKING(Perl version) | |
867 if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then | |
868 eval `$vi_cv_path_perl -V:usethreads` | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
869 eval `$vi_cv_path_perl -V:libperl` |
7 | 870 if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then |
871 badthreads=no | |
872 else | |
873 if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then | |
874 eval `$vi_cv_path_perl -V:use5005threads` | |
875 if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then | |
876 badthreads=no | |
877 else | |
878 badthreads=yes | |
879 AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<) | |
880 fi | |
881 else | |
882 badthreads=yes | |
883 AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<) | |
884 fi | |
885 fi | |
886 if test $badthreads = no; then | |
887 AC_MSG_RESULT(OK) | |
888 eval `$vi_cv_path_perl -V:shrpenv` | |
889 if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04 | |
890 shrpenv="" | |
891 fi | |
892 vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'` | |
893 AC_SUBST(vi_cv_perllib) | |
894 dnl Remove "-fno-something", it breaks using cproto. | |
895 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ | |
896 -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'` | |
897 dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". | |
898 perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ | |
899 sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ | |
900 -e 's/-bE:perl.exp//' -e 's/-lc //'` | |
901 dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH | |
902 dnl a test in configure may fail because of that. | |
903 perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ | |
904 -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` | |
905 | |
906 dnl check that compiling a simple program still works with the flags | |
907 dnl added for Perl. | |
908 AC_MSG_CHECKING([if compile and link flags for Perl are sane]) | |
909 cflags_save=$CFLAGS | |
910 libs_save=$LIBS | |
911 ldflags_save=$LDFLAGS | |
912 CFLAGS="$CFLAGS $perlcppflags" | |
913 LIBS="$LIBS $perllibs" | |
4952
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
914 perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` |
7 | 915 LDFLAGS="$perlldflags $LDFLAGS" |
916 AC_TRY_LINK(,[ ], | |
917 AC_MSG_RESULT(yes); perl_ok=yes, | |
918 AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no) | |
919 CFLAGS=$cflags_save | |
920 LIBS=$libs_save | |
921 LDFLAGS=$ldflags_save | |
922 if test $perl_ok = yes; then | |
923 if test "X$perlcppflags" != "X"; then | |
1154 | 924 dnl remove -pipe and -Wxxx, it confuses cproto |
925 PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'` | |
7 | 926 fi |
927 if test "X$perlldflags" != "X"; then | |
4952
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
928 if test "X`echo \"$LDFLAGS\" | grep -F -e \"$perlldflags\"`" = "X"; then |
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
929 LDFLAGS="$perlldflags $LDFLAGS" |
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
930 fi |
7 | 931 fi |
932 PERL_LIBS=$perllibs | |
933 PERL_SRC="auto/if_perl.c if_perlsfio.c" | |
934 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" | |
935 PERL_PRO="if_perl.pro if_perlsfio.pro" | |
936 AC_DEFINE(FEAT_PERL) | |
937 fi | |
938 fi | |
939 else | |
940 AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<) | |
941 fi | |
942 fi | |
943 | |
944 if test "x$MACOSX" = "xyes"; then | |
574 | 945 dnl Mac OS X 10.2 or later |
7 | 946 dir=/System/Library/Perl |
947 darwindir=$dir/darwin | |
948 if test -d $darwindir; then | |
949 PERL=/usr/bin/perl | |
950 else | |
951 dnl Mac OS X 10.3 | |
952 dir=/System/Library/Perl/5.8.1 | |
953 darwindir=$dir/darwin-thread-multi-2level | |
954 if test -d $darwindir; then | |
955 PERL=/usr/bin/perl | |
956 fi | |
957 fi | |
958 if test -n "$PERL"; then | |
959 PERL_DIR="$dir" | |
960 PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE" | |
961 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a" | |
962 PERL_LIBS="-L$darwindir/CORE -lperl" | |
963 fi | |
2389
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
964 dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only |
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
965 dnl be included if requested by passing --with-mac-arch to |
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
966 dnl configure, so strip these flags first (if present) |
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
967 PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
968 PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
7 | 969 fi |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
970 if test "$enable_perlinterp" = "dynamic"; then |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
971 if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
972 AC_DEFINE(DYNAMIC_PERL) |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
973 PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
974 fi |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
975 fi |
3222 | 976 |
977 if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then | |
978 AC_MSG_ERROR([could not configure perl]) | |
979 fi | |
7 | 980 fi |
981 AC_SUBST(shrpenv) | |
982 AC_SUBST(PERL_SRC) | |
983 AC_SUBST(PERL_OBJ) | |
984 AC_SUBST(PERL_PRO) | |
985 AC_SUBST(PERL_CFLAGS) | |
986 AC_SUBST(PERL_LIBS) | |
987 | |
988 AC_MSG_CHECKING(--enable-pythoninterp argument) | |
989 AC_ARG_ENABLE(pythoninterp, | |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
990 [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
7 | 991 [enable_pythoninterp="no"]) |
992 AC_MSG_RESULT($enable_pythoninterp) | |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
993 if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then |
7 | 994 dnl -- find the python executable |
4001 | 995 AC_PATH_PROGS(vi_cv_path_python, python2 python) |
7 | 996 if test "X$vi_cv_path_python" != "X"; then |
997 | |
998 dnl -- get its version number | |
999 AC_CACHE_CHECK(Python version,vi_cv_var_python_version, | |
1000 [[vi_cv_var_python_version=` | |
1001 ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` | |
1002 ]]) | |
1003 | |
4833
70b1178dec79
updated for version 7.3.1163
Bram Moolenaar <bram@vim.org>
parents:
4708
diff
changeset
|
1004 dnl -- it must be at least version 2.3 |
70b1178dec79
updated for version 7.3.1163
Bram Moolenaar <bram@vim.org>
parents:
4708
diff
changeset
|
1005 AC_MSG_CHECKING(Python is 2.3 or better) |
7 | 1006 if ${vi_cv_path_python} -c \ |
4833
70b1178dec79
updated for version 7.3.1163
Bram Moolenaar <bram@vim.org>
parents:
4708
diff
changeset
|
1007 "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" |
7 | 1008 then |
1009 AC_MSG_RESULT(yep) | |
1010 | |
1011 dnl -- find where python thinks it was installed | |
1012 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx, | |
1013 [ vi_cv_path_python_pfx=` | |
1014 ${vi_cv_path_python} -c \ | |
1015 "import sys; print sys.prefix"` ]) | |
1016 | |
1017 dnl -- and where it thinks it runs | |
1018 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx, | |
1019 [ vi_cv_path_python_epfx=` | |
1020 ${vi_cv_path_python} -c \ | |
1021 "import sys; print sys.exec_prefix"` ]) | |
1022 | |
1023 dnl -- python's internal library path | |
1024 | |
1025 AC_CACHE_VAL(vi_cv_path_pythonpath, | |
1026 [ vi_cv_path_pythonpath=` | |
1027 unset PYTHONPATH; | |
1028 ${vi_cv_path_python} -c \ | |
1029 "import sys, string; print string.join(sys.path,':')"` ]) | |
1030 | |
1031 dnl -- where the Python implementation library archives are | |
1032 | |
1033 AC_ARG_WITH(python-config-dir, | |
1034 [ --with-python-config-dir=PATH Python's config directory], | |
1035 [ vi_cv_path_python_conf="${withval}" ] ) | |
1036 | |
1037 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf, | |
1038 [ | |
1039 vi_cv_path_python_conf= | |
4708
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1040 d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1041 if test -d "$d" && test -f "$d/config.c"; then |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1042 vi_cv_path_python_conf="$d" |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1043 else |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1044 for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1045 for subdir in lib64 lib share; do |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1046 d="${path}/${subdir}/python${vi_cv_var_python_version}/config" |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1047 if test -d "$d" && test -f "$d/config.c"; then |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1048 vi_cv_path_python_conf="$d" |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1049 fi |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1050 done |
7 | 1051 done |
4708
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1052 fi |
7 | 1053 ]) |
1054 | |
1055 PYTHON_CONFDIR="${vi_cv_path_python_conf}" | |
1056 | |
1057 if test "X$PYTHON_CONFDIR" = "X"; then | |
1058 AC_MSG_RESULT([can't find it!]) | |
1059 else | |
1060 | |
1061 dnl -- we need to examine Python's config/Makefile too | |
1062 dnl see what the interpreter is built from | |
1063 AC_CACHE_VAL(vi_cv_path_python_plibs, | |
1064 [ | |
1681 | 1065 pwd=`pwd` |
1066 tmp_mkf="$pwd/config-PyMake$$" | |
1067 cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" | |
7 | 1068 __: |
2200
99ba9a30755a
Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents:
2199
diff
changeset
|
1069 @echo "python_BASEMODLIBS='$(BASEMODLIBS)'" |
7 | 1070 @echo "python_LIBS='$(LIBS)'" |
1071 @echo "python_SYSLIBS='$(SYSLIBS)'" | |
1072 @echo "python_LINKFORSHARED='$(LINKFORSHARED)'" | |
3822 | 1073 @echo "python_DLLLIBRARY='$(DLLLIBRARY)'" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1074 @echo "python_INSTSONAME='$(INSTSONAME)'" |
7 | 1075 eof |
1076 dnl -- delete the lines from make about Entering/Leaving directory | |
1681 | 1077 eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
1078 rm -f -- "${tmp_mkf}" | |
7 | 1079 if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \ |
1080 "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then | |
1081 vi_cv_path_python_plibs="-framework Python" | |
1082 else | |
1083 if test "${vi_cv_var_python_version}" = "1.4"; then | |
1084 vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a" | |
1085 else | |
1086 vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}" | |
1087 fi | |
2200
99ba9a30755a
Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents:
2199
diff
changeset
|
1088 vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" |
7 | 1089 dnl remove -ltermcap, it can conflict with an earlier -lncurses |
1090 vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` | |
1091 fi | |
1092 ]) | |
1093 | |
3822 | 1094 if test "X$python_DLLLIBRARY" != "X"; then |
1095 python_INSTSONAME="$python_DLLLIBRARY" | |
1096 fi | |
7 | 1097 PYTHON_LIBS="${vi_cv_path_python_plibs}" |
1098 if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then | |
4843
ed47632fd149
updated for version 7.3.1168
Bram Moolenaar <bram@vim.org>
parents:
4841
diff
changeset
|
1099 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" |
7 | 1100 else |
4843
ed47632fd149
updated for version 7.3.1168
Bram Moolenaar <bram@vim.org>
parents:
4841
diff
changeset
|
1101 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" |
7 | 1102 fi |
1103 PYTHON_SRC="if_python.c" | |
3707 | 1104 PYTHON_OBJ="objects/if_python.o" |
7 | 1105 if test "${vi_cv_var_python_version}" = "1.4"; then |
1106 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" | |
1107 fi | |
2641 | 1108 PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" |
7 | 1109 |
1110 dnl On FreeBSD linking with "-pthread" is required to use threads. | |
1111 dnl _THREAD_SAFE must be used for compiling then. | |
1112 dnl The "-pthread" is added to $LIBS, so that the following check for | |
1113 dnl sigaltstack() will look in libc_r (it's there in libc!). | |
1114 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC | |
1115 dnl will then define target-specific defines, e.g., -D_REENTRANT. | |
1116 dnl Don't do this for Mac OSX, -pthread will generate a warning. | |
1117 AC_MSG_CHECKING([if -pthread should be used]) | |
1118 threadsafe_flag= | |
1119 thread_lib= | |
997 | 1120 dnl if test "x$MACOSX" != "xyes"; then |
1121 if test "`(uname) 2>/dev/null`" != Darwin; then | |
7 | 1122 test "$GCC" = yes && threadsafe_flag="-pthread" |
1123 if test "`(uname) 2>/dev/null`" = FreeBSD; then | |
1124 threadsafe_flag="-D_THREAD_SAFE" | |
1125 thread_lib="-pthread" | |
1126 fi | |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1127 if test "`(uname) 2>/dev/null`" = SunOS; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1128 threadsafe_flag="-pthreads" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1129 fi |
7 | 1130 fi |
1131 libs_save_old=$LIBS | |
1132 if test -n "$threadsafe_flag"; then | |
1133 cflags_save=$CFLAGS | |
1134 CFLAGS="$CFLAGS $threadsafe_flag" | |
1135 LIBS="$LIBS $thread_lib" | |
1136 AC_TRY_LINK(,[ ], | |
2303
6ebb886efe3c
Filter out -pthread for cproto.
Bram Moolenaar <bram@vim.org>
parents:
2285
diff
changeset
|
1137 AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", |
7 | 1138 AC_MSG_RESULT(no); LIBS=$libs_save_old |
1139 ) | |
1140 CFLAGS=$cflags_save | |
1141 else | |
1142 AC_MSG_RESULT(no) | |
1143 fi | |
1144 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1145 dnl Check that compiling a simple program still works with the flags |
7 | 1146 dnl added for Python. |
1147 AC_MSG_CHECKING([if compile and link flags for Python are sane]) | |
1148 cflags_save=$CFLAGS | |
1149 libs_save=$LIBS | |
2303
6ebb886efe3c
Filter out -pthread for cproto.
Bram Moolenaar <bram@vim.org>
parents:
2285
diff
changeset
|
1150 CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
7 | 1151 LIBS="$LIBS $PYTHON_LIBS" |
1152 AC_TRY_LINK(,[ ], | |
1153 AC_MSG_RESULT(yes); python_ok=yes, | |
1154 AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no) | |
1155 CFLAGS=$cflags_save | |
1156 LIBS=$libs_save | |
1157 if test $python_ok = yes; then | |
1158 AC_DEFINE(FEAT_PYTHON) | |
1159 else | |
1160 LIBS=$libs_save_old | |
1161 PYTHON_SRC= | |
1162 PYTHON_OBJ= | |
1163 PYTHON_LIBS= | |
1164 PYTHON_CFLAGS= | |
1165 fi | |
1166 fi | |
1167 else | |
1168 AC_MSG_RESULT(too old) | |
1169 fi | |
1170 fi | |
3222 | 1171 |
1172 if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then | |
1173 AC_MSG_ERROR([could not configure python]) | |
1174 fi | |
7 | 1175 fi |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1176 |
7 | 1177 AC_SUBST(PYTHON_CONFDIR) |
1178 AC_SUBST(PYTHON_LIBS) | |
1179 AC_SUBST(PYTHON_GETPATH_CFLAGS) | |
1180 AC_SUBST(PYTHON_CFLAGS) | |
1181 AC_SUBST(PYTHON_SRC) | |
1182 AC_SUBST(PYTHON_OBJ) | |
1183 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1184 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1185 AC_MSG_CHECKING(--enable-python3interp argument) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1186 AC_ARG_ENABLE(python3interp, |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1187 [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1188 [enable_python3interp="no"]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1189 AC_MSG_RESULT($enable_python3interp) |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1190 if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1191 dnl -- find the python3 executable |
4001 | 1192 AC_PATH_PROGS(vi_cv_path_python3, python3 python) |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1193 if test "X$vi_cv_path_python3" != "X"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1194 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1195 dnl -- get its version number |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1196 AC_CACHE_CHECK(Python version,vi_cv_var_python3_version, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1197 [[vi_cv_var_python3_version=` |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1198 ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1199 ]]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1200 |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1201 dnl -- it must be at least version 3 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1202 AC_MSG_CHECKING(Python is 3.0 or better) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1203 if ${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1204 "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1205 then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1206 AC_MSG_RESULT(yep) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1207 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1208 dnl -- get abiflags for python 3.2 or higher (PEP 3149) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1209 AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags, |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1210 [ |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1211 vi_cv_var_python3_abiflags= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1212 if ${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1213 "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1214 then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1215 vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1216 "import sys; print(sys.abiflags)"` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1217 fi ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1218 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1219 dnl -- find where python3 thinks it was installed |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1220 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1221 [ vi_cv_path_python3_pfx=` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1222 ${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1223 "import sys; print(sys.prefix)"` ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1224 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1225 dnl -- and where it thinks it runs |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1226 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1227 [ vi_cv_path_python3_epfx=` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1228 ${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1229 "import sys; print(sys.exec_prefix)"` ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1230 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1231 dnl -- python3's internal library path |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1232 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1233 AC_CACHE_VAL(vi_cv_path_python3path, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1234 [ vi_cv_path_python3path=` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1235 unset PYTHONPATH; |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1236 ${vi_cv_path_python3} -c \ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1237 "import sys, string; print(':'.join(sys.path))"` ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1238 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1239 dnl -- where the Python implementation library archives are |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1240 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1241 AC_ARG_WITH(python3-config-dir, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1242 [ --with-python3-config-dir=PATH Python's config directory], |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1243 [ vi_cv_path_python3_conf="${withval}" ] ) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1244 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1245 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1246 [ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1247 vi_cv_path_python3_conf= |
5170
ce587b26b8d6
updated for version 7.4a.011
Bram Moolenaar <bram@vim.org>
parents:
5168
diff
changeset
|
1248 config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1249 d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1250 if test -d "$d" && test -f "$d/config.c"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1251 vi_cv_path_python3_conf="$d" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1252 else |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1253 for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1254 for subdir in lib64 lib share; do |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1255 d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1256 if test -d "$d" && test -f "$d/config.c"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1257 vi_cv_path_python3_conf="$d" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1258 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1259 done |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1260 done |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1261 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1262 ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1263 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1264 PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1265 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1266 if test "X$PYTHON3_CONFDIR" = "X"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1267 AC_MSG_RESULT([can't find it!]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1268 else |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1269 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1270 dnl -- we need to examine Python's config/Makefile too |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1271 dnl see what the interpreter is built from |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1272 AC_CACHE_VAL(vi_cv_path_python3_plibs, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1273 [ |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1274 pwd=`pwd` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1275 tmp_mkf="$pwd/config-PyMake$$" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1276 cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1277 __: |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1278 @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1279 @echo "python3_LIBS='$(LIBS)'" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1280 @echo "python3_SYSLIBS='$(SYSLIBS)'" |
3822 | 1281 @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1282 @echo "python3_INSTSONAME='$(INSTSONAME)'" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1283 eof |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1284 dnl -- delete the lines from make about Entering/Leaving directory |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1285 eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1286 rm -f -- "${tmp_mkf}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1287 vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1288 vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1289 dnl remove -ltermcap, it can conflict with an earlier -lncurses |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1290 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1291 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1292 ]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1293 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1294 if test "X$python3_DLLLIBRARY" != "X"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1295 python3_INSTSONAME="$python3_DLLLIBRARY" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1296 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1297 PYTHON3_LIBS="${vi_cv_path_python3_plibs}" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1298 if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then |
4843
ed47632fd149
updated for version 7.3.1168
Bram Moolenaar <bram@vim.org>
parents:
4841
diff
changeset
|
1299 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1300 else |
4843
ed47632fd149
updated for version 7.3.1168
Bram Moolenaar <bram@vim.org>
parents:
4841
diff
changeset
|
1301 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1302 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1303 PYTHON3_SRC="if_python3.c" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1304 PYTHON3_OBJ="objects/if_python3.o" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1305 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1306 dnl On FreeBSD linking with "-pthread" is required to use threads. |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1307 dnl _THREAD_SAFE must be used for compiling then. |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1308 dnl The "-pthread" is added to $LIBS, so that the following check for |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1309 dnl sigaltstack() will look in libc_r (it's there in libc!). |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1310 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1311 dnl will then define target-specific defines, e.g., -D_REENTRANT. |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1312 dnl Don't do this for Mac OSX, -pthread will generate a warning. |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1313 AC_MSG_CHECKING([if -pthread should be used]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1314 threadsafe_flag= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1315 thread_lib= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1316 dnl if test "x$MACOSX" != "xyes"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1317 if test "`(uname) 2>/dev/null`" != Darwin; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1318 test "$GCC" = yes && threadsafe_flag="-pthread" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1319 if test "`(uname) 2>/dev/null`" = FreeBSD; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1320 threadsafe_flag="-D_THREAD_SAFE" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1321 thread_lib="-pthread" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1322 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1323 if test "`(uname) 2>/dev/null`" = SunOS; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1324 threadsafe_flag="-pthreads" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1325 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1326 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1327 libs_save_old=$LIBS |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1328 if test -n "$threadsafe_flag"; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1329 cflags_save=$CFLAGS |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1330 CFLAGS="$CFLAGS $threadsafe_flag" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1331 LIBS="$LIBS $thread_lib" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1332 AC_TRY_LINK(,[ ], |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1333 AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1334 AC_MSG_RESULT(no); LIBS=$libs_save_old |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1335 ) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1336 CFLAGS=$cflags_save |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1337 else |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1338 AC_MSG_RESULT(no) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1339 fi |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1340 |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1341 dnl check that compiling a simple program still works with the flags |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1342 dnl added for Python. |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1343 AC_MSG_CHECKING([if compile and link flags for Python 3 are sane]) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1344 cflags_save=$CFLAGS |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1345 libs_save=$LIBS |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1346 CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1347 LIBS="$LIBS $PYTHON3_LIBS" |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1348 AC_TRY_LINK(,[ ], |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1349 AC_MSG_RESULT(yes); python3_ok=yes, |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1350 AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1351 CFLAGS=$cflags_save |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1352 LIBS=$libs_save |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1353 if test "$python3_ok" = yes; then |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1354 AC_DEFINE(FEAT_PYTHON3) |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1355 else |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1356 LIBS=$libs_save_old |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1357 PYTHON3_SRC= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1358 PYTHON3_OBJ= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1359 PYTHON3_LIBS= |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1360 PYTHON3_CFLAGS= |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1361 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1362 fi |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1363 else |
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1364 AC_MSG_RESULT(too old) |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1365 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1366 fi |
4895
8b46c37c4b84
updated for version 7.3.1193
Bram Moolenaar <bram@vim.org>
parents:
4843
diff
changeset
|
1367 if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then |
8b46c37c4b84
updated for version 7.3.1193
Bram Moolenaar <bram@vim.org>
parents:
4843
diff
changeset
|
1368 AC_MSG_ERROR([could not configure python3]) |
8b46c37c4b84
updated for version 7.3.1193
Bram Moolenaar <bram@vim.org>
parents:
4843
diff
changeset
|
1369 fi |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1370 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1371 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1372 AC_SUBST(PYTHON3_CONFDIR) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1373 AC_SUBST(PYTHON3_LIBS) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1374 AC_SUBST(PYTHON3_CFLAGS) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1375 AC_SUBST(PYTHON3_SRC) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1376 AC_SUBST(PYTHON3_OBJ) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1377 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1378 dnl if python2.x and python3.x are enabled one can only link in code |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1379 dnl with dlopen(), dlsym(), dlclose() |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1380 if test "$python_ok" = yes && test "$python3_ok" = yes; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1381 AC_DEFINE(DYNAMIC_PYTHON) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1382 AC_DEFINE(DYNAMIC_PYTHON3) |
2641 | 1383 AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python) |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1384 cflags_save=$CFLAGS |
2641 | 1385 CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1386 ldflags_save=$LDFLAGS |
3038 | 1387 dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) |
1388 LDFLAGS="-ldl $LDFLAGS" | |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1389 AC_RUN_IFELSE([ |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1390 #include <dlfcn.h> |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1391 /* If this program fails, then RTLD_GLOBAL is needed. |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1392 * RTLD_GLOBAL will be used and then it is not possible to |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1393 * have both python versions enabled in the same vim instance. |
4352 | 1394 * Only the first python version used will be switched on. |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1395 */ |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1396 |
2641 | 1397 int no_rtl_global_needed_for(char *python_instsoname, char *prefix) |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1398 { |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1399 int needed = 0; |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1400 void* pylib = dlopen(python_instsoname, RTLD_LAZY); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1401 if (pylib != 0) |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1402 { |
2641 | 1403 void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1404 void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1405 int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1406 void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
2641 | 1407 (*pfx)(prefix); |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1408 (*init)(); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1409 needed = (*simple)("import termios") == -1; |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1410 (*final)(); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1411 dlclose(pylib); |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1412 } |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1413 return !needed; |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1414 } |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1415 |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1416 int main(int argc, char** argv) |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1417 { |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1418 int not_needed = 0; |
2641 | 1419 if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}")) |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1420 not_needed = 1; |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1421 return !not_needed; |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1422 }], |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1423 [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) |
2641 | 1424 |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1425 CFLAGS=$cflags_save |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1426 LDFLAGS=$ldflags_save |
2641 | 1427 |
1428 AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3) | |
1429 cflags_save=$CFLAGS | |
1430 CFLAGS="$CFLAGS $PYTHON3_CFLAGS" | |
1431 ldflags_save=$LDFLAGS | |
3038 | 1432 dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) |
1433 LDFLAGS="-ldl $LDFLAGS" | |
2641 | 1434 AC_RUN_IFELSE([ |
1435 #include <dlfcn.h> | |
1436 #include <wchar.h> | |
1437 /* If this program fails, then RTLD_GLOBAL is needed. | |
1438 * RTLD_GLOBAL will be used and then it is not possible to | |
1439 * have both python versions enabled in the same vim instance. | |
4352 | 1440 * Only the first python version used will be switched on. |
2641 | 1441 */ |
1442 | |
1443 int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) | |
1444 { | |
1445 int needed = 0; | |
1446 void* pylib = dlopen(python_instsoname, RTLD_LAZY); | |
1447 if (pylib != 0) | |
1448 { | |
1449 void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); | |
1450 void (*init)(void) = dlsym(pylib, "Py_Initialize"); | |
1451 int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); | |
1452 void (*final)(void) = dlsym(pylib, "Py_Finalize"); | |
1453 (*pfx)(prefix); | |
1454 (*init)(); | |
1455 needed = (*simple)("import termios") == -1; | |
1456 (*final)(); | |
1457 dlclose(pylib); | |
1458 } | |
1459 return !needed; | |
1460 } | |
1461 | |
1462 int main(int argc, char** argv) | |
1463 { | |
1464 int not_needed = 0; | |
1465 if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}")) | |
1466 not_needed = 1; | |
1467 return !not_needed; | |
1468 }], | |
1469 [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) | |
1470 | |
1471 CFLAGS=$cflags_save | |
1472 LDFLAGS=$ldflags_save | |
1473 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1474 PYTHON_SRC="if_python.c" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1475 PYTHON_OBJ="objects/if_python.o" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1476 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1477 PYTHON_LIBS= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1478 PYTHON3_SRC="if_python3.c" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1479 PYTHON3_OBJ="objects/if_python3.o" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1480 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\"" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1481 PYTHON3_LIBS= |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1482 elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1483 AC_DEFINE(DYNAMIC_PYTHON) |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1484 PYTHON_SRC="if_python.c" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1485 PYTHON_OBJ="objects/if_python.o" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1486 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1487 PYTHON_LIBS= |
5168
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1488 elif test "$python_ok" = yes; then |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1489 dnl Check that adding -fPIE works. It may be needed when using a static |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1490 dnl Python library. |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1491 AC_MSG_CHECKING([if -fPIE can be added for Python]) |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1492 cflags_save=$CFLAGS |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1493 libs_save=$LIBS |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1494 CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1495 LIBS="$LIBS $PYTHON_LIBS" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1496 AC_TRY_LINK(,[ ], |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1497 AC_MSG_RESULT(yes); fpie_ok=yes, |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1498 AC_MSG_RESULT(no); fpie_ok=no) |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1499 CFLAGS=$cflags_save |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1500 LIBS=$libs_save |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1501 if test $fpie_ok = yes; then |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1502 PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1503 fi |
2554
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1504 elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1505 AC_DEFINE(DYNAMIC_PYTHON3) |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1506 PYTHON3_SRC="if_python3.c" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1507 PYTHON3_OBJ="objects/if_python3.o" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1508 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\"" |
7abef60aca22
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2402
diff
changeset
|
1509 PYTHON3_LIBS= |
5168
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1510 elif test "$python3_ok" = yes; then |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1511 dnl Check that adding -fPIE works. It may be needed when using a static |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1512 dnl Python library. |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1513 AC_MSG_CHECKING([if -fPIE can be added for Python3]) |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1514 cflags_save=$CFLAGS |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1515 libs_save=$LIBS |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1516 CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1517 LIBS="$LIBS $PYTHON3_LIBS" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1518 AC_TRY_LINK(,[ ], |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1519 AC_MSG_RESULT(yes); fpie_ok=yes, |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1520 AC_MSG_RESULT(no); fpie_ok=no) |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1521 CFLAGS=$cflags_save |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1522 LIBS=$libs_save |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1523 if test $fpie_ok = yes; then |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1524 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE" |
a4e08386a6aa
updated for version 7.4a.010
Bram Moolenaar <bram@vim.org>
parents:
5114
diff
changeset
|
1525 fi |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1526 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1527 |
7 | 1528 AC_MSG_CHECKING(--enable-tclinterp argument) |
1529 AC_ARG_ENABLE(tclinterp, | |
1530 [ --enable-tclinterp Include Tcl interpreter.], , | |
1531 [enable_tclinterp="no"]) | |
1532 AC_MSG_RESULT($enable_tclinterp) | |
1533 | |
1534 if test "$enable_tclinterp" = "yes"; then | |
1535 | |
1464 | 1536 dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420] |
7 | 1537 AC_MSG_CHECKING(--with-tclsh argument) |
1538 AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)], | |
1539 tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name), | |
1464 | 1540 tclsh_name="tclsh8.5"; AC_MSG_RESULT(no)) |
7 | 1541 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
1542 AC_SUBST(vi_cv_path_tcl) | |
1543 | |
1464 | 1544 dnl when no specific version specified, also try 8.4, 8.2 and 8.0 |
1545 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then | |
1546 tclsh_name="tclsh8.4" | |
1547 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1548 fi | |
132 | 1549 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then |
7 | 1550 tclsh_name="tclsh8.2" |
1551 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1552 fi | |
132 | 1553 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then |
1554 tclsh_name="tclsh8.0" | |
1555 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1556 fi | |
7 | 1557 dnl still didn't find it, try without version number |
1558 if test "X$vi_cv_path_tcl" = "X"; then | |
1559 tclsh_name="tclsh" | |
1560 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1561 fi | |
1562 if test "X$vi_cv_path_tcl" != "X"; then | |
1563 AC_MSG_CHECKING(Tcl version) | |
1564 if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then | |
1565 tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -` | |
1566 AC_MSG_RESULT($tclver - OK); | |
1567 tclloc=`echo 'set l [[info library]];set i [[string last lib $l]];incr i -2;puts [[string range $l 0 $i]]' | $vi_cv_path_tcl -` | |
1568 | |
1569 AC_MSG_CHECKING(for location of Tcl include) | |
1570 if test "x$MACOSX" != "xyes"; then | |
1542 | 1571 tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" |
7 | 1572 else |
1573 dnl For Mac OS X 10.3, use the OS-provided framework location | |
1574 tclinc="/System/Library/Frameworks/Tcl.framework/Headers" | |
1575 fi | |
1542 | 1576 TCL_INC= |
7 | 1577 for try in $tclinc; do |
1578 if test -f "$try/tcl.h"; then | |
1579 AC_MSG_RESULT($try/tcl.h) | |
1580 TCL_INC=$try | |
1581 break | |
1582 fi | |
1583 done | |
1584 if test -z "$TCL_INC"; then | |
1585 AC_MSG_RESULT(<not found>) | |
1586 SKIP_TCL=YES | |
1587 fi | |
1588 if test -z "$SKIP_TCL"; then | |
1589 AC_MSG_CHECKING(for location of tclConfig.sh script) | |
1590 if test "x$MACOSX" != "xyes"; then | |
1591 tclcnf=`echo $tclinc | sed s/include/lib/g` | |
1464 | 1592 tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" |
7 | 1593 else |
1594 dnl For Mac OS X 10.3, use the OS-provided framework location | |
1595 tclcnf="/System/Library/Frameworks/Tcl.framework" | |
1596 fi | |
1597 for try in $tclcnf; do | |
1598 if test -f $try/tclConfig.sh; then | |
1599 AC_MSG_RESULT($try/tclConfig.sh) | |
1600 . $try/tclConfig.sh | |
1601 dnl use eval, because tcl 8.2 includes ${TCL_DBGX} | |
1602 TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"` | |
1603 dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the | |
132 | 1604 dnl "-D_ABC" items. Watch out for -DFOO=long\ long. |
1679 | 1605 TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[[^-]]/d' -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'` |
7 | 1606 break |
1607 fi | |
1608 done | |
1609 if test -z "$TCL_LIBS"; then | |
1610 AC_MSG_RESULT(<not found>) | |
1611 AC_MSG_CHECKING(for Tcl library by myself) | |
1612 tcllib=`echo $tclinc | sed s/include/lib/g` | |
1464 | 1613 tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`" |
7 | 1614 for ext in .so .a ; do |
1615 for ver in "" $tclver ; do | |
1616 for try in $tcllib ; do | |
1617 trylib=tcl$ver$ext | |
1618 if test -f $try/lib$trylib ; then | |
1619 AC_MSG_RESULT($try/lib$trylib) | |
1620 TCL_LIBS="-L$try -ltcl$ver -ldl -lm" | |
1621 if test "`(uname) 2>/dev/null`" = SunOS && | |
1622 uname -r | grep '^5' >/dev/null; then | |
1623 TCL_LIBS="$TCL_LIBS -R $try" | |
1624 fi | |
1625 break 3 | |
1626 fi | |
1627 done | |
1628 done | |
1629 done | |
1630 if test -z "$TCL_LIBS"; then | |
1631 AC_MSG_RESULT(<not found>) | |
1632 SKIP_TCL=YES | |
1633 fi | |
1634 fi | |
1635 if test -z "$SKIP_TCL"; then | |
1636 AC_DEFINE(FEAT_TCL) | |
1637 TCL_SRC=if_tcl.c | |
1638 TCL_OBJ=objects/if_tcl.o | |
1639 TCL_PRO=if_tcl.pro | |
1640 TCL_CFLAGS="-I$TCL_INC $TCL_DEFS" | |
1641 fi | |
1642 fi | |
1643 else | |
1644 AC_MSG_RESULT(too old; need Tcl version 8.0 or later) | |
1645 fi | |
1646 fi | |
3222 | 1647 if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then |
1648 AC_MSG_ERROR([could not configure Tcl]) | |
1649 fi | |
7 | 1650 fi |
1651 AC_SUBST(TCL_SRC) | |
1652 AC_SUBST(TCL_OBJ) | |
1653 AC_SUBST(TCL_PRO) | |
1654 AC_SUBST(TCL_CFLAGS) | |
1655 AC_SUBST(TCL_LIBS) | |
1656 | |
1657 AC_MSG_CHECKING(--enable-rubyinterp argument) | |
1658 AC_ARG_ENABLE(rubyinterp, | |
2621 | 1659 [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
7 | 1660 [enable_rubyinterp="no"]) |
1661 AC_MSG_RESULT($enable_rubyinterp) | |
2621 | 1662 if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1663 AC_MSG_CHECKING(--with-ruby-command argument) |
2801 | 1664 AC_SUBST(vi_cv_path_ruby) |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1665 AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], |
2801 | 1666 RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD), |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1667 RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1668 AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD) |
7 | 1669 if test "X$vi_cv_path_ruby" != "X"; then |
1670 AC_MSG_CHECKING(Ruby version) | |
189 | 1671 if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then |
7 | 1672 AC_MSG_RESULT(OK) |
3843 | 1673 AC_MSG_CHECKING(Ruby rbconfig) |
1674 ruby_rbconfig="RbConfig" | |
1675 if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then | |
1676 ruby_rbconfig="Config" | |
1677 fi | |
1678 AC_MSG_RESULT($ruby_rbconfig) | |
7 | 1679 AC_MSG_CHECKING(Ruby header files) |
3843 | 1680 rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null` |
7 | 1681 if test "X$rubyhdrdir" != "X"; then |
1682 AC_MSG_RESULT($rubyhdrdir) | |
1683 RUBY_CFLAGS="-I$rubyhdrdir" | |
3843 | 1684 rubyarch=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['arch']]"` |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1685 if test -d "$rubyhdrdir/$rubyarch"; then |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1686 RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch" |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1687 fi |
3843 | 1688 rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"` |
5280
ba37e955913e
updated for version 7.4b.016
Bram Moolenaar <bram@vim.org>
parents:
5240
diff
changeset
|
1689 if test "X$rubyversion" = "X"; then |
ba37e955913e
updated for version 7.4b.016
Bram Moolenaar <bram@vim.org>
parents:
5240
diff
changeset
|
1690 rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[[0,2]]"` |
ba37e955913e
updated for version 7.4b.016
Bram Moolenaar <bram@vim.org>
parents:
5240
diff
changeset
|
1691 fi |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1692 RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" |
3843 | 1693 rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"` |
7 | 1694 if test "X$rubylibs" != "X"; then |
1695 RUBY_LIBS="$rubylibs" | |
1696 fi | |
3843 | 1697 librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` |
1698 librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` | |
4708
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1699 rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` |
2801 | 1700 if test -f "$rubylibdir/$librubya"; then |
1701 librubyarg="$librubyarg" | |
4708
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1702 RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1703 elif test "$librubyarg" = "libruby.a"; then |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1704 dnl required on Mac OS 10.3 where libruby.a doesn't exist |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1705 librubyarg="-lruby" |
761e42cc79c2
updated for version 7.3.1101
Bram Moolenaar <bram@vim.org>
parents:
4399
diff
changeset
|
1706 RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" |
7 | 1707 fi |
1708 | |
1709 if test "X$librubyarg" != "X"; then | |
1710 RUBY_LIBS="$librubyarg $RUBY_LIBS" | |
1711 fi | |
3843 | 1712 rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"` |
7 | 1713 if test "X$rubyldflags" != "X"; then |
1939 | 1714 dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only |
1715 dnl be included if requested by passing --with-mac-arch to | |
1716 dnl configure, so strip these flags first (if present) | |
2389
d680c97481c1
Remove -arch flag from build flags for Perl. (Bjorn Wickler)
Bram Moolenaar <bram@vim.org>
parents:
2388
diff
changeset
|
1717 rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
1939 | 1718 if test "X$rubyldflags" != "X"; then |
4952
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
1719 if test "X`echo \"$LDFLAGS\" | grep -F -e \"$rubyldflags\"`" = "X"; then |
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
1720 LDFLAGS="$rubyldflags $LDFLAGS" |
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
1721 fi |
1939 | 1722 fi |
7 | 1723 fi |
1724 RUBY_SRC="if_ruby.c" | |
1725 RUBY_OBJ="objects/if_ruby.o" | |
1726 RUBY_PRO="if_ruby.pro" | |
1727 AC_DEFINE(FEAT_RUBY) | |
2621 | 1728 if test "$enable_rubyinterp" = "dynamic"; then |
3843 | 1729 libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` |
2621 | 1730 AC_DEFINE(DYNAMIC_RUBY) |
1731 RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" | |
1732 RUBY_LIBS= | |
1733 fi | |
7 | 1734 else |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1735 AC_MSG_RESULT(not found; disabling Ruby) |
7 | 1736 fi |
1737 else | |
1738 AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) | |
1739 fi | |
1740 fi | |
3222 | 1741 |
1742 if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then | |
1743 AC_MSG_ERROR([could not configure Ruby]) | |
1744 fi | |
7 | 1745 fi |
1746 AC_SUBST(RUBY_SRC) | |
1747 AC_SUBST(RUBY_OBJ) | |
1748 AC_SUBST(RUBY_PRO) | |
1749 AC_SUBST(RUBY_CFLAGS) | |
1750 AC_SUBST(RUBY_LIBS) | |
1751 | |
1752 AC_MSG_CHECKING(--enable-cscope argument) | |
1753 AC_ARG_ENABLE(cscope, | |
1754 [ --enable-cscope Include cscope interface.], , | |
1755 [enable_cscope="no"]) | |
1756 AC_MSG_RESULT($enable_cscope) | |
1757 if test "$enable_cscope" = "yes"; then | |
1758 AC_DEFINE(FEAT_CSCOPE) | |
1759 fi | |
1760 | |
1761 AC_MSG_CHECKING(--enable-workshop argument) | |
1762 AC_ARG_ENABLE(workshop, | |
1763 [ --enable-workshop Include Sun Visual Workshop support.], , | |
1764 [enable_workshop="no"]) | |
1765 AC_MSG_RESULT($enable_workshop) | |
1766 if test "$enable_workshop" = "yes"; then | |
1767 AC_DEFINE(FEAT_SUN_WORKSHOP) | |
1768 WORKSHOP_SRC="workshop.c integration.c" | |
1769 AC_SUBST(WORKSHOP_SRC) | |
1770 WORKSHOP_OBJ="objects/workshop.o objects/integration.o" | |
1771 AC_SUBST(WORKSHOP_OBJ) | |
1772 if test "${enable_gui-xxx}" = xxx; then | |
1773 enable_gui=motif | |
1774 fi | |
1775 fi | |
1776 | |
1777 AC_MSG_CHECKING(--disable-netbeans argument) | |
1778 AC_ARG_ENABLE(netbeans, | |
1779 [ --disable-netbeans Disable NetBeans integration support.], | |
1780 , [enable_netbeans="yes"]) | |
1781 if test "$enable_netbeans" = "yes"; then | |
1782 AC_MSG_RESULT(no) | |
1783 dnl On Solaris we need the socket and nsl library. | |
1784 AC_CHECK_LIB(socket, socket) | |
1785 AC_CHECK_LIB(nsl, gethostbyname) | |
1786 AC_MSG_CHECKING(whether compiling netbeans integration is possible) | |
1787 AC_TRY_LINK([ | |
1788 #include <stdio.h> | |
1789 #include <stdlib.h> | |
1790 #include <stdarg.h> | |
1791 #include <fcntl.h> | |
1792 #include <netdb.h> | |
1793 #include <netinet/in.h> | |
1794 #include <errno.h> | |
1795 #include <sys/types.h> | |
1796 #include <sys/socket.h> | |
1797 /* Check bitfields */ | |
1798 struct nbbuf { | |
1799 unsigned int initDone:1; | |
1800 ushort signmaplen; | |
1801 }; | |
1802 ], [ | |
1803 /* Check creating a socket. */ | |
1804 struct sockaddr_in server; | |
1805 (void)socket(AF_INET, SOCK_STREAM, 0); | |
1806 (void)htons(100); | |
1807 (void)gethostbyname("microsoft.com"); | |
1808 if (errno == ECONNREFUSED) | |
1809 (void)connect(1, (struct sockaddr *)&server, sizeof(server)); | |
1810 ], | |
1811 AC_MSG_RESULT(yes), | |
1812 AC_MSG_RESULT(no); enable_netbeans="no") | |
1813 else | |
1814 AC_MSG_RESULT(yes) | |
1815 fi | |
1816 if test "$enable_netbeans" = "yes"; then | |
1817 AC_DEFINE(FEAT_NETBEANS_INTG) | |
1818 NETBEANS_SRC="netbeans.c" | |
1819 AC_SUBST(NETBEANS_SRC) | |
1820 NETBEANS_OBJ="objects/netbeans.o" | |
1821 AC_SUBST(NETBEANS_OBJ) | |
1822 fi | |
1823 | |
1824 AC_MSG_CHECKING(--enable-sniff argument) | |
1825 AC_ARG_ENABLE(sniff, | |
1826 [ --enable-sniff Include Sniff interface.], , | |
1827 [enable_sniff="no"]) | |
1828 AC_MSG_RESULT($enable_sniff) | |
1829 if test "$enable_sniff" = "yes"; then | |
1830 AC_DEFINE(FEAT_SNIFF) | |
1831 SNIFF_SRC="if_sniff.c" | |
1832 AC_SUBST(SNIFF_SRC) | |
1833 SNIFF_OBJ="objects/if_sniff.o" | |
1834 AC_SUBST(SNIFF_OBJ) | |
1835 fi | |
1836 | |
1837 AC_MSG_CHECKING(--enable-multibyte argument) | |
1838 AC_ARG_ENABLE(multibyte, | |
1839 [ --enable-multibyte Include multibyte editing support.], , | |
1840 [enable_multibyte="no"]) | |
1841 AC_MSG_RESULT($enable_multibyte) | |
1842 if test "$enable_multibyte" = "yes"; then | |
1843 AC_DEFINE(FEAT_MBYTE) | |
1844 fi | |
1845 | |
1846 AC_MSG_CHECKING(--enable-hangulinput argument) | |
1847 AC_ARG_ENABLE(hangulinput, | |
1848 [ --enable-hangulinput Include Hangul input support.], , | |
1849 [enable_hangulinput="no"]) | |
1850 AC_MSG_RESULT($enable_hangulinput) | |
1851 | |
1852 AC_MSG_CHECKING(--enable-xim argument) | |
1853 AC_ARG_ENABLE(xim, | |
1854 [ --enable-xim Include XIM input support.], | |
1855 AC_MSG_RESULT($enable_xim), | |
1856 [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)]) | |
1857 | |
1858 AC_MSG_CHECKING(--enable-fontset argument) | |
1859 AC_ARG_ENABLE(fontset, | |
1860 [ --enable-fontset Include X fontset output support.], , | |
1861 [enable_fontset="no"]) | |
1862 AC_MSG_RESULT($enable_fontset) | |
1863 dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI | |
1864 | |
1865 test -z "$with_x" && with_x=yes | |
1866 test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes | |
1867 if test "$with_x" = no; then | |
1868 AC_MSG_RESULT(defaulting to: don't HAVE_X11) | |
1869 else | |
1870 dnl Do this check early, so that its failure can override user requests. | |
1871 | |
1872 AC_PATH_PROG(xmkmfpath, xmkmf) | |
1873 | |
1874 AC_PATH_XTRA | |
1875 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
1876 dnl On z/OS Unix the X libraries are DLLs. To use them the code must |
7 | 1877 dnl be compiled with a special option. |
1878 dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS. | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
1879 if test "$zOSUnix" = "yes"; then |
7 | 1880 CFLAGS="$CFLAGS -W c,dll" |
1881 LDFLAGS="$LDFLAGS -W l,dll" | |
1882 X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu" | |
1883 fi | |
1884 | |
1885 dnl On my HPUX system the X include dir is found, but the lib dir not. | |
1886 dnl This is a desparate try to fix this. | |
1887 | |
1888 if test -d "$x_includes" && test ! -d "$x_libraries"; then | |
1889 x_libraries=`echo "$x_includes" | sed s/include/lib/` | |
1890 AC_MSG_RESULT(Corrected X libraries to $x_libraries) | |
1891 X_LIBS="$X_LIBS -L$x_libraries" | |
1892 if test "`(uname) 2>/dev/null`" = SunOS && | |
1893 uname -r | grep '^5' >/dev/null; then | |
1894 X_LIBS="$X_LIBS -R $x_libraries" | |
1895 fi | |
1896 fi | |
1897 | |
1898 if test -d "$x_libraries" && test ! -d "$x_includes"; then | |
1899 x_includes=`echo "$x_libraries" | sed s/lib/include/` | |
1900 AC_MSG_RESULT(Corrected X includes to $x_includes) | |
1901 X_CFLAGS="$X_CFLAGS -I$x_includes" | |
1902 fi | |
1903 | |
1904 dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed. | |
1905 X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`" | |
1906 dnl Remove "-L/usr/lib " from X_LIBS, should not be needed. | |
1907 X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`" | |
1908 dnl Same for "-R/usr/lib ". | |
1909 X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`" | |
1910 | |
1911 | |
1912 dnl Check if the X11 header files are correctly installed. On some systems | |
1649 | 1913 dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h |
1914 dnl is missing. | |
7 | 1915 AC_MSG_CHECKING(if X11 header files can be found) |
1916 cflags_save=$CFLAGS | |
1917 CFLAGS="$CFLAGS $X_CFLAGS" | |
1649 | 1918 AC_TRY_COMPILE([#include <X11/Xlib.h> |
1919 #include <X11/Intrinsic.h>], , | |
7 | 1920 AC_MSG_RESULT(yes), |
1921 AC_MSG_RESULT(no); no_x=yes) | |
1922 CFLAGS=$cflags_save | |
1923 | |
1924 if test "${no_x-no}" = yes; then | |
1925 with_x=no | |
1926 else | |
1927 AC_DEFINE(HAVE_X11) | |
1928 X_LIB="-lXt -lX11"; | |
1929 AC_SUBST(X_LIB) | |
1930 | |
1931 ac_save_LDFLAGS="$LDFLAGS" | |
1932 LDFLAGS="-L$x_libraries $LDFLAGS" | |
1933 | |
1934 dnl Check for -lXdmcp (needed on SunOS 4.1.4) | |
1935 dnl For HP-UX 10.20 it must be before -lSM -lICE | |
1936 AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],, | |
1937 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp]) | |
1938 | |
1939 dnl Some systems need -lnsl -lsocket when testing for ICE. | |
1940 dnl The check above doesn't do this, try here (again). Also needed to get | |
1941 dnl them after Xdmcp. link.sh will remove them when not needed. | |
1942 dnl Check for other function than above to avoid the cached value | |
1943 AC_CHECK_LIB(ICE, IceOpenConnection, | |
1944 [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS]) | |
1945 | |
1946 dnl Check for -lXpm (needed for some versions of Motif) | |
1947 LDFLAGS="$X_LIBS $ac_save_LDFLAGS" | |
1948 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],, | |
1949 [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS]) | |
1950 | |
1951 dnl Check that the X11 header files don't use implicit declarations | |
1952 AC_MSG_CHECKING(if X11 header files implicitly declare return values) | |
1953 cflags_save=$CFLAGS | |
4348 | 1954 dnl -Werror is GCC only, others like Solaris Studio might not like it |
1955 if test "$GCC" = yes; then | |
1956 CFLAGS="$CFLAGS $X_CFLAGS -Werror" | |
1957 else | |
1958 CFLAGS="$CFLAGS $X_CFLAGS" | |
1959 fi | |
7 | 1960 AC_TRY_COMPILE([#include <X11/Xlib.h>], , |
1961 AC_MSG_RESULT(no), | |
1962 CFLAGS="$CFLAGS -Wno-implicit-int" | |
1963 AC_TRY_COMPILE([#include <X11/Xlib.h>], , | |
1964 AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int", | |
1965 AC_MSG_RESULT(test failed) | |
1966 ) | |
1967 ) | |
1968 CFLAGS=$cflags_save | |
1969 | |
1970 LDFLAGS="$ac_save_LDFLAGS" | |
1971 | |
1887 | 1972 AC_MSG_CHECKING(size of wchar_t is 2 bytes) |
1973 AC_CACHE_VAL(ac_cv_small_wchar_t, | |
1974 [AC_TRY_RUN([ | |
1975 #include <X11/Xlib.h> | |
1976 #if STDC_HEADERS | |
1977 # include <stdlib.h> | |
1978 # include <stddef.h> | |
1979 #endif | |
1980 main() | |
1981 { | |
1982 if (sizeof(wchar_t) <= 2) | |
1983 exit(1); | |
1984 exit(0); | |
1985 }], | |
1986 ac_cv_small_wchar_t="no", | |
1987 ac_cv_small_wchar_t="yes", | |
1988 AC_MSG_ERROR(failed to compile test program))]) | |
1989 AC_MSG_RESULT($ac_cv_small_wchar_t) | |
1990 if test "x$ac_cv_small_wchar_t" = "xyes" ; then | |
1991 AC_DEFINE(SMALL_WCHAR_T) | |
1992 fi | |
1993 | |
7 | 1994 fi |
1995 fi | |
1996 | |
270 | 1997 test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no |
7 | 1998 |
1999 AC_MSG_CHECKING(--enable-gui argument) | |
2000 AC_ARG_ENABLE(gui, | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2001 [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto") |
7 | 2002 |
2003 dnl Canonicalize the --enable-gui= argument so that it can be easily compared. | |
2004 dnl Do not use character classes for portability with old tools. | |
2005 enable_gui_canon=`echo "_$enable_gui" | \ | |
2006 sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | |
2007 | |
2008 dnl Skip everything by default. | |
2009 SKIP_GTK2=YES | |
2010 SKIP_GNOME=YES | |
2011 SKIP_MOTIF=YES | |
2012 SKIP_ATHENA=YES | |
2013 SKIP_NEXTAW=YES | |
2014 SKIP_PHOTON=YES | |
2015 SKIP_CARBON=YES | |
2016 GUITYPE=NONE | |
2017 | |
67 | 2018 if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then |
7 | 2019 SKIP_PHOTON= |
2020 case "$enable_gui_canon" in | |
2021 no) AC_MSG_RESULT(no GUI support) | |
2022 SKIP_PHOTON=YES ;; | |
2023 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; | |
2024 auto) AC_MSG_RESULT(auto - automatic GUI support) ;; | |
2025 photon) AC_MSG_RESULT(Photon GUI support) ;; | |
2026 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) | |
2027 SKIP_PHOTON=YES ;; | |
2028 esac | |
2029 | |
2030 elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then | |
2031 SKIP_CARBON= | |
2032 case "$enable_gui_canon" in | |
2033 no) AC_MSG_RESULT(no GUI support) | |
2034 SKIP_CARBON=YES ;; | |
2035 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2036 auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2037 SKIP_CARBON=YES ;; |
7 | 2038 carbon) AC_MSG_RESULT(Carbon GUI support) ;; |
2039 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) | |
2040 SKIP_CARBON=YES ;; | |
2041 esac | |
2042 | |
2043 else | |
2044 | |
2045 case "$enable_gui_canon" in | |
2046 no|none) AC_MSG_RESULT(no GUI support) ;; | |
2047 yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support) | |
2048 SKIP_GTK2= | |
2049 SKIP_GNOME= | |
2050 SKIP_MOTIF= | |
2051 SKIP_ATHENA= | |
2052 SKIP_NEXTAW= | |
2053 SKIP_CARBON=;; | |
2054 gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support) | |
2055 SKIP_GTK2=;; | |
2056 gnome2) AC_MSG_RESULT(GNOME 2.x GUI support) | |
2057 SKIP_GNOME= | |
2058 SKIP_GTK2=;; | |
2059 motif) AC_MSG_RESULT(Motif GUI support) | |
2060 SKIP_MOTIF=;; | |
2061 athena) AC_MSG_RESULT(Athena GUI support) | |
2062 SKIP_ATHENA=;; | |
2063 nextaw) AC_MSG_RESULT(neXtaw GUI support) | |
2064 SKIP_NEXTAW=;; | |
2065 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;; | |
2066 esac | |
2067 | |
2068 fi | |
2069 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2070 if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \ |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2071 -a "$enable_gui_canon" != "gnome2"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2072 AC_MSG_CHECKING(whether or not to look for GTK+ 2) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2073 AC_ARG_ENABLE(gtk2-check, |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2074 [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]], |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2075 , enable_gtk2_check="yes") |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2076 AC_MSG_RESULT($enable_gtk2_check) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2077 if test "x$enable_gtk2_check" = "xno"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2078 SKIP_GTK2=YES |
7 | 2079 SKIP_GNOME=YES |
2080 fi | |
2081 fi | |
2082 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2083 if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then |
7 | 2084 AC_MSG_CHECKING(whether or not to look for GNOME) |
2085 AC_ARG_ENABLE(gnome-check, | |
2086 [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]], | |
2087 , enable_gnome_check="no") | |
2088 AC_MSG_RESULT($enable_gnome_check) | |
2089 if test "x$enable_gnome_check" = "xno"; then | |
2090 SKIP_GNOME=YES | |
2091 fi | |
2092 fi | |
2093 | |
2094 if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then | |
2095 AC_MSG_CHECKING(whether or not to look for Motif) | |
2096 AC_ARG_ENABLE(motif-check, | |
2097 [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]], | |
2098 , enable_motif_check="yes") | |
2099 AC_MSG_RESULT($enable_motif_check) | |
2100 if test "x$enable_motif_check" = "xno"; then | |
2101 SKIP_MOTIF=YES | |
2102 fi | |
2103 fi | |
2104 | |
2105 if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then | |
2106 AC_MSG_CHECKING(whether or not to look for Athena) | |
2107 AC_ARG_ENABLE(athena-check, | |
2108 [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]], | |
2109 , enable_athena_check="yes") | |
2110 AC_MSG_RESULT($enable_athena_check) | |
2111 if test "x$enable_athena_check" = "xno"; then | |
2112 SKIP_ATHENA=YES | |
2113 fi | |
2114 fi | |
2115 | |
2116 if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then | |
2117 AC_MSG_CHECKING(whether or not to look for neXtaw) | |
2118 AC_ARG_ENABLE(nextaw-check, | |
2119 [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]], | |
2120 , enable_nextaw_check="yes") | |
2121 AC_MSG_RESULT($enable_nextaw_check); | |
2122 if test "x$enable_nextaw_check" = "xno"; then | |
2123 SKIP_NEXTAW=YES | |
2124 fi | |
2125 fi | |
2126 | |
2127 if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then | |
2128 AC_MSG_CHECKING(whether or not to look for Carbon) | |
2129 AC_ARG_ENABLE(carbon-check, | |
2130 [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]], | |
2131 , enable_carbon_check="yes") | |
2132 AC_MSG_RESULT($enable_carbon_check); | |
2133 if test "x$enable_carbon_check" = "xno"; then | |
2134 SKIP_CARBON=YES | |
2135 fi | |
2136 fi | |
2137 | |
11 | 2138 |
7 | 2139 if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then |
2140 AC_MSG_CHECKING(for Carbon GUI) | |
864 | 2141 dnl already did the check, just give the message |
7 | 2142 AC_MSG_RESULT(yes); |
2143 GUITYPE=CARBONGUI | |
502 | 2144 if test "$VIMNAME" = "vim"; then |
2145 VIMNAME=Vim | |
2146 fi | |
864 | 2147 |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2148 if test "x$MACARCH" = "xboth"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2149 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2150 else |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2151 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2152 fi |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
2153 |
864 | 2154 dnl Default install directory is not /usr/local |
2155 if test x$prefix = xNONE; then | |
2156 prefix=/Applications | |
2157 fi | |
2158 | |
2159 dnl Sorry for the hard coded default | |
2160 datadir='${prefix}/Vim.app/Contents/Resources' | |
2161 | |
7 | 2162 dnl skip everything else |
2163 SKIP_GTK2=YES; | |
2164 SKIP_GNOME=YES; | |
2165 SKIP_MOTIF=YES; | |
2166 SKIP_ATHENA=YES; | |
2167 SKIP_NEXTAW=YES; | |
2168 SKIP_PHOTON=YES; | |
2169 SKIP_CARBON=YES | |
2170 fi | |
2171 | |
2172 dnl define an autoconf function to check for a specified version of GTK, and | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2173 dnl try to compile/link a GTK program. |
7 | 2174 dnl |
2175 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
29 | 2176 dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS |
7 | 2177 dnl |
2178 AC_DEFUN(AM_PATH_GTK, | |
2179 [ | |
2180 if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then | |
2181 { | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2182 min_gtk_version=ifelse([$1], ,2.2.0,$1) |
7 | 2183 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
2184 no_gtk="" | |
2185 if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ | |
2186 && $PKG_CONFIG --exists gtk+-2.0; then | |
2187 { | |
2188 dnl We should be using PKG_CHECK_MODULES() instead of this hack. | |
2189 dnl But I guess the dependency on pkgconfig.m4 is not wanted or | |
2190 dnl something like that. | |
2191 GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` | |
29 | 2192 GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` |
7 | 2193 GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
2194 gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
2195 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | |
2196 gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
2197 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | |
2198 gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
2199 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | |
2200 } | |
2201 else | |
2202 no_gtk=yes | |
2203 fi | |
2204 | |
2205 if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then | |
2206 { | |
2207 ac_save_CFLAGS="$CFLAGS" | |
2208 ac_save_LIBS="$LIBS" | |
2209 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
2210 LIBS="$LIBS $GTK_LIBS" | |
2211 | |
2212 dnl | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2213 dnl Now check if the installed GTK is sufficiently new. |
7 | 2214 dnl |
2215 rm -f conf.gtktest | |
2216 AC_TRY_RUN([ | |
2217 #include <gtk/gtk.h> | |
2218 #include <stdio.h> | |
1621 | 2219 #if STDC_HEADERS |
2220 # include <stdlib.h> | |
2221 # include <stddef.h> | |
2222 #endif | |
7 | 2223 |
2224 int | |
2225 main () | |
2226 { | |
2227 int major, minor, micro; | |
2228 char *tmp_version; | |
2229 | |
2230 system ("touch conf.gtktest"); | |
2231 | |
2232 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
2233 tmp_version = g_strdup("$min_gtk_version"); | |
2234 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
2235 printf("%s, bad version string\n", "$min_gtk_version"); | |
2236 exit(1); | |
2237 } | |
2238 | |
2239 if ((gtk_major_version > major) || | |
2240 ((gtk_major_version == major) && (gtk_minor_version > minor)) || | |
2241 ((gtk_major_version == major) && (gtk_minor_version == minor) && | |
2242 (gtk_micro_version >= micro))) | |
2243 { | |
2244 return 0; | |
2245 } | |
2246 return 1; | |
2247 } | |
2248 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
2249 CFLAGS="$ac_save_CFLAGS" | |
2250 LIBS="$ac_save_LIBS" | |
2251 } | |
2252 fi | |
2253 if test "x$no_gtk" = x ; then | |
2254 if test "x$enable_gtktest" = "xyes"; then | |
2255 AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) | |
2256 else | |
2257 AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) | |
2258 fi | |
2259 ifelse([$2], , :, [$2]) | |
2260 else | |
2261 { | |
2262 AC_MSG_RESULT(no) | |
2263 GTK_CFLAGS="" | |
2264 GTK_LIBS="" | |
2265 ifelse([$3], , :, [$3]) | |
2266 } | |
2267 fi | |
2268 } | |
2269 else | |
2270 GTK_CFLAGS="" | |
2271 GTK_LIBS="" | |
2272 ifelse([$3], , :, [$3]) | |
2273 fi | |
2274 AC_SUBST(GTK_CFLAGS) | |
2275 AC_SUBST(GTK_LIBS) | |
2276 rm -f conf.gtktest | |
2277 ]) | |
2278 | |
2279 dnl --------------------------------------------------------------------------- | |
2280 dnl gnome | |
2281 dnl --------------------------------------------------------------------------- | |
2282 AC_DEFUN([GNOME_INIT_HOOK], | |
2283 [ | |
2284 AC_SUBST(GNOME_LIBS) | |
2285 AC_SUBST(GNOME_LIBDIR) | |
2286 AC_SUBST(GNOME_INCLUDEDIR) | |
2287 | |
2288 AC_ARG_WITH(gnome-includes, | |
2289 [ --with-gnome-includes=DIR Specify location of GNOME headers], | |
2290 [CFLAGS="$CFLAGS -I$withval"] | |
2291 ) | |
2292 | |
2293 AC_ARG_WITH(gnome-libs, | |
2294 [ --with-gnome-libs=DIR Specify location of GNOME libs], | |
2295 [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval] | |
2296 ) | |
2297 | |
2298 AC_ARG_WITH(gnome, | |
2299 [ --with-gnome Specify prefix for GNOME files], | |
2300 if test x$withval = xyes; then | |
2301 want_gnome=yes | |
2302 ifelse([$1], [], :, [$1]) | |
2303 else | |
2304 if test "x$withval" = xno; then | |
2305 want_gnome=no | |
2306 else | |
2307 want_gnome=yes | |
2308 LDFLAGS="$LDFLAGS -L$withval/lib" | |
2309 CFLAGS="$CFLAGS -I$withval/include" | |
2310 gnome_prefix=$withval/lib | |
2311 fi | |
2312 fi, | |
2313 want_gnome=yes) | |
2314 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2315 if test "x$want_gnome" = xyes; then |
7 | 2316 { |
2317 AC_MSG_CHECKING(for libgnomeui-2.0) | |
2318 if $PKG_CONFIG --exists libgnomeui-2.0; then | |
2319 AC_MSG_RESULT(yes) | |
2320 GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0` | |
2321 GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0` | |
2322 GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0` | |
856 | 2323 |
782 | 2324 dnl On FreeBSD we need -pthread but pkg-config doesn't include it. |
2325 dnl This might not be the right way but it works for me... | |
2326 AC_MSG_CHECKING(for FreeBSD) | |
2327 if test "`(uname) 2>/dev/null`" = FreeBSD; then | |
2328 AC_MSG_RESULT(yes, adding -pthread) | |
856 | 2329 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" |
782 | 2330 GNOME_LIBS="$GNOME_LIBS -pthread" |
2331 else | |
2332 AC_MSG_RESULT(no) | |
2333 fi | |
7 | 2334 $1 |
2335 else | |
2336 AC_MSG_RESULT(not found) | |
2337 if test "x$2" = xfail; then | |
2338 AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config) | |
2339 fi | |
2340 fi | |
2341 } | |
2342 fi | |
2343 ]) | |
2344 | |
2345 AC_DEFUN([GNOME_INIT],[ | |
2346 GNOME_INIT_HOOK([],fail) | |
2347 ]) | |
2348 | |
2349 | |
2350 dnl --------------------------------------------------------------------------- | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2351 dnl Check for GTK2. If it fails, then continue on for Motif as before... |
7 | 2352 dnl --------------------------------------------------------------------------- |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2353 if test -z "$SKIP_GTK2"; then |
7 | 2354 |
2355 AC_MSG_CHECKING(--disable-gtktest argument) | |
2356 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], | |
2357 , enable_gtktest=yes) | |
2358 if test "x$enable_gtktest" = "xyes" ; then | |
2359 AC_MSG_RESULT(gtk test enabled) | |
2360 else | |
2361 AC_MSG_RESULT(gtk test disabled) | |
2362 fi | |
2363 | |
2364 if test "X$PKG_CONFIG" = "X"; then | |
2365 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | |
2366 fi | |
2367 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2368 if test "x$PKG_CONFIG" != "xno"; then |
7 | 2369 dnl First try finding version 2.2.0 or later. The 2.0.x series has |
2370 dnl problems (bold fonts, --remote doesn't work). | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2371 AM_PATH_GTK(2.2.0, |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2372 [GUI_LIB_LOC="$GTK_LIBDIR" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2373 GTK_LIBNAME="$GTK_LIBS" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2374 GUI_INC_LOC="$GTK_CFLAGS"], ) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2375 if test "x$GTK_CFLAGS" != "x"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2376 SKIP_ATHENA=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2377 SKIP_NEXTAW=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2378 SKIP_MOTIF=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2379 GUITYPE=GTK |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2380 AC_SUBST(GTK_LIBNAME) |
7 | 2381 fi |
2382 fi | |
2383 if test "x$GUITYPE" = "xGTK"; then | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2384 if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \ |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2385 || test "0$gtk_minor_version" -ge 2; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2386 AC_DEFINE(HAVE_GTK_MULTIHEAD) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2387 fi |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2388 dnl |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2389 dnl if GTK exists, then check for GNOME. |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2390 dnl |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2391 if test -z "$SKIP_GNOME"; then |
7 | 2392 { |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2393 GNOME_INIT_HOOK([have_gnome=yes]) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2394 if test "x$have_gnome" = xyes ; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2395 AC_DEFINE(FEAT_GUI_GNOME) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2396 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2397 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS" |
7 | 2398 fi |
2399 } | |
2400 fi | |
2401 fi | |
2402 fi | |
2403 | |
2404 dnl Check for Motif include files location. | |
2405 dnl The LAST one found is used, this makes the highest version to be used, | |
2406 dnl e.g. when Motif1.2 and Motif2.0 are both present. | |
2407 | |
2408 if test -z "$SKIP_MOTIF"; then | |
2409 gui_XXX="/usr/XXX/Motif* /usr/Motif*/XXX /usr/XXX /usr/shlib /usr/X11*/XXX /usr/XXX/X11* /usr/dt/XXX /local/Motif*/XXX /local/XXX/Motif* /usr/local/Motif*/XXX /usr/local/XXX/Motif* /usr/local/XXX /usr/local/X11*/XXX /usr/local/LessTif/Motif*/XXX $MOTIFHOME/XXX" | |
2410 dnl Remove "-I" from before $GUI_INC_LOC if it's there | |
2411 GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`" | |
2412 | |
2413 AC_MSG_CHECKING(for location of Motif GUI includes) | |
2414 gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC" | |
2415 GUI_INC_LOC= | |
2416 for try in $gui_includes; do | |
2417 if test -f "$try/Xm/Xm.h"; then | |
2418 GUI_INC_LOC=$try | |
2419 fi | |
2420 done | |
2421 if test -n "$GUI_INC_LOC"; then | |
2422 if test "$GUI_INC_LOC" = /usr/include; then | |
2423 GUI_INC_LOC= | |
2424 AC_MSG_RESULT(in default path) | |
2425 else | |
2426 AC_MSG_RESULT($GUI_INC_LOC) | |
2427 fi | |
2428 else | |
2429 AC_MSG_RESULT(<not found>) | |
2430 SKIP_MOTIF=YES | |
2431 fi | |
2432 fi | |
2433 | |
2434 dnl Check for Motif library files location. In the same order as the include | |
2435 dnl files, to avoid a mixup if several versions are present | |
2436 | |
2437 if test -z "$SKIP_MOTIF"; then | |
2438 AC_MSG_CHECKING(--with-motif-lib argument) | |
2439 AC_ARG_WITH(motif-lib, | |
2440 [ --with-motif-lib=STRING Library for Motif ], | |
2441 [ MOTIF_LIBNAME="${withval}" ] ) | |
2442 | |
2443 if test -n "$MOTIF_LIBNAME"; then | |
2444 AC_MSG_RESULT($MOTIF_LIBNAME) | |
2445 GUI_LIB_LOC= | |
2446 else | |
2447 AC_MSG_RESULT(no) | |
2448 | |
2449 dnl Remove "-L" from before $GUI_LIB_LOC if it's there | |
2450 GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" | |
2451 | |
4942
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2452 dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The |
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2453 dnl linker will figure out which one to use, we only check if one exists. |
7 | 2454 AC_MSG_CHECKING(for location of Motif GUI libs) |
4942
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2455 gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" |
7 | 2456 GUI_LIB_LOC= |
2457 for try in $gui_libs; do | |
14 | 2458 for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do |
7 | 2459 if test -f "$libtry"; then |
2460 GUI_LIB_LOC=$try | |
2461 fi | |
2462 done | |
2463 done | |
2464 if test -n "$GUI_LIB_LOC"; then | |
2465 dnl Remove /usr/lib, it causes trouble on some systems | |
4942
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2466 if test "$GUI_LIB_LOC" = /usr/lib \ |
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2467 -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ |
b89aa3374b7f
updated for version 7.3.1216
Bram Moolenaar <bram@vim.org>
parents:
4895
diff
changeset
|
2468 -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then |
7 | 2469 GUI_LIB_LOC= |
2470 AC_MSG_RESULT(in default path) | |
2471 else | |
2472 if test -n "$GUI_LIB_LOC"; then | |
2473 AC_MSG_RESULT($GUI_LIB_LOC) | |
2474 if test "`(uname) 2>/dev/null`" = SunOS && | |
2475 uname -r | grep '^5' >/dev/null; then | |
2476 GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC" | |
2477 fi | |
2478 fi | |
2479 fi | |
2480 MOTIF_LIBNAME=-lXm | |
2481 else | |
2482 AC_MSG_RESULT(<not found>) | |
2483 SKIP_MOTIF=YES | |
2484 fi | |
2485 fi | |
2486 fi | |
2487 | |
2488 if test -z "$SKIP_MOTIF"; then | |
2489 SKIP_ATHENA=YES | |
2490 SKIP_NEXTAW=YES | |
2491 GUITYPE=MOTIF | |
2492 AC_SUBST(MOTIF_LIBNAME) | |
2493 fi | |
2494 | |
2495 dnl Check if the Athena files can be found | |
2496 | |
2497 GUI_X_LIBS= | |
2498 | |
2499 if test -z "$SKIP_ATHENA"; then | |
2500 AC_MSG_CHECKING(if Athena header files can be found) | |
2501 cflags_save=$CFLAGS | |
2502 CFLAGS="$CFLAGS $X_CFLAGS" | |
2503 AC_TRY_COMPILE([ | |
2504 #include <X11/Intrinsic.h> | |
2505 #include <X11/Xaw/Paned.h>], , | |
2506 AC_MSG_RESULT(yes), | |
2507 AC_MSG_RESULT(no); SKIP_ATHENA=YES ) | |
2508 CFLAGS=$cflags_save | |
2509 fi | |
2510 | |
2511 if test -z "$SKIP_ATHENA"; then | |
2512 GUITYPE=ATHENA | |
2513 fi | |
2514 | |
2515 if test -z "$SKIP_NEXTAW"; then | |
2516 AC_MSG_CHECKING(if neXtaw header files can be found) | |
2517 cflags_save=$CFLAGS | |
2518 CFLAGS="$CFLAGS $X_CFLAGS" | |
2519 AC_TRY_COMPILE([ | |
2520 #include <X11/Intrinsic.h> | |
2521 #include <X11/neXtaw/Paned.h>], , | |
2522 AC_MSG_RESULT(yes), | |
2523 AC_MSG_RESULT(no); SKIP_NEXTAW=YES ) | |
2524 CFLAGS=$cflags_save | |
2525 fi | |
2526 | |
2527 if test -z "$SKIP_NEXTAW"; then | |
2528 GUITYPE=NEXTAW | |
2529 fi | |
2530 | |
2531 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then | |
2532 dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty | |
2533 dnl Avoid adding it when it twice | |
2534 if test -n "$GUI_INC_LOC"; then | |
2535 GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`" | |
2536 fi | |
2537 if test -n "$GUI_LIB_LOC"; then | |
2538 GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`" | |
2539 fi | |
2540 | |
2541 dnl Check for -lXext and then for -lXmu | |
2542 ldflags_save=$LDFLAGS | |
2543 LDFLAGS="$X_LIBS $LDFLAGS" | |
2544 AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],, | |
2545 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2546 dnl For Solaris we need -lw and -ldl before linking with -lXmu works. | |
2547 AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],, | |
2548 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2549 AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],, | |
2550 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2551 AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],, | |
2552 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2553 if test -z "$SKIP_MOTIF"; then | |
2554 AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],, | |
2555 [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2556 fi | |
2557 LDFLAGS=$ldflags_save | |
2558 | |
2559 dnl Execute xmkmf to figure out if -DNARROWPROTO is needed. | |
2560 AC_MSG_CHECKING(for extra X11 defines) | |
2561 NARROW_PROTO= | |
2562 rm -fr conftestdir | |
2563 if mkdir conftestdir; then | |
2564 cd conftestdir | |
2565 cat > Imakefile <<'EOF' | |
2566 acfindx: | |
2567 @echo 'NARROW_PROTO="${PROTO_DEFINES}"' | |
2568 EOF | |
2569 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then | |
2570 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` | |
2571 fi | |
2572 cd .. | |
2573 rm -fr conftestdir | |
2574 fi | |
2575 if test -z "$NARROW_PROTO"; then | |
2576 AC_MSG_RESULT(no) | |
2577 else | |
2578 AC_MSG_RESULT($NARROW_PROTO) | |
2579 fi | |
2580 AC_SUBST(NARROW_PROTO) | |
2581 fi | |
2582 | |
2583 dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs | |
2584 dnl use the X11 include path | |
2585 if test "$enable_xsmp" = "yes"; then | |
2586 cppflags_save=$CPPFLAGS | |
2587 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2588 AC_CHECK_HEADERS(X11/SM/SMlib.h) | |
2589 CPPFLAGS=$cppflags_save | |
2590 fi | |
2591 | |
2592 | |
2285
69064995302a
Change SKIP_GTK to SKIP_GTK2 in configure.
Bram Moolenaar <bram@vim.org>
parents:
2277
diff
changeset
|
2593 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2"; then |
7 | 2594 dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path |
2595 cppflags_save=$CPPFLAGS | |
2596 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2597 AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h) | |
2598 | |
2599 dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h | |
2600 if test ! "$enable_xim" = "no"; then | |
2601 AC_MSG_CHECKING(for XIMText in X11/Xlib.h) | |
2602 AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>], | |
2603 AC_MSG_RESULT(yes), | |
2604 AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no") | |
2605 fi | |
2606 CPPFLAGS=$cppflags_save | |
2607 | |
2608 dnl automatically enable XIM when hangul input isn't enabled | |
2609 if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \ | |
2610 -a "x$GUITYPE" != "xNONE" ; then | |
2611 AC_MSG_RESULT(X GUI selected; xim has been enabled) | |
2612 enable_xim="yes" | |
2613 fi | |
2614 fi | |
2615 | |
2616 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then | |
2617 cppflags_save=$CPPFLAGS | |
2618 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
148 | 2619 dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h |
2620 AC_MSG_CHECKING([for X11/Xmu/Editres.h]) | |
2621 AC_TRY_COMPILE([ | |
2622 #include <X11/Intrinsic.h> | |
2623 #include <X11/Xmu/Editres.h>], | |
2624 [int i; i = 0;], | |
2625 AC_MSG_RESULT(yes) | |
2626 AC_DEFINE(HAVE_X11_XMU_EDITRES_H), | |
2627 AC_MSG_RESULT(no)) | |
7 | 2628 CPPFLAGS=$cppflags_save |
2629 fi | |
2630 | |
2631 dnl Only use the Xm directory when compiling Motif, don't use it for Athena | |
2632 if test -z "$SKIP_MOTIF"; then | |
2633 cppflags_save=$CPPFLAGS | |
2634 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
3590 | 2635 if test "$zOSUnix" = "yes"; then |
2636 xmheader="Xm/Xm.h" | |
2637 else | |
2638 xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h | |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
2639 Xm/UnhighlightT.h Xm/Notebook.h" |
3590 | 2640 fi |
2641 AC_CHECK_HEADERS($xmheader) | |
2642 | |
2643 if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then | |
819 | 2644 dnl Solaris uses XpmAttributes_21, very annoying. |
2645 AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) | |
2646 AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;], | |
2647 AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21), | |
2648 AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) | |
2649 ) | |
2650 else | |
839 | 2651 AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) |
819 | 2652 fi |
7 | 2653 CPPFLAGS=$cppflags_save |
2654 fi | |
2655 | |
2656 if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then | |
2657 AC_MSG_RESULT(no GUI selected; xim has been disabled) | |
2658 enable_xim="no" | |
2659 fi | |
2660 if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then | |
2661 AC_MSG_RESULT(no GUI selected; fontset has been disabled) | |
2662 enable_fontset="no" | |
2663 fi | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2664 if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then |
7 | 2665 AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled) |
2666 enable_fontset="no" | |
2667 fi | |
2668 | |
2669 if test -z "$SKIP_PHOTON"; then | |
2670 GUITYPE=PHOTONGUI | |
2671 fi | |
2672 | |
2673 AC_SUBST(GUI_INC_LOC) | |
2674 AC_SUBST(GUI_LIB_LOC) | |
2675 AC_SUBST(GUITYPE) | |
2676 AC_SUBST(GUI_X_LIBS) | |
2677 | |
2678 if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then | |
2679 AC_MSG_ERROR([cannot use workshop without Motif]) | |
2680 fi | |
2681 | |
2682 dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled | |
2683 if test "$enable_xim" = "yes"; then | |
2684 AC_DEFINE(FEAT_XIM) | |
2685 fi | |
2686 if test "$enable_fontset" = "yes"; then | |
2687 AC_DEFINE(FEAT_XFONTSET) | |
2688 fi | |
2689 | |
2690 | |
2691 dnl --------------------------------------------------------------------------- | |
2692 dnl end of GUI-checking | |
2693 dnl --------------------------------------------------------------------------- | |
2694 | |
4168 | 2695 dnl Check for Cygwin, which needs an extra source file if not using X11 |
2696 AC_MSG_CHECKING(for CYGWIN environment) | |
2697 case `uname` in | |
2698 CYGWIN*) CYGWIN=yes; AC_MSG_RESULT(yes) | |
2699 AC_MSG_CHECKING(for CYGWIN clipboard support) | |
2700 if test "x$with_x" = "xno" ; then | |
2701 OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o | |
2702 AC_MSG_RESULT(yes) | |
2703 AC_DEFINE(FEAT_CYGWIN_WIN32_CLIPBOARD) | |
2704 else | |
2705 AC_MSG_RESULT(no - using X11) | |
2706 fi ;; | |
2707 | |
2708 *) CYGWIN=no; AC_MSG_RESULT(no);; | |
2709 esac | |
7 | 2710 |
2711 dnl Only really enable hangul input when GUI and XFONTSET are available | |
2712 if test "$enable_hangulinput" = "yes"; then | |
2713 if test "x$GUITYPE" = "xNONE"; then | |
2714 AC_MSG_RESULT(no GUI selected; hangul input has been disabled) | |
2715 enable_hangulinput=no | |
2716 else | |
2717 AC_DEFINE(FEAT_HANGULIN) | |
2718 HANGULIN_SRC=hangulin.c | |
2719 AC_SUBST(HANGULIN_SRC) | |
2720 HANGULIN_OBJ=objects/hangulin.o | |
2721 AC_SUBST(HANGULIN_OBJ) | |
2722 fi | |
2723 fi | |
2724 | |
2725 dnl Checks for libraries and include files. | |
2726 | |
1621 | 2727 AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], |
2728 [ | |
2729 AC_RUN_IFELSE([[ | |
2730 #include "confdefs.h" | |
2731 #include <ctype.h> | |
2732 #if STDC_HEADERS | |
2733 # include <stdlib.h> | |
2734 # include <stddef.h> | |
2735 #endif | |
2736 main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } | |
2737 ]],[ | |
2738 vim_cv_toupper_broken=yes | |
2739 ],[ | |
2740 vim_cv_toupper_broken=no | |
2741 ],[ | |
2742 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken') | |
2743 ])]) | |
2744 | |
2745 if test "x$vim_cv_toupper_broken" = "xyes" ; then | |
2746 AC_DEFINE(BROKEN_TOUPPER) | |
2747 fi | |
7 | 2748 |
2749 AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) | |
1621 | 2750 AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");], |
7 | 2751 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME), |
2752 AC_MSG_RESULT(no)) | |
2753 | |
1876 | 2754 AC_MSG_CHECKING(whether __attribute__((unused)) is allowed) |
2755 AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));], | |
2756 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED), | |
2757 AC_MSG_RESULT(no)) | |
2758 | |
7 | 2759 dnl Checks for header files. |
2760 AC_CHECK_HEADER(elf.h, HAS_ELF=1) | |
2761 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1) | |
2762 if test "$HAS_ELF" = 1; then | |
2763 AC_CHECK_LIB(elf, main) | |
2764 fi | |
2765 | |
2766 AC_HEADER_DIRENT | |
2767 | |
2768 dnl If sys/wait.h is not found it might still exist but not be POSIX | |
2769 dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT) | |
2770 if test $ac_cv_header_sys_wait_h = no; then | |
2771 AC_MSG_CHECKING([for sys/wait.h that defines union wait]) | |
2772 AC_TRY_COMPILE([#include <sys/wait.h>], | |
2773 [union wait xx, yy; xx = yy], | |
2774 AC_MSG_RESULT(yes) | |
2775 AC_DEFINE(HAVE_SYS_WAIT_H) | |
2776 AC_DEFINE(HAVE_UNION_WAIT), | |
2777 AC_MSG_RESULT(no)) | |
2778 fi | |
2779 | |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2780 AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2781 sys/select.h sys/utsname.h termcap.h fcntl.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2782 sgtty.h sys/ioctl.h sys/time.h sys/types.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2783 termio.h iconv.h inttypes.h langinfo.h math.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2784 unistd.h stropts.h errno.h sys/resource.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2785 sys/systeminfo.h locale.h sys/stream.h termios.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2786 libc.h sys/statfs.h poll.h sys/poll.h pwd.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2787 utime.h sys/param.h libintl.h libgen.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2788 util/debug.h util/msg18n.h frame.h sys/acl.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2789 sys/access.h sys/sysinfo.h wchar.h wctype.h) |
7 | 2790 |
1649 | 2791 dnl sys/ptem.h depends on sys/stream.h on Solaris |
2792 AC_CHECK_HEADERS(sys/ptem.h, [], [], | |
2793 [#if defined HAVE_SYS_STREAM_H | |
2794 # include <sys/stream.h> | |
2795 #endif]) | |
2796 | |
1886 | 2797 dnl sys/sysctl.h depends on sys/param.h on OpenBSD |
2798 AC_CHECK_HEADERS(sys/sysctl.h, [], [], | |
2799 [#if defined HAVE_SYS_PARAM_H | |
2800 # include <sys/param.h> | |
2801 #endif]) | |
2802 | |
1649 | 2803 |
132 | 2804 dnl pthread_np.h may exist but can only be used after including pthread.h |
2805 AC_MSG_CHECKING([for pthread_np.h]) | |
2806 AC_TRY_COMPILE([ | |
2807 #include <pthread.h> | |
2808 #include <pthread_np.h>], | |
2809 [int i; i = 0;], | |
2810 AC_MSG_RESULT(yes) | |
2811 AC_DEFINE(HAVE_PTHREAD_NP_H), | |
2812 AC_MSG_RESULT(no)) | |
2813 | |
502 | 2814 AC_CHECK_HEADERS(strings.h) |
574 | 2815 if test "x$MACOSX" = "xyes"; then |
2816 dnl The strings.h file on OS/X contains a warning and nothing useful. | |
2817 AC_DEFINE(NO_STRINGS_WITH_STRING_H) | |
2818 else | |
7 | 2819 |
2820 dnl Check if strings.h and string.h can both be included when defined. | |
2821 AC_MSG_CHECKING([if strings.h can be included after string.h]) | |
2822 cppflags_save=$CPPFLAGS | |
2823 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2824 AC_TRY_COMPILE([ | |
2825 #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO) | |
2826 # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */ | |
2827 /* but don't do it on AIX 5.1 (Uribarri) */ | |
2828 #endif | |
2829 #ifdef HAVE_XM_XM_H | |
2830 # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */ | |
2831 #endif | |
2832 #ifdef HAVE_STRING_H | |
2833 # include <string.h> | |
2834 #endif | |
2835 #if defined(HAVE_STRINGS_H) | |
2836 # include <strings.h> | |
2837 #endif | |
2838 ], [int i; i = 0;], | |
2839 AC_MSG_RESULT(yes), | |
2840 AC_DEFINE(NO_STRINGS_WITH_STRING_H) | |
2841 AC_MSG_RESULT(no)) | |
2842 CPPFLAGS=$cppflags_save | |
574 | 2843 fi |
7 | 2844 |
2845 dnl Checks for typedefs, structures, and compiler characteristics. | |
2846 AC_PROG_GCC_TRADITIONAL | |
2847 AC_C_CONST | |
1832 | 2848 AC_C_VOLATILE |
7 | 2849 AC_TYPE_MODE_T |
2850 AC_TYPE_OFF_T | |
2851 AC_TYPE_PID_T | |
2852 AC_TYPE_SIZE_T | |
2853 AC_TYPE_UID_T | |
2184
5028c4d6d825
Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents:
2131
diff
changeset
|
2854 AC_TYPE_UINT32_T |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2855 |
7 | 2856 AC_HEADER_TIME |
2857 AC_CHECK_TYPE(ino_t, long) | |
2858 AC_CHECK_TYPE(dev_t, unsigned) | |
2184
5028c4d6d825
Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents:
2131
diff
changeset
|
2859 AC_C_BIGENDIAN(,,,) |
7 | 2860 |
2861 AC_MSG_CHECKING(for rlim_t) | |
2862 if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then | |
2863 AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t]) | |
2864 else | |
2865 AC_EGREP_CPP(dnl | |
2866 changequote(<<,>>)dnl | |
2867 <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl | |
2868 changequote([,]), | |
2869 [ | |
2870 #include <sys/types.h> | |
2871 #if STDC_HEADERS | |
1621 | 2872 # include <stdlib.h> |
2873 # include <stddef.h> | |
7 | 2874 #endif |
2875 #ifdef HAVE_SYS_RESOURCE_H | |
1621 | 2876 # include <sys/resource.h> |
7 | 2877 #endif |
2878 ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no) | |
2879 AC_MSG_RESULT($ac_cv_type_rlim_t) | |
2880 fi | |
2881 if test $ac_cv_type_rlim_t = no; then | |
2882 cat >> confdefs.h <<\EOF | |
2883 #define rlim_t unsigned long | |
2884 EOF | |
2885 fi | |
2886 | |
2887 AC_MSG_CHECKING(for stack_t) | |
2888 if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then | |
2889 AC_MSG_RESULT([(cached) $ac_cv_type_stack_t]) | |
2890 else | |
2891 AC_EGREP_CPP(stack_t, | |
2892 [ | |
2893 #include <sys/types.h> | |
2894 #if STDC_HEADERS | |
1621 | 2895 # include <stdlib.h> |
2896 # include <stddef.h> | |
7 | 2897 #endif |
2898 #include <signal.h> | |
2899 ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no) | |
2900 AC_MSG_RESULT($ac_cv_type_stack_t) | |
2901 fi | |
2902 if test $ac_cv_type_stack_t = no; then | |
2903 cat >> confdefs.h <<\EOF | |
2904 #define stack_t struct sigaltstack | |
2905 EOF | |
2906 fi | |
2907 | |
2908 dnl BSDI uses ss_base while others use ss_sp for the stack pointer. | |
2909 AC_MSG_CHECKING(whether stack_t has an ss_base field) | |
2910 AC_TRY_COMPILE([ | |
2911 #include <sys/types.h> | |
2912 #if STDC_HEADERS | |
1621 | 2913 # include <stdlib.h> |
2914 # include <stddef.h> | |
7 | 2915 #endif |
2916 #include <signal.h> | |
2917 #include "confdefs.h" | |
2918 ], [stack_t sigstk; sigstk.ss_base = 0; ], | |
2919 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE), | |
2920 AC_MSG_RESULT(no)) | |
2921 | |
2922 olibs="$LIBS" | |
2923 AC_MSG_CHECKING(--with-tlib argument) | |
2924 AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],) | |
2925 if test -n "$with_tlib"; then | |
2926 AC_MSG_RESULT($with_tlib) | |
2927 LIBS="$LIBS -l$with_tlib" | |
39 | 2928 AC_MSG_CHECKING(for linking with $with_tlib library) |
2929 AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) | |
2930 dnl Need to check for tgetent() below. | |
2931 olibs="$LIBS" | |
7 | 2932 else |
39 | 2933 AC_MSG_RESULT([empty: automatic terminal library selection]) |
7 | 2934 dnl On HP-UX 10.10 termcap or termlib should be used instead of |
2935 dnl curses, because curses is much slower. | |
2700 | 2936 dnl Newer versions of ncurses are preferred over anything, except |
2797 | 2937 dnl when tinfo has been split off, it contains all we need. |
7 | 2938 dnl Older versions of ncurses have bugs, get a new one! |
2939 dnl Digital Unix (OSF1) should use curses (Ronald Schild). | |
997 | 2940 dnl On SCO Openserver should prefer termlib (Roger Cornelius). |
7 | 2941 case "`uname -s 2>/dev/null`" in |
2700 | 2942 OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; |
2943 *) tlibs="tinfo ncurses termlib termcap curses";; | |
7 | 2944 esac |
2945 for libname in $tlibs; do | |
2946 AC_CHECK_LIB(${libname}, tgetent,,) | |
2947 if test "x$olibs" != "x$LIBS"; then | |
2948 dnl It's possible that a library is found but it doesn't work | |
2949 dnl e.g., shared library that cannot be found | |
2950 dnl compile and run a test program to be sure | |
2951 AC_TRY_RUN([ | |
2952 #ifdef HAVE_TERMCAP_H | |
2953 # include <termcap.h> | |
2954 #endif | |
1621 | 2955 #if STDC_HEADERS |
2956 # include <stdlib.h> | |
2957 # include <stddef.h> | |
2958 #endif | |
7 | 2959 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], |
2960 res="OK", res="FAIL", res="FAIL") | |
2961 if test "$res" = "OK"; then | |
2962 break | |
2963 fi | |
2964 AC_MSG_RESULT($libname library is not usable) | |
2965 LIBS="$olibs" | |
2966 fi | |
2967 done | |
39 | 2968 if test "x$olibs" = "x$LIBS"; then |
2969 AC_MSG_RESULT(no terminal library found) | |
2970 fi | |
7 | 2971 fi |
39 | 2972 |
2973 if test "x$olibs" = "x$LIBS"; then | |
2974 AC_MSG_CHECKING([for tgetent()]) | |
282 | 2975 AC_TRY_LINK([], |
39 | 2976 [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");], |
2977 AC_MSG_RESULT(yes), | |
2978 AC_MSG_ERROR([NOT FOUND! | |
2979 You need to install a terminal library; for example ncurses. | |
2980 Or specify the name of the library with --with-tlib.])) | |
2981 fi | |
2982 | |
1621 | 2983 AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], |
2984 [ | |
2985 AC_RUN_IFELSE([[ | |
2986 #include "confdefs.h" | |
7 | 2987 #ifdef HAVE_TERMCAP_H |
2988 # include <termcap.h> | |
2989 #endif | |
1621 | 2990 #ifdef HAVE_STRING_H |
2991 # include <string.h> | |
2992 #endif | |
2993 #if STDC_HEADERS | |
2994 # include <stdlib.h> | |
2995 # include <stddef.h> | |
2996 #endif | |
7 | 2997 main() |
1621 | 2998 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } |
2999 ]],[ | |
3000 vim_cv_terminfo=no | |
3001 ],[ | |
3002 vim_cv_terminfo=yes | |
3003 ],[ | |
3004 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo') | |
3005 ]) | |
3006 ]) | |
3007 | |
3008 if test "x$vim_cv_terminfo" = "xyes" ; then | |
3009 AC_DEFINE(TERMINFO) | |
3010 fi | |
7 | 3011 |
3012 if test "x$olibs" != "x$LIBS"; then | |
1621 | 3013 AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent], |
3014 [ | |
3015 AC_RUN_IFELSE([[ | |
3016 #include "confdefs.h" | |
7 | 3017 #ifdef HAVE_TERMCAP_H |
3018 # include <termcap.h> | |
3019 #endif | |
1621 | 3020 #if STDC_HEADERS |
3021 # include <stdlib.h> | |
3022 # include <stddef.h> | |
3023 #endif | |
7 | 3024 main() |
1621 | 3025 {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } |
3026 ]],[ | |
3027 vim_cv_tgent=zero | |
3028 ],[ | |
3029 vim_cv_tgent=non-zero | |
3030 ],[ | |
3031 AC_MSG_ERROR(failed to compile test program.) | |
3032 ]) | |
3033 ]) | |
3034 | |
3035 if test "x$vim_cv_tgent" = "xzero" ; then | |
3036 AC_DEFINE(TGETENT_ZERO_ERR, 0) | |
3037 fi | |
7 | 3038 fi |
3039 | |
3040 AC_MSG_CHECKING(whether termcap.h contains ospeed) | |
3041 AC_TRY_LINK([ | |
3042 #ifdef HAVE_TERMCAP_H | |
3043 # include <termcap.h> | |
3044 #endif | |
3045 ], [ospeed = 20000], | |
3046 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED), | |
3047 [AC_MSG_RESULT(no) | |
3048 AC_MSG_CHECKING(whether ospeed can be extern) | |
3049 AC_TRY_LINK([ | |
3050 #ifdef HAVE_TERMCAP_H | |
3051 # include <termcap.h> | |
3052 #endif | |
3053 extern short ospeed; | |
3054 ], [ospeed = 20000], | |
3055 AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN), | |
3056 AC_MSG_RESULT(no))] | |
3057 ) | |
3058 | |
3059 AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC]) | |
3060 AC_TRY_LINK([ | |
3061 #ifdef HAVE_TERMCAP_H | |
3062 # include <termcap.h> | |
3063 #endif | |
3064 ], [if (UP == 0 && BC == 0) PC = 1], | |
3065 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC), | |
3066 [AC_MSG_RESULT(no) | |
3067 AC_MSG_CHECKING([whether UP, BC and PC can be extern]) | |
3068 AC_TRY_LINK([ | |
3069 #ifdef HAVE_TERMCAP_H | |
3070 # include <termcap.h> | |
3071 #endif | |
3072 extern char *UP, *BC, PC; | |
3073 ], [if (UP == 0 && BC == 0) PC = 1], | |
3074 AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN), | |
3075 AC_MSG_RESULT(no))] | |
3076 ) | |
3077 | |
3078 AC_MSG_CHECKING(whether tputs() uses outfuntype) | |
3079 AC_TRY_COMPILE([ | |
3080 #ifdef HAVE_TERMCAP_H | |
3081 # include <termcap.h> | |
3082 #endif | |
3083 ], [extern int xx(); tputs("test", 1, (outfuntype)xx)], | |
3084 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE), | |
3085 AC_MSG_RESULT(no)) | |
3086 | |
3087 dnl On some SCO machines sys/select redefines struct timeval | |
3088 AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included]) | |
3089 AC_TRY_COMPILE([ | |
3090 #include <sys/types.h> | |
3091 #include <sys/time.h> | |
3092 #include <sys/select.h>], , | |
3093 AC_MSG_RESULT(yes) | |
3094 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME), | |
3095 AC_MSG_RESULT(no)) | |
3096 | |
3097 dnl AC_DECL_SYS_SIGLIST | |
3098 | |
3099 dnl Checks for pty.c (copied from screen) ========================== | |
3100 AC_MSG_CHECKING(for /dev/ptc) | |
3101 if test -r /dev/ptc; then | |
3102 AC_DEFINE(HAVE_DEV_PTC) | |
3103 AC_MSG_RESULT(yes) | |
3104 else | |
3105 AC_MSG_RESULT(no) | |
3106 fi | |
3107 | |
3108 AC_MSG_CHECKING(for SVR4 ptys) | |
3109 if test -c /dev/ptmx ; then | |
3110 AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);], | |
3111 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS), | |
3112 AC_MSG_RESULT(no)) | |
3113 else | |
3114 AC_MSG_RESULT(no) | |
3115 fi | |
3116 | |
3117 AC_MSG_CHECKING(for ptyranges) | |
3118 if test -d /dev/ptym ; then | |
3119 pdir='/dev/ptym' | |
3120 else | |
3121 pdir='/dev' | |
3122 fi | |
3123 dnl SCO uses ptyp%d | |
3124 AC_EGREP_CPP(yes, | |
3125 [#ifdef M_UNIX | |
3126 yes; | |
3127 #endif | |
3128 ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`) | |
3129 dnl if test -c /dev/ptyp19; then | |
3130 dnl ptys=`echo /dev/ptyp??` | |
3131 dnl else | |
3132 dnl ptys=`echo $pdir/pty??` | |
3133 dnl fi | |
3134 if test "$ptys" != "$pdir/pty??" ; then | |
3135 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` | |
3136 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` | |
3137 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") | |
3138 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") | |
3139 AC_MSG_RESULT([$p0 / $p1]) | |
3140 else | |
3141 AC_MSG_RESULT([don't know]) | |
3142 fi | |
3143 | |
3144 dnl **** pty mode/group handling **** | |
3145 dnl | |
3146 dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222 | |
3147 rm -f conftest_grp | |
1621 | 3148 AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], |
3149 [ | |
3150 AC_RUN_IFELSE([[ | |
3151 #include "confdefs.h" | |
7 | 3152 #include <sys/types.h> |
1621 | 3153 #if STDC_HEADERS |
3154 # include <stdlib.h> | |
3155 # include <stddef.h> | |
3156 #endif | |
3157 #ifdef HAVE_UNISTD_H | |
3158 #include <unistd.h> | |
3159 #endif | |
7 | 3160 #include <sys/stat.h> |
3161 #include <stdio.h> | |
3162 main() | |
3163 { | |
3164 struct stat sb; | |
3165 char *x,*ttyname(); | |
3166 int om, m; | |
3167 FILE *fp; | |
3168 | |
3169 if (!(x = ttyname(0))) exit(1); | |
3170 if (stat(x, &sb)) exit(1); | |
3171 om = sb.st_mode; | |
3172 if (om & 002) exit(0); | |
3173 m = system("mesg y"); | |
3174 if (m == -1 || m == 127) exit(1); | |
3175 if (stat(x, &sb)) exit(1); | |
3176 m = sb.st_mode; | |
3177 if (chmod(x, om)) exit(1); | |
3178 if (m & 002) exit(0); | |
3179 if (sb.st_gid == getgid()) exit(1); | |
3180 if (!(fp=fopen("conftest_grp", "w"))) | |
3181 exit(1); | |
3182 fprintf(fp, "%d\n", sb.st_gid); | |
3183 fclose(fp); | |
3184 exit(0); | |
3185 } | |
1621 | 3186 ]],[ |
3187 if test -f conftest_grp; then | |
3188 vim_cv_tty_group=`cat conftest_grp` | |
3189 if test "x$vim_cv_tty_mode" = "x" ; then | |
3190 vim_cv_tty_mode=0620 | |
3191 fi | |
3192 AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) | |
3193 else | |
3194 vim_cv_tty_group=world | |
2018 | 3195 AC_MSG_RESULT([ptys are world accessible]) |
1621 | 3196 fi |
3197 ],[ | |
3198 vim_cv_tty_group=world | |
2018 | 3199 AC_MSG_RESULT([can't determine - assume ptys are world accessible]) |
1621 | 3200 ],[ |
3201 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') | |
3202 ]) | |
3203 ]) | |
7 | 3204 rm -f conftest_grp |
3205 | |
1621 | 3206 if test "x$vim_cv_tty_group" != "xworld" ; then |
3207 AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) | |
3208 if test "x$vim_cv_tty_mode" = "x" ; then | |
4352 | 3209 AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)]) |
1621 | 3210 else |
3211 AC_DEFINE(PTYMODE, 0620) | |
3212 fi | |
3213 fi | |
3214 | |
7 | 3215 dnl Checks for library functions. =================================== |
3216 | |
3217 AC_TYPE_SIGNAL | |
3218 | |
3219 dnl find out what to use at the end of a signal function | |
3220 if test $ac_cv_type_signal = void; then | |
3221 AC_DEFINE(SIGRETURN, [return]) | |
3222 else | |
3223 AC_DEFINE(SIGRETURN, [return 0]) | |
3224 fi | |
3225 | |
3226 dnl check if struct sigcontext is defined (used for SGI only) | |
3227 AC_MSG_CHECKING(for struct sigcontext) | |
3228 AC_TRY_COMPILE([ | |
3229 #include <signal.h> | |
3230 test_sig() | |
3231 { | |
3232 struct sigcontext *scont; | |
3233 scont = (struct sigcontext *)0; | |
3234 return 1; | |
3235 } ], , | |
3236 AC_MSG_RESULT(yes) | |
3237 AC_DEFINE(HAVE_SIGCONTEXT), | |
3238 AC_MSG_RESULT(no)) | |
3239 | |
3240 dnl tricky stuff: try to find out if getcwd() is implemented with | |
3241 dnl system("sh -c pwd") | |
1621 | 3242 AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], |
3243 [ | |
3244 AC_RUN_IFELSE([[ | |
3245 #include "confdefs.h" | |
3246 #ifdef HAVE_UNISTD_H | |
3247 #include <unistd.h> | |
3248 #endif | |
7 | 3249 char *dagger[] = { "IFS=pwd", 0 }; |
3250 main() | |
3251 { | |
3252 char buffer[500]; | |
3253 extern char **environ; | |
3254 environ = dagger; | |
3255 return getcwd(buffer, 500) ? 0 : 1; | |
1621 | 3256 } |
3257 ]],[ | |
3258 vim_cv_getcwd_broken=no | |
3259 ],[ | |
3260 vim_cv_getcwd_broken=yes | |
3261 ],[ | |
3262 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken') | |
3263 ]) | |
3264 ]) | |
3265 | |
3266 if test "x$vim_cv_getcwd_broken" = "xyes" ; then | |
3267 AC_DEFINE(BAD_GETCWD) | |
3268 fi | |
7 | 3269 |
2087
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
3270 dnl Check for functions in one big call, to reduce the size of configure. |
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
3271 dnl Can only be used for functions that do not require any include. |
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
3272 AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ |
3744 | 3273 getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ |
1997 | 3274 memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ |
7 | 3275 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ |
273 | 3276 sigvec strcasecmp strerror strftime stricmp strncasecmp \ |
258 | 3277 strnicmp strpbrk strtol tgetent towlower towupper iswupper \ |
3278 usleep utime utimes) | |
2087
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
3279 AC_FUNC_FSEEKO |
7 | 3280 |
2131
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
3281 dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
3282 dnl appropriate, so that off_t is 64 bits when needed. |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
3283 AC_SYS_LARGEFILE |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
3284 |
7 | 3285 dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible |
3286 AC_MSG_CHECKING(for st_blksize) | |
3287 AC_TRY_COMPILE( | |
3288 [#include <sys/types.h> | |
3289 #include <sys/stat.h>], | |
3290 [ struct stat st; | |
3291 int n; | |
3292 | |
3293 stat("/", &st); | |
3294 n = (int)st.st_blksize;], | |
3295 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE), | |
3296 AC_MSG_RESULT(no)) | |
3297 | |
1621 | 3298 AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], |
3299 [ | |
3300 AC_RUN_IFELSE([[ | |
3301 #include "confdefs.h" | |
3302 #if STDC_HEADERS | |
3303 # include <stdlib.h> | |
3304 # include <stddef.h> | |
3305 #endif | |
3306 #include <sys/types.h> | |
7 | 3307 #include <sys/stat.h> |
1621 | 3308 main() {struct stat st; exit(stat("configure/", &st) != 0); } |
3309 ]],[ | |
3310 vim_cv_stat_ignores_slash=yes | |
3311 ],[ | |
3312 vim_cv_stat_ignores_slash=no | |
3313 ],[ | |
3314 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash') | |
3315 ]) | |
3316 ]) | |
7 | 3317 |
1621 | 3318 if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then |
3319 AC_DEFINE(STAT_IGNORES_SLASH) | |
3320 fi | |
3321 | |
7 | 3322 dnl Link with iconv for charset translation, if not found without library. |
3323 dnl check for iconv() requires including iconv.h | |
3324 dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it | |
3325 dnl has been installed. | |
3326 AC_MSG_CHECKING(for iconv_open()) | |
3327 save_LIBS="$LIBS" | |
3328 LIBS="$LIBS -liconv" | |
3329 AC_TRY_LINK([ | |
3330 #ifdef HAVE_ICONV_H | |
3331 # include <iconv.h> | |
3332 #endif | |
3333 ], [iconv_open("fr", "to");], | |
3334 AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV), | |
3335 LIBS="$save_LIBS" | |
3336 AC_TRY_LINK([ | |
3337 #ifdef HAVE_ICONV_H | |
3338 # include <iconv.h> | |
3339 #endif | |
3340 ], [iconv_open("fr", "to");], | |
3341 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV), | |
3342 AC_MSG_RESULT(no))) | |
3343 | |
3344 | |
3345 AC_MSG_CHECKING(for nl_langinfo(CODESET)) | |
3346 AC_TRY_LINK([ | |
3347 #ifdef HAVE_LANGINFO_H | |
3348 # include <langinfo.h> | |
3349 #endif | |
3350 ], [char *cs = nl_langinfo(CODESET);], | |
3351 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET), | |
3352 AC_MSG_RESULT(no)) | |
3353 | |
1621 | 3354 dnl Need various functions for floating point support. Only enable |
3355 dnl floating point when they are all present. | |
3356 AC_CHECK_LIB(m, strtod) | |
3357 AC_MSG_CHECKING([for strtod() and other floating point functions]) | |
3358 AC_TRY_LINK([ | |
3359 #ifdef HAVE_MATH_H | |
3360 # include <math.h> | |
3361 #endif | |
3362 #if STDC_HEADERS | |
3363 # include <stdlib.h> | |
3364 # include <stddef.h> | |
3365 #endif | |
3366 ], [char *s; double d; | |
3367 d = strtod("1.1", &s); | |
3368 d = fabs(1.11); | |
3369 d = ceil(1.11); | |
3370 d = floor(1.11); | |
3371 d = log10(1.11); | |
3372 d = pow(1.11, 2.22); | |
3373 d = sqrt(1.11); | |
3374 d = sin(1.11); | |
3375 d = cos(1.11); | |
3376 d = atan(1.11); | |
3377 ], | |
3378 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS), | |
3379 AC_MSG_RESULT(no)) | |
3380 | |
7 | 3381 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI |
3382 dnl when -lacl works, also try to use -lattr (required for Debian). | |
3330 | 3383 dnl On Solaris, use the acl_get/set functions in libsec, if present. |
7 | 3384 AC_MSG_CHECKING(--disable-acl argument) |
3385 AC_ARG_ENABLE(acl, | |
3386 [ --disable-acl Don't check for ACL support.], | |
3387 , [enable_acl="yes"]) | |
3388 if test "$enable_acl" = "yes"; then | |
3389 AC_MSG_RESULT(no) | |
3390 AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"], | |
3391 AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl" | |
3392 AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),) | |
3393 | |
3394 AC_MSG_CHECKING(for POSIX ACL support) | |
3395 AC_TRY_LINK([ | |
3396 #include <sys/types.h> | |
3397 #ifdef HAVE_SYS_ACL_H | |
3398 # include <sys/acl.h> | |
3399 #endif | |
3400 acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS); | |
3401 acl_set_file("foo", ACL_TYPE_ACCESS, acl); | |
3402 acl_free(acl);], | |
3403 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), | |
3404 AC_MSG_RESULT(no)) | |
3405 | |
3330 | 3406 AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)], |
7 | 3407 AC_MSG_CHECKING(for Solaris ACL support) |
3408 AC_TRY_LINK([ | |
3409 #ifdef HAVE_SYS_ACL_H | |
3410 # include <sys/acl.h> | |
3411 #endif], [acl("foo", GETACLCNT, 0, NULL); | |
3412 ], | |
3413 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL), | |
3330 | 3414 AC_MSG_RESULT(no))) |
7 | 3415 |
3416 AC_MSG_CHECKING(for AIX ACL support) | |
3417 AC_TRY_LINK([ | |
1621 | 3418 #if STDC_HEADERS |
3419 # include <stdlib.h> | |
3420 # include <stddef.h> | |
3421 #endif | |
7 | 3422 #ifdef HAVE_SYS_ACL_H |
3423 # include <sys/acl.h> | |
3424 #endif | |
3425 #ifdef HAVE_SYS_ACCESS_H | |
3426 # include <sys/access.h> | |
3427 #endif | |
3428 #define _ALL_SOURCE | |
3429 | |
3430 #include <sys/stat.h> | |
3431 | |
3432 int aclsize; | |
3433 struct acl *aclent;], [aclsize = sizeof(struct acl); | |
3434 aclent = (void *)malloc(aclsize); | |
3435 statacl("foo", STX_NORMAL, aclent, aclsize); | |
3436 ], | |
3437 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL), | |
3438 AC_MSG_RESULT(no)) | |
3439 else | |
3440 AC_MSG_RESULT(yes) | |
3441 fi | |
3442 | |
3443 AC_MSG_CHECKING(--disable-gpm argument) | |
3444 AC_ARG_ENABLE(gpm, | |
3445 [ --disable-gpm Don't use gpm (Linux mouse daemon).], , | |
3446 [enable_gpm="yes"]) | |
3447 | |
3448 if test "$enable_gpm" = "yes"; then | |
3449 AC_MSG_RESULT(no) | |
3450 dnl Checking if gpm support can be compiled | |
3451 AC_CACHE_CHECK([for gpm], vi_cv_have_gpm, | |
3452 [olibs="$LIBS" ; LIBS="-lgpm"] | |
3453 AC_TRY_LINK( | |
3454 [#include <gpm.h> | |
3455 #include <linux/keyboard.h>], | |
3456 [Gpm_GetLibVersion(NULL);], | |
3457 dnl Configure defines HAVE_GPM, if it is defined feature.h defines | |
3458 dnl FEAT_MOUSE_GPM if mouse support is included | |
3459 [vi_cv_have_gpm=yes], | |
3460 [vi_cv_have_gpm=no]) | |
3461 [LIBS="$olibs"] | |
3462 ) | |
3463 if test $vi_cv_have_gpm = yes; then | |
3464 LIBS="$LIBS -lgpm" | |
3465 AC_DEFINE(HAVE_GPM) | |
3466 fi | |
3467 else | |
3468 AC_MSG_RESULT(yes) | |
3469 fi | |
3470 | |
1621 | 3471 AC_MSG_CHECKING(--disable-sysmouse argument) |
3472 AC_ARG_ENABLE(sysmouse, | |
3473 [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], , | |
3474 [enable_sysmouse="yes"]) | |
3475 | |
3476 if test "$enable_sysmouse" = "yes"; then | |
3477 AC_MSG_RESULT(no) | |
3478 dnl Checking if sysmouse support can be compiled | |
3479 dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h | |
3480 dnl defines FEAT_SYSMOUSE if mouse support is included | |
3481 AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse, | |
3482 AC_TRY_LINK( | |
3483 [#include <sys/consio.h> | |
3484 #include <signal.h> | |
3485 #include <sys/fbio.h>], | |
3486 [struct mouse_info mouse; | |
3487 mouse.operation = MOUSE_MODE; | |
3488 mouse.operation = MOUSE_SHOW; | |
3489 mouse.u.mode.mode = 0; | |
3490 mouse.u.mode.signal = SIGUSR2;], | |
3491 [vi_cv_have_sysmouse=yes], | |
3492 [vi_cv_have_sysmouse=no]) | |
3493 ) | |
3494 if test $vi_cv_have_sysmouse = yes; then | |
3495 AC_DEFINE(HAVE_SYSMOUSE) | |
3496 fi | |
3497 else | |
3498 AC_MSG_RESULT(yes) | |
3499 fi | |
3500 | |
2003 | 3501 dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known |
3502 AC_MSG_CHECKING(for FD_CLOEXEC) | |
3503 AC_TRY_COMPILE( | |
3504 [#if HAVE_FCNTL_H | |
3505 # include <fcntl.h> | |
3506 #endif], | |
3507 [ int flag = FD_CLOEXEC;], | |
3508 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), | |
3509 AC_MSG_RESULT(not usable)) | |
3510 | |
7 | 3511 dnl rename needs to be checked separately to work on Nextstep with cc |
3512 AC_MSG_CHECKING(for rename) | |
3513 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")], | |
3514 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), | |
3515 AC_MSG_RESULT(no)) | |
3516 | |
3517 dnl sysctl() may exist but not the arguments we use | |
3518 AC_MSG_CHECKING(for sysctl) | |
3519 AC_TRY_COMPILE( | |
3520 [#include <sys/types.h> | |
3521 #include <sys/sysctl.h>], | |
3522 [ int mib[2], r; | |
3523 size_t len; | |
3524 | |
3525 mib[0] = CTL_HW; | |
3526 mib[1] = HW_USERMEM; | |
3527 len = sizeof(r); | |
3528 (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0); | |
3529 ], | |
3530 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), | |
3531 AC_MSG_RESULT(not usable)) | |
3532 | |
3533 dnl sysinfo() may exist but not be Linux compatible | |
3534 AC_MSG_CHECKING(for sysinfo) | |
3535 AC_TRY_COMPILE( | |
3536 [#include <sys/types.h> | |
3537 #include <sys/sysinfo.h>], | |
3538 [ struct sysinfo sinfo; | |
3539 int t; | |
3540 | |
3541 (void)sysinfo(&sinfo); | |
3542 t = sinfo.totalram; | |
3543 ], | |
3544 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO), | |
3545 AC_MSG_RESULT(not usable)) | |
3546 | |
1110 | 3547 dnl struct sysinfo may have the mem_unit field or not |
3548 AC_MSG_CHECKING(for sysinfo.mem_unit) | |
3549 AC_TRY_COMPILE( | |
3550 [#include <sys/types.h> | |
3551 #include <sys/sysinfo.h>], | |
3552 [ struct sysinfo sinfo; | |
4841
81dedcd64821
updated for version 7.3.1167
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
3553 sinfo.mem_unit = 1; |
1110 | 3554 ], |
3555 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), | |
3556 AC_MSG_RESULT(no)) | |
3557 | |
7 | 3558 dnl sysconf() may exist but not support what we want to use |
3559 AC_MSG_CHECKING(for sysconf) | |
3560 AC_TRY_COMPILE( | |
3561 [#include <unistd.h>], | |
3562 [ (void)sysconf(_SC_PAGESIZE); | |
3563 (void)sysconf(_SC_PHYS_PAGES); | |
3564 ], | |
3565 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), | |
3566 AC_MSG_RESULT(not usable)) | |
3567 | |
2241
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3568 AC_CHECK_SIZEOF([int]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3569 AC_CHECK_SIZEOF([long]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3570 AC_CHECK_SIZEOF([time_t]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3571 AC_CHECK_SIZEOF([off_t]) |
2232
2e6906bbc5f4
A few more fixes for undo file. Split test in two parts so that it doesn't
Bram Moolenaar <bram@vim.org>
parents:
2200
diff
changeset
|
3572 |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3573 dnl Make sure that uint32_t is really 32 bits unsigned. |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3574 AC_MSG_CHECKING([uint32_t is 32 bits]) |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3575 AC_TRY_RUN([ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3576 #ifdef HAVE_STDINT_H |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3577 # include <stdint.h> |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3578 #endif |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3579 #ifdef HAVE_INTTYPES_H |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3580 # include <inttypes.h> |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3581 #endif |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3582 main() { |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3583 uint32_t nr1 = (uint32_t)-1; |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3584 uint32_t nr2 = (uint32_t)0xffffffffUL; |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3585 if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3586 exit(0); |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3587 }], |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3588 AC_MSG_RESULT(ok), |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3589 AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]), |
3216 | 3590 AC_MSG_WARN([cannot check uint32_t when cross-compiling.])) |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3591 |
1621 | 3592 dnl Check for memmove() before bcopy(), makes memmove() be used when both are |
3593 dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. | |
3594 | |
7 | 3595 [bcopy_test_prog=' |
1621 | 3596 #include "confdefs.h" |
3597 #ifdef HAVE_STRING_H | |
3598 # include <string.h> | |
3599 #endif | |
3600 #if STDC_HEADERS | |
3601 # include <stdlib.h> | |
3602 # include <stddef.h> | |
3603 #endif | |
7 | 3604 main() { |
3605 char buf[10]; | |
3606 strcpy(buf, "abcdefghi"); | |
3607 mch_memmove(buf, buf + 2, 3); | |
3608 if (strncmp(buf, "ababcf", 6)) | |
3609 exit(1); | |
3610 strcpy(buf, "abcdefghi"); | |
3611 mch_memmove(buf + 2, buf, 3); | |
3612 if (strncmp(buf, "cdedef", 6)) | |
3613 exit(1); | |
3614 exit(0); /* libc version works properly. */ | |
3615 }'] | |
3616 | |
1621 | 3617 AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap], |
3618 [ | |
3619 AC_RUN_IFELSE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]], | |
3620 [ | |
3621 vim_cv_memmove_handles_overlap=yes | |
3622 ],[ | |
3623 vim_cv_memmove_handles_overlap=no | |
3624 ],[ | |
3625 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap') | |
3626 ]) | |
3627 ]) | |
7 | 3628 |
1621 | 3629 if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then |
3630 AC_DEFINE(USEMEMMOVE) | |
3631 else | |
3632 AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap], | |
3633 [ | |
3634 AC_RUN_IFELSE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]], | |
3635 [ | |
3636 vim_cv_bcopy_handles_overlap=yes | |
3637 ],[ | |
3638 vim_cv_bcopy_handles_overlap=no | |
3639 ],[ | |
3640 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap') | |
3641 ]) | |
3642 ]) | |
3643 | |
3644 if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then | |
3645 AC_DEFINE(USEBCOPY) | |
3646 else | |
3647 AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap], | |
3648 [ | |
3649 AC_RUN_IFELSE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]], | |
3650 [ | |
3651 vim_cv_memcpy_handles_overlap=yes | |
3652 ],[ | |
3653 vim_cv_memcpy_handles_overlap=no | |
3654 ],[ | |
3655 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap') | |
3656 ]) | |
3657 ]) | |
3658 | |
3659 if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then | |
3660 AC_DEFINE(USEMEMCPY) | |
3661 fi | |
3662 fi | |
3663 fi | |
3664 | |
7 | 3665 |
3666 dnl Check for multibyte locale functions | |
3667 dnl Find out if _Xsetlocale() is supported by libX11. | |
3668 dnl Check if X_LOCALE should be defined. | |
3669 | |
3670 if test "$enable_multibyte" = "yes"; then | |
3671 cflags_save=$CFLAGS | |
3672 ldflags_save=$LDFLAGS | |
1861 | 3673 if test "x$x_includes" != "xNONE" ; then |
7 | 3674 CFLAGS="$CFLAGS -I$x_includes" |
3675 LDFLAGS="$X_LIBS $LDFLAGS -lX11" | |
3676 AC_MSG_CHECKING(whether X_LOCALE needed) | |
3677 AC_TRY_COMPILE([#include <X11/Xlocale.h>],, | |
3678 AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes) | |
3679 AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)), | |
3680 AC_MSG_RESULT(no)) | |
3681 fi | |
3682 CFLAGS=$cflags_save | |
3683 LDFLAGS=$ldflags_save | |
3684 fi | |
3685 | |
3686 dnl Link with xpg4, it is said to make Korean locale working | |
3687 AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,) | |
3688 | |
1871 | 3689 dnl Check how we can run ctags. Default to "ctags" when nothing works. |
2797 | 3690 dnl Use --version to detect Exuberant ctags (preferred) |
834 | 3691 dnl Add --fields=+S to get function signatures for omni completion. |
7 | 3692 dnl -t for typedefs (many ctags have this) |
3693 dnl -s for static functions (Elvis ctags only?) | |
3694 dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'. | |
3695 dnl -i+m to test for older Exuberant ctags | |
3696 AC_MSG_CHECKING(how to create tags) | |
3697 test -f tags && mv tags tags.save | |
2815 | 3698 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then |
3699 TAGPRG="ctags -I INIT+ --fields=+S" | |
3700 elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then | |
2797 | 3701 TAGPRG="exctags -I INIT+ --fields=+S" |
2815 | 3702 elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then |
3703 TAGPRG="exuberant-ctags -I INIT+ --fields=+S" | |
7 | 3704 else |
1871 | 3705 TAGPRG="ctags" |
7 | 3706 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags" |
3707 (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c" | |
3708 (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags" | |
3709 (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t" | |
3710 (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts" | |
3711 (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs" | |
3712 (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m" | |
3713 fi | |
3714 test -f tags.save && mv tags.save tags | |
3715 AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG) | |
3716 | |
3717 dnl Check how we can run man with a section number | |
3718 AC_MSG_CHECKING(how to run man with a section nr) | |
3719 MANDEF="man" | |
1531 | 3720 (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s" |
7 | 3721 AC_MSG_RESULT($MANDEF) |
3722 if test "$MANDEF" = "man -s"; then | |
3723 AC_DEFINE(USEMAN_S) | |
3724 fi | |
3725 | |
3726 dnl Check if gettext() is working and if it needs -lintl | |
3727 AC_MSG_CHECKING(--disable-nls argument) | |
3728 AC_ARG_ENABLE(nls, | |
3729 [ --disable-nls Don't support NLS (gettext()).], , | |
3730 [enable_nls="yes"]) | |
3731 | |
3732 if test "$enable_nls" = "yes"; then | |
3733 AC_MSG_RESULT(no) | |
282 | 3734 |
3735 INSTALL_LANGS=install-languages | |
3736 AC_SUBST(INSTALL_LANGS) | |
3737 INSTALL_TOOL_LANGS=install-tool-languages | |
3738 AC_SUBST(INSTALL_TOOL_LANGS) | |
3739 | |
7 | 3740 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, ) |
3741 AC_MSG_CHECKING([for NLS]) | |
3742 if test -f po/Makefile; then | |
3743 have_gettext="no" | |
3744 if test -n "$MSGFMT"; then | |
3745 AC_TRY_LINK( | |
3746 [#include <libintl.h>], | |
3747 [gettext("Test");], | |
3748 AC_MSG_RESULT([gettext() works]); have_gettext="yes", | |
3749 olibs=$LIBS | |
3750 LIBS="$LIBS -lintl" | |
3751 AC_TRY_LINK( | |
3752 [#include <libintl.h>], | |
3753 [gettext("Test");], | |
3754 AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes", | |
3755 AC_MSG_RESULT([gettext() doesn't work]); | |
3756 LIBS=$olibs)) | |
3757 else | |
3758 AC_MSG_RESULT([msgfmt not found - disabled]); | |
3759 fi | |
3760 if test $have_gettext = "yes"; then | |
3761 AC_DEFINE(HAVE_GETTEXT) | |
3762 MAKEMO=yes | |
3763 AC_SUBST(MAKEMO) | |
3764 dnl this was added in GNU gettext 0.10.36 | |
3765 AC_CHECK_FUNCS(bind_textdomain_codeset) | |
3766 dnl _nl_msg_cat_cntr is required for GNU gettext | |
3767 AC_MSG_CHECKING([for _nl_msg_cat_cntr]) | |
3768 AC_TRY_LINK( | |
3769 [#include <libintl.h> | |
3770 extern int _nl_msg_cat_cntr;], | |
3771 [++_nl_msg_cat_cntr;], | |
3772 AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR), | |
3773 AC_MSG_RESULT([no])) | |
3774 fi | |
3775 else | |
3776 AC_MSG_RESULT([no "po/Makefile" - disabled]); | |
3777 fi | |
3778 else | |
3779 AC_MSG_RESULT(yes) | |
3780 fi | |
3781 | |
3782 dnl Check for dynamic linking loader | |
3783 AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)]) | |
3784 if test x${DLL} = xdlfcn.h; then | |
3785 AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ]) | |
3786 AC_MSG_CHECKING([for dlopen()]) | |
3787 AC_TRY_LINK(,[ | |
3788 extern void* dlopen(); | |
3789 dlopen(); | |
3790 ], | |
3791 AC_MSG_RESULT(yes); | |
3792 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), | |
3793 AC_MSG_RESULT(no); | |
3794 AC_MSG_CHECKING([for dlopen() in -ldl]) | |
3795 olibs=$LIBS | |
3796 LIBS="$LIBS -ldl" | |
3797 AC_TRY_LINK(,[ | |
3798 extern void* dlopen(); | |
3799 dlopen(); | |
3800 ], | |
3801 AC_MSG_RESULT(yes); | |
3802 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), | |
3803 AC_MSG_RESULT(no); | |
3804 LIBS=$olibs)) | |
3805 dnl ReliantUNIX has dlopen() in libc but everything else in libdl | |
3806 dnl ick :-) | |
3807 AC_MSG_CHECKING([for dlsym()]) | |
3808 AC_TRY_LINK(,[ | |
3809 extern void* dlsym(); | |
3810 dlsym(); | |
3811 ], | |
3812 AC_MSG_RESULT(yes); | |
3813 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), | |
3814 AC_MSG_RESULT(no); | |
3815 AC_MSG_CHECKING([for dlsym() in -ldl]) | |
3816 olibs=$LIBS | |
3817 LIBS="$LIBS -ldl" | |
3818 AC_TRY_LINK(,[ | |
3819 extern void* dlsym(); | |
3820 dlsym(); | |
3821 ], | |
3822 AC_MSG_RESULT(yes); | |
3823 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), | |
3824 AC_MSG_RESULT(no); | |
3825 LIBS=$olibs)) | |
3826 elif test x${DLL} = xdl.h; then | |
3827 AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ]) | |
3828 AC_MSG_CHECKING([for shl_load()]) | |
3829 AC_TRY_LINK(,[ | |
3830 extern void* shl_load(); | |
3831 shl_load(); | |
3832 ], | |
3833 AC_MSG_RESULT(yes); | |
3834 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), | |
3835 AC_MSG_RESULT(no); | |
3836 AC_MSG_CHECKING([for shl_load() in -ldld]) | |
3837 olibs=$LIBS | |
3838 LIBS="$LIBS -ldld" | |
3839 AC_TRY_LINK(,[ | |
3840 extern void* shl_load(); | |
3841 shl_load(); | |
3842 ], | |
3843 AC_MSG_RESULT(yes); | |
3844 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), | |
3845 AC_MSG_RESULT(no); | |
3846 LIBS=$olibs)) | |
3847 fi | |
3848 AC_CHECK_HEADERS(setjmp.h) | |
3849 | |
3850 if test "x$MACOSX" = "xyes" -a -n "$PERL"; then | |
3851 dnl -ldl must come after DynaLoader.a | |
3852 if echo $LIBS | grep -e '-ldl' >/dev/null; then | |
3853 LIBS=`echo $LIBS | sed s/-ldl//` | |
3854 PERL_LIBS="$PERL_LIBS -ldl" | |
3855 fi | |
3856 fi | |
3857 | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3858 if test "x$MACOSX" = "xyes"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3859 AC_MSG_CHECKING(whether we need -framework Cocoa) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3860 dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3861 dnl disabled during tiny build) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3862 if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3863 LIBS=$"$LIBS -framework Cocoa" |
7 | 3864 AC_MSG_RESULT(yes) |
3865 else | |
3866 AC_MSG_RESULT(no) | |
3867 fi | |
5114
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3868 dnl As mentioned above, tiny build implies os_macosx.m isn't needed. |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3869 dnl Exclude it from OS_EXTRA_SRC so that linker won't complain about |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3870 dnl missing Objective-C symbols. |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3871 if test "x$features" = "xtiny"; then |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3872 OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3873 OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` |
56bc3698f8c6
updated for version 7.3.1300
Bram Moolenaar <bram@vim.org>
parents:
4952
diff
changeset
|
3874 fi |
7 | 3875 fi |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3876 if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
3877 LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
697 | 3878 fi |
7 | 3879 |
548 | 3880 dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to |
3881 dnl use "-isystem" instead of "-I" for all non-Vim include dirs. | |
3882 dnl But only when making dependencies, cproto and lint don't take "-isystem". | |
685 | 3883 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow |
3884 dnl the number before the version number. | |
548 | 3885 DEPEND_CFLAGS_FILTER= |
3886 if test "$GCC" = yes; then | |
1747 | 3887 AC_MSG_CHECKING(for GCC 3 or later) |
804 | 3888 gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'` |
671 | 3889 if test "$gccmajor" -gt "2"; then |
548 | 3890 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" |
1747 | 3891 AC_MSG_RESULT(yes) |
3892 else | |
3893 AC_MSG_RESULT(no) | |
548 | 3894 fi |
1747 | 3895 dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is |
3896 dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. | |
2019 | 3897 dnl Also remove duplicate _FORTIFY_SOURCE arguments. |
3196 | 3898 dnl And undefine it first to avoid a warning. |
1747 | 3899 AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) |
3900 if test "$gccmajor" -gt "3"; then | |
4952
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
3901 CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` |
1747 | 3902 AC_MSG_RESULT(yes) |
3903 else | |
3904 AC_MSG_RESULT(no) | |
3905 fi | |
557 | 3906 fi |
548 | 3907 AC_SUBST(DEPEND_CFLAGS_FILTER) |
7 | 3908 |
2629 | 3909 dnl link.sh tries to avoid overlinking in a hackish way. |
3910 dnl At least GNU ld supports --as-needed which provides the same functionality | |
3911 dnl at linker level. Let's use it. | |
3912 AC_MSG_CHECKING(linker --as-needed support) | |
3913 LINK_AS_NEEDED= | |
3914 # Check if linker supports --as-needed and --no-as-needed options | |
3915 if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then | |
4952
9f7b92f232d3
updated for version 7.3.1221
Bram Moolenaar <bram@vim.org>
parents:
4942
diff
changeset
|
3916 LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` |
2629 | 3917 LINK_AS_NEEDED=yes |
3918 fi | |
3919 if test "$LINK_AS_NEEDED" = yes; then | |
3920 AC_MSG_RESULT(yes) | |
3921 else | |
3922 AC_MSG_RESULT(no) | |
3923 fi | |
3924 AC_SUBST(LINK_AS_NEEDED) | |
3925 | |
3590 | 3926 # IBM z/OS reset CFLAGS for config.mk |
3927 if test "$zOSUnix" = "yes"; then | |
3928 CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" | |
3929 fi | |
3930 | |
7 | 3931 dnl write output files |
3932 AC_OUTPUT(auto/config.mk:config.mk.in) | |
3933 | |
3934 dnl vim: set sw=2 tw=78 fo+=l: |