1 dnl configure.in: autoconf script for Vim
3 dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
4 dnl Should also work with autoconf 2.54 and later.
7 AC_CONFIG_HEADER(auto/config.h:config.h.in)
9 dnl Being able to run configure means the system is Unix (compatible).
13 dnl Checks for programs.
14 AC_PROG_CC dnl required by almost everything
15 AC_PROG_CPP dnl required by header file checks
16 AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
17 AC_ISC_POSIX dnl required by AC_C_CROSS
18 AC_PROG_AWK dnl required for "make html" in ../doc
20 dnl Don't strip if we don't have it
21 AC_CHECK_PROG(STRIP, strip, strip, :)
23 dnl Check for extension of executables
26 dnl Check for standard headers. We don't use this in Vim but other stuff
27 dnl in autoconf needs it, where it uses STDC_HEADERS.
31 dnl Check for the flag that fails if stuff are missing.
33 AC_MSG_CHECKING(--enable-fail-if-missing argument)
34 AC_ARG_ENABLE(fail_if_missing,
35 [ --enable-fail-if-missing Fail if dependencies on additional features
36 specified on the command line are missing.],
37 [fail_if_missing="yes"],
38 [fail_if_missing="no"])
39 AC_MSG_RESULT($fail_if_missing)
41 dnl Set default value for CFLAGS if none is defined or it's empty
42 if test -z "$CFLAGS"; then
44 test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
46 if test "$GCC" = yes; then
47 dnl method that should work for nearly all versions
48 gccversion=`"$CC" -dumpversion`
49 if test "x$gccversion" = "x"; then
50 dnl old method; fall-back for when -dumpversion doesn't work
51 gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
53 dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
54 if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
55 echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
56 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
58 if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
59 echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
60 CFLAGS="$CFLAGS -fno-strength-reduce"
65 dnl If configure thinks we are cross compiling, there might be something
66 dnl wrong with the CC or CFLAGS settings, give a useful warning message
67 if test "$cross_compiling" = yes; then
68 AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS])
71 dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
72 dnl But gcc 3.1 changed the meaning! See near the end.
73 test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
75 if test -f ./toolcheck; then
76 AC_CHECKING(for buggy tools)
77 sh ./toolcheck 1>&AC_FD_MSG
80 OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
82 dnl Check for BeOS, which needs an extra source file
83 AC_MSG_CHECKING(for BeOS)
85 BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
86 BEOS=yes; AC_MSG_RESULT(yes);;
87 *) BEOS=no; AC_MSG_RESULT(no);;
90 dnl If QNX is found, assume we don't want to use Xphoton
91 dnl unless it was specifically asked for (--with-x)
92 AC_MSG_CHECKING(for QNX)
94 QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
95 test -z "$with_x" && with_x=no
96 QNX=yes; AC_MSG_RESULT(yes);;
97 *) QNX=no; AC_MSG_RESULT(no);;
100 dnl Check for Darwin and MacOS X
101 dnl We do a check for MacOS X in the very beginning because there
102 dnl are a lot of other things we need to change besides GUI stuff
103 AC_MSG_CHECKING([for Darwin (Mac OS X)])
104 if test "`(uname) 2>/dev/null`" = Darwin; then
107 AC_MSG_CHECKING(--disable-darwin argument)
108 AC_ARG_ENABLE(darwin,
109 [ --disable-darwin Disable Darwin (Mac OS X) support.],
110 , [enable_darwin="yes"])
111 if test "$enable_darwin" = "yes"; then
113 AC_MSG_CHECKING(if Darwin files are there)
114 if test -f os_macosx.m; then
117 AC_MSG_RESULT([no, Darwin support disabled])
121 AC_MSG_RESULT([yes, Darwin support excluded])
124 AC_MSG_CHECKING(--with-mac-arch argument)
125 AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
126 MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
127 MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
129 AC_MSG_CHECKING(--with-developer-dir argument)
130 AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools],
131 DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
132 DEVELOPER_DIR=""; AC_MSG_RESULT(not present))
134 if test "x$DEVELOPER_DIR" = "x"; then
135 AC_PATH_PROG(XCODE_SELECT, xcode-select)
136 if test "x$XCODE_SELECT" != "x"; then
137 AC_MSG_CHECKING(for developer dir using xcode-select)
138 DEVELOPER_DIR=`$XCODE_SELECT -print-path`
139 AC_MSG_RESULT([$DEVELOPER_DIR])
141 DEVELOPER_DIR=/Developer
145 if test "x$MACARCH" = "xboth"; then
146 AC_MSG_CHECKING(for 10.4 universal SDK)
147 dnl There is a terrible inconsistency (but we appear to get away with it):
148 dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
149 dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
150 dnl tests using the preprocessor are actually done with the wrong header
151 dnl files. $LDFLAGS is set at the end, because configure uses it together
152 dnl with $CFLAGS and we can only have one -sysroot argument.
153 save_cppflags="$CPPFLAGS"
154 save_cflags="$CFLAGS"
155 save_ldflags="$LDFLAGS"
156 CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
157 AC_TRY_LINK([ ], [ ],
158 AC_MSG_RESULT(found, will make universal binary),
160 AC_MSG_RESULT(not found)
161 CFLAGS="$save_cflags"
162 AC_MSG_CHECKING(if Intel architecture is supported)
163 CPPFLAGS="$CPPFLAGS -arch i386"
164 LDFLAGS="$save_ldflags -arch i386"
165 AC_TRY_LINK([ ], [ ],
166 AC_MSG_RESULT(yes); MACARCH="intel",
167 AC_MSG_RESULT(no, using PowerPC)
169 CPPFLAGS="$save_cppflags -arch ppc"
170 LDFLAGS="$save_ldflags -arch ppc"))
171 elif test "x$MACARCH" = "xintel"; then
172 CPPFLAGS="$CPPFLAGS -arch intel"
173 LDFLAGS="$LDFLAGS -arch intel"
174 elif test "x$MACARCH" = "xppc"; then
175 CPPFLAGS="$CPPFLAGS -arch ppc"
176 LDFLAGS="$LDFLAGS -arch ppc"
179 if test "$enable_darwin" = "yes"; then
181 OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
182 OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
183 dnl TODO: use -arch i386 on Intel machines
184 CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
186 dnl If Carbon is found, assume we don't want X11
187 dnl unless it was specifically asked for (--with-x)
188 dnl or Motif, Athena or GTK GUI is used.
189 AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
190 if test "x$CARBON" = "xyes"; then
191 if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then
197 dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
198 dnl free. This happens in expand_filename(), because the optimizer swaps
199 dnl two blocks of code, both using "repl", that can't be swapped.
200 if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
201 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
208 AC_SUBST(OS_EXTRA_SRC)
209 AC_SUBST(OS_EXTRA_OBJ)
211 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
212 dnl Only when the directory exists and it wasn't there yet.
213 dnl For gcc don't do this when it is already in the default search path.
214 dnl Skip all of this when cross-compiling.
215 if test "$cross_compiling" = no; then
216 AC_MSG_CHECKING(--with-local-dir argument)
217 have_local_include=''
219 AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries.
220 --without-local-dir do not search /usr/local for local libraries.], [
225 # avoid adding local dir to LDFLAGS and CPPFLAGS
226 have_local_include=yes
229 *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;;
231 AC_MSG_RESULT($local_dir)
234 AC_MSG_RESULT(Defaulting to $local_dir)
236 if test "$GCC" = yes -a "$local_dir" != no; then
237 echo 'void f(){}' > conftest.c
238 dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler)
239 have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
240 have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
241 rm -f conftest.c conftest.o
243 if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then
244 tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"`
245 if test "$tt" = "$LDFLAGS"; then
246 LDFLAGS="$LDFLAGS -L${local_dir}/lib"
249 if test -z "$have_local_include" -a -d "${local_dir}/include"; then
250 tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
251 if test "$tt" = "$CPPFLAGS"; then
252 CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
257 AC_MSG_CHECKING(--with-vim-name argument)
258 AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
259 VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
260 VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
262 AC_MSG_CHECKING(--with-ex-name argument)
263 AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
264 EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
265 EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
267 AC_MSG_CHECKING(--with-view-name argument)
268 AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
269 VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
270 VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
273 AC_MSG_CHECKING(--with-global-runtime argument)
274 AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
275 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
278 AC_MSG_CHECKING(--with-modified-by argument)
279 AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
280 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
283 dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix
284 AC_MSG_CHECKING(if character set is EBCDIC)
286 [ /* TryCompile function for CharSet.
287 Treat any failure as ASCII for compatibility with existing art.
288 Use compile-time rather than run-time tests for cross-compiler
291 make an error "Character set is not EBCDIC"
293 [ # TryCompile action if true
295 [ # TryCompile action if false
297 # end of TryCompile ])
298 # end of CacheVal CvEbcdic
299 AC_MSG_RESULT($cf_cv_ebcdic)
300 case "$cf_cv_ebcdic" in #(vi
301 yes) AC_DEFINE(EBCDIC)
304 *) line_break='"\\012"';;
308 if test "$cf_cv_ebcdic" = "yes"; then
309 dnl If we have EBCDIC we most likley have z/OS Unix, let's test it!
310 AC_MSG_CHECKING(for z/OS Unix)
312 OS/390) zOSUnix="yes";
313 dnl If using cc the environment variable _CC_CCMODE must be
314 dnl set to "1", so that some compiler extensions are enabled.
315 dnl If using c89 the environment variable is named _CC_C89MODE.
316 dnl Note: compile with c89 never tested.
317 if test "$CC" = "cc"; then
321 if test "$CC" = "c89"; then
328 if test "$ccm" != "1"; then
330 echo "------------------------------------------"
331 echo " On z/OS Unix, the environment variable"
332 echo " __CC_${ccn}MODE must be set to \"1\"!"
334 echo " export _CC_${ccn}MODE=1"
335 echo " and then call configure again."
336 echo "------------------------------------------"
339 CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)";
340 LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
349 dnl Set QUOTESED. Needs additional backslashes on zOS
350 if test "$zOSUnix" = "yes"; then
351 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'"
353 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'"
358 dnl Link with -lselinux for SELinux stuff; if not found
359 AC_MSG_CHECKING(--disable-selinux argument)
360 AC_ARG_ENABLE(selinux,
361 [ --disable-selinux Don't check for SELinux support.],
362 , enable_selinux="yes")
363 if test "$enable_selinux" = "yes"; then
365 AC_CHECK_LIB(selinux, is_selinux_enabled,
366 [LIBS="$LIBS -lselinux"
367 AC_DEFINE(HAVE_SELINUX)])
372 dnl Check user requested features.
374 AC_MSG_CHECKING(--with-features argument)
375 AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)],
376 features="$withval"; AC_MSG_RESULT($features),
377 features="normal"; AC_MSG_RESULT(Defaulting to normal))
382 tiny) AC_DEFINE(FEAT_TINY) ;;
383 small) AC_DEFINE(FEAT_SMALL) ;;
384 normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
385 dogvimdiff="installgvimdiff" ;;
386 big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
387 dogvimdiff="installgvimdiff" ;;
388 huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
389 dogvimdiff="installgvimdiff" ;;
390 *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
396 AC_MSG_CHECKING(--with-compiledby argument)
397 AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
398 compiledby="$withval"; AC_MSG_RESULT($withval),
399 compiledby=""; AC_MSG_RESULT(no))
402 AC_MSG_CHECKING(--disable-xsmp argument)
404 [ --disable-xsmp Disable XSMP session management],
407 if test "$enable_xsmp" = "yes"; then
409 AC_MSG_CHECKING(--disable-xsmp-interact argument)
410 AC_ARG_ENABLE(xsmp-interact,
411 [ --disable-xsmp-interact Disable XSMP interaction],
412 , enable_xsmp_interact="yes")
413 if test "$enable_xsmp_interact" = "yes"; then
415 AC_DEFINE(USE_XSMP_INTERACT)
423 dnl Check for Lua feature.
424 AC_MSG_CHECKING(--enable-luainterp argument)
425 AC_ARG_ENABLE(luainterp,
426 [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
427 [enable_luainterp="no"])
428 AC_MSG_RESULT($enable_luainterp)
430 if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
431 dnl -- find the lua executable
432 AC_SUBST(vi_cv_path_lua)
434 AC_MSG_CHECKING(--with-lua-prefix argument)
435 AC_ARG_WITH(lua_prefix,
436 [ --with-lua-prefix=PFX Prefix where Lua is installed.],
437 with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
438 with_lua_prefix="";AC_MSG_RESULT(no))
440 if test "X$with_lua_prefix" != "X"; then
441 vi_cv_path_lua_pfx="$with_lua_prefix"
443 AC_MSG_CHECKING(LUA_PREFIX environment var)
444 if test "X$LUA_PREFIX" != "X"; then
445 AC_MSG_RESULT("$LUA_PREFIX")
446 vi_cv_path_lua_pfx="$LUA_PREFIX"
448 AC_MSG_RESULT([not set, default to /usr])
449 vi_cv_path_lua_pfx="/usr"
454 if test "X$vi_cv_path_lua_pfx" != "X"; then
455 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
456 if test -f $vi_cv_path_lua_pfx/include/lua.h; then
460 dnl -- try to find Lua executable
461 AC_PATH_PROG(vi_cv_path_lua, lua)
462 if test "X$vi_cv_path_lua" != "X"; then
463 dnl -- find Lua version
464 AC_CACHE_CHECK(Lua version, vi_cv_version_lua,
465 [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
466 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
467 if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
469 LUA_INC=/lua$vi_cv_version_lua
478 if test "X$vi_cv_path_lua_pfx" != "X"; then
479 if test "X$vi_cv_version_lua" != "X"; then
480 dnl Test alternate location using version
481 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
483 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
485 LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}"
487 LUA_OBJ="objects/if_lua.o"
490 if test "$enable_luainterp" = "dynamic"; then
491 dnl Determine the SONAME for the current version, but fallback to
492 dnl liblua${vi_cv_version_lua}.so if no SONAME-versioned file is found.
493 for i in 0 1 2 3 4 5 6 7 8 9; do
494 if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
499 AC_DEFINE(DYNAMIC_LUA)
501 LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
504 if test "$fail_if_missing" = "yes" -a -z "$LUA_SRC"; then
505 AC_MSG_ERROR([could not configure lua])
515 dnl Check for MzScheme feature.
516 AC_MSG_CHECKING(--enable-mzschemeinterp argument)
517 AC_ARG_ENABLE(mzschemeinterp,
518 [ --enable-mzschemeinterp Include MzScheme interpreter.], ,
519 [enable_mzschemeinterp="no"])
520 AC_MSG_RESULT($enable_mzschemeinterp)
522 if test "$enable_mzschemeinterp" = "yes"; then
523 dnl -- find the mzscheme executable
524 AC_SUBST(vi_cv_path_mzscheme)
526 AC_MSG_CHECKING(--with-plthome argument)
528 [ --with-plthome=PLTHOME Use PLTHOME.],
529 with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
530 with_plthome="";AC_MSG_RESULT("no"))
532 if test "X$with_plthome" != "X"; then
533 vi_cv_path_mzscheme_pfx="$with_plthome"
535 AC_MSG_CHECKING(PLTHOME environment var)
536 if test "X$PLTHOME" != "X"; then
537 AC_MSG_RESULT("$PLTHOME")
538 vi_cv_path_mzscheme_pfx="$PLTHOME"
540 AC_MSG_RESULT(not set)
541 dnl -- try to find MzScheme executable
542 AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
544 dnl resolve symbolic link, the executable is often elsewhere and there
545 dnl are no links for the include files.
546 if test "X$vi_cv_path_mzscheme" != "X"; then
547 lsout=`ls -l $vi_cv_path_mzscheme`
548 if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
549 vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
553 if test "X$vi_cv_path_mzscheme" != "X"; then
554 dnl -- find where MzScheme thinks it was installed
555 AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
556 dnl different versions of MzScheme differ in command line processing
557 dnl use universal approach
558 echo "(display (simplify-path \
559 (build-path (call-with-values \
560 (lambda () (split-path (find-system-path (quote exec-file)))) \
561 (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
562 dnl Remove a trailing slash
563 [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
571 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
572 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
573 if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
574 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
578 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
579 if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
581 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
584 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
585 if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then
587 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
590 AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
591 if test -f /usr/include/plt/scheme.h; then
593 SCHEME_INC=/usr/include/plt
596 AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
597 if test -f /usr/include/racket/scheme.h; then
599 SCHEME_INC=/usr/include/racket
602 vi_cv_path_mzscheme_pfx=
610 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
611 if test "x$MACOSX" = "xyes"; then
612 MZSCHEME_LIBS="-framework PLT_MzScheme"
613 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
614 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
615 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
616 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then
617 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"
618 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
619 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then
620 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
621 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then
622 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
624 dnl Using shared objects
625 if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
626 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
627 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
628 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then
629 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m"
630 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
631 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then
632 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc"
634 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
636 if test "$GCC" = yes; then
637 dnl Make Vim remember the path to the library. For when it's not in
638 dnl $LD_LIBRARY_PATH.
639 MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
640 elif test "`(uname) 2>/dev/null`" = SunOS &&
641 uname -r | grep '^5' >/dev/null; then
642 MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
645 if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
646 SCHEME_COLLECTS=lib/plt/
648 if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then
649 SCHEME_COLLECTS=lib/racket/
652 if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
653 MZSCHEME_EXTRA="mzscheme_base.c"
655 if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then
656 MZSCHEME_EXTRA="mzscheme_base.c"
659 if test "X$MZSCHEME_EXTRA" != "X" ; then
660 dnl need to generate bytecode for MzScheme base
661 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
662 MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
664 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
665 -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
666 MZSCHEME_SRC="if_mzsch.c"
667 MZSCHEME_OBJ="objects/if_mzsch.o"
668 MZSCHEME_PRO="if_mzsch.pro"
669 AC_DEFINE(FEAT_MZSCHEME)
671 AC_SUBST(MZSCHEME_SRC)
672 AC_SUBST(MZSCHEME_OBJ)
673 AC_SUBST(MZSCHEME_PRO)
674 AC_SUBST(MZSCHEME_LIBS)
675 AC_SUBST(MZSCHEME_CFLAGS)
676 AC_SUBST(MZSCHEME_EXTRA)
677 AC_SUBST(MZSCHEME_MZC)
681 AC_MSG_CHECKING(--enable-perlinterp argument)
682 AC_ARG_ENABLE(perlinterp,
683 [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
684 [enable_perlinterp="no"])
685 AC_MSG_RESULT($enable_perlinterp)
686 if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
687 AC_SUBST(vi_cv_path_perl)
688 AC_PATH_PROG(vi_cv_path_perl, perl)
689 if test "X$vi_cv_path_perl" != "X"; then
690 AC_MSG_CHECKING(Perl version)
691 if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
692 eval `$vi_cv_path_perl -V:usethreads`
693 eval `$vi_cv_path_perl -V:libperl`
694 if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
697 if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
698 eval `$vi_cv_path_perl -V:use5005threads`
699 if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
703 AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
707 AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
710 if test $badthreads = no; then
712 eval `$vi_cv_path_perl -V:shrpenv`
713 if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
716 vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
717 AC_SUBST(vi_cv_perllib)
718 dnl Remove "-fno-something", it breaks using cproto.
719 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
720 -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
721 dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
722 perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
723 sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
724 -e 's/-bE:perl.exp//' -e 's/-lc //'`
725 dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
726 dnl a test in configure may fail because of that.
727 perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
728 -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
730 dnl check that compiling a simple program still works with the flags
732 AC_MSG_CHECKING([if compile and link flags for Perl are sane])
735 ldflags_save=$LDFLAGS
736 CFLAGS="$CFLAGS $perlcppflags"
737 LIBS="$LIBS $perllibs"
738 LDFLAGS="$perlldflags $LDFLAGS"
740 AC_MSG_RESULT(yes); perl_ok=yes,
741 AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
744 LDFLAGS=$ldflags_save
745 if test $perl_ok = yes; then
746 if test "X$perlcppflags" != "X"; then
747 dnl remove -pipe and -Wxxx, it confuses cproto
748 PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'`
750 if test "X$perlldflags" != "X"; then
751 LDFLAGS="$perlldflags $LDFLAGS"
754 PERL_SRC="auto/if_perl.c if_perlsfio.c"
755 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
756 PERL_PRO="if_perl.pro if_perlsfio.pro"
761 AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
765 if test "x$MACOSX" = "xyes"; then
766 dnl Mac OS X 10.2 or later
767 dir=/System/Library/Perl
768 darwindir=$dir/darwin
769 if test -d $darwindir; then
773 dir=/System/Library/Perl/5.8.1
774 darwindir=$dir/darwin-thread-multi-2level
775 if test -d $darwindir; then
779 if test -n "$PERL"; then
781 PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
782 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
783 PERL_LIBS="-L$darwindir/CORE -lperl"
785 dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
786 dnl be included if requested by passing --with-mac-arch to
787 dnl configure, so strip these flags first (if present)
788 PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
789 PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
791 if test "$enable_perlinterp" = "dynamic"; then
792 if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
793 AC_DEFINE(DYNAMIC_PERL)
794 PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS"
798 if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then
799 AC_MSG_ERROR([could not configure perl])
806 AC_SUBST(PERL_CFLAGS)
809 AC_MSG_CHECKING(--enable-pythoninterp argument)
810 AC_ARG_ENABLE(pythoninterp,
811 [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
812 [enable_pythoninterp="no"])
813 AC_MSG_RESULT($enable_pythoninterp)
814 if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
815 dnl -- find the python executable
816 AC_PATH_PROG(vi_cv_path_python, python)
817 if test "X$vi_cv_path_python" != "X"; then
819 dnl -- get its version number
820 AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
821 [[vi_cv_var_python_version=`
822 ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
825 dnl -- it must be at least version 1.4
826 AC_MSG_CHECKING(Python is 1.4 or better)
827 if ${vi_cv_path_python} -c \
828 "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
832 dnl -- find where python thinks it was installed
833 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
834 [ vi_cv_path_python_pfx=`
835 ${vi_cv_path_python} -c \
836 "import sys; print sys.prefix"` ])
838 dnl -- and where it thinks it runs
839 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
840 [ vi_cv_path_python_epfx=`
841 ${vi_cv_path_python} -c \
842 "import sys; print sys.exec_prefix"` ])
844 dnl -- python's internal library path
846 AC_CACHE_VAL(vi_cv_path_pythonpath,
847 [ vi_cv_path_pythonpath=`
849 ${vi_cv_path_python} -c \
850 "import sys, string; print string.join(sys.path,':')"` ])
852 dnl -- where the Python implementation library archives are
854 AC_ARG_WITH(python-config-dir,
855 [ --with-python-config-dir=PATH Python's config directory],
856 [ vi_cv_path_python_conf="${withval}" ] )
858 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
860 vi_cv_path_python_conf=
861 for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
862 for subdir in lib64 lib share; do
863 d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
864 if test -d "$d" && test -f "$d/config.c"; then
865 vi_cv_path_python_conf="$d"
871 PYTHON_CONFDIR="${vi_cv_path_python_conf}"
873 if test "X$PYTHON_CONFDIR" = "X"; then
874 AC_MSG_RESULT([can't find it!])
877 dnl -- we need to examine Python's config/Makefile too
878 dnl see what the interpreter is built from
879 AC_CACHE_VAL(vi_cv_path_python_plibs,
882 tmp_mkf="$pwd/config-PyMake$$"
883 cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
885 @echo "python_BASEMODLIBS='$(BASEMODLIBS)'"
886 @echo "python_LIBS='$(LIBS)'"
887 @echo "python_SYSLIBS='$(SYSLIBS)'"
888 @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
889 @echo "python_INSTSONAME='$(INSTSONAME)'"
891 dnl -- delete the lines from make about Entering/Leaving directory
892 eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
893 rm -f -- "${tmp_mkf}"
894 if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
895 "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
896 vi_cv_path_python_plibs="-framework Python"
898 if test "${vi_cv_var_python_version}" = "1.4"; then
899 vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
901 vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
903 vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
904 dnl remove -ltermcap, it can conflict with an earlier -lncurses
905 vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
909 PYTHON_LIBS="${vi_cv_path_python_plibs}"
910 if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
911 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
913 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
915 PYTHON_SRC="if_python.c"
916 dnl For Mac OSX 10.2 config.o is included in the Python library.
917 if test "x$MACOSX" = "xyes"; then
918 PYTHON_OBJ="objects/if_python.o"
920 PYTHON_OBJ="objects/if_python.o objects/py_config.o"
922 if test "${vi_cv_var_python_version}" = "1.4"; then
923 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
925 PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
927 dnl On FreeBSD linking with "-pthread" is required to use threads.
928 dnl _THREAD_SAFE must be used for compiling then.
929 dnl The "-pthread" is added to $LIBS, so that the following check for
930 dnl sigaltstack() will look in libc_r (it's there in libc!).
931 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
932 dnl will then define target-specific defines, e.g., -D_REENTRANT.
933 dnl Don't do this for Mac OSX, -pthread will generate a warning.
934 AC_MSG_CHECKING([if -pthread should be used])
937 dnl if test "x$MACOSX" != "xyes"; then
938 if test "`(uname) 2>/dev/null`" != Darwin; then
939 test "$GCC" = yes && threadsafe_flag="-pthread"
940 if test "`(uname) 2>/dev/null`" = FreeBSD; then
941 threadsafe_flag="-D_THREAD_SAFE"
942 thread_lib="-pthread"
946 if test -n "$threadsafe_flag"; then
948 CFLAGS="$CFLAGS $threadsafe_flag"
949 LIBS="$LIBS $thread_lib"
951 AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
952 AC_MSG_RESULT(no); LIBS=$libs_save_old
959 dnl Check that compiling a simple program still works with the flags
960 dnl added for Python.
961 AC_MSG_CHECKING([if compile and link flags for Python are sane])
964 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
965 LIBS="$LIBS $PYTHON_LIBS"
967 AC_MSG_RESULT(yes); python_ok=yes,
968 AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
971 if test $python_ok = yes; then
972 AC_DEFINE(FEAT_PYTHON)
983 AC_MSG_RESULT(too old)
987 if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then
988 AC_MSG_ERROR([could not configure python])
992 AC_SUBST(PYTHON_CONFDIR)
993 AC_SUBST(PYTHON_LIBS)
994 AC_SUBST(PYTHON_GETPATH_CFLAGS)
995 AC_SUBST(PYTHON_CFLAGS)
1000 AC_MSG_CHECKING(--enable-python3interp argument)
1001 AC_ARG_ENABLE(python3interp,
1002 [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1003 [enable_python3interp="no"])
1004 AC_MSG_RESULT($enable_python3interp)
1005 if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
1006 dnl -- find the python3 executable
1007 AC_PATH_PROG(vi_cv_path_python3, python3)
1008 if test "X$vi_cv_path_python3" != "X"; then
1010 dnl -- get its version number
1011 AC_CACHE_CHECK(Python version,vi_cv_var_python3_version,
1012 [[vi_cv_var_python3_version=`
1013 ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
1016 dnl -- get abiflags for python 3.2 or higher (PEP 3149)
1017 AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
1019 vi_cv_var_python3_abiflags=
1020 if ${vi_cv_path_python3} -c \
1021 "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
1023 vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
1024 "import sys; print(sys.abiflags)"`
1027 dnl -- find where python3 thinks it was installed
1028 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
1029 [ vi_cv_path_python3_pfx=`
1030 ${vi_cv_path_python3} -c \
1031 "import sys; print(sys.prefix)"` ])
1033 dnl -- and where it thinks it runs
1034 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx,
1035 [ vi_cv_path_python3_epfx=`
1036 ${vi_cv_path_python3} -c \
1037 "import sys; print(sys.exec_prefix)"` ])
1039 dnl -- python3's internal library path
1041 AC_CACHE_VAL(vi_cv_path_python3path,
1042 [ vi_cv_path_python3path=`
1044 ${vi_cv_path_python3} -c \
1045 "import sys, string; print(':'.join(sys.path))"` ])
1047 dnl -- where the Python implementation library archives are
1049 AC_ARG_WITH(python3-config-dir,
1050 [ --with-python3-config-dir=PATH Python's config directory],
1051 [ vi_cv_path_python3_conf="${withval}" ] )
1053 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
1055 vi_cv_path_python3_conf=
1057 if test "${vi_cv_var_python3_abiflags}" != ""; then
1058 config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
1060 for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
1061 for subdir in lib64 lib share; do
1062 d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
1063 if test -d "$d" && test -f "$d/config.c"; then
1064 vi_cv_path_python3_conf="$d"
1070 PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
1072 if test "X$PYTHON3_CONFDIR" = "X"; then
1073 AC_MSG_RESULT([can't find it!])
1076 dnl -- we need to examine Python's config/Makefile too
1077 dnl see what the interpreter is built from
1078 AC_CACHE_VAL(vi_cv_path_python3_plibs,
1081 tmp_mkf="$pwd/config-PyMake$$"
1082 cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
1084 @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
1085 @echo "python3_LIBS='$(LIBS)'"
1086 @echo "python3_SYSLIBS='$(SYSLIBS)'"
1087 @echo "python3_INSTSONAME='$(INSTSONAME)'"
1089 dnl -- delete the lines from make about Entering/Leaving directory
1090 eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
1091 rm -f -- "${tmp_mkf}"
1092 vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
1093 vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
1094 dnl remove -ltermcap, it can conflict with an earlier -lncurses
1095 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
1096 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
1099 PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
1100 if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
1101 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
1103 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
1105 PYTHON3_SRC="if_python3.c"
1106 dnl For Mac OSX 10.2 config.o is included in the Python library.
1107 if test "x$MACOSX" = "xyes"; then
1108 PYTHON3_OBJ="objects/if_python3.o"
1110 PYTHON3_OBJ="objects/if_python3.o objects/py3_config.o"
1113 dnl On FreeBSD linking with "-pthread" is required to use threads.
1114 dnl _THREAD_SAFE must be used for compiling then.
1115 dnl The "-pthread" is added to $LIBS, so that the following check for
1116 dnl sigaltstack() will look in libc_r (it's there in libc!).
1117 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
1118 dnl will then define target-specific defines, e.g., -D_REENTRANT.
1119 dnl Don't do this for Mac OSX, -pthread will generate a warning.
1120 AC_MSG_CHECKING([if -pthread should be used])
1123 dnl if test "x$MACOSX" != "xyes"; then
1124 if test "`(uname) 2>/dev/null`" != Darwin; then
1125 test "$GCC" = yes && threadsafe_flag="-pthread"
1126 if test "`(uname) 2>/dev/null`" = FreeBSD; then
1127 threadsafe_flag="-D_THREAD_SAFE"
1128 thread_lib="-pthread"
1132 if test -n "$threadsafe_flag"; then
1134 CFLAGS="$CFLAGS $threadsafe_flag"
1135 LIBS="$LIBS $thread_lib"
1137 AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag",
1138 AC_MSG_RESULT(no); LIBS=$libs_save_old
1145 dnl check that compiling a simple program still works with the flags
1146 dnl added for Python.
1147 AC_MSG_CHECKING([if compile and link flags for Python 3 are sane])
1150 CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
1151 LIBS="$LIBS $PYTHON3_LIBS"
1153 AC_MSG_RESULT(yes); python3_ok=yes,
1154 AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no)
1157 if test "$python3_ok" = yes; then
1158 AC_DEFINE(FEAT_PYTHON3)
1170 AC_SUBST(PYTHON3_CONFDIR)
1171 AC_SUBST(PYTHON3_LIBS)
1172 AC_SUBST(PYTHON3_CFLAGS)
1173 AC_SUBST(PYTHON3_SRC)
1174 AC_SUBST(PYTHON3_OBJ)
1176 dnl if python2.x and python3.x are enabled one can only link in code
1177 dnl with dlopen(), dlsym(), dlclose()
1178 if test "$python_ok" = yes && test "$python3_ok" = yes; then
1179 AC_DEFINE(DYNAMIC_PYTHON)
1180 AC_DEFINE(DYNAMIC_PYTHON3)
1181 AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
1183 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
1184 ldflags_save=$LDFLAGS
1185 dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
1186 LDFLAGS="-ldl $LDFLAGS"
1189 /* If this program fails, then RTLD_GLOBAL is needed.
1190 * RTLD_GLOBAL will be used and then it is not possible to
1191 * have both python versions enabled in the same vim instance.
1192 * Only the first pyhton version used will be switched on.
1195 int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
1198 void* pylib = dlopen(python_instsoname, RTLD_LAZY);
1201 void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
1202 void (*init)(void) = dlsym(pylib, "Py_Initialize");
1203 int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
1204 void (*final)(void) = dlsym(pylib, "Py_Finalize");
1207 needed = (*simple)("import termios") == -1;
1214 int main(int argc, char** argv)
1217 if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
1221 [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
1224 LDFLAGS=$ldflags_save
1226 AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
1228 CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
1229 ldflags_save=$LDFLAGS
1230 dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
1231 LDFLAGS="-ldl $LDFLAGS"
1235 /* If this program fails, then RTLD_GLOBAL is needed.
1236 * RTLD_GLOBAL will be used and then it is not possible to
1237 * have both python versions enabled in the same vim instance.
1238 * Only the first pyhton version used will be switched on.
1241 int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
1244 void* pylib = dlopen(python_instsoname, RTLD_LAZY);
1247 void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
1248 void (*init)(void) = dlsym(pylib, "Py_Initialize");
1249 int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
1250 void (*final)(void) = dlsym(pylib, "Py_Finalize");
1253 needed = (*simple)("import termios") == -1;
1260 int main(int argc, char** argv)
1263 if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
1267 [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
1270 LDFLAGS=$ldflags_save
1272 PYTHON_SRC="if_python.c"
1273 PYTHON_OBJ="objects/if_python.o"
1274 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
1276 PYTHON3_SRC="if_python3.c"
1277 PYTHON3_OBJ="objects/if_python3.o"
1278 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\""
1280 elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then
1281 AC_DEFINE(DYNAMIC_PYTHON)
1282 PYTHON_SRC="if_python.c"
1283 PYTHON_OBJ="objects/if_python.o"
1284 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
1286 elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then
1287 AC_DEFINE(DYNAMIC_PYTHON3)
1288 PYTHON3_SRC="if_python3.c"
1289 PYTHON3_OBJ="objects/if_python3.o"
1290 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\""
1294 AC_MSG_CHECKING(--enable-tclinterp argument)
1295 AC_ARG_ENABLE(tclinterp,
1296 [ --enable-tclinterp Include Tcl interpreter.], ,
1297 [enable_tclinterp="no"])
1298 AC_MSG_RESULT($enable_tclinterp)
1300 if test "$enable_tclinterp" = "yes"; then
1302 dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420]
1303 AC_MSG_CHECKING(--with-tclsh argument)
1304 AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
1305 tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
1306 tclsh_name="tclsh8.5"; AC_MSG_RESULT(no))
1307 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1308 AC_SUBST(vi_cv_path_tcl)
1310 dnl when no specific version specified, also try 8.4, 8.2 and 8.0
1311 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then
1312 tclsh_name="tclsh8.4"
1313 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1315 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then
1316 tclsh_name="tclsh8.2"
1317 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1319 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then
1320 tclsh_name="tclsh8.0"
1321 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1323 dnl still didn't find it, try without version number
1324 if test "X$vi_cv_path_tcl" = "X"; then
1326 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1328 if test "X$vi_cv_path_tcl" != "X"; then
1329 AC_MSG_CHECKING(Tcl version)
1330 if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then
1331 tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
1332 AC_MSG_RESULT($tclver - OK);
1333 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 -`
1335 AC_MSG_CHECKING(for location of Tcl include)
1336 if test "x$MACOSX" != "xyes"; then
1337 tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
1339 dnl For Mac OS X 10.3, use the OS-provided framework location
1340 tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
1343 for try in $tclinc; do
1344 if test -f "$try/tcl.h"; then
1345 AC_MSG_RESULT($try/tcl.h)
1350 if test -z "$TCL_INC"; then
1351 AC_MSG_RESULT(<not found>)
1354 if test -z "$SKIP_TCL"; then
1355 AC_MSG_CHECKING(for location of tclConfig.sh script)
1356 if test "x$MACOSX" != "xyes"; then
1357 tclcnf=`echo $tclinc | sed s/include/lib/g`
1358 tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
1360 dnl For Mac OS X 10.3, use the OS-provided framework location
1361 tclcnf="/System/Library/Frameworks/Tcl.framework"
1363 for try in $tclcnf; do
1364 if test -f $try/tclConfig.sh; then
1365 AC_MSG_RESULT($try/tclConfig.sh)
1367 dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
1368 TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
1369 dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
1370 dnl "-D_ABC" items. Watch out for -DFOO=long\ long.
1371 TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[[^-]]/d' -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
1375 if test -z "$TCL_LIBS"; then
1376 AC_MSG_RESULT(<not found>)
1377 AC_MSG_CHECKING(for Tcl library by myself)
1378 tcllib=`echo $tclinc | sed s/include/lib/g`
1379 tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`"
1380 for ext in .so .a ; do
1381 for ver in "" $tclver ; do
1382 for try in $tcllib ; do
1384 if test -f $try/lib$trylib ; then
1385 AC_MSG_RESULT($try/lib$trylib)
1386 TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
1387 if test "`(uname) 2>/dev/null`" = SunOS &&
1388 uname -r | grep '^5' >/dev/null; then
1389 TCL_LIBS="$TCL_LIBS -R $try"
1396 if test -z "$TCL_LIBS"; then
1397 AC_MSG_RESULT(<not found>)
1401 if test -z "$SKIP_TCL"; then
1404 TCL_OBJ=objects/if_tcl.o
1406 TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
1410 AC_MSG_RESULT(too old; need Tcl version 8.0 or later)
1413 if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then
1414 AC_MSG_ERROR([could not configure Tcl])
1420 AC_SUBST(TCL_CFLAGS)
1423 AC_MSG_CHECKING(--enable-rubyinterp argument)
1424 AC_ARG_ENABLE(rubyinterp,
1425 [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1426 [enable_rubyinterp="no"])
1427 AC_MSG_RESULT($enable_rubyinterp)
1428 if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
1429 AC_MSG_CHECKING(--with-ruby-command argument)
1430 AC_SUBST(vi_cv_path_ruby)
1431 AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
1432 RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD),
1433 RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
1434 AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
1435 if test "X$vi_cv_path_ruby" != "X"; then
1436 AC_MSG_CHECKING(Ruby version)
1437 if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
1439 AC_MSG_CHECKING(Ruby header files)
1440 rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
1441 if test "X$rubyhdrdir" != "X"; then
1442 AC_MSG_RESULT($rubyhdrdir)
1443 RUBY_CFLAGS="-I$rubyhdrdir"
1444 rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'`
1445 if test -d "$rubyhdrdir/$rubyarch"; then
1446 RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
1448 rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'`
1449 RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
1450 rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
1451 if test "X$rubylibs" != "X"; then
1452 RUBY_LIBS="$rubylibs"
1454 librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
1455 librubya=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBY_A"]])'`
1456 rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
1457 if test -f "$rubylibdir/$librubya"; then
1458 librubyarg="$librubyarg"
1459 RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1460 elif test "$librubyarg" = "libruby.a"; then
1461 dnl required on Mac OS 10.3 where libruby.a doesn't exist
1463 RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1466 if test "X$librubyarg" != "X"; then
1467 RUBY_LIBS="$librubyarg $RUBY_LIBS"
1469 rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
1470 if test "X$rubyldflags" != "X"; then
1471 dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
1472 dnl be included if requested by passing --with-mac-arch to
1473 dnl configure, so strip these flags first (if present)
1474 rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
1475 if test "X$rubyldflags" != "X"; then
1476 LDFLAGS="$rubyldflags $LDFLAGS"
1479 RUBY_SRC="if_ruby.c"
1480 RUBY_OBJ="objects/if_ruby.o"
1481 RUBY_PRO="if_ruby.pro"
1482 AC_DEFINE(FEAT_RUBY)
1483 if test "$enable_rubyinterp" = "dynamic"; then
1484 libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG[["RUBY_SO_NAME"]], Config::CONFIG[["DLEXT"]]'`
1485 AC_DEFINE(DYNAMIC_RUBY)
1486 RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
1490 AC_MSG_RESULT(not found; disabling Ruby)
1493 AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
1497 if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then
1498 AC_MSG_ERROR([could not configure Ruby])
1504 AC_SUBST(RUBY_CFLAGS)
1507 AC_MSG_CHECKING(--enable-cscope argument)
1508 AC_ARG_ENABLE(cscope,
1509 [ --enable-cscope Include cscope interface.], ,
1510 [enable_cscope="no"])
1511 AC_MSG_RESULT($enable_cscope)
1512 if test "$enable_cscope" = "yes"; then
1513 AC_DEFINE(FEAT_CSCOPE)
1516 AC_MSG_CHECKING(--enable-workshop argument)
1517 AC_ARG_ENABLE(workshop,
1518 [ --enable-workshop Include Sun Visual Workshop support.], ,
1519 [enable_workshop="no"])
1520 AC_MSG_RESULT($enable_workshop)
1521 if test "$enable_workshop" = "yes"; then
1522 AC_DEFINE(FEAT_SUN_WORKSHOP)
1523 WORKSHOP_SRC="workshop.c integration.c"
1524 AC_SUBST(WORKSHOP_SRC)
1525 WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
1526 AC_SUBST(WORKSHOP_OBJ)
1527 if test "${enable_gui-xxx}" = xxx; then
1532 AC_MSG_CHECKING(--disable-netbeans argument)
1533 AC_ARG_ENABLE(netbeans,
1534 [ --disable-netbeans Disable NetBeans integration support.],
1535 , [enable_netbeans="yes"])
1536 if test "$enable_netbeans" = "yes"; then
1538 dnl On Solaris we need the socket and nsl library.
1539 AC_CHECK_LIB(socket, socket)
1540 AC_CHECK_LIB(nsl, gethostbyname)
1541 AC_MSG_CHECKING(whether compiling netbeans integration is possible)
1548 #include <netinet/in.h>
1550 #include <sys/types.h>
1551 #include <sys/socket.h>
1552 /* Check bitfields */
1554 unsigned int initDone:1;
1558 /* Check creating a socket. */
1559 struct sockaddr_in server;
1560 (void)socket(AF_INET, SOCK_STREAM, 0);
1562 (void)gethostbyname("microsoft.com");
1563 if (errno == ECONNREFUSED)
1564 (void)connect(1, (struct sockaddr *)&server, sizeof(server));
1567 AC_MSG_RESULT(no); enable_netbeans="no")
1571 if test "$enable_netbeans" = "yes"; then
1572 AC_DEFINE(FEAT_NETBEANS_INTG)
1573 NETBEANS_SRC="netbeans.c"
1574 AC_SUBST(NETBEANS_SRC)
1575 NETBEANS_OBJ="objects/netbeans.o"
1576 AC_SUBST(NETBEANS_OBJ)
1579 AC_MSG_CHECKING(--enable-sniff argument)
1580 AC_ARG_ENABLE(sniff,
1581 [ --enable-sniff Include Sniff interface.], ,
1582 [enable_sniff="no"])
1583 AC_MSG_RESULT($enable_sniff)
1584 if test "$enable_sniff" = "yes"; then
1585 AC_DEFINE(FEAT_SNIFF)
1586 SNIFF_SRC="if_sniff.c"
1588 SNIFF_OBJ="objects/if_sniff.o"
1592 AC_MSG_CHECKING(--enable-multibyte argument)
1593 AC_ARG_ENABLE(multibyte,
1594 [ --enable-multibyte Include multibyte editing support.], ,
1595 [enable_multibyte="no"])
1596 AC_MSG_RESULT($enable_multibyte)
1597 if test "$enable_multibyte" = "yes"; then
1598 AC_DEFINE(FEAT_MBYTE)
1601 AC_MSG_CHECKING(--enable-hangulinput argument)
1602 AC_ARG_ENABLE(hangulinput,
1603 [ --enable-hangulinput Include Hangul input support.], ,
1604 [enable_hangulinput="no"])
1605 AC_MSG_RESULT($enable_hangulinput)
1607 AC_MSG_CHECKING(--enable-xim argument)
1609 [ --enable-xim Include XIM input support.],
1610 AC_MSG_RESULT($enable_xim),
1611 [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
1613 AC_MSG_CHECKING(--enable-fontset argument)
1614 AC_ARG_ENABLE(fontset,
1615 [ --enable-fontset Include X fontset output support.], ,
1616 [enable_fontset="no"])
1617 AC_MSG_RESULT($enable_fontset)
1618 dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI
1620 test -z "$with_x" && with_x=yes
1621 test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
1622 if test "$with_x" = no; then
1623 AC_MSG_RESULT(defaulting to: don't HAVE_X11)
1625 dnl Do this check early, so that its failure can override user requests.
1627 AC_PATH_PROG(xmkmfpath, xmkmf)
1631 dnl On z/OS Unix the X libraries are DLLs. To use them the code must
1632 dnl be compiled with a special option.
1633 dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS.
1634 if test "$zOSUnix" = "yes"; then
1635 CFLAGS="$CFLAGS -W c,dll"
1636 LDFLAGS="$LDFLAGS -W l,dll"
1637 X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
1640 dnl On my HPUX system the X include dir is found, but the lib dir not.
1641 dnl This is a desparate try to fix this.
1643 if test -d "$x_includes" && test ! -d "$x_libraries"; then
1644 x_libraries=`echo "$x_includes" | sed s/include/lib/`
1645 AC_MSG_RESULT(Corrected X libraries to $x_libraries)
1646 X_LIBS="$X_LIBS -L$x_libraries"
1647 if test "`(uname) 2>/dev/null`" = SunOS &&
1648 uname -r | grep '^5' >/dev/null; then
1649 X_LIBS="$X_LIBS -R $x_libraries"
1653 if test -d "$x_libraries" && test ! -d "$x_includes"; then
1654 x_includes=`echo "$x_libraries" | sed s/lib/include/`
1655 AC_MSG_RESULT(Corrected X includes to $x_includes)
1656 X_CFLAGS="$X_CFLAGS -I$x_includes"
1659 dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed.
1660 X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
1661 dnl Remove "-L/usr/lib " from X_LIBS, should not be needed.
1662 X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
1663 dnl Same for "-R/usr/lib ".
1664 X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
1667 dnl Check if the X11 header files are correctly installed. On some systems
1668 dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h
1670 AC_MSG_CHECKING(if X11 header files can be found)
1672 CFLAGS="$CFLAGS $X_CFLAGS"
1673 AC_TRY_COMPILE([#include <X11/Xlib.h>
1674 #include <X11/Intrinsic.h>], ,
1676 AC_MSG_RESULT(no); no_x=yes)
1679 if test "${no_x-no}" = yes; then
1686 ac_save_LDFLAGS="$LDFLAGS"
1687 LDFLAGS="-L$x_libraries $LDFLAGS"
1689 dnl Check for -lXdmcp (needed on SunOS 4.1.4)
1690 dnl For HP-UX 10.20 it must be before -lSM -lICE
1691 AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],,
1692 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp])
1694 dnl Some systems need -lnsl -lsocket when testing for ICE.
1695 dnl The check above doesn't do this, try here (again). Also needed to get
1696 dnl them after Xdmcp. link.sh will remove them when not needed.
1697 dnl Check for other function than above to avoid the cached value
1698 AC_CHECK_LIB(ICE, IceOpenConnection,
1699 [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
1701 dnl Check for -lXpm (needed for some versions of Motif)
1702 LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
1703 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
1704 [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS])
1706 dnl Check that the X11 header files don't use implicit declarations
1707 AC_MSG_CHECKING(if X11 header files implicitly declare return values)
1709 CFLAGS="$CFLAGS $X_CFLAGS -Werror"
1710 AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
1712 CFLAGS="$CFLAGS -Wno-implicit-int"
1713 AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
1714 AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int",
1715 AC_MSG_RESULT(test failed)
1720 LDFLAGS="$ac_save_LDFLAGS"
1722 AC_MSG_CHECKING(size of wchar_t is 2 bytes)
1723 AC_CACHE_VAL(ac_cv_small_wchar_t,
1725 #include <X11/Xlib.h>
1727 # include <stdlib.h>
1728 # include <stddef.h>
1732 if (sizeof(wchar_t) <= 2)
1736 ac_cv_small_wchar_t="no",
1737 ac_cv_small_wchar_t="yes",
1738 AC_MSG_ERROR(failed to compile test program))])
1739 AC_MSG_RESULT($ac_cv_small_wchar_t)
1740 if test "x$ac_cv_small_wchar_t" = "xyes" ; then
1741 AC_DEFINE(SMALL_WCHAR_T)
1747 test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
1749 AC_MSG_CHECKING(--enable-gui argument)
1751 [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
1753 dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
1754 dnl Do not use character classes for portability with old tools.
1755 enable_gui_canon=`echo "_$enable_gui" | \
1756 sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1758 dnl Skip everything by default.
1768 if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
1770 case "$enable_gui_canon" in
1771 no) AC_MSG_RESULT(no GUI support)
1773 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
1774 auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
1775 photon) AC_MSG_RESULT(Photon GUI support) ;;
1776 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
1780 elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
1782 case "$enable_gui_canon" in
1783 no) AC_MSG_RESULT(no GUI support)
1785 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
1786 auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support)
1788 carbon) AC_MSG_RESULT(Carbon GUI support) ;;
1789 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
1795 case "$enable_gui_canon" in
1796 no|none) AC_MSG_RESULT(no GUI support) ;;
1797 yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
1804 gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
1806 gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
1809 motif) AC_MSG_RESULT(Motif GUI support)
1811 athena) AC_MSG_RESULT(Athena GUI support)
1813 nextaw) AC_MSG_RESULT(neXtaw GUI support)
1815 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;;
1820 if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
1821 -a "$enable_gui_canon" != "gnome2"; then
1822 AC_MSG_CHECKING(whether or not to look for GTK+ 2)
1823 AC_ARG_ENABLE(gtk2-check,
1824 [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]],
1825 , enable_gtk2_check="yes")
1826 AC_MSG_RESULT($enable_gtk2_check)
1827 if test "x$enable_gtk2_check" = "xno"; then
1833 if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then
1834 AC_MSG_CHECKING(whether or not to look for GNOME)
1835 AC_ARG_ENABLE(gnome-check,
1836 [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
1837 , enable_gnome_check="no")
1838 AC_MSG_RESULT($enable_gnome_check)
1839 if test "x$enable_gnome_check" = "xno"; then
1844 if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
1845 AC_MSG_CHECKING(whether or not to look for Motif)
1846 AC_ARG_ENABLE(motif-check,
1847 [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]],
1848 , enable_motif_check="yes")
1849 AC_MSG_RESULT($enable_motif_check)
1850 if test "x$enable_motif_check" = "xno"; then
1855 if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
1856 AC_MSG_CHECKING(whether or not to look for Athena)
1857 AC_ARG_ENABLE(athena-check,
1858 [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]],
1859 , enable_athena_check="yes")
1860 AC_MSG_RESULT($enable_athena_check)
1861 if test "x$enable_athena_check" = "xno"; then
1866 if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
1867 AC_MSG_CHECKING(whether or not to look for neXtaw)
1868 AC_ARG_ENABLE(nextaw-check,
1869 [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]],
1870 , enable_nextaw_check="yes")
1871 AC_MSG_RESULT($enable_nextaw_check);
1872 if test "x$enable_nextaw_check" = "xno"; then
1877 if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
1878 AC_MSG_CHECKING(whether or not to look for Carbon)
1879 AC_ARG_ENABLE(carbon-check,
1880 [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]],
1881 , enable_carbon_check="yes")
1882 AC_MSG_RESULT($enable_carbon_check);
1883 if test "x$enable_carbon_check" = "xno"; then
1889 if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
1890 AC_MSG_CHECKING(for Carbon GUI)
1891 dnl already did the check, just give the message
1894 if test "$VIMNAME" = "vim"; then
1898 if test "x$MACARCH" = "xboth"; then
1899 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
1901 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon"
1904 dnl Default install directory is not /usr/local
1905 if test x$prefix = xNONE; then
1906 prefix=/Applications
1909 dnl Sorry for the hard coded default
1910 datadir='${prefix}/Vim.app/Contents/Resources'
1912 dnl skip everything else
1922 dnl define an autoconf function to check for a specified version of GTK, and
1923 dnl try to compile/link a GTK program.
1925 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1926 dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
1928 AC_DEFUN(AM_PATH_GTK,
1930 if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
1932 min_gtk_version=ifelse([$1], ,2.2.0,$1)
1933 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
1935 if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
1936 && $PKG_CONFIG --exists gtk+-2.0; then
1938 dnl We should be using PKG_CHECK_MODULES() instead of this hack.
1939 dnl But I guess the dependency on pkgconfig.m4 is not wanted or
1940 dnl something like that.
1941 GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
1942 GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
1943 GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
1944 gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1945 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
1946 gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1947 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
1948 gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1949 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
1955 if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
1957 ac_save_CFLAGS="$CFLAGS"
1958 ac_save_LIBS="$LIBS"
1959 CFLAGS="$CFLAGS $GTK_CFLAGS"
1960 LIBS="$LIBS $GTK_LIBS"
1963 dnl Now check if the installed GTK is sufficiently new.
1967 #include <gtk/gtk.h>
1970 # include <stdlib.h>
1971 # include <stddef.h>
1977 int major, minor, micro;
1980 system ("touch conf.gtktest");
1982 /* HP/UX 9 (%@#!) writes to sscanf strings */
1983 tmp_version = g_strdup("$min_gtk_version");
1984 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
1985 printf("%s, bad version string\n", "$min_gtk_version");
1989 if ((gtk_major_version > major) ||
1990 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1991 ((gtk_major_version == major) && (gtk_minor_version == minor) &&
1992 (gtk_micro_version >= micro)))
1998 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1999 CFLAGS="$ac_save_CFLAGS"
2000 LIBS="$ac_save_LIBS"
2003 if test "x$no_gtk" = x ; then
2004 if test "x$enable_gtktest" = "xyes"; then
2005 AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
2007 AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
2009 ifelse([$2], , :, [$2])
2015 ifelse([$3], , :, [$3])
2022 ifelse([$3], , :, [$3])
2024 AC_SUBST(GTK_CFLAGS)
2029 dnl ---------------------------------------------------------------------------
2031 dnl ---------------------------------------------------------------------------
2032 AC_DEFUN([GNOME_INIT_HOOK],
2034 AC_SUBST(GNOME_LIBS)
2035 AC_SUBST(GNOME_LIBDIR)
2036 AC_SUBST(GNOME_INCLUDEDIR)
2038 AC_ARG_WITH(gnome-includes,
2039 [ --with-gnome-includes=DIR Specify location of GNOME headers],
2040 [CFLAGS="$CFLAGS -I$withval"]
2043 AC_ARG_WITH(gnome-libs,
2044 [ --with-gnome-libs=DIR Specify location of GNOME libs],
2045 [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval]
2049 [ --with-gnome Specify prefix for GNOME files],
2050 if test x$withval = xyes; then
2052 ifelse([$1], [], :, [$1])
2054 if test "x$withval" = xno; then
2058 LDFLAGS="$LDFLAGS -L$withval/lib"
2059 CFLAGS="$CFLAGS -I$withval/include"
2060 gnome_prefix=$withval/lib
2065 if test "x$want_gnome" = xyes; then
2067 AC_MSG_CHECKING(for libgnomeui-2.0)
2068 if $PKG_CONFIG --exists libgnomeui-2.0; then
2070 GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
2071 GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
2072 GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
2074 dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
2075 dnl This might not be the right way but it works for me...
2076 AC_MSG_CHECKING(for FreeBSD)
2077 if test "`(uname) 2>/dev/null`" = FreeBSD; then
2078 AC_MSG_RESULT(yes, adding -pthread)
2079 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
2080 GNOME_LIBS="$GNOME_LIBS -pthread"
2086 AC_MSG_RESULT(not found)
2087 if test "x$2" = xfail; then
2088 AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
2095 AC_DEFUN([GNOME_INIT],[
2096 GNOME_INIT_HOOK([],fail)
2100 dnl ---------------------------------------------------------------------------
2101 dnl Check for GTK2. If it fails, then continue on for Motif as before...
2102 dnl ---------------------------------------------------------------------------
2103 if test -z "$SKIP_GTK2"; then
2105 AC_MSG_CHECKING(--disable-gtktest argument)
2106 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
2107 , enable_gtktest=yes)
2108 if test "x$enable_gtktest" = "xyes" ; then
2109 AC_MSG_RESULT(gtk test enabled)
2111 AC_MSG_RESULT(gtk test disabled)
2114 if test "X$PKG_CONFIG" = "X"; then
2115 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2118 if test "x$PKG_CONFIG" != "xno"; then
2119 dnl First try finding version 2.2.0 or later. The 2.0.x series has
2120 dnl problems (bold fonts, --remote doesn't work).
2122 [GUI_LIB_LOC="$GTK_LIBDIR"
2123 GTK_LIBNAME="$GTK_LIBS"
2124 GUI_INC_LOC="$GTK_CFLAGS"], )
2125 if test "x$GTK_CFLAGS" != "x"; then
2130 AC_SUBST(GTK_LIBNAME)
2133 if test "x$GUITYPE" = "xGTK"; then
2134 if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
2135 || test "0$gtk_minor_version" -ge 2; then
2136 AC_DEFINE(HAVE_GTK_MULTIHEAD)
2139 dnl if GTK exists, then check for GNOME.
2141 if test -z "$SKIP_GNOME"; then
2143 GNOME_INIT_HOOK([have_gnome=yes])
2144 if test "x$have_gnome" = xyes ; then
2145 AC_DEFINE(FEAT_GUI_GNOME)
2146 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
2147 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
2154 dnl Check for Motif include files location.
2155 dnl The LAST one found is used, this makes the highest version to be used,
2156 dnl e.g. when Motif1.2 and Motif2.0 are both present.
2158 if test -z "$SKIP_MOTIF"; then
2159 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"
2160 dnl Remove "-I" from before $GUI_INC_LOC if it's there
2161 GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
2163 AC_MSG_CHECKING(for location of Motif GUI includes)
2164 gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
2166 for try in $gui_includes; do
2167 if test -f "$try/Xm/Xm.h"; then
2171 if test -n "$GUI_INC_LOC"; then
2172 if test "$GUI_INC_LOC" = /usr/include; then
2174 AC_MSG_RESULT(in default path)
2176 AC_MSG_RESULT($GUI_INC_LOC)
2179 AC_MSG_RESULT(<not found>)
2184 dnl Check for Motif library files location. In the same order as the include
2185 dnl files, to avoid a mixup if several versions are present
2187 if test -z "$SKIP_MOTIF"; then
2188 AC_MSG_CHECKING(--with-motif-lib argument)
2189 AC_ARG_WITH(motif-lib,
2190 [ --with-motif-lib=STRING Library for Motif ],
2191 [ MOTIF_LIBNAME="${withval}" ] )
2193 if test -n "$MOTIF_LIBNAME"; then
2194 AC_MSG_RESULT($MOTIF_LIBNAME)
2199 dnl Remove "-L" from before $GUI_LIB_LOC if it's there
2200 GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
2202 AC_MSG_CHECKING(for location of Motif GUI libs)
2203 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"
2205 for try in $gui_libs; do
2206 for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do
2207 if test -f "$libtry"; then
2212 if test -n "$GUI_LIB_LOC"; then
2213 dnl Remove /usr/lib, it causes trouble on some systems
2214 if test "$GUI_LIB_LOC" = /usr/lib; then
2216 AC_MSG_RESULT(in default path)
2218 if test -n "$GUI_LIB_LOC"; then
2219 AC_MSG_RESULT($GUI_LIB_LOC)
2220 if test "`(uname) 2>/dev/null`" = SunOS &&
2221 uname -r | grep '^5' >/dev/null; then
2222 GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
2228 AC_MSG_RESULT(<not found>)
2234 if test -z "$SKIP_MOTIF"; then
2238 AC_SUBST(MOTIF_LIBNAME)
2241 dnl Check if the Athena files can be found
2245 if test -z "$SKIP_ATHENA"; then
2246 AC_MSG_CHECKING(if Athena header files can be found)
2248 CFLAGS="$CFLAGS $X_CFLAGS"
2250 #include <X11/Intrinsic.h>
2251 #include <X11/Xaw/Paned.h>], ,
2253 AC_MSG_RESULT(no); SKIP_ATHENA=YES )
2257 if test -z "$SKIP_ATHENA"; then
2261 if test -z "$SKIP_NEXTAW"; then
2262 AC_MSG_CHECKING(if neXtaw header files can be found)
2264 CFLAGS="$CFLAGS $X_CFLAGS"
2266 #include <X11/Intrinsic.h>
2267 #include <X11/neXtaw/Paned.h>], ,
2269 AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
2273 if test -z "$SKIP_NEXTAW"; then
2277 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
2278 dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
2279 dnl Avoid adding it when it twice
2280 if test -n "$GUI_INC_LOC"; then
2281 GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
2283 if test -n "$GUI_LIB_LOC"; then
2284 GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
2287 dnl Check for -lXext and then for -lXmu
2288 ldflags_save=$LDFLAGS
2289 LDFLAGS="$X_LIBS $LDFLAGS"
2290 AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
2291 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2292 dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
2293 AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
2294 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2295 AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
2296 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2297 AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
2298 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2299 if test -z "$SKIP_MOTIF"; then
2300 AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
2301 [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2303 LDFLAGS=$ldflags_save
2305 dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
2306 AC_MSG_CHECKING(for extra X11 defines)
2309 if mkdir conftestdir; then
2311 cat > Imakefile <<'EOF'
2313 @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
2315 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2316 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2321 if test -z "$NARROW_PROTO"; then
2324 AC_MSG_RESULT($NARROW_PROTO)
2326 AC_SUBST(NARROW_PROTO)
2329 dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
2330 dnl use the X11 include path
2331 if test "$enable_xsmp" = "yes"; then
2332 cppflags_save=$CPPFLAGS
2333 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2334 AC_CHECK_HEADERS(X11/SM/SMlib.h)
2335 CPPFLAGS=$cppflags_save
2339 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2"; then
2340 dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
2341 cppflags_save=$CPPFLAGS
2342 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2343 AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
2345 dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
2346 if test ! "$enable_xim" = "no"; then
2347 AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
2348 AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
2350 AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no")
2352 CPPFLAGS=$cppflags_save
2354 dnl automatically enable XIM when hangul input isn't enabled
2355 if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
2356 -a "x$GUITYPE" != "xNONE" ; then
2357 AC_MSG_RESULT(X GUI selected; xim has been enabled)
2362 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
2363 cppflags_save=$CPPFLAGS
2364 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2365 dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h
2366 AC_MSG_CHECKING([for X11/Xmu/Editres.h])
2368 #include <X11/Intrinsic.h>
2369 #include <X11/Xmu/Editres.h>],
2372 AC_DEFINE(HAVE_X11_XMU_EDITRES_H),
2374 CPPFLAGS=$cppflags_save
2377 dnl Only use the Xm directory when compiling Motif, don't use it for Athena
2378 if test -z "$SKIP_MOTIF"; then
2379 cppflags_save=$CPPFLAGS
2380 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2381 AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
2382 Xm/UnhighlightT.h Xm/Notebook.h)
2384 if test $ac_cv_header_Xm_XpmP_h = yes; then
2385 dnl Solaris uses XpmAttributes_21, very annoying.
2386 AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
2387 AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
2388 AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21),
2389 AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
2392 AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
2394 CPPFLAGS=$cppflags_save
2397 if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
2398 AC_MSG_RESULT(no GUI selected; xim has been disabled)
2401 if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
2402 AC_MSG_RESULT(no GUI selected; fontset has been disabled)
2405 if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then
2406 AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
2410 if test -z "$SKIP_PHOTON"; then
2414 AC_SUBST(GUI_INC_LOC)
2415 AC_SUBST(GUI_LIB_LOC)
2417 AC_SUBST(GUI_X_LIBS)
2419 if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
2420 AC_MSG_ERROR([cannot use workshop without Motif])
2423 dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
2424 if test "$enable_xim" = "yes"; then
2427 if test "$enable_fontset" = "yes"; then
2428 AC_DEFINE(FEAT_XFONTSET)
2432 dnl ---------------------------------------------------------------------------
2433 dnl end of GUI-checking
2434 dnl ---------------------------------------------------------------------------
2437 dnl Only really enable hangul input when GUI and XFONTSET are available
2438 if test "$enable_hangulinput" = "yes"; then
2439 if test "x$GUITYPE" = "xNONE"; then
2440 AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
2441 enable_hangulinput=no
2443 AC_DEFINE(FEAT_HANGULIN)
2444 HANGULIN_SRC=hangulin.c
2445 AC_SUBST(HANGULIN_SRC)
2446 HANGULIN_OBJ=objects/hangulin.o
2447 AC_SUBST(HANGULIN_OBJ)
2451 dnl Checks for libraries and include files.
2453 AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken],
2456 #include "confdefs.h"
2459 # include <stdlib.h>
2460 # include <stddef.h>
2462 main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
2464 vim_cv_toupper_broken=yes
2466 vim_cv_toupper_broken=no
2468 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken')
2471 if test "x$vim_cv_toupper_broken" = "xyes" ; then
2472 AC_DEFINE(BROKEN_TOUPPER)
2475 AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
2476 AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");],
2477 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
2480 AC_MSG_CHECKING(whether __attribute__((unused)) is allowed)
2481 AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
2482 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED),
2485 dnl Checks for header files.
2486 AC_CHECK_HEADER(elf.h, HAS_ELF=1)
2487 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
2488 if test "$HAS_ELF" = 1; then
2489 AC_CHECK_LIB(elf, main)
2494 dnl If sys/wait.h is not found it might still exist but not be POSIX
2495 dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
2496 if test $ac_cv_header_sys_wait_h = no; then
2497 AC_MSG_CHECKING([for sys/wait.h that defines union wait])
2498 AC_TRY_COMPILE([#include <sys/wait.h>],
2499 [union wait xx, yy; xx = yy],
2501 AC_DEFINE(HAVE_SYS_WAIT_H)
2502 AC_DEFINE(HAVE_UNION_WAIT),
2506 AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \
2507 sys/select.h sys/utsname.h termcap.h fcntl.h \
2508 sgtty.h sys/ioctl.h sys/time.h sys/types.h \
2509 termio.h iconv.h inttypes.h langinfo.h math.h \
2510 unistd.h stropts.h errno.h sys/resource.h \
2511 sys/systeminfo.h locale.h sys/stream.h termios.h \
2512 libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
2513 utime.h sys/param.h libintl.h libgen.h \
2514 util/debug.h util/msg18n.h frame.h sys/acl.h \
2515 sys/access.h sys/sysinfo.h wchar.h wctype.h)
2517 dnl sys/ptem.h depends on sys/stream.h on Solaris
2518 AC_CHECK_HEADERS(sys/ptem.h, [], [],
2519 [#if defined HAVE_SYS_STREAM_H
2520 # include <sys/stream.h>
2523 dnl sys/sysctl.h depends on sys/param.h on OpenBSD
2524 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
2525 [#if defined HAVE_SYS_PARAM_H
2526 # include <sys/param.h>
2530 dnl pthread_np.h may exist but can only be used after including pthread.h
2531 AC_MSG_CHECKING([for pthread_np.h])
2533 #include <pthread.h>
2534 #include <pthread_np.h>],
2537 AC_DEFINE(HAVE_PTHREAD_NP_H),
2540 AC_CHECK_HEADERS(strings.h)
2541 if test "x$MACOSX" = "xyes"; then
2542 dnl The strings.h file on OS/X contains a warning and nothing useful.
2543 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
2546 dnl Check if strings.h and string.h can both be included when defined.
2547 AC_MSG_CHECKING([if strings.h can be included after string.h])
2548 cppflags_save=$CPPFLAGS
2549 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2551 #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
2552 # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
2553 /* but don't do it on AIX 5.1 (Uribarri) */
2556 # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
2558 #ifdef HAVE_STRING_H
2559 # include <string.h>
2561 #if defined(HAVE_STRINGS_H)
2562 # include <strings.h>
2566 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
2568 CPPFLAGS=$cppflags_save
2571 dnl Checks for typedefs, structures, and compiler characteristics.
2572 AC_PROG_GCC_TRADITIONAL
2583 AC_CHECK_TYPE(ino_t, long)
2584 AC_CHECK_TYPE(dev_t, unsigned)
2587 AC_MSG_CHECKING(for rlim_t)
2588 if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
2589 AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
2592 changequote(<<,>>)dnl
2593 <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
2596 #include <sys/types.h>
2598 # include <stdlib.h>
2599 # include <stddef.h>
2601 #ifdef HAVE_SYS_RESOURCE_H
2602 # include <sys/resource.h>
2604 ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
2605 AC_MSG_RESULT($ac_cv_type_rlim_t)
2607 if test $ac_cv_type_rlim_t = no; then
2608 cat >> confdefs.h <<\EOF
2609 #define rlim_t unsigned long
2613 AC_MSG_CHECKING(for stack_t)
2614 if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
2615 AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
2617 AC_EGREP_CPP(stack_t,
2619 #include <sys/types.h>
2621 # include <stdlib.h>
2622 # include <stddef.h>
2625 ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
2626 AC_MSG_RESULT($ac_cv_type_stack_t)
2628 if test $ac_cv_type_stack_t = no; then
2629 cat >> confdefs.h <<\EOF
2630 #define stack_t struct sigaltstack
2634 dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
2635 AC_MSG_CHECKING(whether stack_t has an ss_base field)
2637 #include <sys/types.h>
2639 # include <stdlib.h>
2640 # include <stddef.h>
2643 #include "confdefs.h"
2644 ], [stack_t sigstk; sigstk.ss_base = 0; ],
2645 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
2649 AC_MSG_CHECKING(--with-tlib argument)
2650 AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
2651 if test -n "$with_tlib"; then
2652 AC_MSG_RESULT($with_tlib)
2653 LIBS="$LIBS -l$with_tlib"
2654 AC_MSG_CHECKING(for linking with $with_tlib library)
2655 AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED))
2656 dnl Need to check for tgetent() below.
2659 AC_MSG_RESULT([empty: automatic terminal library selection])
2660 dnl On HP-UX 10.10 termcap or termlib should be used instead of
2661 dnl curses, because curses is much slower.
2662 dnl Newer versions of ncurses are preferred over anything, except
2663 dnl when tinfo has been split off, it contains all we need.
2664 dnl Older versions of ncurses have bugs, get a new one!
2665 dnl Digital Unix (OSF1) should use curses (Ronald Schild).
2666 dnl On SCO Openserver should prefer termlib (Roger Cornelius).
2667 case "`uname -s 2>/dev/null`" in
2668 OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";;
2669 *) tlibs="tinfo ncurses termlib termcap curses";;
2671 for libname in $tlibs; do
2672 AC_CHECK_LIB(${libname}, tgetent,,)
2673 if test "x$olibs" != "x$LIBS"; then
2674 dnl It's possible that a library is found but it doesn't work
2675 dnl e.g., shared library that cannot be found
2676 dnl compile and run a test program to be sure
2678 #ifdef HAVE_TERMCAP_H
2679 # include <termcap.h>
2682 # include <stdlib.h>
2683 # include <stddef.h>
2685 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
2686 res="OK", res="FAIL", res="FAIL")
2687 if test "$res" = "OK"; then
2690 AC_MSG_RESULT($libname library is not usable)
2694 if test "x$olibs" = "x$LIBS"; then
2695 AC_MSG_RESULT(no terminal library found)
2699 if test "x$olibs" = "x$LIBS"; then
2700 AC_MSG_CHECKING([for tgetent()])
2702 [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
2704 AC_MSG_ERROR([NOT FOUND!
2705 You need to install a terminal library; for example ncurses.
2706 Or specify the name of the library with --with-tlib.]))
2709 AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo],
2712 #include "confdefs.h"
2713 #ifdef HAVE_TERMCAP_H
2714 # include <termcap.h>
2716 #ifdef HAVE_STRING_H
2717 # include <string.h>
2720 # include <stdlib.h>
2721 # include <stddef.h>
2724 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
2730 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo')
2734 if test "x$vim_cv_terminfo" = "xyes" ; then
2738 if test "x$olibs" != "x$LIBS"; then
2739 AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
2742 #include "confdefs.h"
2743 #ifdef HAVE_TERMCAP_H
2744 # include <termcap.h>
2747 # include <stdlib.h>
2748 # include <stddef.h>
2751 {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
2755 vim_cv_tgent=non-zero
2757 AC_MSG_ERROR(failed to compile test program.)
2761 if test "x$vim_cv_tgent" = "xzero" ; then
2762 AC_DEFINE(TGETENT_ZERO_ERR, 0)
2766 AC_MSG_CHECKING(whether termcap.h contains ospeed)
2768 #ifdef HAVE_TERMCAP_H
2769 # include <termcap.h>
2771 ], [ospeed = 20000],
2772 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
2774 AC_MSG_CHECKING(whether ospeed can be extern)
2776 #ifdef HAVE_TERMCAP_H
2777 # include <termcap.h>
2779 extern short ospeed;
2780 ], [ospeed = 20000],
2781 AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
2785 AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
2787 #ifdef HAVE_TERMCAP_H
2788 # include <termcap.h>
2790 ], [if (UP == 0 && BC == 0) PC = 1],
2791 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
2793 AC_MSG_CHECKING([whether UP, BC and PC can be extern])
2795 #ifdef HAVE_TERMCAP_H
2796 # include <termcap.h>
2798 extern char *UP, *BC, PC;
2799 ], [if (UP == 0 && BC == 0) PC = 1],
2800 AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
2804 AC_MSG_CHECKING(whether tputs() uses outfuntype)
2806 #ifdef HAVE_TERMCAP_H
2807 # include <termcap.h>
2809 ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
2810 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
2813 dnl On some SCO machines sys/select redefines struct timeval
2814 AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
2816 #include <sys/types.h>
2817 #include <sys/time.h>
2818 #include <sys/select.h>], ,
2820 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
2823 dnl AC_DECL_SYS_SIGLIST
2825 dnl Checks for pty.c (copied from screen) ==========================
2826 AC_MSG_CHECKING(for /dev/ptc)
2827 if test -r /dev/ptc; then
2828 AC_DEFINE(HAVE_DEV_PTC)
2834 AC_MSG_CHECKING(for SVR4 ptys)
2835 if test -c /dev/ptmx ; then
2836 AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
2837 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
2843 AC_MSG_CHECKING(for ptyranges)
2844 if test -d /dev/ptym ; then
2854 ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
2855 dnl if test -c /dev/ptyp19; then
2856 dnl ptys=`echo /dev/ptyp??`
2858 dnl ptys=`echo $pdir/pty??`
2860 if test "$ptys" != "$pdir/pty??" ; then
2861 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
2862 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
2863 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
2864 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
2865 AC_MSG_RESULT([$p0 / $p1])
2867 AC_MSG_RESULT([don't know])
2870 dnl **** pty mode/group handling ****
2872 dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
2874 AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group],
2877 #include "confdefs.h"
2878 #include <sys/types.h>
2880 # include <stdlib.h>
2881 # include <stddef.h>
2883 #ifdef HAVE_UNISTD_H
2886 #include <sys/stat.h>
2895 if (!(x = ttyname(0))) exit(1);
2896 if (stat(x, &sb)) exit(1);
2898 if (om & 002) exit(0);
2899 m = system("mesg y");
2900 if (m == -1 || m == 127) exit(1);
2901 if (stat(x, &sb)) exit(1);
2903 if (chmod(x, om)) exit(1);
2904 if (m & 002) exit(0);
2905 if (sb.st_gid == getgid()) exit(1);
2906 if (!(fp=fopen("conftest_grp", "w")))
2908 fprintf(fp, "%d\n", sb.st_gid);
2913 if test -f conftest_grp; then
2914 vim_cv_tty_group=`cat conftest_grp`
2915 if test "x$vim_cv_tty_mode" = "x" ; then
2916 vim_cv_tty_mode=0620
2918 AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group])
2920 vim_cv_tty_group=world
2921 AC_MSG_RESULT([ptys are world accessible])
2924 vim_cv_tty_group=world
2925 AC_MSG_RESULT([can't determine - assume ptys are world accessible])
2927 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode')
2932 if test "x$vim_cv_tty_group" != "xworld" ; then
2933 AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group)
2934 if test "x$vim_cv_tty_mode" = "x" ; then
2935 AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (propably 0620)])
2937 AC_DEFINE(PTYMODE, 0620)
2941 dnl Checks for library functions. ===================================
2945 dnl find out what to use at the end of a signal function
2946 if test $ac_cv_type_signal = void; then
2947 AC_DEFINE(SIGRETURN, [return])
2949 AC_DEFINE(SIGRETURN, [return 0])
2952 dnl check if struct sigcontext is defined (used for SGI only)
2953 AC_MSG_CHECKING(for struct sigcontext)
2958 struct sigcontext *scont;
2959 scont = (struct sigcontext *)0;
2963 AC_DEFINE(HAVE_SIGCONTEXT),
2966 dnl tricky stuff: try to find out if getcwd() is implemented with
2967 dnl system("sh -c pwd")
2968 AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken],
2971 #include "confdefs.h"
2972 #ifdef HAVE_UNISTD_H
2975 char *dagger[] = { "IFS=pwd", 0 };
2979 extern char **environ;
2981 return getcwd(buffer, 500) ? 0 : 1;
2984 vim_cv_getcwd_broken=no
2986 vim_cv_getcwd_broken=yes
2988 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken')
2992 if test "x$vim_cv_getcwd_broken" = "xyes" ; then
2993 AC_DEFINE(BAD_GETCWD)
2996 dnl Check for functions in one big call, to reduce the size of configure.
2997 dnl Can only be used for functions that do not require any include.
2998 AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
2999 getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
3000 memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
3001 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
3002 sigvec strcasecmp strerror strftime stricmp strncasecmp \
3003 strnicmp strpbrk strtol tgetent towlower towupper iswupper \
3004 usleep utime utimes)
3007 dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
3008 dnl appropriate, so that off_t is 64 bits when needed.
3011 dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
3012 AC_MSG_CHECKING(for st_blksize)
3014 [#include <sys/types.h>
3015 #include <sys/stat.h>],
3020 n = (int)st.st_blksize;],
3021 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
3024 AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash],
3027 #include "confdefs.h"
3029 # include <stdlib.h>
3030 # include <stddef.h>
3032 #include <sys/types.h>
3033 #include <sys/stat.h>
3034 main() {struct stat st; exit(stat("configure/", &st) != 0); }
3036 vim_cv_stat_ignores_slash=yes
3038 vim_cv_stat_ignores_slash=no
3040 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash')
3044 if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then
3045 AC_DEFINE(STAT_IGNORES_SLASH)
3048 dnl Link with iconv for charset translation, if not found without library.
3049 dnl check for iconv() requires including iconv.h
3050 dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
3051 dnl has been installed.
3052 AC_MSG_CHECKING(for iconv_open())
3054 LIBS="$LIBS -liconv"
3059 ], [iconv_open("fr", "to");],
3060 AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
3066 ], [iconv_open("fr", "to");],
3067 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
3071 AC_MSG_CHECKING(for nl_langinfo(CODESET))
3073 #ifdef HAVE_LANGINFO_H
3074 # include <langinfo.h>
3076 ], [char *cs = nl_langinfo(CODESET);],
3077 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
3080 dnl Need various functions for floating point support. Only enable
3081 dnl floating point when they are all present.
3082 AC_CHECK_LIB(m, strtod)
3083 AC_MSG_CHECKING([for strtod() and other floating point functions])
3089 # include <stdlib.h>
3090 # include <stddef.h>
3092 ], [char *s; double d;
3093 d = strtod("1.1", &s);
3098 d = pow(1.11, 2.22);
3104 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
3107 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
3108 dnl when -lacl works, also try to use -lattr (required for Debian).
3109 AC_MSG_CHECKING(--disable-acl argument)
3111 [ --disable-acl Don't check for ACL support.],
3112 , [enable_acl="yes"])
3113 if test "$enable_acl" = "yes"; then
3115 AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
3116 AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
3117 AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
3119 AC_MSG_CHECKING(for POSIX ACL support)
3121 #include <sys/types.h>
3122 #ifdef HAVE_SYS_ACL_H
3123 # include <sys/acl.h>
3125 acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
3126 acl_set_file("foo", ACL_TYPE_ACCESS, acl);
3128 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
3131 AC_MSG_CHECKING(for Solaris ACL support)
3133 #ifdef HAVE_SYS_ACL_H
3134 # include <sys/acl.h>
3135 #endif], [acl("foo", GETACLCNT, 0, NULL);
3137 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
3140 AC_MSG_CHECKING(for AIX ACL support)
3143 # include <stdlib.h>
3144 # include <stddef.h>
3146 #ifdef HAVE_SYS_ACL_H
3147 # include <sys/acl.h>
3149 #ifdef HAVE_SYS_ACCESS_H
3150 # include <sys/access.h>
3154 #include <sys/stat.h>
3157 struct acl *aclent;], [aclsize = sizeof(struct acl);
3158 aclent = (void *)malloc(aclsize);
3159 statacl("foo", STX_NORMAL, aclent, aclsize);
3161 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
3167 AC_MSG_CHECKING(--disable-gpm argument)
3169 [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
3172 if test "$enable_gpm" = "yes"; then
3174 dnl Checking if gpm support can be compiled
3175 AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
3176 [olibs="$LIBS" ; LIBS="-lgpm"]
3179 #include <linux/keyboard.h>],
3180 [Gpm_GetLibVersion(NULL);],
3181 dnl Configure defines HAVE_GPM, if it is defined feature.h defines
3182 dnl FEAT_MOUSE_GPM if mouse support is included
3183 [vi_cv_have_gpm=yes],
3184 [vi_cv_have_gpm=no])
3187 if test $vi_cv_have_gpm = yes; then
3195 AC_MSG_CHECKING(--disable-sysmouse argument)
3196 AC_ARG_ENABLE(sysmouse,
3197 [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], ,
3198 [enable_sysmouse="yes"])
3200 if test "$enable_sysmouse" = "yes"; then
3202 dnl Checking if sysmouse support can be compiled
3203 dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h
3204 dnl defines FEAT_SYSMOUSE if mouse support is included
3205 AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse,
3207 [#include <sys/consio.h>
3209 #include <sys/fbio.h>],
3210 [struct mouse_info mouse;
3211 mouse.operation = MOUSE_MODE;
3212 mouse.operation = MOUSE_SHOW;
3213 mouse.u.mode.mode = 0;
3214 mouse.u.mode.signal = SIGUSR2;],
3215 [vi_cv_have_sysmouse=yes],
3216 [vi_cv_have_sysmouse=no])
3218 if test $vi_cv_have_sysmouse = yes; then
3219 AC_DEFINE(HAVE_SYSMOUSE)
3225 dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
3226 AC_MSG_CHECKING(for FD_CLOEXEC)
3231 [ int flag = FD_CLOEXEC;],
3232 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
3233 AC_MSG_RESULT(not usable))
3235 dnl rename needs to be checked separately to work on Nextstep with cc
3236 AC_MSG_CHECKING(for rename)
3237 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
3238 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
3241 dnl sysctl() may exist but not the arguments we use
3242 AC_MSG_CHECKING(for sysctl)
3244 [#include <sys/types.h>
3245 #include <sys/sysctl.h>],
3250 mib[1] = HW_USERMEM;
3252 (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
3254 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
3255 AC_MSG_RESULT(not usable))
3257 dnl sysinfo() may exist but not be Linux compatible
3258 AC_MSG_CHECKING(for sysinfo)
3260 [#include <sys/types.h>
3261 #include <sys/sysinfo.h>],
3262 [ struct sysinfo sinfo;
3265 (void)sysinfo(&sinfo);
3268 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
3269 AC_MSG_RESULT(not usable))
3271 dnl struct sysinfo may have the mem_unit field or not
3272 AC_MSG_CHECKING(for sysinfo.mem_unit)
3274 [#include <sys/types.h>
3275 #include <sys/sysinfo.h>],
3276 [ struct sysinfo sinfo;
3279 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT),
3282 dnl sysconf() may exist but not support what we want to use
3283 AC_MSG_CHECKING(for sysconf)
3285 [#include <unistd.h>],
3286 [ (void)sysconf(_SC_PAGESIZE);
3287 (void)sysconf(_SC_PHYS_PAGES);
3289 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
3290 AC_MSG_RESULT(not usable))
3292 AC_CHECK_SIZEOF([int])
3293 AC_CHECK_SIZEOF([long])
3294 AC_CHECK_SIZEOF([time_t])
3295 AC_CHECK_SIZEOF([off_t])
3297 dnl Make sure that uint32_t is really 32 bits unsigned.
3298 AC_MSG_CHECKING([uint32_t is 32 bits])
3300 #ifdef HAVE_STDINT_H
3301 # include <stdint.h>
3303 #ifdef HAVE_INTTYPES_H
3304 # include <inttypes.h>
3307 uint32_t nr1 = (uint32_t)-1;
3308 uint32_t nr2 = (uint32_t)0xffffffffUL;
3309 if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1);
3313 AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]),
3314 AC_MSG_WARN([cannot check uint32_t when cross-compiling.]))
3316 dnl Check for memmove() before bcopy(), makes memmove() be used when both are
3317 dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
3320 #include "confdefs.h"
3321 #ifdef HAVE_STRING_H
3322 # include <string.h>
3325 # include <stdlib.h>
3326 # include <stddef.h>
3330 strcpy(buf, "abcdefghi");
3331 mch_memmove(buf, buf + 2, 3);
3332 if (strncmp(buf, "ababcf", 6))
3334 strcpy(buf, "abcdefghi");
3335 mch_memmove(buf + 2, buf, 3);
3336 if (strncmp(buf, "cdedef", 6))
3338 exit(0); /* libc version works properly. */
3341 AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap],
3343 AC_RUN_IFELSE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]],
3345 vim_cv_memmove_handles_overlap=yes
3347 vim_cv_memmove_handles_overlap=no
3349 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap')
3353 if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then
3354 AC_DEFINE(USEMEMMOVE)
3356 AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap],
3358 AC_RUN_IFELSE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]],
3360 vim_cv_bcopy_handles_overlap=yes
3362 vim_cv_bcopy_handles_overlap=no
3364 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap')
3368 if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then
3371 AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap],
3373 AC_RUN_IFELSE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]],
3375 vim_cv_memcpy_handles_overlap=yes
3377 vim_cv_memcpy_handles_overlap=no
3379 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap')
3383 if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then
3384 AC_DEFINE(USEMEMCPY)
3390 dnl Check for multibyte locale functions
3391 dnl Find out if _Xsetlocale() is supported by libX11.
3392 dnl Check if X_LOCALE should be defined.
3394 if test "$enable_multibyte" = "yes"; then
3396 ldflags_save=$LDFLAGS
3397 if test "x$x_includes" != "xNONE" ; then
3398 CFLAGS="$CFLAGS -I$x_includes"
3399 LDFLAGS="$X_LIBS $LDFLAGS -lX11"
3400 AC_MSG_CHECKING(whether X_LOCALE needed)
3401 AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
3402 AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
3403 AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
3407 LDFLAGS=$ldflags_save
3410 dnl Link with xpg4, it is said to make Korean locale working
3411 AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
3413 dnl Check how we can run ctags. Default to "ctags" when nothing works.
3414 dnl Use --version to detect Exuberant ctags (preferred)
3415 dnl Add --fields=+S to get function signatures for omni completion.
3416 dnl -t for typedefs (many ctags have this)
3417 dnl -s for static functions (Elvis ctags only?)
3418 dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
3419 dnl -i+m to test for older Exuberant ctags
3420 AC_MSG_CHECKING(how to create tags)
3421 test -f tags && mv tags tags.save
3422 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
3423 TAGPRG="ctags -I INIT+ --fields=+S"
3424 elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
3425 TAGPRG="exctags -I INIT+ --fields=+S"
3426 elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
3427 TAGPRG="exuberant-ctags -I INIT+ --fields=+S"
3430 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
3431 (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
3432 (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
3433 (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
3434 (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
3435 (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
3436 (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
3438 test -f tags.save && mv tags.save tags
3439 AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
3441 dnl Check how we can run man with a section number
3442 AC_MSG_CHECKING(how to run man with a section nr)
3444 (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
3445 AC_MSG_RESULT($MANDEF)
3446 if test "$MANDEF" = "man -s"; then
3450 dnl Check if gettext() is working and if it needs -lintl
3451 AC_MSG_CHECKING(--disable-nls argument)
3453 [ --disable-nls Don't support NLS (gettext()).], ,
3456 if test "$enable_nls" = "yes"; then
3459 INSTALL_LANGS=install-languages
3460 AC_SUBST(INSTALL_LANGS)
3461 INSTALL_TOOL_LANGS=install-tool-languages
3462 AC_SUBST(INSTALL_TOOL_LANGS)
3464 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
3465 AC_MSG_CHECKING([for NLS])
3466 if test -f po/Makefile; then
3468 if test -n "$MSGFMT"; then
3470 [#include <libintl.h>],
3472 AC_MSG_RESULT([gettext() works]); have_gettext="yes",
3476 [#include <libintl.h>],
3478 AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes",
3479 AC_MSG_RESULT([gettext() doesn't work]);
3482 AC_MSG_RESULT([msgfmt not found - disabled]);
3484 if test $have_gettext = "yes"; then
3485 AC_DEFINE(HAVE_GETTEXT)
3488 dnl this was added in GNU gettext 0.10.36
3489 AC_CHECK_FUNCS(bind_textdomain_codeset)
3490 dnl _nl_msg_cat_cntr is required for GNU gettext
3491 AC_MSG_CHECKING([for _nl_msg_cat_cntr])
3493 [#include <libintl.h>
3494 extern int _nl_msg_cat_cntr;],
3495 [++_nl_msg_cat_cntr;],
3496 AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
3497 AC_MSG_RESULT([no]))
3500 AC_MSG_RESULT([no "po/Makefile" - disabled]);
3506 dnl Check for dynamic linking loader
3507 AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
3508 if test x${DLL} = xdlfcn.h; then
3509 AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
3510 AC_MSG_CHECKING([for dlopen()])
3512 extern void* dlopen();
3516 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
3518 AC_MSG_CHECKING([for dlopen() in -ldl])
3522 extern void* dlopen();
3526 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
3529 dnl ReliantUNIX has dlopen() in libc but everything else in libdl
3531 AC_MSG_CHECKING([for dlsym()])
3533 extern void* dlsym();
3537 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
3539 AC_MSG_CHECKING([for dlsym() in -ldl])
3543 extern void* dlsym();
3547 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
3550 elif test x${DLL} = xdl.h; then
3551 AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
3552 AC_MSG_CHECKING([for shl_load()])
3554 extern void* shl_load();
3558 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
3560 AC_MSG_CHECKING([for shl_load() in -ldld])
3564 extern void* shl_load();
3568 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
3572 AC_CHECK_HEADERS(setjmp.h)
3574 if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
3575 dnl -ldl must come after DynaLoader.a
3576 if echo $LIBS | grep -e '-ldl' >/dev/null; then
3577 LIBS=`echo $LIBS | sed s/-ldl//`
3578 PERL_LIBS="$PERL_LIBS -ldl"
3582 if test "x$MACOSX" = "xyes"; then
3583 AC_MSG_CHECKING(whether we need -framework Cocoa)
3584 dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is
3585 dnl disabled during tiny build)
3586 if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then
3587 LIBS=$"$LIBS -framework Cocoa"
3593 if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then
3594 LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
3597 dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
3598 dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
3599 dnl But only when making dependencies, cproto and lint don't take "-isystem".
3600 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
3601 dnl the number before the version number.
3602 DEPEND_CFLAGS_FILTER=
3603 if test "$GCC" = yes; then
3604 AC_MSG_CHECKING(for GCC 3 or later)
3605 gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
3606 if test "$gccmajor" -gt "2"; then
3607 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
3612 dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
3613 dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
3614 dnl Also remove duplicate _FORTIFY_SOURCE arguments.
3615 dnl And undefine it first to avoid a warning.
3616 AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
3617 if test "$gccmajor" -gt "3"; then
3618 CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
3624 AC_SUBST(DEPEND_CFLAGS_FILTER)
3626 dnl link.sh tries to avoid overlinking in a hackish way.
3627 dnl At least GNU ld supports --as-needed which provides the same functionality
3628 dnl at linker level. Let's use it.
3629 AC_MSG_CHECKING(linker --as-needed support)
3631 # Check if linker supports --as-needed and --no-as-needed options
3632 if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then
3633 LDFLAGS="$LDFLAGS -Wl,--as-needed"
3636 if test "$LINK_AS_NEEDED" = yes; then
3641 AC_SUBST(LINK_AS_NEEDED)
3643 dnl write output files
3644 AC_OUTPUT(auto/config.mk:config.mk.in)
3646 dnl vim: set sw=2 tw=78 fo+=l: