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