blob: 2a71f42f5c0ede32b7a65dce1aedc2bf57d7ce3e [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001dnl configure.in: autoconf script for Vim
2
3dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
4dnl Should also work with autoconf 2.54 and later.
5
6AC_INIT(vim.h)
7AC_CONFIG_HEADER(auto/config.h:config.h.in)
8
9dnl Being able to run configure means the system is Unix (compatible).
10AC_DEFINE(UNIX)
11AC_PROG_MAKE_SET
12
13dnl Checks for programs.
14AC_PROG_CC dnl required by almost everything
15AC_PROG_CPP dnl required by header file checks
16AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
17AC_ISC_POSIX dnl required by AC_C_CROSS
18AC_PROG_AWK dnl required for "make html" in ../doc
19
20dnl Don't strip if we don't have it
21AC_CHECK_PROG(STRIP, strip, strip, :)
22
Bram Moolenaar325b7a22004-07-05 15:58:32 +000023dnl Check for extension of executables
Bram Moolenaar071d4272004-06-13 20:20:40 +000024AC_EXEEXT
25
26dnl Set default value for CFLAGS if none is defined or it's empty
27if test -z "$CFLAGS"; then
28 CFLAGS="-O"
29 test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
30fi
31if test "$GCC" = yes; then
Bram Moolenaar2217cae2006-03-25 21:55:52 +000032 gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
Bram Moolenaara5792f52005-11-23 21:25:05 +000033 dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
34 if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
Bram Moolenaare224ffa2006-03-01 00:01:28 +000035 echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
Bram Moolenaar071d4272004-06-13 20:20:40 +000036 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
37 else
38 if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
39 echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
40 CFLAGS="$CFLAGS -fno-strength-reduce"
41 fi
42 fi
43fi
44
45dnl If configure thinks we are cross compiling, there is probably something
46dnl wrong with the CC or CFLAGS settings, give an understandable error message
47if test "$cross_compiling" = yes; then
48 AC_MSG_ERROR([cannot compile a simple program, check CC and CFLAGS
49 (cross compiling doesn't work)])
50fi
51
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +000052dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
53dnl But gcc 3.1 changed the meaning! See near the end.
Bram Moolenaar071d4272004-06-13 20:20:40 +000054test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
55
56if test -f ./toolcheck; then
57 AC_CHECKING(for buggy tools)
58 sh ./toolcheck 1>&AC_FD_MSG
59fi
60
61OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
62
63dnl Check for BeOS, which needs an extra source file
64AC_MSG_CHECKING(for BeOS)
65case `uname` in
66 BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
67 BEOS=yes; AC_MSG_RESULT(yes);;
68 *) BEOS=no; AC_MSG_RESULT(no);;
69esac
70
71dnl If QNX is found, assume we don't want to use Xphoton
72dnl unless it was specifically asked for (--with-x)
73AC_MSG_CHECKING(for QNX)
74case `uname` in
75 QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
76 test -z "$with_x" && with_x=no
77 QNX=yes; AC_MSG_RESULT(yes);;
78 *) QNX=no; AC_MSG_RESULT(no);;
79esac
80
81dnl Check for Darwin and MacOS X
82dnl We do a check for MacOS X in the very beginning because there
83dnl are a lot of other things we need to change besides GUI stuff
Bram Moolenaar071d4272004-06-13 20:20:40 +000084AC_MSG_CHECKING([for Darwin (Mac OS X)])
85if test "`(uname) 2>/dev/null`" = Darwin; then
86 AC_MSG_RESULT(yes)
87
88 AC_MSG_CHECKING(--disable-darwin argument)
89 AC_ARG_ENABLE(darwin,
90 [ --disable-darwin Disable Darwin (Mac OS X) support.],
91 , [enable_darwin="yes"])
92 if test "$enable_darwin" = "yes"; then
93 AC_MSG_RESULT(no)
94 AC_MSG_CHECKING(if Darwin files are there)
95 if test -f os_macosx.c; then
96 AC_MSG_RESULT(yes)
97 else
98 AC_MSG_RESULT([no, Darwin support disabled])
99 enable_darwin=no
100 fi
101 else
102 AC_MSG_RESULT([yes, Darwin support excluded])
103 fi
104
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000105 AC_MSG_CHECKING(--with-mac-arch argument)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000106 AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000107 MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000108 MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000109
110 if test "x$MACARCH" = "xboth"; then
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000111 AC_MSG_CHECKING(for 10.4 universal SDK)
112 dnl There is a terrible inconsistency (but we appear to get away with it):
113 dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
114 dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
115 dnl tests using the preprocessor are actually done with the wrong header
116 dnl files. $LDFLAGS is set at the end, because configure uses it together
117 dnl with $CFLAGS and we can only have one -sysroot argument.
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000118 save_cppflags="$CPPFLAGS"
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000119 save_cflags="$CFLAGS"
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000120 save_ldflags="$LDFLAGS"
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000121 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000122 AC_TRY_LINK([ ], [ ],
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000123 AC_MSG_RESULT(found, will make universal binary),
124
125 AC_MSG_RESULT(not found)
Bram Moolenaar1f35bf92006-03-07 22:38:47 +0000126 CFLAGS="$save_cflags"
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000127 AC_MSG_CHECKING(if Intel architecture is supported)
128 CPPFLAGS="$CPPFLAGS -arch i386"
129 LDFLAGS="$save_ldflags -arch i386"
130 AC_TRY_LINK([ ], [ ],
131 AC_MSG_RESULT(yes); MACARCH="intel",
132 AC_MSG_RESULT(no, using PowerPC)
133 MACARCH="ppc"
134 CPPFLAGS="$save_cppflags -arch ppc"
135 LDFLAGS="$save_ldflags -arch ppc"))
136 elif test "x$MACARCH" = "xintel"; then
137 CPPFLAGS="$CPPFLAGS -arch intel"
138 LDFLAGS="$LDFLAGS -arch intel"
139 else
140 CPPFLAGS="$CPPFLAGS -arch ppc"
141 LDFLAGS="$LDFLAGS -arch ppc"
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000142 fi
143
Bram Moolenaar071d4272004-06-13 20:20:40 +0000144 if test "$enable_darwin" = "yes"; then
145 MACOSX=yes
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000146 OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
147 OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
Bram Moolenaar32466aa2006-02-24 23:53:04 +0000148 dnl TODO: use -arch i386 on Intel machines
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000149 CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
150 if test "x$MACARCH" = "xboth"; then
151 CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
152 else
153 CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
154 fi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
156 dnl If Carbon is found, assume we don't want X11
157 dnl unless it was specifically asked for (--with-x)
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000158 dnl or Motif, Athena or GTK GUI is used.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000159 AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
160 if test "x$CARBON" = "xyes"; then
Bram Moolenaarab79bcb2004-07-18 21:34:53 +0000161 if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk -a "X$enable_gui" != Xgtk2; then
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162 with_x=no
Bram Moolenaarefd2bf12006-03-16 21:41:35 +0000163
164 dnl Default install directory is not /usr/local
165 if test x$prefix = xNONE; then
166 prefix=/Applications
167 fi
Bram Moolenaard2cec5b2006-03-28 21:08:56 +0000168
169 dnl Sorry for the hard coded default
170 datadir='${prefix}/Vim.app/Contents/Resources'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171 fi
172 fi
173 fi
Bram Moolenaara23ccb82006-02-27 00:08:02 +0000174
Bram Moolenaardb552d602006-03-23 22:59:57 +0000175 dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
Bram Moolenaarfd2ac762006-03-01 22:09:21 +0000176 dnl free. This happens in expand_filename(), because the optimizer swaps
Bram Moolenaardb552d602006-03-23 22:59:57 +0000177 dnl two blocks of code, both using "repl", that can't be swapped.
Bram Moolenaare224ffa2006-03-01 00:01:28 +0000178 if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
179 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
180 fi
181
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182else
183 AC_MSG_RESULT(no)
184fi
185
186AC_SUBST(OS_EXTRA_SRC)
187AC_SUBST(OS_EXTRA_OBJ)
188
189dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
190dnl Only when the directory exists and it wasn't there yet.
191dnl For gcc don't do this when it is already in the default search path.
192have_local_include=''
193have_local_lib=''
194if test "$GCC" = yes; then
195 echo 'void f(){}' > conftest.c
196 dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler)
197 have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep '/usr/local/include'`
198 have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep '/usr/local/lib'`
199 rm -f conftest.c conftest.o
200fi
201if test -z "$have_local_lib" -a -d /usr/local/lib; then
202 tt=`echo "$LDFLAGS" | sed -e 's+-L/usr/local/lib ++g' -e 's+-L/usr/local/lib$++g'`
203 if test "$tt" = "$LDFLAGS"; then
204 LDFLAGS="$LDFLAGS -L/usr/local/lib"
205 fi
206fi
207if test -z "$have_local_include" -a -d /usr/local/include; then
208 tt=`echo "$CPPFLAGS" | sed -e 's+-I/usr/local/include ++g' -e 's+-I/usr/local/include$++g'`
209 if test "$tt" = "$CPPFLAGS"; then
210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
211 fi
212fi
213
214AC_MSG_CHECKING(--with-vim-name argument)
215AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
216 VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
Bram Moolenaare344bea2005-09-01 20:46:49 +0000217 VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000218AC_SUBST(VIMNAME)
219AC_MSG_CHECKING(--with-ex-name argument)
220AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
221 EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
222 EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
223AC_SUBST(EXNAME)
224AC_MSG_CHECKING(--with-view-name argument)
225AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
226 VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
227 VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
228AC_SUBST(VIEWNAME)
229
230AC_MSG_CHECKING(--with-global-runtime argument)
231AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
232 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
233 AC_MSG_RESULT(no))
234
235AC_MSG_CHECKING(--with-modified-by argument)
236AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
237 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
238 AC_MSG_RESULT(no))
239
240dnl Check for EBCDIC stolen from the LYNX port to OS390 Unix
241AC_MSG_CHECKING(if character set is EBCDIC)
242AC_TRY_COMPILE([ ],
243[ /* TryCompile function for CharSet.
244 Treat any failure as ASCII for compatibility with existing art.
245 Use compile-time rather than run-time tests for cross-compiler
246 tolerance. */
247#if '0'!=240
248make an error "Character set is not EBCDIC"
249#endif ],
250[ # TryCompile action if true
251cf_cv_ebcdic=yes ],
252[ # TryCompile action if false
253cf_cv_ebcdic=no])
254# end of TryCompile ])
255# end of CacheVal CvEbcdic
256AC_MSG_RESULT($cf_cv_ebcdic)
257case "$cf_cv_ebcdic" in #(vi
258 yes) AC_DEFINE(EBCDIC)
259 line_break='"\\n"'
260 ;;
261 *) line_break='"\\012"';;
262esac
263AC_SUBST(line_break)
264
265if test "$cf_cv_ebcdic" = "yes"; then
266dnl If we have EBCDIC we most likley have OS390 Unix, let's test it!
267AC_MSG_CHECKING(for OS/390 Unix)
268case `uname` in
269 OS/390) OS390Unix="yes";
270 dnl If using cc the environment variable _CC_CCMODE must be
271 dnl set to "1", so that some compiler extensions are enabled.
272 dnl If using c89 the environment variable is named _CC_C89MODE.
273 dnl Note: compile with c89 never tested.
274 if test "$CC" = "cc"; then
275 ccm="$_CC_CCMODE"
276 ccn="CC"
277 else
278 if test "$CC" = "c89"; then
279 ccm="$_CC_C89MODE"
280 ccn="C89"
281 else
282 ccm=1
283 fi
284 fi
285 if test "$ccm" != "1"; then
286 echo ""
287 echo "------------------------------------------"
288 echo " On OS/390 Unix, the environment variable"
289 echo " __CC_${ccn}MODE must be set to \"1\"!"
290 echo " Do:"
291 echo " export _CC_${ccn}MODE=1"
292 echo " and then call configure again."
293 echo "------------------------------------------"
294 exit 1
295 fi
296 CFLAGS="$CFLAGS -D_ALL_SOURCE"; LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
297 AC_MSG_RESULT(yes)
298 ;;
299 *) OS390Unix="no";
300 AC_MSG_RESULT(no)
301 ;;
302esac
303fi
304
305
306dnl Check user requested features.
307
308AC_MSG_CHECKING(--with-features argument)
309AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)],
310 features="$withval"; AC_MSG_RESULT($features),
311 features="normal"; AC_MSG_RESULT(Defaulting to normal))
312
313dovimdiff=""
314dogvimdiff=""
315case "$features" in
316 tiny) AC_DEFINE(FEAT_TINY) ;;
317 small) AC_DEFINE(FEAT_SMALL) ;;
318 normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
319 dogvimdiff="installgvimdiff" ;;
320 big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
321 dogvimdiff="installgvimdiff" ;;
322 huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
323 dogvimdiff="installgvimdiff" ;;
324 *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
325esac
326
327AC_SUBST(dovimdiff)
328AC_SUBST(dogvimdiff)
329
330AC_MSG_CHECKING(--with-compiledby argument)
331AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
332 compiledby="$withval"; AC_MSG_RESULT($withval),
333 compiledby=""; AC_MSG_RESULT(no))
334AC_SUBST(compiledby)
335
336AC_MSG_CHECKING(--disable-xsmp argument)
337AC_ARG_ENABLE(xsmp,
338 [ --disable-xsmp Disable XSMP session management],
339 , enable_xsmp="yes")
340
341if test "$enable_xsmp" = "yes"; then
342 AC_MSG_RESULT(no)
343 AC_MSG_CHECKING(--disable-xsmp-interact argument)
344 AC_ARG_ENABLE(xsmp-interact,
345 [ --disable-xsmp-interact Disable XSMP interaction],
346 , enable_xsmp_interact="yes")
347 if test "$enable_xsmp_interact" = "yes"; then
348 AC_MSG_RESULT(no)
349 AC_DEFINE(USE_XSMP_INTERACT)
350 else
351 AC_MSG_RESULT(yes)
352 fi
353else
354 AC_MSG_RESULT(yes)
355fi
356
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000357dnl Check for MzScheme feature.
358AC_MSG_CHECKING(--enable-mzschemeinterp argument)
359AC_ARG_ENABLE(mzschemeinterp,
360 [ --enable-mzschemeinterp Include MzScheme interpreter.], ,
361 [enable_mzschemeinterp="no"])
362AC_MSG_RESULT($enable_mzschemeinterp)
363
364if test "$enable_mzschemeinterp" = "yes"; then
365 dnl -- find the mzscheme executable
366 AC_SUBST(vi_cv_path_mzscheme)
367
368 AC_MSG_CHECKING(--with-plthome argument)
369 AC_ARG_WITH(plthome,
370 [ --with-plthome=PLTHOME Use PLTHOME.],
371 with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
372 with_plthome="";AC_MSG_RESULT("no"))
373
374 if test "X$with_plthome" != "X"; then
375 vi_cv_path_mzscheme_pfx="$with_plthome"
376 else
377 AC_MSG_CHECKING(PLTHOME environment var)
378 if test "X$PLTHOME" != "X"; then
379 AC_MSG_RESULT("$PLTHOME")
380 vi_cv_path_mzscheme_pfx="$PLTHOME"
381 else
382 AC_MSG_RESULT("not set")
383 dnl -- try to find MzScheme executable
384 AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
385
386 dnl resolve symbolic link, the executable is often elsewhere and there
387 dnl are no links for the include files.
388 if test "X$vi_cv_path_mzscheme" != "X"; then
389 lsout=`ls -l $vi_cv_path_mzscheme`
390 if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
391 vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
392 fi
393 fi
394
395 if test "X$vi_cv_path_mzscheme" != "X"; then
396 dnl -- find where MzScheme thinks it was installed
397 AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
398 [ vi_cv_path_mzscheme_pfx=`
399 ${vi_cv_path_mzscheme} -evm \
400 "(display (simplify-path \
401 (build-path (call-with-values \
402 (lambda () (split-path (find-system-path (quote exec-file)))) \
403 (lambda (base name must-be-dir?) base)) (quote up))))"` ])
404 dnl Remove a trailing slash.
405 vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'`
406 fi
407 fi
408 fi
409
410 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
411 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
412 if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
413 AC_MSG_RESULT("yes")
414 else
415 AC_MSG_RESULT("no")
416 vi_cv_path_mzscheme_pfx=
417 fi
418 fi
419
420 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
421 if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
422 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a ${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"
423 else
424 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzgc -lmzscheme"
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000425 if test "$GCC" = yes; then
426 dnl Make Vim remember the path to the library. For when it's not in
427 dnl $LD_LIBRARY_PATH.
428 MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
Bram Moolenaar21cf8232004-07-16 20:18:37 +0000429 elif test "`(uname) 2>/dev/null`" = SunOS &&
430 uname -r | grep '^5' >/dev/null; then
431 MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000432 fi
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000433 fi
434 MZSCHEME_CFLAGS="-I${vi_cv_path_mzscheme_pfx}/include \
435 -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/collects\"'"
436 MZSCHEME_SRC="if_mzsch.c"
437 MZSCHEME_OBJ="objects/if_mzsch.o"
438 MZSCHEME_PRO="if_mzsch.pro"
439 AC_DEFINE(FEAT_MZSCHEME)
440 fi
441 AC_SUBST(MZSCHEME_SRC)
442 AC_SUBST(MZSCHEME_OBJ)
443 AC_SUBST(MZSCHEME_PRO)
444 AC_SUBST(MZSCHEME_LIBS)
445 AC_SUBST(MZSCHEME_CFLAGS)
446fi
447
448
Bram Moolenaar071d4272004-06-13 20:20:40 +0000449AC_MSG_CHECKING(--enable-perlinterp argument)
450AC_ARG_ENABLE(perlinterp,
451 [ --enable-perlinterp Include Perl interpreter.], ,
452 [enable_perlinterp="no"])
453AC_MSG_RESULT($enable_perlinterp)
454if test "$enable_perlinterp" = "yes"; then
455 AC_SUBST(vi_cv_path_perl)
456 AC_PATH_PROG(vi_cv_path_perl, perl)
457 if test "X$vi_cv_path_perl" != "X"; then
458 AC_MSG_CHECKING(Perl version)
459 if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
460 eval `$vi_cv_path_perl -V:usethreads`
461 if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
462 badthreads=no
463 else
464 if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
465 eval `$vi_cv_path_perl -V:use5005threads`
466 if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
467 badthreads=no
468 else
469 badthreads=yes
470 AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
471 fi
472 else
473 badthreads=yes
474 AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
475 fi
476 fi
477 if test $badthreads = no; then
478 AC_MSG_RESULT(OK)
479 eval `$vi_cv_path_perl -V:shrpenv`
480 if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
481 shrpenv=""
482 fi
483 vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
484 AC_SUBST(vi_cv_perllib)
485 dnl Remove "-fno-something", it breaks using cproto.
486 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
487 -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
488 dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
489 perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
490 sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
491 -e 's/-bE:perl.exp//' -e 's/-lc //'`
492 dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
493 dnl a test in configure may fail because of that.
494 perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
495 -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
496
497 dnl check that compiling a simple program still works with the flags
498 dnl added for Perl.
499 AC_MSG_CHECKING([if compile and link flags for Perl are sane])
500 cflags_save=$CFLAGS
501 libs_save=$LIBS
502 ldflags_save=$LDFLAGS
503 CFLAGS="$CFLAGS $perlcppflags"
504 LIBS="$LIBS $perllibs"
505 LDFLAGS="$perlldflags $LDFLAGS"
506 AC_TRY_LINK(,[ ],
507 AC_MSG_RESULT(yes); perl_ok=yes,
508 AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
509 CFLAGS=$cflags_save
510 LIBS=$libs_save
511 LDFLAGS=$ldflags_save
512 if test $perl_ok = yes; then
513 if test "X$perlcppflags" != "X"; then
514 PERL_CFLAGS="$perlcppflags"
515 fi
516 if test "X$perlldflags" != "X"; then
517 LDFLAGS="$perlldflags $LDFLAGS"
518 fi
519 PERL_LIBS=$perllibs
520 PERL_SRC="auto/if_perl.c if_perlsfio.c"
521 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
522 PERL_PRO="if_perl.pro if_perlsfio.pro"
523 AC_DEFINE(FEAT_PERL)
524 fi
525 fi
526 else
527 AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
528 fi
529 fi
530
531 if test "x$MACOSX" = "xyes"; then
Bram Moolenaar9372a112005-12-06 19:59:18 +0000532 dnl Mac OS X 10.2 or later
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533 dir=/System/Library/Perl
534 darwindir=$dir/darwin
535 if test -d $darwindir; then
536 PERL=/usr/bin/perl
537 else
538 dnl Mac OS X 10.3
539 dir=/System/Library/Perl/5.8.1
540 darwindir=$dir/darwin-thread-multi-2level
541 if test -d $darwindir; then
542 PERL=/usr/bin/perl
543 fi
544 fi
545 if test -n "$PERL"; then
546 PERL_DIR="$dir"
547 PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
548 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
549 PERL_LIBS="-L$darwindir/CORE -lperl"
550 fi
551 fi
552fi
553AC_SUBST(shrpenv)
554AC_SUBST(PERL_SRC)
555AC_SUBST(PERL_OBJ)
556AC_SUBST(PERL_PRO)
557AC_SUBST(PERL_CFLAGS)
558AC_SUBST(PERL_LIBS)
559
560AC_MSG_CHECKING(--enable-pythoninterp argument)
561AC_ARG_ENABLE(pythoninterp,
562 [ --enable-pythoninterp Include Python interpreter.], ,
563 [enable_pythoninterp="no"])
564AC_MSG_RESULT($enable_pythoninterp)
565if test "$enable_pythoninterp" = "yes"; then
566 dnl -- find the python executable
567 AC_PATH_PROG(vi_cv_path_python, python)
568 if test "X$vi_cv_path_python" != "X"; then
569
570 dnl -- get its version number
571 AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
572 [[vi_cv_var_python_version=`
573 ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
574 ]])
575
576 dnl -- it must be at least version 1.4
577 AC_MSG_CHECKING(Python is 1.4 or better)
578 if ${vi_cv_path_python} -c \
579 "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
580 then
581 AC_MSG_RESULT(yep)
582
583 dnl -- find where python thinks it was installed
584 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
585 [ vi_cv_path_python_pfx=`
586 ${vi_cv_path_python} -c \
587 "import sys; print sys.prefix"` ])
588
589 dnl -- and where it thinks it runs
590 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
591 [ vi_cv_path_python_epfx=`
592 ${vi_cv_path_python} -c \
593 "import sys; print sys.exec_prefix"` ])
594
595 dnl -- python's internal library path
596
597 AC_CACHE_VAL(vi_cv_path_pythonpath,
598 [ vi_cv_path_pythonpath=`
599 unset PYTHONPATH;
600 ${vi_cv_path_python} -c \
601 "import sys, string; print string.join(sys.path,':')"` ])
602
603 dnl -- where the Python implementation library archives are
604
605 AC_ARG_WITH(python-config-dir,
606 [ --with-python-config-dir=PATH Python's config directory],
607 [ vi_cv_path_python_conf="${withval}" ] )
608
609 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
610 [
611 vi_cv_path_python_conf=
612 for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
613 for subdir in lib share; do
614 d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
615 if test -d "$d" && test -f "$d/config.c"; then
616 vi_cv_path_python_conf="$d"
617 fi
618 done
619 done
620 ])
621
622 PYTHON_CONFDIR="${vi_cv_path_python_conf}"
623
624 if test "X$PYTHON_CONFDIR" = "X"; then
625 AC_MSG_RESULT([can't find it!])
626 else
627
628 dnl -- we need to examine Python's config/Makefile too
629 dnl see what the interpreter is built from
630 AC_CACHE_VAL(vi_cv_path_python_plibs,
631 [
632 tmp_mkf="/tmp/Makefile-conf$$"
633 cat ${PYTHON_CONFDIR}/Makefile - <<'eof' >${tmp_mkf}
634__:
635 @echo "python_MODLIBS='$(MODLIBS)'"
636 @echo "python_LIBS='$(LIBS)'"
637 @echo "python_SYSLIBS='$(SYSLIBS)'"
638 @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
639eof
640 dnl -- delete the lines from make about Entering/Leaving directory
641 eval "`cd ${PYTHON_CONFDIR} && make -f ${tmp_mkf} __ | sed '/ directory /d'`"
642 rm -f ${tmp_mkf}
643 if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
644 "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
645 vi_cv_path_python_plibs="-framework Python"
646 else
647 if test "${vi_cv_var_python_version}" = "1.4"; then
648 vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
649 else
650 vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
651 fi
652 vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_MODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
653 dnl remove -ltermcap, it can conflict with an earlier -lncurses
654 vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
655 fi
656 ])
657
658 PYTHON_LIBS="${vi_cv_path_python_plibs}"
659 if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
660 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
661 else
662 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}"
663 fi
664 PYTHON_SRC="if_python.c"
665 dnl For Mac OSX 10.2 config.o is included in the Python library.
666 if test "x$MACOSX" = "xyes"; then
667 PYTHON_OBJ="objects/if_python.o"
668 else
669 PYTHON_OBJ="objects/if_python.o objects/py_config.o"
670 fi
671 if test "${vi_cv_var_python_version}" = "1.4"; then
672 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
673 fi
674 PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
675
676 dnl On FreeBSD linking with "-pthread" is required to use threads.
677 dnl _THREAD_SAFE must be used for compiling then.
678 dnl The "-pthread" is added to $LIBS, so that the following check for
679 dnl sigaltstack() will look in libc_r (it's there in libc!).
680 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
681 dnl will then define target-specific defines, e.g., -D_REENTRANT.
682 dnl Don't do this for Mac OSX, -pthread will generate a warning.
683 AC_MSG_CHECKING([if -pthread should be used])
684 threadsafe_flag=
685 thread_lib=
686 if test "x$MACOSX" != "xyes"; then
687 test "$GCC" = yes && threadsafe_flag="-pthread"
688 if test "`(uname) 2>/dev/null`" = FreeBSD; then
689 threadsafe_flag="-D_THREAD_SAFE"
690 thread_lib="-pthread"
691 fi
692 fi
693 libs_save_old=$LIBS
694 if test -n "$threadsafe_flag"; then
695 cflags_save=$CFLAGS
696 CFLAGS="$CFLAGS $threadsafe_flag"
697 LIBS="$LIBS $thread_lib"
698 AC_TRY_LINK(,[ ],
699 AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
700 AC_MSG_RESULT(no); LIBS=$libs_save_old
701 )
702 CFLAGS=$cflags_save
703 else
704 AC_MSG_RESULT(no)
705 fi
706
707 dnl check that compiling a simple program still works with the flags
708 dnl added for Python.
709 AC_MSG_CHECKING([if compile and link flags for Python are sane])
710 cflags_save=$CFLAGS
711 libs_save=$LIBS
712 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
713 LIBS="$LIBS $PYTHON_LIBS"
714 AC_TRY_LINK(,[ ],
715 AC_MSG_RESULT(yes); python_ok=yes,
716 AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
717 CFLAGS=$cflags_save
718 LIBS=$libs_save
719 if test $python_ok = yes; then
720 AC_DEFINE(FEAT_PYTHON)
721 else
722 LIBS=$libs_save_old
723 PYTHON_SRC=
724 PYTHON_OBJ=
725 PYTHON_LIBS=
726 PYTHON_CFLAGS=
727 fi
728
729 fi
730 else
731 AC_MSG_RESULT(too old)
732 fi
733 fi
734fi
735AC_SUBST(PYTHON_CONFDIR)
736AC_SUBST(PYTHON_LIBS)
737AC_SUBST(PYTHON_GETPATH_CFLAGS)
738AC_SUBST(PYTHON_CFLAGS)
739AC_SUBST(PYTHON_SRC)
740AC_SUBST(PYTHON_OBJ)
741
742AC_MSG_CHECKING(--enable-tclinterp argument)
743AC_ARG_ENABLE(tclinterp,
744 [ --enable-tclinterp Include Tcl interpreter.], ,
745 [enable_tclinterp="no"])
746AC_MSG_RESULT($enable_tclinterp)
747
748if test "$enable_tclinterp" = "yes"; then
749
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000750 dnl on FreeBSD tclsh is a silly script, look for tclsh8.[420]
Bram Moolenaar071d4272004-06-13 20:20:40 +0000751 AC_MSG_CHECKING(--with-tclsh argument)
752 AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
753 tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000754 tclsh_name="tclsh8.4"; AC_MSG_RESULT(no))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000755 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
756 AC_SUBST(vi_cv_path_tcl)
757
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000758 dnl when no specific version specified, also try 8.2 and 8.0
759 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760 tclsh_name="tclsh8.2"
761 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
762 fi
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000763 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then
764 tclsh_name="tclsh8.0"
765 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
766 fi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000767 dnl still didn't find it, try without version number
768 if test "X$vi_cv_path_tcl" = "X"; then
769 tclsh_name="tclsh"
770 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
771 fi
772 if test "X$vi_cv_path_tcl" != "X"; then
773 AC_MSG_CHECKING(Tcl version)
774 if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then
775 tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
776 AC_MSG_RESULT($tclver - OK);
777 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 -`
778
779 AC_MSG_CHECKING(for location of Tcl include)
780 if test "x$MACOSX" != "xyes"; then
Bram Moolenaar47136d72004-10-12 20:02:24 +0000781 tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000782 else
783 dnl For Mac OS X 10.3, use the OS-provided framework location
784 tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
785 fi
786 for try in $tclinc; do
787 if test -f "$try/tcl.h"; then
788 AC_MSG_RESULT($try/tcl.h)
789 TCL_INC=$try
790 break
791 fi
792 done
793 if test -z "$TCL_INC"; then
794 AC_MSG_RESULT(<not found>)
795 SKIP_TCL=YES
796 fi
797 if test -z "$SKIP_TCL"; then
798 AC_MSG_CHECKING(for location of tclConfig.sh script)
799 if test "x$MACOSX" != "xyes"; then
800 tclcnf=`echo $tclinc | sed s/include/lib/g`
801 else
802 dnl For Mac OS X 10.3, use the OS-provided framework location
803 tclcnf="/System/Library/Frameworks/Tcl.framework"
804 fi
805 for try in $tclcnf; do
806 if test -f $try/tclConfig.sh; then
807 AC_MSG_RESULT($try/tclConfig.sh)
808 . $try/tclConfig.sh
809 dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
810 TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
811 dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000812 dnl "-D_ABC" items. Watch out for -DFOO=long\ long.
Bram Moolenaar9372a112005-12-06 19:59:18 +0000813 TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
Bram Moolenaar071d4272004-06-13 20:20:40 +0000814 break
815 fi
816 done
817 if test -z "$TCL_LIBS"; then
818 AC_MSG_RESULT(<not found>)
819 AC_MSG_CHECKING(for Tcl library by myself)
820 tcllib=`echo $tclinc | sed s/include/lib/g`
821 for ext in .so .a ; do
822 for ver in "" $tclver ; do
823 for try in $tcllib ; do
824 trylib=tcl$ver$ext
825 if test -f $try/lib$trylib ; then
826 AC_MSG_RESULT($try/lib$trylib)
827 TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
828 if test "`(uname) 2>/dev/null`" = SunOS &&
829 uname -r | grep '^5' >/dev/null; then
830 TCL_LIBS="$TCL_LIBS -R $try"
831 fi
832 break 3
833 fi
834 done
835 done
836 done
837 if test -z "$TCL_LIBS"; then
838 AC_MSG_RESULT(<not found>)
839 SKIP_TCL=YES
840 fi
841 fi
842 if test -z "$SKIP_TCL"; then
843 AC_DEFINE(FEAT_TCL)
844 TCL_SRC=if_tcl.c
845 TCL_OBJ=objects/if_tcl.o
846 TCL_PRO=if_tcl.pro
847 TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
848 fi
849 fi
850 else
851 AC_MSG_RESULT(too old; need Tcl version 8.0 or later)
852 fi
853 fi
854fi
855AC_SUBST(TCL_SRC)
856AC_SUBST(TCL_OBJ)
857AC_SUBST(TCL_PRO)
858AC_SUBST(TCL_CFLAGS)
859AC_SUBST(TCL_LIBS)
860
861AC_MSG_CHECKING(--enable-rubyinterp argument)
862AC_ARG_ENABLE(rubyinterp,
863 [ --enable-rubyinterp Include Ruby interpreter.], ,
864 [enable_rubyinterp="no"])
865AC_MSG_RESULT($enable_rubyinterp)
866if test "$enable_rubyinterp" = "yes"; then
867 AC_SUBST(vi_cv_path_ruby)
868 AC_PATH_PROG(vi_cv_path_ruby, ruby)
869 if test "X$vi_cv_path_ruby" != "X"; then
870 AC_MSG_CHECKING(Ruby version)
Bram Moolenaare4efc3b2005-03-07 23:16:51 +0000871 if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
Bram Moolenaar071d4272004-06-13 20:20:40 +0000872 AC_MSG_RESULT(OK)
873 AC_MSG_CHECKING(Ruby header files)
874 rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
875 if test "X$rubyhdrdir" != "X"; then
876 AC_MSG_RESULT($rubyhdrdir)
877 RUBY_CFLAGS="-I$rubyhdrdir"
878 rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
879 if test "X$rubylibs" != "X"; then
880 RUBY_LIBS="$rubylibs"
881 fi
882 librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
883 if test -f "$rubyhdrdir/$librubyarg"; then
884 librubyarg="$rubyhdrdir/$librubyarg"
885 else
886 rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
887 if test -f "$rubylibdir/$librubyarg"; then
888 librubyarg="$rubylibdir/$librubyarg"
889 elif test "$librubyarg" = "libruby.a"; then
890 dnl required on Mac OS 10.3 where libruby.a doesn't exist
891 librubyarg="-lruby"
892 else
893 librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
894 fi
895 fi
896
897 if test "X$librubyarg" != "X"; then
898 RUBY_LIBS="$librubyarg $RUBY_LIBS"
899 fi
900 rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
901 if test "X$rubyldflags" != "X"; then
902 LDFLAGS="$rubyldflags $LDFLAGS"
903 fi
904 RUBY_SRC="if_ruby.c"
905 RUBY_OBJ="objects/if_ruby.o"
906 RUBY_PRO="if_ruby.pro"
907 AC_DEFINE(FEAT_RUBY)
908 else
909 AC_MSG_RESULT(not found, disabling Ruby)
910 fi
911 else
912 AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
913 fi
914 fi
915fi
916AC_SUBST(RUBY_SRC)
917AC_SUBST(RUBY_OBJ)
918AC_SUBST(RUBY_PRO)
919AC_SUBST(RUBY_CFLAGS)
920AC_SUBST(RUBY_LIBS)
921
922AC_MSG_CHECKING(--enable-cscope argument)
923AC_ARG_ENABLE(cscope,
924 [ --enable-cscope Include cscope interface.], ,
925 [enable_cscope="no"])
926AC_MSG_RESULT($enable_cscope)
927if test "$enable_cscope" = "yes"; then
928 AC_DEFINE(FEAT_CSCOPE)
929fi
930
931AC_MSG_CHECKING(--enable-workshop argument)
932AC_ARG_ENABLE(workshop,
933 [ --enable-workshop Include Sun Visual Workshop support.], ,
934 [enable_workshop="no"])
935AC_MSG_RESULT($enable_workshop)
936if test "$enable_workshop" = "yes"; then
937 AC_DEFINE(FEAT_SUN_WORKSHOP)
938 WORKSHOP_SRC="workshop.c integration.c"
939 AC_SUBST(WORKSHOP_SRC)
940 WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
941 AC_SUBST(WORKSHOP_OBJ)
942 if test "${enable_gui-xxx}" = xxx; then
943 enable_gui=motif
944 fi
945fi
946
947AC_MSG_CHECKING(--disable-netbeans argument)
948AC_ARG_ENABLE(netbeans,
949 [ --disable-netbeans Disable NetBeans integration support.],
950 , [enable_netbeans="yes"])
951if test "$enable_netbeans" = "yes"; then
952 AC_MSG_RESULT(no)
953 dnl On Solaris we need the socket and nsl library.
954 AC_CHECK_LIB(socket, socket)
955 AC_CHECK_LIB(nsl, gethostbyname)
956 AC_MSG_CHECKING(whether compiling netbeans integration is possible)
957 AC_TRY_LINK([
958#include <stdio.h>
959#include <stdlib.h>
960#include <stdarg.h>
961#include <fcntl.h>
962#include <netdb.h>
963#include <netinet/in.h>
964#include <errno.h>
965#include <sys/types.h>
966#include <sys/socket.h>
967 /* Check bitfields */
968 struct nbbuf {
969 unsigned int initDone:1;
970 ushort signmaplen;
971 };
972 ], [
973 /* Check creating a socket. */
974 struct sockaddr_in server;
975 (void)socket(AF_INET, SOCK_STREAM, 0);
976 (void)htons(100);
977 (void)gethostbyname("microsoft.com");
978 if (errno == ECONNREFUSED)
979 (void)connect(1, (struct sockaddr *)&server, sizeof(server));
980 ],
981 AC_MSG_RESULT(yes),
982 AC_MSG_RESULT(no); enable_netbeans="no")
983else
984 AC_MSG_RESULT(yes)
985fi
986if test "$enable_netbeans" = "yes"; then
987 AC_DEFINE(FEAT_NETBEANS_INTG)
988 NETBEANS_SRC="netbeans.c"
989 AC_SUBST(NETBEANS_SRC)
990 NETBEANS_OBJ="objects/netbeans.o"
991 AC_SUBST(NETBEANS_OBJ)
992fi
993
994AC_MSG_CHECKING(--enable-sniff argument)
995AC_ARG_ENABLE(sniff,
996 [ --enable-sniff Include Sniff interface.], ,
997 [enable_sniff="no"])
998AC_MSG_RESULT($enable_sniff)
999if test "$enable_sniff" = "yes"; then
1000 AC_DEFINE(FEAT_SNIFF)
1001 SNIFF_SRC="if_sniff.c"
1002 AC_SUBST(SNIFF_SRC)
1003 SNIFF_OBJ="objects/if_sniff.o"
1004 AC_SUBST(SNIFF_OBJ)
1005fi
1006
1007AC_MSG_CHECKING(--enable-multibyte argument)
1008AC_ARG_ENABLE(multibyte,
1009 [ --enable-multibyte Include multibyte editing support.], ,
1010 [enable_multibyte="no"])
1011AC_MSG_RESULT($enable_multibyte)
1012if test "$enable_multibyte" = "yes"; then
1013 AC_DEFINE(FEAT_MBYTE)
1014fi
1015
1016AC_MSG_CHECKING(--enable-hangulinput argument)
1017AC_ARG_ENABLE(hangulinput,
1018 [ --enable-hangulinput Include Hangul input support.], ,
1019 [enable_hangulinput="no"])
1020AC_MSG_RESULT($enable_hangulinput)
1021
1022AC_MSG_CHECKING(--enable-xim argument)
1023AC_ARG_ENABLE(xim,
1024 [ --enable-xim Include XIM input support.],
1025 AC_MSG_RESULT($enable_xim),
1026 [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
1027dnl defining FEAT_XIM is delayed, so that it can be disabled for older GTK
1028
1029AC_MSG_CHECKING(--enable-fontset argument)
1030AC_ARG_ENABLE(fontset,
1031 [ --enable-fontset Include X fontset output support.], ,
1032 [enable_fontset="no"])
1033AC_MSG_RESULT($enable_fontset)
1034dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI
1035
1036test -z "$with_x" && with_x=yes
1037test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
1038if test "$with_x" = no; then
1039 AC_MSG_RESULT(defaulting to: don't HAVE_X11)
1040else
1041 dnl Do this check early, so that its failure can override user requests.
1042
1043 AC_PATH_PROG(xmkmfpath, xmkmf)
1044
1045 AC_PATH_XTRA
1046
1047 dnl On OS390Unix the X libraries are DLLs. To use them the code must
1048 dnl be compiled with a special option.
1049 dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS.
1050 if test "$OS390Unix" = "yes"; then
1051 CFLAGS="$CFLAGS -W c,dll"
1052 LDFLAGS="$LDFLAGS -W l,dll"
1053 X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
1054 fi
1055
1056 dnl On my HPUX system the X include dir is found, but the lib dir not.
1057 dnl This is a desparate try to fix this.
1058
1059 if test -d "$x_includes" && test ! -d "$x_libraries"; then
1060 x_libraries=`echo "$x_includes" | sed s/include/lib/`
1061 AC_MSG_RESULT(Corrected X libraries to $x_libraries)
1062 X_LIBS="$X_LIBS -L$x_libraries"
1063 if test "`(uname) 2>/dev/null`" = SunOS &&
1064 uname -r | grep '^5' >/dev/null; then
1065 X_LIBS="$X_LIBS -R $x_libraries"
1066 fi
1067 fi
1068
1069 if test -d "$x_libraries" && test ! -d "$x_includes"; then
1070 x_includes=`echo "$x_libraries" | sed s/lib/include/`
1071 AC_MSG_RESULT(Corrected X includes to $x_includes)
1072 X_CFLAGS="$X_CFLAGS -I$x_includes"
1073 fi
1074
1075 dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed.
1076 X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
1077 dnl Remove "-L/usr/lib " from X_LIBS, should not be needed.
1078 X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
1079 dnl Same for "-R/usr/lib ".
1080 X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
1081
1082
1083 dnl Check if the X11 header files are correctly installed. On some systems
1084 dnl Xlib.h includes files that don't exist
1085 AC_MSG_CHECKING(if X11 header files can be found)
1086 cflags_save=$CFLAGS
1087 CFLAGS="$CFLAGS $X_CFLAGS"
1088 AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
1089 AC_MSG_RESULT(yes),
1090 AC_MSG_RESULT(no); no_x=yes)
1091 CFLAGS=$cflags_save
1092
1093 if test "${no_x-no}" = yes; then
1094 with_x=no
1095 else
1096 AC_DEFINE(HAVE_X11)
1097 X_LIB="-lXt -lX11";
1098 AC_SUBST(X_LIB)
1099
1100 ac_save_LDFLAGS="$LDFLAGS"
1101 LDFLAGS="-L$x_libraries $LDFLAGS"
1102
1103 dnl Check for -lXdmcp (needed on SunOS 4.1.4)
1104 dnl For HP-UX 10.20 it must be before -lSM -lICE
1105 AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],,
1106 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp])
1107
1108 dnl Some systems need -lnsl -lsocket when testing for ICE.
1109 dnl The check above doesn't do this, try here (again). Also needed to get
1110 dnl them after Xdmcp. link.sh will remove them when not needed.
1111 dnl Check for other function than above to avoid the cached value
1112 AC_CHECK_LIB(ICE, IceOpenConnection,
1113 [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
1114
1115 dnl Check for -lXpm (needed for some versions of Motif)
1116 LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
1117 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
1118 [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS])
1119
1120 dnl Check that the X11 header files don't use implicit declarations
1121 AC_MSG_CHECKING(if X11 header files implicitly declare return values)
1122 cflags_save=$CFLAGS
1123 CFLAGS="$CFLAGS $X_CFLAGS -Werror"
1124 AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
1125 AC_MSG_RESULT(no),
1126 CFLAGS="$CFLAGS -Wno-implicit-int"
1127 AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
1128 AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int",
1129 AC_MSG_RESULT(test failed)
1130 )
1131 )
1132 CFLAGS=$cflags_save
1133
1134 LDFLAGS="$ac_save_LDFLAGS"
1135
1136 fi
1137fi
1138
Bram Moolenaara7fc0102005-05-18 22:17:12 +00001139test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
Bram Moolenaar071d4272004-06-13 20:20:40 +00001140
1141AC_MSG_CHECKING(--enable-gui argument)
1142AC_ARG_ENABLE(gui,
Bram Moolenaar9372a112005-12-06 19:59:18 +00001143 [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
Bram Moolenaar071d4272004-06-13 20:20:40 +00001144
1145dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
1146dnl Do not use character classes for portability with old tools.
1147enable_gui_canon=`echo "_$enable_gui" | \
1148 sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1149
1150dnl Skip everything by default.
1151SKIP_GTK=YES
1152SKIP_GTK2=YES
1153SKIP_GNOME=YES
1154SKIP_MOTIF=YES
1155SKIP_ATHENA=YES
1156SKIP_NEXTAW=YES
1157SKIP_PHOTON=YES
Bram Moolenaar071d4272004-06-13 20:20:40 +00001158SKIP_CARBON=YES
1159GUITYPE=NONE
1160
Bram Moolenaarb11160e2005-01-04 21:31:43 +00001161if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
Bram Moolenaar071d4272004-06-13 20:20:40 +00001162 SKIP_PHOTON=
1163 case "$enable_gui_canon" in
1164 no) AC_MSG_RESULT(no GUI support)
1165 SKIP_PHOTON=YES ;;
1166 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
1167 auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
1168 photon) AC_MSG_RESULT(Photon GUI support) ;;
1169 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
1170 SKIP_PHOTON=YES ;;
1171 esac
1172
1173elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
1174 SKIP_CARBON=
1175 case "$enable_gui_canon" in
1176 no) AC_MSG_RESULT(no GUI support)
1177 SKIP_CARBON=YES ;;
1178 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
1179 auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
1180 carbon) AC_MSG_RESULT(Carbon GUI support) ;;
1181 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
1182 SKIP_CARBON=YES ;;
1183 esac
1184
1185else
1186
Bram Moolenaar071d4272004-06-13 20:20:40 +00001187 case "$enable_gui_canon" in
1188 no|none) AC_MSG_RESULT(no GUI support) ;;
1189 yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
1190 SKIP_GTK=
1191 SKIP_GTK2=
1192 SKIP_GNOME=
1193 SKIP_MOTIF=
1194 SKIP_ATHENA=
1195 SKIP_NEXTAW=
1196 SKIP_CARBON=;;
1197 gtk) AC_MSG_RESULT(GTK+ 1.x GUI support)
1198 SKIP_GTK=;;
1199 gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
1200 SKIP_GTK=
1201 SKIP_GTK2=;;
1202 gnome) AC_MSG_RESULT(GNOME 1.x GUI support)
1203 SKIP_GNOME=
1204 SKIP_GTK=;;
1205 gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
1206 SKIP_GNOME=
1207 SKIP_GTK=
1208 SKIP_GTK2=;;
1209 motif) AC_MSG_RESULT(Motif GUI support)
1210 SKIP_MOTIF=;;
1211 athena) AC_MSG_RESULT(Athena GUI support)
1212 SKIP_ATHENA=;;
1213 nextaw) AC_MSG_RESULT(neXtaw GUI support)
1214 SKIP_NEXTAW=;;
1215 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;;
1216 esac
1217
1218fi
1219
1220if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
1221 AC_MSG_CHECKING(whether or not to look for GTK)
1222 AC_ARG_ENABLE(gtk-check,
1223 [ --enable-gtk-check If auto-select GUI, check for GTK [default=yes]],
1224 , enable_gtk_check="yes")
1225 AC_MSG_RESULT($enable_gtk_check)
1226 if test "x$enable_gtk_check" = "xno"; then
1227 SKIP_GTK=YES
1228 SKIP_GNOME=YES
1229 fi
1230fi
1231
1232if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
1233 -a "$enable_gui_canon" != "gnome2"; then
1234 AC_MSG_CHECKING(whether or not to look for GTK+ 2)
1235 AC_ARG_ENABLE(gtk2-check,
1236 [ --enable-gtk2-check If GTK GUI, check for GTK+ 2 [default=yes]],
1237 , enable_gtk2_check="yes")
1238 AC_MSG_RESULT($enable_gtk2_check)
1239 if test "x$enable_gtk2_check" = "xno"; then
1240 SKIP_GTK2=YES
1241 fi
1242fi
1243
1244if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome" \
1245 -a "$enable_gui_canon" != "gnome2"; then
1246 AC_MSG_CHECKING(whether or not to look for GNOME)
1247 AC_ARG_ENABLE(gnome-check,
1248 [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
1249 , enable_gnome_check="no")
1250 AC_MSG_RESULT($enable_gnome_check)
1251 if test "x$enable_gnome_check" = "xno"; then
1252 SKIP_GNOME=YES
1253 fi
1254fi
1255
1256if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
1257 AC_MSG_CHECKING(whether or not to look for Motif)
1258 AC_ARG_ENABLE(motif-check,
1259 [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]],
1260 , enable_motif_check="yes")
1261 AC_MSG_RESULT($enable_motif_check)
1262 if test "x$enable_motif_check" = "xno"; then
1263 SKIP_MOTIF=YES
1264 fi
1265fi
1266
1267if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
1268 AC_MSG_CHECKING(whether or not to look for Athena)
1269 AC_ARG_ENABLE(athena-check,
1270 [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]],
1271 , enable_athena_check="yes")
1272 AC_MSG_RESULT($enable_athena_check)
1273 if test "x$enable_athena_check" = "xno"; then
1274 SKIP_ATHENA=YES
1275 fi
1276fi
1277
1278if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
1279 AC_MSG_CHECKING(whether or not to look for neXtaw)
1280 AC_ARG_ENABLE(nextaw-check,
1281 [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]],
1282 , enable_nextaw_check="yes")
1283 AC_MSG_RESULT($enable_nextaw_check);
1284 if test "x$enable_nextaw_check" = "xno"; then
1285 SKIP_NEXTAW=YES
1286 fi
1287fi
1288
1289if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
1290 AC_MSG_CHECKING(whether or not to look for Carbon)
1291 AC_ARG_ENABLE(carbon-check,
1292 [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]],
1293 , enable_carbon_check="yes")
1294 AC_MSG_RESULT($enable_carbon_check);
1295 if test "x$enable_carbon_check" = "xno"; then
1296 SKIP_CARBON=YES
1297 fi
1298fi
1299
Bram Moolenaar843ee412004-06-30 16:16:41 +00001300
Bram Moolenaar071d4272004-06-13 20:20:40 +00001301if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
1302 AC_MSG_CHECKING(for Carbon GUI)
1303 dnl already did this
1304 AC_MSG_RESULT(yes);
1305 GUITYPE=CARBONGUI
Bram Moolenaare344bea2005-09-01 20:46:49 +00001306 if test "$VIMNAME" = "vim"; then
1307 VIMNAME=Vim
1308 fi
Bram Moolenaar071d4272004-06-13 20:20:40 +00001309 dnl skip everything else
1310 SKIP_GTK=YES;
1311 SKIP_GTK2=YES;
1312 SKIP_GNOME=YES;
1313 SKIP_MOTIF=YES;
1314 SKIP_ATHENA=YES;
1315 SKIP_NEXTAW=YES;
1316 SKIP_PHOTON=YES;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001317 SKIP_CARBON=YES
1318fi
1319
Bram Moolenaar071d4272004-06-13 20:20:40 +00001320dnl
1321dnl Get the cflags and libraries from the gtk-config script
1322dnl
1323
1324dnl define an autoconf function to check for a specified version of GTK, and
1325dnl try to compile/link a GTK program. this gets used once for GTK 1.1.16.
1326dnl
1327dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
Bram Moolenaar7b0294c2004-10-11 10:16:09 +00001328dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
Bram Moolenaar071d4272004-06-13 20:20:40 +00001329dnl
1330AC_DEFUN(AM_PATH_GTK,
1331[
1332 if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
1333 {
1334 min_gtk_version=ifelse([$1], ,0.99.7,$1)
1335 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1336 no_gtk=""
1337 if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
1338 && $PKG_CONFIG --exists gtk+-2.0; then
1339 {
1340 dnl We should be using PKG_CHECK_MODULES() instead of this hack.
1341 dnl But I guess the dependency on pkgconfig.m4 is not wanted or
1342 dnl something like that.
1343 GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
Bram Moolenaar7b0294c2004-10-11 10:16:09 +00001344 GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
Bram Moolenaar071d4272004-06-13 20:20:40 +00001345 GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
1346 gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1347 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
1348 gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1349 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
1350 gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1351 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
1352 }
1353 elif test "X$GTK_CONFIG" != "Xno"; then
1354 {
1355 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
Bram Moolenaar7b0294c2004-10-11 10:16:09 +00001356 GTK_LIBDIR=
Bram Moolenaar071d4272004-06-13 20:20:40 +00001357 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
1358 gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
1359 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
1360 gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
1361 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
1362 gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
1363 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
1364 }
1365 else
1366 no_gtk=yes
1367 fi
1368
1369 if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
1370 {
1371 ac_save_CFLAGS="$CFLAGS"
1372 ac_save_LIBS="$LIBS"
1373 CFLAGS="$CFLAGS $GTK_CFLAGS"
1374 LIBS="$LIBS $GTK_LIBS"
1375
1376 dnl
1377 dnl Now check if the installed GTK is sufficiently new. (Also sanity
1378 dnl checks the results of gtk-config to some extent
1379 dnl
1380 rm -f conf.gtktest
1381 AC_TRY_RUN([
1382#include <gtk/gtk.h>
1383#include <stdio.h>
1384
1385int
1386main ()
1387{
1388int major, minor, micro;
1389char *tmp_version;
1390
1391system ("touch conf.gtktest");
1392
1393/* HP/UX 9 (%@#!) writes to sscanf strings */
1394tmp_version = g_strdup("$min_gtk_version");
1395if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1396 printf("%s, bad version string\n", "$min_gtk_version");
1397 exit(1);
1398 }
1399
1400if ((gtk_major_version > major) ||
1401 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1402 ((gtk_major_version == major) && (gtk_minor_version == minor) &&
1403 (gtk_micro_version >= micro)))
1404{
1405 return 0;
1406}
1407return 1;
1408}
1409],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1410 CFLAGS="$ac_save_CFLAGS"
1411 LIBS="$ac_save_LIBS"
1412 }
1413 fi
1414 if test "x$no_gtk" = x ; then
1415 if test "x$enable_gtktest" = "xyes"; then
1416 AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
1417 else
1418 AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
1419 fi
1420 ifelse([$2], , :, [$2])
1421 else
1422 {
1423 AC_MSG_RESULT(no)
1424 GTK_CFLAGS=""
1425 GTK_LIBS=""
1426 ifelse([$3], , :, [$3])
1427 }
1428 fi
1429 }
1430 else
1431 GTK_CFLAGS=""
1432 GTK_LIBS=""
1433 ifelse([$3], , :, [$3])
1434 fi
1435 AC_SUBST(GTK_CFLAGS)
1436 AC_SUBST(GTK_LIBS)
1437 rm -f conf.gtktest
1438])
1439
1440dnl ---------------------------------------------------------------------------
1441dnl gnome
1442dnl ---------------------------------------------------------------------------
1443AC_DEFUN([GNOME_INIT_HOOK],
1444[
1445 AC_SUBST(GNOME_LIBS)
1446 AC_SUBST(GNOME_LIBDIR)
1447 AC_SUBST(GNOME_INCLUDEDIR)
1448
1449 AC_ARG_WITH(gnome-includes,
1450 [ --with-gnome-includes=DIR Specify location of GNOME headers],
1451 [CFLAGS="$CFLAGS -I$withval"]
1452 )
1453
1454 AC_ARG_WITH(gnome-libs,
1455 [ --with-gnome-libs=DIR Specify location of GNOME libs],
1456 [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval]
1457 )
1458
1459 AC_ARG_WITH(gnome,
1460 [ --with-gnome Specify prefix for GNOME files],
1461 if test x$withval = xyes; then
1462 want_gnome=yes
1463 ifelse([$1], [], :, [$1])
1464 else
1465 if test "x$withval" = xno; then
1466 want_gnome=no
1467 else
1468 want_gnome=yes
1469 LDFLAGS="$LDFLAGS -L$withval/lib"
1470 CFLAGS="$CFLAGS -I$withval/include"
1471 gnome_prefix=$withval/lib
1472 fi
1473 fi,
1474 want_gnome=yes)
1475
1476 if test "x$want_gnome" = xyes -a "0$gtk_major_version" -ge 2; then
1477 {
1478 AC_MSG_CHECKING(for libgnomeui-2.0)
1479 if $PKG_CONFIG --exists libgnomeui-2.0; then
1480 AC_MSG_RESULT(yes)
1481 GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
1482 GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
1483 GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
Bram Moolenaar97b2ad32006-03-18 21:40:56 +00001484
1485 dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
1486 dnl This might not be the right way but it works for me...
1487 AC_MSG_CHECKING(for FreeBSD)
1488 if test "`(uname) 2>/dev/null`" = FreeBSD; then
1489 AC_MSG_RESULT(yes, adding -pthread)
1490 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
1491 GNOME_LIBS="$GNOME_LIBS -pthread"
1492 else
1493 AC_MSG_RESULT(no)
1494 fi
Bram Moolenaar071d4272004-06-13 20:20:40 +00001495 $1
1496 else
1497 AC_MSG_RESULT(not found)
1498 if test "x$2" = xfail; then
1499 AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
1500 fi
1501 fi
1502 }
1503 elif test "x$want_gnome" = xyes; then
1504 {
1505 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
1506 if test "$GNOME_CONFIG" = "no"; then
1507 no_gnome_config="yes"
1508 else
1509 AC_MSG_CHECKING(if $GNOME_CONFIG works)
1510 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
1511 AC_MSG_RESULT(yes)
1512 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
1513 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
1514 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
1515 $1
1516 else
1517 AC_MSG_RESULT(no)
1518 no_gnome_config="yes"
1519 fi
1520 fi
1521
1522 if test x$exec_prefix = xNONE; then
1523 if test x$prefix = xNONE; then
1524 gnome_prefix=$ac_default_prefix/lib
1525 else
1526 gnome_prefix=$prefix/lib
1527 fi
1528 else
1529 gnome_prefix=`eval echo \`echo $libdir\``
1530 fi
1531
1532 if test "$no_gnome_config" = "yes"; then
1533 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
1534 if test -f $gnome_prefix/gnomeConf.sh; then
1535 AC_MSG_RESULT(found)
1536 echo "loading gnome configuration from" \
1537 "$gnome_prefix/gnomeConf.sh"
1538 . $gnome_prefix/gnomeConf.sh
1539 $1
1540 else
1541 AC_MSG_RESULT(not found)
1542 if test x$2 = xfail; then
1543 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
1544 fi
1545 fi
1546 fi
1547 }
1548 fi
1549])
1550
1551AC_DEFUN([GNOME_INIT],[
1552 GNOME_INIT_HOOK([],fail)
1553])
1554
1555
1556dnl ---------------------------------------------------------------------------
1557dnl Check for GTK. First checks for gtk-config, cause it needs that to get the
1558dnl correct compiler flags. Then checks for GTK 1.1.16. If that fails, then
1559dnl it checks for 1.0.6. If both fail, then continue on for Motif as before...
1560dnl ---------------------------------------------------------------------------
1561if test -z "$SKIP_GTK"; then
1562
1563 AC_MSG_CHECKING(--with-gtk-prefix argument)
1564 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
1565 gtk_config_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
1566 gtk_config_prefix=""; AC_MSG_RESULT(no))
1567
1568 AC_MSG_CHECKING(--with-gtk-exec-prefix argument)
1569 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
1570 gtk_config_exec_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
1571 gtk_config_exec_prefix=""; AC_MSG_RESULT(no))
1572
1573 AC_MSG_CHECKING(--disable-gtktest argument)
1574 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
1575 , enable_gtktest=yes)
1576 if test "x$enable_gtktest" = "xyes" ; then
1577 AC_MSG_RESULT(gtk test enabled)
1578 else
1579 AC_MSG_RESULT(gtk test disabled)
1580 fi
1581
1582 if test "x$gtk_config_prefix" != "x" ; then
1583 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
1584 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
1585 fi
1586 if test "x$gtk_config_exec_prefix" != "x" ; then
1587 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
1588 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
1589 fi
1590 if test "X$GTK_CONFIG" = "X"; then
1591 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
1592 if test "X$GTK_CONFIG" = "Xno"; then
1593 dnl Some distributions call it gtk12-config, annoying!
1594 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no)
1595 GTK_CONFIG="$GTK12_CONFIG"
1596 fi
1597 else
1598 AC_MSG_RESULT(Using GTK configuration program $GTK_CONFIG)
1599 fi
1600 if test "X$PKG_CONFIG" = "X"; then
1601 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1602 fi
1603
1604 if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
1605 dnl First try finding version 2.2.0 or later. The 2.0.x series has
1606 dnl problems (bold fonts, --remote doesn't work).
1607 if test "X$SKIP_GTK2" != "XYES"; then
1608 AM_PATH_GTK(2.2.0,
Bram Moolenaar7b0294c2004-10-11 10:16:09 +00001609 [GUI_LIB_LOC="$GTK_LIBDIR"
1610 GTK_LIBNAME="$GTK_LIBS"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001611 GUI_INC_LOC="$GTK_CFLAGS"], )
1612 if test "x$GTK_CFLAGS" != "x"; then
1613 SKIP_ATHENA=YES
1614 SKIP_NEXTAW=YES
1615 SKIP_MOTIF=YES
1616 GUITYPE=GTK
1617 AC_SUBST(GTK_LIBNAME)
1618 fi
1619 fi
1620
1621 dnl If there is no 2.2.0 or later try the 1.x.x series. We require at
1622 dnl least GTK 1.1.16. 1.0.6 doesn't work. 1.1.1 to 1.1.15
1623 dnl were test versions.
1624 if test "x$GUITYPE" != "xGTK"; then
1625 SKIP_GTK2=YES
1626 AM_PATH_GTK(1.1.16,
1627 [GTK_LIBNAME="$GTK_LIBS"
1628 GUI_INC_LOC="$GTK_CFLAGS"], )
1629 if test "x$GTK_CFLAGS" != "x"; then
1630 SKIP_ATHENA=YES
1631 SKIP_NEXTAW=YES
1632 SKIP_MOTIF=YES
1633 GUITYPE=GTK
1634 AC_SUBST(GTK_LIBNAME)
1635 fi
1636 fi
1637 fi
1638 dnl Give a warning if GTK is older than 1.2.3
1639 if test "x$GUITYPE" = "xGTK"; then
1640 if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
1641 -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
1642 AC_MSG_RESULT(this GTK version is old; version 1.2.3 or later is recommended)
1643 else
1644 {
1645 if test "0$gtk_major_version" -ge 2; then
1646 AC_DEFINE(HAVE_GTK2)
1647 if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
1648 || test "0$gtk_minor_version" -ge 2 \
1649 || test "0$gtk_major_version" -gt 2; then
1650 AC_DEFINE(HAVE_GTK_MULTIHEAD)
1651 fi
1652 fi
1653 dnl
1654 dnl if GTK exists, and it's not the 1.0.x series, then check for GNOME.
1655 dnl
1656 if test -z "$SKIP_GNOME"; then
1657 {
1658 GNOME_INIT_HOOK([have_gnome=yes])
1659 if test x$have_gnome = xyes ; then
1660 AC_DEFINE(FEAT_GUI_GNOME)
1661 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
1662 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
1663 fi
1664 }
1665 fi
1666 }
1667 fi
1668 fi
1669fi
1670
1671dnl Check for Motif include files location.
1672dnl The LAST one found is used, this makes the highest version to be used,
1673dnl e.g. when Motif1.2 and Motif2.0 are both present.
1674
1675if test -z "$SKIP_MOTIF"; then
1676 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"
1677 dnl Remove "-I" from before $GUI_INC_LOC if it's there
1678 GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
1679
1680 AC_MSG_CHECKING(for location of Motif GUI includes)
1681 gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
1682 GUI_INC_LOC=
1683 for try in $gui_includes; do
1684 if test -f "$try/Xm/Xm.h"; then
1685 GUI_INC_LOC=$try
1686 fi
1687 done
1688 if test -n "$GUI_INC_LOC"; then
1689 if test "$GUI_INC_LOC" = /usr/include; then
1690 GUI_INC_LOC=
1691 AC_MSG_RESULT(in default path)
1692 else
1693 AC_MSG_RESULT($GUI_INC_LOC)
1694 fi
1695 else
1696 AC_MSG_RESULT(<not found>)
1697 SKIP_MOTIF=YES
1698 fi
1699fi
1700
1701dnl Check for Motif library files location. In the same order as the include
1702dnl files, to avoid a mixup if several versions are present
1703
1704if test -z "$SKIP_MOTIF"; then
1705 AC_MSG_CHECKING(--with-motif-lib argument)
1706 AC_ARG_WITH(motif-lib,
1707 [ --with-motif-lib=STRING Library for Motif ],
1708 [ MOTIF_LIBNAME="${withval}" ] )
1709
1710 if test -n "$MOTIF_LIBNAME"; then
1711 AC_MSG_RESULT($MOTIF_LIBNAME)
1712 GUI_LIB_LOC=
1713 else
1714 AC_MSG_RESULT(no)
1715
1716 dnl Remove "-L" from before $GUI_LIB_LOC if it's there
1717 GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
1718
1719 AC_MSG_CHECKING(for location of Motif GUI libs)
1720 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"
1721 GUI_LIB_LOC=
1722 for try in $gui_libs; do
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001723 for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do
Bram Moolenaar071d4272004-06-13 20:20:40 +00001724 if test -f "$libtry"; then
1725 GUI_LIB_LOC=$try
1726 fi
1727 done
1728 done
1729 if test -n "$GUI_LIB_LOC"; then
1730 dnl Remove /usr/lib, it causes trouble on some systems
1731 if test "$GUI_LIB_LOC" = /usr/lib; then
1732 GUI_LIB_LOC=
1733 AC_MSG_RESULT(in default path)
1734 else
1735 if test -n "$GUI_LIB_LOC"; then
1736 AC_MSG_RESULT($GUI_LIB_LOC)
1737 if test "`(uname) 2>/dev/null`" = SunOS &&
1738 uname -r | grep '^5' >/dev/null; then
1739 GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
1740 fi
1741 fi
1742 fi
1743 MOTIF_LIBNAME=-lXm
1744 else
1745 AC_MSG_RESULT(<not found>)
1746 SKIP_MOTIF=YES
1747 fi
1748 fi
1749fi
1750
1751if test -z "$SKIP_MOTIF"; then
1752 SKIP_ATHENA=YES
1753 SKIP_NEXTAW=YES
1754 GUITYPE=MOTIF
1755 AC_SUBST(MOTIF_LIBNAME)
1756fi
1757
1758dnl Check if the Athena files can be found
1759
1760GUI_X_LIBS=
1761
1762if test -z "$SKIP_ATHENA"; then
1763 AC_MSG_CHECKING(if Athena header files can be found)
1764 cflags_save=$CFLAGS
1765 CFLAGS="$CFLAGS $X_CFLAGS"
1766 AC_TRY_COMPILE([
1767#include <X11/Intrinsic.h>
1768#include <X11/Xaw/Paned.h>], ,
1769 AC_MSG_RESULT(yes),
1770 AC_MSG_RESULT(no); SKIP_ATHENA=YES )
1771 CFLAGS=$cflags_save
1772fi
1773
1774if test -z "$SKIP_ATHENA"; then
1775 GUITYPE=ATHENA
1776fi
1777
1778if test -z "$SKIP_NEXTAW"; then
1779 AC_MSG_CHECKING(if neXtaw header files can be found)
1780 cflags_save=$CFLAGS
1781 CFLAGS="$CFLAGS $X_CFLAGS"
1782 AC_TRY_COMPILE([
1783#include <X11/Intrinsic.h>
1784#include <X11/neXtaw/Paned.h>], ,
1785 AC_MSG_RESULT(yes),
1786 AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
1787 CFLAGS=$cflags_save
1788fi
1789
1790if test -z "$SKIP_NEXTAW"; then
1791 GUITYPE=NEXTAW
1792fi
1793
1794if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
1795 dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
1796 dnl Avoid adding it when it twice
1797 if test -n "$GUI_INC_LOC"; then
1798 GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
1799 fi
1800 if test -n "$GUI_LIB_LOC"; then
1801 GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
1802 fi
1803
1804 dnl Check for -lXext and then for -lXmu
1805 ldflags_save=$LDFLAGS
1806 LDFLAGS="$X_LIBS $LDFLAGS"
1807 AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
1808 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
1809 dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
1810 AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
1811 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
1812 AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
1813 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
1814 AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
1815 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
1816 if test -z "$SKIP_MOTIF"; then
1817 AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
1818 [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
1819 fi
1820 LDFLAGS=$ldflags_save
1821
1822 dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
1823 AC_MSG_CHECKING(for extra X11 defines)
1824 NARROW_PROTO=
1825 rm -fr conftestdir
1826 if mkdir conftestdir; then
1827 cd conftestdir
1828 cat > Imakefile <<'EOF'
1829acfindx:
1830 @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
1831EOF
1832 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1833 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1834 fi
1835 cd ..
1836 rm -fr conftestdir
1837 fi
1838 if test -z "$NARROW_PROTO"; then
1839 AC_MSG_RESULT(no)
1840 else
1841 AC_MSG_RESULT($NARROW_PROTO)
1842 fi
1843 AC_SUBST(NARROW_PROTO)
1844fi
1845
1846dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
1847dnl use the X11 include path
1848if test "$enable_xsmp" = "yes"; then
1849 cppflags_save=$CPPFLAGS
1850 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1851 AC_CHECK_HEADERS(X11/SM/SMlib.h)
1852 CPPFLAGS=$cppflags_save
1853fi
1854
1855
1856if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK"; then
1857 dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
1858 cppflags_save=$CPPFLAGS
1859 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1860 AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
1861
1862 dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
1863 if test ! "$enable_xim" = "no"; then
1864 AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
1865 AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
1866 AC_MSG_RESULT(yes),
1867 AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no")
1868 fi
1869 CPPFLAGS=$cppflags_save
1870
1871 dnl automatically enable XIM when hangul input isn't enabled
1872 if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
1873 -a "x$GUITYPE" != "xNONE" ; then
1874 AC_MSG_RESULT(X GUI selected; xim has been enabled)
1875 enable_xim="yes"
1876 fi
1877fi
1878
1879if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
1880 cppflags_save=$CPPFLAGS
1881 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
Bram Moolenaar2ce06f62005-01-31 19:19:04 +00001882dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h
1883 AC_MSG_CHECKING([for X11/Xmu/Editres.h])
1884 AC_TRY_COMPILE([
1885#include <X11/Intrinsic.h>
1886#include <X11/Xmu/Editres.h>],
1887 [int i; i = 0;],
1888 AC_MSG_RESULT(yes)
1889 AC_DEFINE(HAVE_X11_XMU_EDITRES_H),
1890 AC_MSG_RESULT(no))
Bram Moolenaar071d4272004-06-13 20:20:40 +00001891 CPPFLAGS=$cppflags_save
1892fi
1893
1894dnl Only use the Xm directory when compiling Motif, don't use it for Athena
1895if test -z "$SKIP_MOTIF"; then
1896 cppflags_save=$CPPFLAGS
1897 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
Bram Moolenaar2ce06f62005-01-31 19:19:04 +00001898 AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
1899 Xm/UnhighlightT.h)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001900 CPPFLAGS=$cppflags_save
1901fi
1902
1903if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
1904 AC_MSG_RESULT(no GUI selected; xim has been disabled)
1905 enable_xim="no"
1906fi
1907if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
1908 AC_MSG_RESULT(no GUI selected; fontset has been disabled)
1909 enable_fontset="no"
1910fi
1911if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
1912 AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
1913 enable_fontset="no"
1914fi
1915
Bram Moolenaar071d4272004-06-13 20:20:40 +00001916if test -z "$SKIP_PHOTON"; then
1917 GUITYPE=PHOTONGUI
1918fi
1919
1920AC_SUBST(GUI_INC_LOC)
1921AC_SUBST(GUI_LIB_LOC)
1922AC_SUBST(GUITYPE)
1923AC_SUBST(GUI_X_LIBS)
1924
1925if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
1926 AC_MSG_ERROR([cannot use workshop without Motif])
1927fi
1928
1929dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
1930if test "$enable_xim" = "yes"; then
1931 AC_DEFINE(FEAT_XIM)
1932fi
1933if test "$enable_fontset" = "yes"; then
1934 AC_DEFINE(FEAT_XFONTSET)
1935fi
1936
1937
1938dnl ---------------------------------------------------------------------------
1939dnl end of GUI-checking
1940dnl ---------------------------------------------------------------------------
1941
1942
1943dnl Only really enable hangul input when GUI and XFONTSET are available
1944if test "$enable_hangulinput" = "yes"; then
1945 if test "x$GUITYPE" = "xNONE"; then
1946 AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
1947 enable_hangulinput=no
1948 else
1949 AC_DEFINE(FEAT_HANGULIN)
1950 HANGULIN_SRC=hangulin.c
1951 AC_SUBST(HANGULIN_SRC)
1952 HANGULIN_OBJ=objects/hangulin.o
1953 AC_SUBST(HANGULIN_OBJ)
1954 fi
1955fi
1956
1957dnl Checks for libraries and include files.
1958
1959AC_MSG_CHECKING(quality of toupper)
1960AC_TRY_RUN([#include <ctype.h>
1961main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }],
1962 AC_DEFINE(BROKEN_TOUPPER) AC_MSG_RESULT(bad),
1963 AC_MSG_RESULT(good), AC_MSG_ERROR(failed to compile test program))
1964
1965AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
1966AC_TRY_COMPILE(, [printf("(" __DATE__ " " __TIME__ ")");],
1967 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
1968 AC_MSG_RESULT(no))
1969
1970dnl Checks for header files.
1971AC_CHECK_HEADER(elf.h, HAS_ELF=1)
1972dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
1973if test "$HAS_ELF" = 1; then
1974 AC_CHECK_LIB(elf, main)
1975fi
1976
1977AC_HEADER_DIRENT
1978
1979dnl check for standard headers, we don't use this in Vim but other stuff
1980dnl in autoconf needs it
1981AC_HEADER_STDC
1982AC_HEADER_SYS_WAIT
1983
1984dnl If sys/wait.h is not found it might still exist but not be POSIX
1985dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
1986if test $ac_cv_header_sys_wait_h = no; then
1987 AC_MSG_CHECKING([for sys/wait.h that defines union wait])
1988 AC_TRY_COMPILE([#include <sys/wait.h>],
1989 [union wait xx, yy; xx = yy],
1990 AC_MSG_RESULT(yes)
1991 AC_DEFINE(HAVE_SYS_WAIT_H)
1992 AC_DEFINE(HAVE_UNION_WAIT),
1993 AC_MSG_RESULT(no))
1994fi
1995
1996AC_CHECK_HEADERS(stdarg.h stdlib.h string.h sys/select.h sys/utsname.h \
1997 termcap.h fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h \
1998 iconv.h langinfo.h unistd.h stropts.h errno.h \
1999 sys/resource.h sys/systeminfo.h locale.h \
2000 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
2001 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
Bram Moolenaardf3267e2005-01-25 22:07:05 +00002002 libgen.h util/debug.h util/msg18n.h frame.h \
Bram Moolenaar0cb032e2005-04-23 20:52:00 +00002003 sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h wctype.h)
Bram Moolenaar071d4272004-06-13 20:20:40 +00002004
Bram Moolenaardf3267e2005-01-25 22:07:05 +00002005dnl pthread_np.h may exist but can only be used after including pthread.h
2006AC_MSG_CHECKING([for pthread_np.h])
2007AC_TRY_COMPILE([
2008#include <pthread.h>
2009#include <pthread_np.h>],
2010 [int i; i = 0;],
2011 AC_MSG_RESULT(yes)
2012 AC_DEFINE(HAVE_PTHREAD_NP_H),
2013 AC_MSG_RESULT(no))
2014
Bram Moolenaare344bea2005-09-01 20:46:49 +00002015AC_CHECK_HEADERS(strings.h)
Bram Moolenaar9372a112005-12-06 19:59:18 +00002016if test "x$MACOSX" = "xyes"; then
2017 dnl The strings.h file on OS/X contains a warning and nothing useful.
2018 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
2019else
Bram Moolenaar071d4272004-06-13 20:20:40 +00002020
2021dnl Check if strings.h and string.h can both be included when defined.
2022AC_MSG_CHECKING([if strings.h can be included after string.h])
2023cppflags_save=$CPPFLAGS
2024CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2025AC_TRY_COMPILE([
2026#if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
2027# define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
2028 /* but don't do it on AIX 5.1 (Uribarri) */
2029#endif
2030#ifdef HAVE_XM_XM_H
2031# include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
2032#endif
2033#ifdef HAVE_STRING_H
2034# include <string.h>
2035#endif
2036#if defined(HAVE_STRINGS_H)
2037# include <strings.h>
2038#endif
2039 ], [int i; i = 0;],
2040 AC_MSG_RESULT(yes),
2041 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
2042 AC_MSG_RESULT(no))
2043CPPFLAGS=$cppflags_save
Bram Moolenaar9372a112005-12-06 19:59:18 +00002044fi
Bram Moolenaar071d4272004-06-13 20:20:40 +00002045
2046dnl Checks for typedefs, structures, and compiler characteristics.
2047AC_PROG_GCC_TRADITIONAL
2048AC_C_CONST
2049AC_TYPE_MODE_T
2050AC_TYPE_OFF_T
2051AC_TYPE_PID_T
2052AC_TYPE_SIZE_T
2053AC_TYPE_UID_T
2054AC_HEADER_TIME
2055AC_CHECK_TYPE(ino_t, long)
2056AC_CHECK_TYPE(dev_t, unsigned)
2057
2058AC_MSG_CHECKING(for rlim_t)
2059if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
2060 AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
2061else
2062 AC_EGREP_CPP(dnl
2063changequote(<<,>>)dnl
2064<<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
2065changequote([,]),
2066 [
2067#include <sys/types.h>
2068#if STDC_HEADERS
2069#include <stdlib.h>
2070#include <stddef.h>
2071#endif
2072#ifdef HAVE_SYS_RESOURCE_H
2073#include <sys/resource.h>
2074#endif
2075 ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
2076 AC_MSG_RESULT($ac_cv_type_rlim_t)
2077fi
2078if test $ac_cv_type_rlim_t = no; then
2079 cat >> confdefs.h <<\EOF
2080#define rlim_t unsigned long
2081EOF
2082fi
2083
2084AC_MSG_CHECKING(for stack_t)
2085if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
2086 AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
2087else
2088 AC_EGREP_CPP(stack_t,
2089 [
2090#include <sys/types.h>
2091#if STDC_HEADERS
2092#include <stdlib.h>
2093#include <stddef.h>
2094#endif
2095#include <signal.h>
2096 ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
2097 AC_MSG_RESULT($ac_cv_type_stack_t)
2098fi
2099if test $ac_cv_type_stack_t = no; then
2100 cat >> confdefs.h <<\EOF
2101#define stack_t struct sigaltstack
2102EOF
2103fi
2104
2105dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
2106AC_MSG_CHECKING(whether stack_t has an ss_base field)
2107AC_TRY_COMPILE([
2108#include <sys/types.h>
2109#if STDC_HEADERS
2110#include <stdlib.h>
2111#include <stddef.h>
2112#endif
2113#include <signal.h>
2114#include "confdefs.h"
2115 ], [stack_t sigstk; sigstk.ss_base = 0; ],
2116 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
2117 AC_MSG_RESULT(no))
2118
2119olibs="$LIBS"
2120AC_MSG_CHECKING(--with-tlib argument)
2121AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
2122if test -n "$with_tlib"; then
2123 AC_MSG_RESULT($with_tlib)
2124 LIBS="$LIBS -l$with_tlib"
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00002125 AC_MSG_CHECKING(for linking with $with_tlib library)
2126 AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED))
2127 dnl Need to check for tgetent() below.
2128 olibs="$LIBS"
Bram Moolenaar071d4272004-06-13 20:20:40 +00002129else
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00002130 AC_MSG_RESULT([empty: automatic terminal library selection])
Bram Moolenaar071d4272004-06-13 20:20:40 +00002131 dnl On HP-UX 10.10 termcap or termlib should be used instead of
2132 dnl curses, because curses is much slower.
2133 dnl Newer versions of ncurses are preferred over anything.
2134 dnl Older versions of ncurses have bugs, get a new one!
2135 dnl Digital Unix (OSF1) should use curses (Ronald Schild).
2136 case "`uname -s 2>/dev/null`" in
2137 OSF1) tlibs="ncurses curses termlib termcap";;
2138 *) tlibs="ncurses termlib termcap curses";;
2139 esac
2140 for libname in $tlibs; do
2141 AC_CHECK_LIB(${libname}, tgetent,,)
2142 if test "x$olibs" != "x$LIBS"; then
2143 dnl It's possible that a library is found but it doesn't work
2144 dnl e.g., shared library that cannot be found
2145 dnl compile and run a test program to be sure
2146 AC_TRY_RUN([
2147#ifdef HAVE_TERMCAP_H
2148# include <termcap.h>
2149#endif
2150main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
2151 res="OK", res="FAIL", res="FAIL")
2152 if test "$res" = "OK"; then
2153 break
2154 fi
2155 AC_MSG_RESULT($libname library is not usable)
2156 LIBS="$olibs"
2157 fi
2158 done
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00002159 if test "x$olibs" = "x$LIBS"; then
2160 AC_MSG_RESULT(no terminal library found)
2161 fi
Bram Moolenaar071d4272004-06-13 20:20:40 +00002162fi
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00002163
2164if test "x$olibs" = "x$LIBS"; then
2165 AC_MSG_CHECKING([for tgetent()])
Bram Moolenaar2389c3c2005-05-22 22:07:59 +00002166 AC_TRY_LINK([],
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00002167 [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
2168 AC_MSG_RESULT(yes),
2169 AC_MSG_ERROR([NOT FOUND!
2170 You need to install a terminal library; for example ncurses.
2171 Or specify the name of the library with --with-tlib.]))
2172fi
2173
2174AC_MSG_CHECKING(whether we talk terminfo)
2175AC_TRY_RUN([
Bram Moolenaar071d4272004-06-13 20:20:40 +00002176#ifdef HAVE_TERMCAP_H
2177# include <termcap.h>
2178#endif
2179main()
2180{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
2181 AC_MSG_RESULT([no -- we are in termcap land]),
2182 AC_MSG_RESULT([yes -- terminfo spoken here]); AC_DEFINE(TERMINFO),
2183 AC_MSG_ERROR(failed to compile test program.))
Bram Moolenaar071d4272004-06-13 20:20:40 +00002184
2185if test "x$olibs" != "x$LIBS"; then
2186 AC_MSG_CHECKING(what tgetent() returns for an unknown terminal)
2187 AC_TRY_RUN([
2188#ifdef HAVE_TERMCAP_H
2189# include <termcap.h>
2190#endif
2191main()
2192{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }],
2193 AC_MSG_RESULT(zero); AC_DEFINE(TGETENT_ZERO_ERR, 0),
2194 AC_MSG_RESULT(non-zero),
2195 AC_MSG_ERROR(failed to compile test program.))
2196fi
2197
2198AC_MSG_CHECKING(whether termcap.h contains ospeed)
2199AC_TRY_LINK([
2200#ifdef HAVE_TERMCAP_H
2201# include <termcap.h>
2202#endif
2203 ], [ospeed = 20000],
2204 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
2205 [AC_MSG_RESULT(no)
2206 AC_MSG_CHECKING(whether ospeed can be extern)
2207 AC_TRY_LINK([
2208#ifdef HAVE_TERMCAP_H
2209# include <termcap.h>
2210#endif
2211extern short ospeed;
2212 ], [ospeed = 20000],
2213 AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
2214 AC_MSG_RESULT(no))]
2215 )
2216
2217AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
2218AC_TRY_LINK([
2219#ifdef HAVE_TERMCAP_H
2220# include <termcap.h>
2221#endif
2222 ], [if (UP == 0 && BC == 0) PC = 1],
2223 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
2224 [AC_MSG_RESULT(no)
2225 AC_MSG_CHECKING([whether UP, BC and PC can be extern])
2226 AC_TRY_LINK([
2227#ifdef HAVE_TERMCAP_H
2228# include <termcap.h>
2229#endif
2230extern char *UP, *BC, PC;
2231 ], [if (UP == 0 && BC == 0) PC = 1],
2232 AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
2233 AC_MSG_RESULT(no))]
2234 )
2235
2236AC_MSG_CHECKING(whether tputs() uses outfuntype)
2237AC_TRY_COMPILE([
2238#ifdef HAVE_TERMCAP_H
2239# include <termcap.h>
2240#endif
2241 ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
2242 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
2243 AC_MSG_RESULT(no))
2244
2245dnl On some SCO machines sys/select redefines struct timeval
2246AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
2247AC_TRY_COMPILE([
2248#include <sys/types.h>
2249#include <sys/time.h>
2250#include <sys/select.h>], ,
2251 AC_MSG_RESULT(yes)
2252 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
2253 AC_MSG_RESULT(no))
2254
2255dnl AC_DECL_SYS_SIGLIST
2256
2257dnl Checks for pty.c (copied from screen) ==========================
2258AC_MSG_CHECKING(for /dev/ptc)
2259if test -r /dev/ptc; then
2260 AC_DEFINE(HAVE_DEV_PTC)
2261 AC_MSG_RESULT(yes)
2262else
2263 AC_MSG_RESULT(no)
2264fi
2265
2266AC_MSG_CHECKING(for SVR4 ptys)
2267if test -c /dev/ptmx ; then
2268 AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
2269 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
2270 AC_MSG_RESULT(no))
2271else
2272 AC_MSG_RESULT(no)
2273fi
2274
2275AC_MSG_CHECKING(for ptyranges)
2276if test -d /dev/ptym ; then
2277 pdir='/dev/ptym'
2278else
2279 pdir='/dev'
2280fi
2281dnl SCO uses ptyp%d
2282AC_EGREP_CPP(yes,
2283[#ifdef M_UNIX
2284 yes;
2285#endif
2286 ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
2287dnl if test -c /dev/ptyp19; then
2288dnl ptys=`echo /dev/ptyp??`
2289dnl else
2290dnl ptys=`echo $pdir/pty??`
2291dnl fi
2292if test "$ptys" != "$pdir/pty??" ; then
2293 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
2294 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
2295 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
2296 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
2297 AC_MSG_RESULT([$p0 / $p1])
2298else
2299 AC_MSG_RESULT([don't know])
2300fi
2301
2302dnl **** pty mode/group handling ****
2303dnl
2304dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
2305AC_MSG_CHECKING(default tty permissions/group)
2306rm -f conftest_grp
2307AC_TRY_RUN([
2308#include <sys/types.h>
2309#include <sys/stat.h>
2310#include <stdio.h>
2311main()
2312{
2313 struct stat sb;
2314 char *x,*ttyname();
2315 int om, m;
2316 FILE *fp;
2317
2318 if (!(x = ttyname(0))) exit(1);
2319 if (stat(x, &sb)) exit(1);
2320 om = sb.st_mode;
2321 if (om & 002) exit(0);
2322 m = system("mesg y");
2323 if (m == -1 || m == 127) exit(1);
2324 if (stat(x, &sb)) exit(1);
2325 m = sb.st_mode;
2326 if (chmod(x, om)) exit(1);
2327 if (m & 002) exit(0);
2328 if (sb.st_gid == getgid()) exit(1);
2329 if (!(fp=fopen("conftest_grp", "w")))
2330 exit(1);
2331 fprintf(fp, "%d\n", sb.st_gid);
2332 fclose(fp);
2333 exit(0);
2334}
2335],[
2336 if test -f conftest_grp; then
2337 ptygrp=`cat conftest_grp`
2338 AC_MSG_RESULT([pty mode: 0620, group: $ptygrp])
2339 AC_DEFINE(PTYMODE, 0620)
2340 AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
2341 else
2342 AC_MSG_RESULT([ptys are world accessable])
2343 fi
2344],
2345 AC_MSG_RESULT([can't determine - assume ptys are world accessable]),
2346 AC_MSG_ERROR(failed to compile test program))
2347rm -f conftest_grp
2348
2349dnl Checks for library functions. ===================================
2350
2351AC_TYPE_SIGNAL
2352
2353dnl find out what to use at the end of a signal function
2354if test $ac_cv_type_signal = void; then
2355 AC_DEFINE(SIGRETURN, [return])
2356else
2357 AC_DEFINE(SIGRETURN, [return 0])
2358fi
2359
2360dnl check if struct sigcontext is defined (used for SGI only)
2361AC_MSG_CHECKING(for struct sigcontext)
2362AC_TRY_COMPILE([
2363#include <signal.h>
2364test_sig()
2365{
2366 struct sigcontext *scont;
2367 scont = (struct sigcontext *)0;
2368 return 1;
2369} ], ,
2370 AC_MSG_RESULT(yes)
2371 AC_DEFINE(HAVE_SIGCONTEXT),
2372 AC_MSG_RESULT(no))
2373
2374dnl tricky stuff: try to find out if getcwd() is implemented with
2375dnl system("sh -c pwd")
2376AC_MSG_CHECKING(getcwd implementation)
2377AC_TRY_RUN([
2378char *dagger[] = { "IFS=pwd", 0 };
2379main()
2380{
2381 char buffer[500];
2382 extern char **environ;
2383 environ = dagger;
2384 return getcwd(buffer, 500) ? 0 : 1;
2385}],
2386 AC_MSG_RESULT(it is usable),
2387 AC_MSG_RESULT(it stinks)
2388 AC_DEFINE(BAD_GETCWD),
2389 AC_MSG_ERROR(failed to compile test program))
2390
2391dnl Check for functions in one big call, to reduce the size of configure
2392AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
2393 getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
2394 memset nanosleep opendir putenv qsort readlink select setenv \
2395 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
Bram Moolenaar051b7822005-05-19 21:00:46 +00002396 sigvec strcasecmp strerror strftime stricmp strncasecmp \
Bram Moolenaar0cb032e2005-04-23 20:52:00 +00002397 strnicmp strpbrk strtol tgetent towlower towupper iswupper \
2398 usleep utime utimes)
Bram Moolenaar071d4272004-06-13 20:20:40 +00002399
2400dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
2401AC_MSG_CHECKING(for st_blksize)
2402AC_TRY_COMPILE(
2403[#include <sys/types.h>
2404#include <sys/stat.h>],
2405[ struct stat st;
2406 int n;
2407
2408 stat("/", &st);
2409 n = (int)st.st_blksize;],
2410 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
2411 AC_MSG_RESULT(no))
2412
2413AC_MSG_CHECKING(whether stat() ignores a trailing slash)
2414AC_TRY_RUN(
2415[#include <sys/types.h>
2416#include <sys/stat.h>
2417main() {struct stat st; exit(stat("configure/", &st) != 0); }],
2418 AC_MSG_RESULT(yes); AC_DEFINE(STAT_IGNORES_SLASH),
2419 AC_MSG_RESULT(no), AC_MSG_ERROR(failed to compile test program))
2420
2421dnl Link with iconv for charset translation, if not found without library.
2422dnl check for iconv() requires including iconv.h
2423dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
2424dnl has been installed.
2425AC_MSG_CHECKING(for iconv_open())
2426save_LIBS="$LIBS"
2427LIBS="$LIBS -liconv"
2428AC_TRY_LINK([
2429#ifdef HAVE_ICONV_H
2430# include <iconv.h>
2431#endif
2432 ], [iconv_open("fr", "to");],
2433 AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
2434 LIBS="$save_LIBS"
2435 AC_TRY_LINK([
2436#ifdef HAVE_ICONV_H
2437# include <iconv.h>
2438#endif
2439 ], [iconv_open("fr", "to");],
2440 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
2441 AC_MSG_RESULT(no)))
2442
2443
2444AC_MSG_CHECKING(for nl_langinfo(CODESET))
2445AC_TRY_LINK([
2446#ifdef HAVE_LANGINFO_H
2447# include <langinfo.h>
2448#endif
2449], [char *cs = nl_langinfo(CODESET);],
2450 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
2451 AC_MSG_RESULT(no))
2452
2453dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
2454dnl when -lacl works, also try to use -lattr (required for Debian).
2455AC_MSG_CHECKING(--disable-acl argument)
2456AC_ARG_ENABLE(acl,
2457 [ --disable-acl Don't check for ACL support.],
2458 , [enable_acl="yes"])
2459if test "$enable_acl" = "yes"; then
2460AC_MSG_RESULT(no)
2461AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
2462 AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
2463 AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
2464
2465AC_MSG_CHECKING(for POSIX ACL support)
2466AC_TRY_LINK([
2467#include <sys/types.h>
2468#ifdef HAVE_SYS_ACL_H
2469# include <sys/acl.h>
2470#endif
2471acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
2472 acl_set_file("foo", ACL_TYPE_ACCESS, acl);
2473 acl_free(acl);],
2474 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
2475 AC_MSG_RESULT(no))
2476
2477AC_MSG_CHECKING(for Solaris ACL support)
2478AC_TRY_LINK([
2479#ifdef HAVE_SYS_ACL_H
2480# include <sys/acl.h>
2481#endif], [acl("foo", GETACLCNT, 0, NULL);
2482 ],
2483 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
2484 AC_MSG_RESULT(no))
2485
2486AC_MSG_CHECKING(for AIX ACL support)
2487AC_TRY_LINK([
2488#ifdef HAVE_SYS_ACL_H
2489# include <sys/acl.h>
2490#endif
2491#ifdef HAVE_SYS_ACCESS_H
2492# include <sys/access.h>
2493#endif
2494#define _ALL_SOURCE
2495
2496#include <sys/stat.h>
2497
2498int aclsize;
2499struct acl *aclent;], [aclsize = sizeof(struct acl);
2500 aclent = (void *)malloc(aclsize);
2501 statacl("foo", STX_NORMAL, aclent, aclsize);
2502 ],
2503 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
2504 AC_MSG_RESULT(no))
2505else
2506 AC_MSG_RESULT(yes)
2507fi
2508
2509AC_MSG_CHECKING(--disable-gpm argument)
2510AC_ARG_ENABLE(gpm,
2511 [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
2512 [enable_gpm="yes"])
2513
2514if test "$enable_gpm" = "yes"; then
2515 AC_MSG_RESULT(no)
2516 dnl Checking if gpm support can be compiled
2517 AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
2518 [olibs="$LIBS" ; LIBS="-lgpm"]
2519 AC_TRY_LINK(
2520 [#include <gpm.h>
2521 #include <linux/keyboard.h>],
2522 [Gpm_GetLibVersion(NULL);],
2523 dnl Configure defines HAVE_GPM, if it is defined feature.h defines
2524 dnl FEAT_MOUSE_GPM if mouse support is included
2525 [vi_cv_have_gpm=yes],
2526 [vi_cv_have_gpm=no])
2527 [LIBS="$olibs"]
2528 )
2529 if test $vi_cv_have_gpm = yes; then
2530 LIBS="$LIBS -lgpm"
2531 AC_DEFINE(HAVE_GPM)
2532 fi
2533else
2534 AC_MSG_RESULT(yes)
2535fi
2536
Bram Moolenaar071d4272004-06-13 20:20:40 +00002537dnl rename needs to be checked separately to work on Nextstep with cc
2538AC_MSG_CHECKING(for rename)
2539AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
2540 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
2541 AC_MSG_RESULT(no))
2542
2543dnl sysctl() may exist but not the arguments we use
2544AC_MSG_CHECKING(for sysctl)
2545AC_TRY_COMPILE(
2546[#include <sys/types.h>
2547#include <sys/sysctl.h>],
2548[ int mib[2], r;
2549 size_t len;
2550
2551 mib[0] = CTL_HW;
2552 mib[1] = HW_USERMEM;
2553 len = sizeof(r);
2554 (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
2555 ],
2556 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
2557 AC_MSG_RESULT(not usable))
2558
2559dnl sysinfo() may exist but not be Linux compatible
2560AC_MSG_CHECKING(for sysinfo)
2561AC_TRY_COMPILE(
2562[#include <sys/types.h>
2563#include <sys/sysinfo.h>],
2564[ struct sysinfo sinfo;
2565 int t;
2566
2567 (void)sysinfo(&sinfo);
2568 t = sinfo.totalram;
2569 ],
2570 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
2571 AC_MSG_RESULT(not usable))
2572
2573dnl sysconf() may exist but not support what we want to use
2574AC_MSG_CHECKING(for sysconf)
2575AC_TRY_COMPILE(
2576[#include <unistd.h>],
2577[ (void)sysconf(_SC_PAGESIZE);
2578 (void)sysconf(_SC_PHYS_PAGES);
2579 ],
2580 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
2581 AC_MSG_RESULT(not usable))
2582
2583dnl Our own version of AC_CHECK_SIZEOF(int); fixes a bug when sizeof() can't
2584dnl be printed with "%d", and avoids a warning for cross-compiling.
2585
2586AC_MSG_CHECKING(size of int)
2587AC_CACHE_VAL(ac_cv_sizeof_int,
2588 [AC_TRY_RUN([#include <stdio.h>
2589 main()
2590 {
2591 FILE *f=fopen("conftestval", "w");
2592 if (!f) exit(1);
2593 fprintf(f, "%d\n", (int)sizeof(int));
2594 exit(0);
2595 }],
2596 ac_cv_sizeof_int=`cat conftestval`,
2597 ac_cv_sizeof_int=0,
2598 AC_MSG_ERROR(failed to compile test program))])
2599AC_MSG_RESULT($ac_cv_sizeof_int)
2600AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int)
2601
2602AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps)
2603[bcopy_test_prog='
2604main() {
2605 char buf[10];
2606 strcpy(buf, "abcdefghi");
2607 mch_memmove(buf, buf + 2, 3);
2608 if (strncmp(buf, "ababcf", 6))
2609 exit(1);
2610 strcpy(buf, "abcdefghi");
2611 mch_memmove(buf + 2, buf, 3);
2612 if (strncmp(buf, "cdedef", 6))
2613 exit(1);
2614 exit(0); /* libc version works properly. */
2615}']
2616
2617dnl Check for memmove() before bcopy(), makes memmove() be used when both are
2618dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
2619
2620AC_TRY_RUN([#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog],
2621 AC_DEFINE(USEMEMMOVE) AC_MSG_RESULT(memmove does),
2622 AC_TRY_RUN([#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog],
2623 AC_DEFINE(USEBCOPY) AC_MSG_RESULT(bcopy does),
2624 AC_TRY_RUN([#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog],
2625 AC_DEFINE(USEMEMCPY) AC_MSG_RESULT(memcpy does), AC_MSG_RESULT(no),
2626 AC_MSG_ERROR(failed to compile test program)),
2627 AC_MSG_ERROR(failed to compile test program)),
2628 AC_MSG_ERROR(failed to compile test program))
2629
2630dnl Check for multibyte locale functions
2631dnl Find out if _Xsetlocale() is supported by libX11.
2632dnl Check if X_LOCALE should be defined.
2633
2634if test "$enable_multibyte" = "yes"; then
2635 cflags_save=$CFLAGS
2636 ldflags_save=$LDFLAGS
2637 if test -n "$x_includes" ; then
2638 CFLAGS="$CFLAGS -I$x_includes"
2639 LDFLAGS="$X_LIBS $LDFLAGS -lX11"
2640 AC_MSG_CHECKING(whether X_LOCALE needed)
2641 AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
2642 AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
2643 AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
2644 AC_MSG_RESULT(no))
2645 fi
2646 CFLAGS=$cflags_save
2647 LDFLAGS=$ldflags_save
2648fi
2649
2650dnl Link with xpg4, it is said to make Korean locale working
2651AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
2652
2653dnl Check how we can run ctags
2654dnl --version for Exuberant ctags (preferred)
2655dnl -t for typedefs (many ctags have this)
2656dnl -s for static functions (Elvis ctags only?)
2657dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
2658dnl -i+m to test for older Exuberant ctags
2659AC_MSG_CHECKING(how to create tags)
2660test -f tags && mv tags tags.save
2661if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
Bram Moolenaar78984f52005-08-01 07:19:10 +00002662 TAGPRG="ctags -I INIT+"
Bram Moolenaar071d4272004-06-13 20:20:40 +00002663else
2664 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
2665 (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
2666 (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
2667 (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
2668 (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
2669 (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
2670 (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
2671fi
2672test -f tags.save && mv tags.save tags
2673AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
2674
2675dnl Check how we can run man with a section number
2676AC_MSG_CHECKING(how to run man with a section nr)
2677MANDEF="man"
2678(eval man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
2679AC_MSG_RESULT($MANDEF)
2680if test "$MANDEF" = "man -s"; then
2681 AC_DEFINE(USEMAN_S)
2682fi
2683
2684dnl Check if gettext() is working and if it needs -lintl
2685AC_MSG_CHECKING(--disable-nls argument)
2686AC_ARG_ENABLE(nls,
2687 [ --disable-nls Don't support NLS (gettext()).], ,
2688 [enable_nls="yes"])
2689
2690if test "$enable_nls" = "yes"; then
2691 AC_MSG_RESULT(no)
Bram Moolenaar2389c3c2005-05-22 22:07:59 +00002692
2693 INSTALL_LANGS=install-languages
2694 AC_SUBST(INSTALL_LANGS)
2695 INSTALL_TOOL_LANGS=install-tool-languages
2696 AC_SUBST(INSTALL_TOOL_LANGS)
2697
Bram Moolenaar071d4272004-06-13 20:20:40 +00002698 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
2699 AC_MSG_CHECKING([for NLS])
2700 if test -f po/Makefile; then
2701 have_gettext="no"
2702 if test -n "$MSGFMT"; then
2703 AC_TRY_LINK(
2704 [#include <libintl.h>],
2705 [gettext("Test");],
2706 AC_MSG_RESULT([gettext() works]); have_gettext="yes",
2707 olibs=$LIBS
2708 LIBS="$LIBS -lintl"
2709 AC_TRY_LINK(
2710 [#include <libintl.h>],
2711 [gettext("Test");],
2712 AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes",
2713 AC_MSG_RESULT([gettext() doesn't work]);
2714 LIBS=$olibs))
2715 else
2716 AC_MSG_RESULT([msgfmt not found - disabled]);
2717 fi
2718 if test $have_gettext = "yes"; then
2719 AC_DEFINE(HAVE_GETTEXT)
2720 MAKEMO=yes
2721 AC_SUBST(MAKEMO)
2722 dnl this was added in GNU gettext 0.10.36
2723 AC_CHECK_FUNCS(bind_textdomain_codeset)
2724 dnl _nl_msg_cat_cntr is required for GNU gettext
2725 AC_MSG_CHECKING([for _nl_msg_cat_cntr])
2726 AC_TRY_LINK(
2727 [#include <libintl.h>
2728 extern int _nl_msg_cat_cntr;],
2729 [++_nl_msg_cat_cntr;],
2730 AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
2731 AC_MSG_RESULT([no]))
2732 fi
2733 else
2734 AC_MSG_RESULT([no "po/Makefile" - disabled]);
2735 fi
2736else
2737 AC_MSG_RESULT(yes)
2738fi
2739
2740dnl Check for dynamic linking loader
2741AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
2742if test x${DLL} = xdlfcn.h; then
2743 AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
2744 AC_MSG_CHECKING([for dlopen()])
2745 AC_TRY_LINK(,[
2746 extern void* dlopen();
2747 dlopen();
2748 ],
2749 AC_MSG_RESULT(yes);
2750 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
2751 AC_MSG_RESULT(no);
2752 AC_MSG_CHECKING([for dlopen() in -ldl])
2753 olibs=$LIBS
2754 LIBS="$LIBS -ldl"
2755 AC_TRY_LINK(,[
2756 extern void* dlopen();
2757 dlopen();
2758 ],
2759 AC_MSG_RESULT(yes);
2760 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
2761 AC_MSG_RESULT(no);
2762 LIBS=$olibs))
2763 dnl ReliantUNIX has dlopen() in libc but everything else in libdl
2764 dnl ick :-)
2765 AC_MSG_CHECKING([for dlsym()])
2766 AC_TRY_LINK(,[
2767 extern void* dlsym();
2768 dlsym();
2769 ],
2770 AC_MSG_RESULT(yes);
2771 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
2772 AC_MSG_RESULT(no);
2773 AC_MSG_CHECKING([for dlsym() in -ldl])
2774 olibs=$LIBS
2775 LIBS="$LIBS -ldl"
2776 AC_TRY_LINK(,[
2777 extern void* dlsym();
2778 dlsym();
2779 ],
2780 AC_MSG_RESULT(yes);
2781 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
2782 AC_MSG_RESULT(no);
2783 LIBS=$olibs))
2784elif test x${DLL} = xdl.h; then
2785 AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
2786 AC_MSG_CHECKING([for shl_load()])
2787 AC_TRY_LINK(,[
2788 extern void* shl_load();
2789 shl_load();
2790 ],
2791 AC_MSG_RESULT(yes);
2792 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
2793 AC_MSG_RESULT(no);
2794 AC_MSG_CHECKING([for shl_load() in -ldld])
2795 olibs=$LIBS
2796 LIBS="$LIBS -ldld"
2797 AC_TRY_LINK(,[
2798 extern void* shl_load();
2799 shl_load();
2800 ],
2801 AC_MSG_RESULT(yes);
2802 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
2803 AC_MSG_RESULT(no);
2804 LIBS=$olibs))
2805fi
2806AC_CHECK_HEADERS(setjmp.h)
2807
2808if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
2809 dnl -ldl must come after DynaLoader.a
2810 if echo $LIBS | grep -e '-ldl' >/dev/null; then
2811 LIBS=`echo $LIBS | sed s/-ldl//`
2812 PERL_LIBS="$PERL_LIBS -ldl"
2813 fi
2814fi
2815
2816if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \
2817 && test "x$GUITYPE" != "xCARBONGUI"; then
2818 AC_MSG_CHECKING(whether we need -framework Carbon)
2819 dnl check for MACOSX without Carbon GUI, but with FEAT_MBYTE
2820 if test "x$enable_multibyte" = "xyes" || test "x$features" == "xbig" \
2821 || test "x$features" = "xhuge"; then
2822 LIBS="$LIBS -framework Carbon"
2823 AC_MSG_RESULT(yes)
2824 else
2825 AC_MSG_RESULT(no)
2826 fi
2827fi
Bram Moolenaare224ffa2006-03-01 00:01:28 +00002828if test "x$MACARCH" = "xboth"; then
2829 LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
2830fi
Bram Moolenaar071d4272004-06-13 20:20:40 +00002831
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +00002832dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
2833dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
2834dnl But only when making dependencies, cproto and lint don't take "-isystem".
Bram Moolenaar32466aa2006-02-24 23:53:04 +00002835dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
2836dnl the number before the version number.
Bram Moolenaara5792f52005-11-23 21:25:05 +00002837AC_MSG_CHECKING(for GCC 3 or later)
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +00002838DEPEND_CFLAGS_FILTER=
2839if test "$GCC" = yes; then
Bram Moolenaar2217cae2006-03-25 21:55:52 +00002840 gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
Bram Moolenaarf740b292006-02-16 22:11:02 +00002841 if test "$gccmajor" -gt "2"; then
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +00002842 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
2843 fi
2844fi
Bram Moolenaara5792f52005-11-23 21:25:05 +00002845if test "$DEPEND_CFLAGS_FILTER" = ""; then
2846 AC_MSG_RESULT(no)
2847else
2848 AC_MSG_RESULT(yes)
2849fi
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +00002850AC_SUBST(DEPEND_CFLAGS_FILTER)
Bram Moolenaar071d4272004-06-13 20:20:40 +00002851
2852dnl write output files
2853AC_OUTPUT(auto/config.mk:config.mk.in)
2854
2855dnl vim: set sw=2 tw=78 fo+=l: