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