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