1 To: vim_dev@googlegroups.com
2 Subject: Patch 8.0.0082
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Extension for configure should be ".ac".
12 Solution: Rename configure.in to configure.ac. (James McCoy, closes #1173)
13 Files: src/configure.in, src/configure.ac, Filelist, src/Makefile,
14 src/blowfish.c, src/channel.c, src/config.h.in, src/main.aap,
15 src/os_unix.c, src/INSTALL, src/mysign
18 *** ../vim-8.0.0081/src/configure.in 2016-10-18 16:27:20.544756017 +0200
19 --- src/configure.in 1970-01-01 01:00:00.000000000 +0100
22 - dnl configure.in: autoconf script for Vim
24 - dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
25 - dnl Should also work with autoconf 2.54 and later.
28 - AC_CONFIG_HEADER(auto/config.h:config.h.in)
30 - dnl Being able to run configure means the system is Unix (compatible).
34 - dnl Checks for programs.
35 - AC_PROG_CC dnl required by almost everything
36 - AC_PROG_CPP dnl required by header file checks
37 - AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
38 - AC_PROG_FGREP dnl finds working grep -F
39 - AC_ISC_POSIX dnl required by AC_C_CROSS
40 - AC_PROG_AWK dnl required for "make html" in ../doc
42 - dnl Don't strip if we don't have it
43 - AC_CHECK_PROG(STRIP, strip, strip, :)
45 - dnl Check for extension of executables
48 - dnl Check for standard headers. We don't use this in Vim but other stuff
49 - dnl in autoconf needs it, where it uses STDC_HEADERS.
53 - dnl Check for the flag that fails if stuff are missing.
55 - AC_MSG_CHECKING(--enable-fail-if-missing argument)
56 - AC_ARG_ENABLE(fail_if_missing,
57 - [ --enable-fail-if-missing Fail if dependencies on additional features
58 - specified on the command line are missing.],
59 - [fail_if_missing="yes"],
60 - [fail_if_missing="no"])
61 - AC_MSG_RESULT($fail_if_missing)
63 - dnl Set default value for CFLAGS if none is defined or it's empty
64 - if test -z "$CFLAGS"; then
66 - test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
68 - if test "$GCC" = yes; then
69 - dnl method that should work for nearly all versions
70 - gccversion=`$CC -dumpversion`
71 - if test "x$gccversion" = "x"; then
72 - dnl old method; fall-back for when -dumpversion doesn't work
73 - gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
75 - dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
76 - if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
77 - echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
78 - CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
80 - if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
81 - echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
82 - CFLAGS="$CFLAGS -fno-strength-reduce"
87 - dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
88 - dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
89 - dnl the version number of the clang in use.
90 - dnl Note that this does not work to get the version of clang 3.1 or 3.2.
91 - AC_MSG_CHECKING(for recent clang version)
92 - CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
93 - if test x"$CLANG_VERSION_STRING" != x"" ; then
94 - CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
95 - CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
96 - CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
97 - CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
98 - AC_MSG_RESULT($CLANG_VERSION)
99 - dnl If you find the same issue with versions earlier than 500.2.75,
100 - dnl change the constant 500002075 below appropriately. To get the
101 - dnl integer corresponding to a version number, refer to the
102 - dnl definition of CLANG_VERSION above.
103 - if test "$CLANG_VERSION" -ge 500002075 ; then
104 - CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
110 - dnl If configure thinks we are cross compiling, there might be something
111 - dnl wrong with the CC or CFLAGS settings, give a useful warning message
113 - if test "$cross_compiling" = yes; then
114 - AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS])
117 - AC_SUBST(CROSS_COMPILING)
119 - dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
120 - dnl But gcc 3.1 changed the meaning! See near the end.
121 - test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
123 - if test -f ./toolcheck; then
124 - AC_CHECKING(for buggy tools)
125 - sh ./toolcheck 1>&AC_FD_MSG
128 - OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
130 - dnl Check for BeOS, which needs an extra source file
131 - AC_MSG_CHECKING(for BeOS)
133 - BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
134 - BEOS=yes; AC_MSG_RESULT(yes);;
135 - *) BEOS=no; AC_MSG_RESULT(no);;
138 - dnl If QNX is found, assume we don't want to use Xphoton
139 - dnl unless it was specifically asked for (--with-x)
140 - AC_MSG_CHECKING(for QNX)
142 - QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
143 - test -z "$with_x" && with_x=no
144 - QNX=yes; AC_MSG_RESULT(yes);;
145 - *) QNX=no; AC_MSG_RESULT(no);;
148 - dnl Check for Darwin and MacOS X
149 - dnl We do a check for MacOS X in the very beginning because there
150 - dnl are a lot of other things we need to change besides GUI stuff
151 - AC_MSG_CHECKING([for Darwin (Mac OS X)])
152 - if test "`(uname) 2>/dev/null`" = Darwin; then
155 - AC_MSG_CHECKING(--disable-darwin argument)
156 - AC_ARG_ENABLE(darwin,
157 - [ --disable-darwin Disable Darwin (Mac OS X) support.],
158 - , [enable_darwin="yes"])
159 - if test "$enable_darwin" = "yes"; then
161 - AC_MSG_CHECKING(if Darwin files are there)
162 - if test -f os_macosx.m; then
165 - AC_MSG_RESULT([no, Darwin support disabled])
169 - AC_MSG_RESULT([yes, Darwin support excluded])
172 - AC_MSG_CHECKING(--with-mac-arch argument)
173 - AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
174 - MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
175 - MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
177 - AC_MSG_CHECKING(--with-developer-dir argument)
178 - AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools],
179 - DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
180 - AC_MSG_RESULT(not present))
182 - if test "x$DEVELOPER_DIR" = "x"; then
183 - AC_PATH_PROG(XCODE_SELECT, xcode-select)
184 - if test "x$XCODE_SELECT" != "x"; then
185 - AC_MSG_CHECKING(for developer dir using xcode-select)
186 - DEVELOPER_DIR=`$XCODE_SELECT -print-path`
187 - AC_MSG_RESULT([$DEVELOPER_DIR])
189 - DEVELOPER_DIR=/Developer
193 - if test "x$MACARCH" = "xboth"; then
194 - AC_MSG_CHECKING(for 10.4 universal SDK)
195 - dnl There is a terrible inconsistency (but we appear to get away with it):
196 - dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
197 - dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
198 - dnl tests using the preprocessor are actually done with the wrong header
199 - dnl files. $LDFLAGS is set at the end, because configure uses it together
200 - dnl with $CFLAGS and we can only have one -sysroot argument.
201 - save_cppflags="$CPPFLAGS"
202 - save_cflags="$CFLAGS"
203 - save_ldflags="$LDFLAGS"
204 - CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
205 - AC_TRY_LINK([ ], [ ],
206 - AC_MSG_RESULT(found, will make universal binary),
208 - AC_MSG_RESULT(not found)
209 - CFLAGS="$save_cflags"
210 - AC_MSG_CHECKING(if Intel architecture is supported)
211 - CPPFLAGS="$CPPFLAGS -arch i386"
212 - LDFLAGS="$save_ldflags -arch i386"
213 - AC_TRY_LINK([ ], [ ],
214 - AC_MSG_RESULT(yes); MACARCH="intel",
215 - AC_MSG_RESULT(no, using PowerPC)
217 - CPPFLAGS="$save_cppflags -arch ppc"
218 - LDFLAGS="$save_ldflags -arch ppc"))
219 - elif test "x$MACARCH" = "xintel"; then
220 - CPPFLAGS="$CPPFLAGS -arch intel"
221 - LDFLAGS="$LDFLAGS -arch intel"
222 - elif test "x$MACARCH" = "xppc"; then
223 - CPPFLAGS="$CPPFLAGS -arch ppc"
224 - LDFLAGS="$LDFLAGS -arch ppc"
227 - if test "$enable_darwin" = "yes"; then
229 - OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
230 - OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
231 - dnl TODO: use -arch i386 on Intel machines
232 - dnl Removed -no-cpp-precomp, only for very old compilers.
233 - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX"
235 - dnl If Carbon is found, assume we don't want X11
236 - dnl unless it was specifically asked for (--with-x)
237 - dnl or Motif, Athena or GTK GUI is used.
238 - AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
239 - if test "x$CARBON" = "xyes"; then
240 - if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then
246 - dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
247 - dnl free. This happens in expand_filename(), because the optimizer swaps
248 - dnl two blocks of code, both using "repl", that can't be swapped.
249 - if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
250 - CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
257 - dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon
258 - dnl so we need to include it to have access to version macros.
259 - AC_CHECK_HEADERS(AvailabilityMacros.h)
261 - AC_SUBST(OS_EXTRA_SRC)
262 - AC_SUBST(OS_EXTRA_OBJ)
264 - dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
265 - dnl Only when the directory exists and it wasn't there yet.
266 - dnl For gcc don't do this when it is already in the default search path.
267 - dnl Skip all of this when cross-compiling.
268 - if test "$cross_compiling" = no; then
269 - AC_MSG_CHECKING(--with-local-dir argument)
270 - have_local_include=''
272 - AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries.
273 - --without-local-dir do not search /usr/local for local libraries.], [
274 - local_dir="$withval"
278 - # avoid adding local dir to LDFLAGS and CPPFLAGS
279 - have_local_include=yes
282 - *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;;
284 - AC_MSG_RESULT($local_dir)
286 - local_dir=/usr/local
287 - AC_MSG_RESULT(Defaulting to $local_dir)
289 - if test "$GCC" = yes -a "$local_dir" != no; then
290 - echo 'void f(){}' > conftest.c
291 - dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler)
292 - have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
293 - have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
294 - rm -f conftest.c conftest.o
296 - if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then
297 - tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"`
298 - if test "$tt" = "$LDFLAGS"; then
299 - LDFLAGS="$LDFLAGS -L${local_dir}/lib"
302 - if test -z "$have_local_include" -a -d "${local_dir}/include"; then
303 - tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
304 - if test "$tt" = "$CPPFLAGS"; then
305 - CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
310 - AC_MSG_CHECKING(--with-vim-name argument)
311 - AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
312 - VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
313 - VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
315 - AC_MSG_CHECKING(--with-ex-name argument)
316 - AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
317 - EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
318 - EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
320 - AC_MSG_CHECKING(--with-view-name argument)
321 - AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
322 - VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
323 - VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
326 - AC_MSG_CHECKING(--with-global-runtime argument)
327 - AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
328 - AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
331 - AC_MSG_CHECKING(--with-modified-by argument)
332 - AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
333 - AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
336 - dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix
337 - AC_MSG_CHECKING(if character set is EBCDIC)
338 - AC_TRY_COMPILE([ ],
339 - [ /* TryCompile function for CharSet.
340 - Treat any failure as ASCII for compatibility with existing art.
341 - Use compile-time rather than run-time tests for cross-compiler
344 - make an error "Character set is not EBCDIC"
346 - [ # TryCompile action if true
347 - cf_cv_ebcdic=yes ],
348 - [ # TryCompile action if false
350 - # end of TryCompile ])
351 - # end of CacheVal CvEbcdic
352 - AC_MSG_RESULT($cf_cv_ebcdic)
353 - case "$cf_cv_ebcdic" in #(vi
354 - yes) AC_DEFINE(EBCDIC)
357 - *) line_break='"\\012"';;
359 - AC_SUBST(line_break)
361 - if test "$cf_cv_ebcdic" = "yes"; then
362 - dnl If we have EBCDIC we most likely have z/OS Unix, let's test it!
363 - AC_MSG_CHECKING(for z/OS Unix)
365 - OS/390) zOSUnix="yes";
366 - dnl If using cc the environment variable _CC_CCMODE must be
367 - dnl set to "1", so that some compiler extensions are enabled.
368 - dnl If using c89 the environment variable is named _CC_C89MODE.
369 - dnl Note: compile with c89 never tested.
370 - if test "$CC" = "cc"; then
374 - if test "$CC" = "c89"; then
381 - if test "$ccm" != "1"; then
383 - echo "------------------------------------------"
384 - echo " On z/OS Unix, the environment variable"
385 - echo " _CC_${ccn}MODE must be set to \"1\"!"
387 - echo " export _CC_${ccn}MODE=1"
388 - echo " and then call configure again."
389 - echo "------------------------------------------"
392 - # Set CFLAGS for configure process.
393 - # This will be reset later for config.mk.
394 - # Use haltonmsg to force error for missing H files.
395 - CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)";
396 - LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
405 - dnl Set QUOTESED. Needs additional backslashes on zOS
406 - if test "$zOSUnix" = "yes"; then
407 - QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'"
409 - QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'"
414 - dnl Link with -lsmack for Smack stuff; if not found
415 - AC_MSG_CHECKING(--disable-smack argument)
416 - AC_ARG_ENABLE(smack,
417 - [ --disable-smack Do not check for Smack support.],
418 - , enable_smack="yes")
419 - if test "$enable_smack" = "yes"; then
421 - AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
425 - if test "$enable_smack" = "yes"; then
426 - AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no")
428 - if test "$enable_smack" = "yes"; then
429 - AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h)
430 - AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>],
431 - AC_MSG_RESULT(yes),
432 - AC_MSG_RESULT(no); enable_smack="no")
434 - if test "$enable_smack" = "yes"; then
435 - AC_CHECK_LIB(attr, setxattr,
436 - [LIBS="$LIBS -lattr"
438 - AC_DEFINE(HAVE_SMACK)])
441 - dnl When smack was found don't search for SELinux
442 - if test "x$found_smack" = "x"; then
443 - dnl Link with -lselinux for SELinux stuff; if not found
444 - AC_MSG_CHECKING(--disable-selinux argument)
445 - AC_ARG_ENABLE(selinux,
446 - [ --disable-selinux Do not check for SELinux support.],
447 - , enable_selinux="yes")
448 - if test "$enable_selinux" = "yes"; then
450 - AC_CHECK_LIB(selinux, is_selinux_enabled,
451 - [LIBS="$LIBS -lselinux"
452 - AC_DEFINE(HAVE_SELINUX)])
458 - dnl Check user requested features.
460 - AC_MSG_CHECKING(--with-features argument)
461 - AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: huge)],
462 - features="$withval"; AC_MSG_RESULT($features),
463 - features="huge"; AC_MSG_RESULT(Defaulting to huge))
467 - case "$features" in
468 - tiny) AC_DEFINE(FEAT_TINY) ;;
469 - small) AC_DEFINE(FEAT_SMALL) ;;
470 - normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
471 - dogvimdiff="installgvimdiff" ;;
472 - big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
473 - dogvimdiff="installgvimdiff" ;;
474 - huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
475 - dogvimdiff="installgvimdiff" ;;
476 - *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
479 - AC_SUBST(dovimdiff)
480 - AC_SUBST(dogvimdiff)
482 - AC_MSG_CHECKING(--with-compiledby argument)
483 - AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
484 - compiledby="$withval"; AC_MSG_RESULT($withval),
485 - compiledby=""; AC_MSG_RESULT(no))
486 - AC_SUBST(compiledby)
488 - AC_MSG_CHECKING(--disable-xsmp argument)
489 - AC_ARG_ENABLE(xsmp,
490 - [ --disable-xsmp Disable XSMP session management],
491 - , enable_xsmp="yes")
493 - if test "$enable_xsmp" = "yes"; then
495 - AC_MSG_CHECKING(--disable-xsmp-interact argument)
496 - AC_ARG_ENABLE(xsmp-interact,
497 - [ --disable-xsmp-interact Disable XSMP interaction],
498 - , enable_xsmp_interact="yes")
499 - if test "$enable_xsmp_interact" = "yes"; then
501 - AC_DEFINE(USE_XSMP_INTERACT)
509 - dnl Check for Lua feature.
510 - AC_MSG_CHECKING(--enable-luainterp argument)
511 - AC_ARG_ENABLE(luainterp,
512 - [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
513 - [enable_luainterp="no"])
514 - AC_MSG_RESULT($enable_luainterp)
516 - if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
517 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
518 - AC_MSG_ERROR([cannot use Lua with tiny or small features])
521 - dnl -- find the lua executable
522 - AC_SUBST(vi_cv_path_lua)
524 - AC_MSG_CHECKING(--with-lua-prefix argument)
525 - AC_ARG_WITH(lua_prefix,
526 - [ --with-lua-prefix=PFX Prefix where Lua is installed.],
527 - with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
528 - with_lua_prefix="";AC_MSG_RESULT(no))
530 - if test "X$with_lua_prefix" != "X"; then
531 - vi_cv_path_lua_pfx="$with_lua_prefix"
533 - AC_MSG_CHECKING(LUA_PREFIX environment var)
534 - if test "X$LUA_PREFIX" != "X"; then
535 - AC_MSG_RESULT("$LUA_PREFIX")
536 - vi_cv_path_lua_pfx="$LUA_PREFIX"
538 - AC_MSG_RESULT([not set, default to /usr])
539 - vi_cv_path_lua_pfx="/usr"
543 - AC_MSG_CHECKING(--with-luajit)
544 - AC_ARG_WITH(luajit,
545 - [ --with-luajit Link with LuaJIT instead of Lua.],
546 - [vi_cv_with_luajit="$withval"],
547 - [vi_cv_with_luajit="no"])
548 - AC_MSG_RESULT($vi_cv_with_luajit)
551 - if test "X$vi_cv_path_lua_pfx" != "X"; then
552 - if test "x$vi_cv_with_luajit" != "xno"; then
553 - dnl -- try to find LuaJIT executable
554 - AC_PATH_PROG(vi_cv_path_luajit, luajit)
555 - if test "X$vi_cv_path_luajit" != "X"; then
556 - dnl -- find LuaJIT version
557 - AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit,
558 - [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]*\)* .*/\1/'` ])
559 - AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit,
560 - [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ])
561 - vi_cv_path_lua="$vi_cv_path_luajit"
562 - vi_cv_version_lua="$vi_cv_version_lua_luajit"
565 - dnl -- try to find Lua executable
566 - AC_PATH_PROG(vi_cv_path_plain_lua, lua)
567 - if test "X$vi_cv_path_plain_lua" != "X"; then
568 - dnl -- find Lua version
569 - AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua,
570 - [ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
572 - vi_cv_path_lua="$vi_cv_path_plain_lua"
573 - vi_cv_version_lua="$vi_cv_version_plain_lua"
575 - if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then
576 - AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit)
577 - if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then
579 - LUA_INC=/luajit-$vi_cv_version_luajit
582 - if test "X$LUA_INC" = "X"; then
583 - AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
584 - if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then
588 - AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
589 - if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
591 - LUA_INC=/lua$vi_cv_version_lua
594 - vi_cv_path_lua_pfx=
600 - if test "X$vi_cv_path_lua_pfx" != "X"; then
601 - if test "x$vi_cv_with_luajit" != "xno"; then
602 - multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
603 - if test "X$multiarch" != "X"; then
604 - lib_multiarch="lib/${multiarch}"
606 - lib_multiarch="lib"
608 - if test "X$vi_cv_version_lua" = "X"; then
609 - LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit"
611 - LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua"
614 - if test "X$LUA_INC" != "X"; then
615 - dnl Test alternate location using version
616 - LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
618 - LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
621 - if test "$enable_luainterp" = "dynamic"; then
624 - AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane])
626 - LIBS="$LIBS $LUA_LIBS"
628 - AC_MSG_RESULT(yes); lua_ok="yes",
629 - AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="")
632 - if test "x$lua_ok" = "xyes"; then
633 - LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}"
635 - LUA_OBJ="objects/if_lua.o"
636 - LUA_PRO="if_lua.pro"
637 - AC_DEFINE(FEAT_LUA)
639 - if test "$enable_luainterp" = "dynamic"; then
640 - if test "x$vi_cv_with_luajit" != "xno"; then
643 - if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
644 - vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
646 - if test "x$MACOSX" = "xyes"; then
651 - indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9"
652 - multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
653 - if test "X$multiarch" != "X"; then
654 - lib_multiarch="lib/${multiarch}"
657 - dnl Determine the sover for the current version, but fallback to
658 - dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found.
659 - AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx)
660 - for subdir in "${lib_multiarch}" lib64 lib; do
661 - if test -z "$subdir"; then
664 - for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \
665 - ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do
666 - for i in $indexes ""; do
667 - if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then
675 - if test "X$sover" = "X"; then
678 - vi_cv_dll_name_lua="liblua${luajit}.${ext}"
682 - vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2"
685 - AC_DEFINE(DYNAMIC_LUA)
687 - LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
689 - if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
690 - test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
691 - test "`(uname -m) 2>/dev/null`" = "x86_64"; then
692 - dnl OSX/x64 requires these flags. See http://luajit.org/install.html
693 - LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
696 - if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then
697 - AC_MSG_ERROR([could not configure lua])
703 - AC_SUBST(LUA_CFLAGS)
707 - dnl Check for MzScheme feature.
708 - AC_MSG_CHECKING(--enable-mzschemeinterp argument)
709 - AC_ARG_ENABLE(mzschemeinterp,
710 - [ --enable-mzschemeinterp Include MzScheme interpreter.], ,
711 - [enable_mzschemeinterp="no"])
712 - AC_MSG_RESULT($enable_mzschemeinterp)
714 - if test "$enable_mzschemeinterp" = "yes"; then
715 - dnl -- find the mzscheme executable
716 - AC_SUBST(vi_cv_path_mzscheme)
718 - AC_MSG_CHECKING(--with-plthome argument)
719 - AC_ARG_WITH(plthome,
720 - [ --with-plthome=PLTHOME Use PLTHOME.],
721 - with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
722 - with_plthome="";AC_MSG_RESULT("no"))
724 - if test "X$with_plthome" != "X"; then
725 - vi_cv_path_mzscheme_pfx="$with_plthome"
726 - vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
728 - AC_MSG_CHECKING(PLTHOME environment var)
729 - if test "X$PLTHOME" != "X"; then
730 - AC_MSG_RESULT("$PLTHOME")
731 - vi_cv_path_mzscheme_pfx="$PLTHOME"
732 - vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
734 - AC_MSG_RESULT(not set)
735 - dnl -- try to find MzScheme executable
736 - AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
738 - dnl resolve symbolic link, the executable is often elsewhere and there
739 - dnl are no links for the include files.
740 - if test "X$vi_cv_path_mzscheme" != "X"; then
741 - lsout=`ls -l $vi_cv_path_mzscheme`
742 - if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
743 - vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
747 - if test "X$vi_cv_path_mzscheme" != "X"; then
748 - dnl -- find where MzScheme thinks it was installed
749 - AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
750 - dnl different versions of MzScheme differ in command line processing
751 - dnl use universal approach
752 - echo "(display (simplify-path \
753 - (build-path (call-with-values \
754 - (lambda () (split-path (find-system-path (quote exec-file)))) \
755 - (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
756 - dnl Remove a trailing slash
757 - [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
758 - sed -e 's+/$++'` ])
764 - if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
765 - AC_MSG_CHECKING(for racket include directory)
766 - SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'`
767 - if test "X$SCHEME_INC" != "X"; then
768 - AC_MSG_RESULT(${SCHEME_INC})
770 - AC_MSG_RESULT(not found)
771 - AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
772 - if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
773 - SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
777 - AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
778 - if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
780 - SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
783 - AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
784 - if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
786 - SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
789 - AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
790 - if test -f /usr/include/plt/scheme.h; then
792 - SCHEME_INC=/usr/include/plt
795 - AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
796 - if test -f /usr/include/racket/scheme.h; then
798 - SCHEME_INC=/usr/include/racket
801 - vi_cv_path_mzscheme_pfx=
810 - if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
812 - AC_MSG_CHECKING(for racket lib directory)
813 - SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'`
814 - if test "X$SCHEME_LIB" != "X"; then
815 - AC_MSG_RESULT(${SCHEME_LIB})
817 - AC_MSG_RESULT(not found)
820 - for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
821 - if test "X$path" != "X"; then
822 - if test "x$MACOSX" = "xyes"; then
823 - MZSCHEME_LIBS="-framework Racket"
824 - MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
825 - elif test -f "${path}/libmzscheme3m.a"; then
826 - MZSCHEME_LIBS="${path}/libmzscheme3m.a"
827 - MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
828 - elif test -f "${path}/libracket3m.a"; then
829 - MZSCHEME_LIBS="${path}/libracket3m.a"
830 - MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
831 - elif test -f "${path}/libracket.a"; then
832 - MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a"
833 - elif test -f "${path}/libmzscheme.a"; then
834 - MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a"
836 - dnl Using shared objects
837 - if test -f "${path}/libmzscheme3m.so"; then
838 - MZSCHEME_LIBS="-L${path} -lmzscheme3m"
839 - MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
840 - elif test -f "${path}/libracket3m.so"; then
841 - MZSCHEME_LIBS="-L${path} -lracket3m"
842 - MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
843 - elif test -f "${path}/libracket.so"; then
844 - MZSCHEME_LIBS="-L${path} -lracket -lmzgc"
846 - dnl try next until last
847 - if test "$path" != "$SCHEME_LIB"; then
850 - MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc"
852 - if test "$GCC" = yes; then
853 - dnl Make Vim remember the path to the library. For when it's not in
854 - dnl $LD_LIBRARY_PATH.
855 - MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
856 - elif test "`(uname) 2>/dev/null`" = SunOS &&
857 - uname -r | grep '^5' >/dev/null; then
858 - MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
862 - if test "X$MZSCHEME_LIBS" != "X"; then
867 - AC_MSG_CHECKING([if racket requires -pthread])
868 - if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then
870 - MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread"
871 - MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread"
876 - AC_MSG_CHECKING(for racket config directory)
877 - SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'`
878 - if test "X$SCHEME_CONFIGDIR" != "X"; then
879 - MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'"
880 - AC_MSG_RESULT(${SCHEME_CONFIGDIR})
882 - AC_MSG_RESULT(not found)
885 - AC_MSG_CHECKING(for racket collects directory)
886 - SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'`
887 - if test "X$SCHEME_COLLECTS" = "X"; then
888 - if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
889 - SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
891 - if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
892 - SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
894 - if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
895 - SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
897 - if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
898 - SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
904 - if test "X$SCHEME_COLLECTS" != "X" ; then
905 - AC_MSG_RESULT(${SCHEME_COLLECTS})
907 - AC_MSG_RESULT(not found)
910 - AC_MSG_CHECKING(for mzscheme_base.c)
911 - if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
912 - MZSCHEME_EXTRA="mzscheme_base.c"
913 - MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
914 - MZSCHEME_MOD="++lib scheme/base"
916 - if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then
917 - MZSCHEME_EXTRA="mzscheme_base.c"
918 - MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
919 - MZSCHEME_MOD="++lib scheme/base"
921 - if test -f "${SCHEME_COLLECTS}collects/racket/base.rkt" ; then
922 - MZSCHEME_EXTRA="mzscheme_base.c"
923 - MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/raco ctool"
928 - if test "X$MZSCHEME_EXTRA" != "X" ; then
929 - dnl need to generate bytecode for MzScheme base
930 - MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
931 - AC_MSG_RESULT(needed)
933 - AC_MSG_RESULT(not needed)
936 - dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'".
937 - AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"])
939 - MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
940 - -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'"
942 - dnl Test that we can compile a simple program with these CFLAGS and LIBS.
943 - AC_MSG_CHECKING([if compile and link flags for MzScheme are sane])
944 - cflags_save=$CFLAGS
946 - CFLAGS="$CFLAGS $MZSCHEME_CFLAGS"
947 - LIBS="$LIBS $MZSCHEME_LIBS"
949 - AC_MSG_RESULT(yes); mzs_ok=yes,
950 - AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no)
951 - CFLAGS=$cflags_save
953 - if test $mzs_ok = yes; then
954 - MZSCHEME_SRC="if_mzsch.c"
955 - MZSCHEME_OBJ="objects/if_mzsch.o"
956 - MZSCHEME_PRO="if_mzsch.pro"
957 - AC_DEFINE(FEAT_MZSCHEME)
965 - AC_SUBST(MZSCHEME_SRC)
966 - AC_SUBST(MZSCHEME_OBJ)
967 - AC_SUBST(MZSCHEME_PRO)
968 - AC_SUBST(MZSCHEME_LIBS)
969 - AC_SUBST(MZSCHEME_CFLAGS)
970 - AC_SUBST(MZSCHEME_EXTRA)
971 - AC_SUBST(MZSCHEME_MZC)
975 - AC_MSG_CHECKING(--enable-perlinterp argument)
976 - AC_ARG_ENABLE(perlinterp,
977 - [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
978 - [enable_perlinterp="no"])
979 - AC_MSG_RESULT($enable_perlinterp)
980 - if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
981 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
982 - AC_MSG_ERROR([cannot use Perl with tiny or small features])
984 - AC_SUBST(vi_cv_path_perl)
985 - AC_PATH_PROG(vi_cv_path_perl, perl)
986 - if test "X$vi_cv_path_perl" != "X"; then
987 - AC_MSG_CHECKING(Perl version)
988 - if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
989 - eval `$vi_cv_path_perl -V:usethreads`
990 - eval `$vi_cv_path_perl -V:libperl`
991 - if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
994 - if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
995 - eval `$vi_cv_path_perl -V:use5005threads`
996 - if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
1000 - AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
1004 - AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
1007 - if test $badthreads = no; then
1009 - eval `$vi_cv_path_perl -V:shrpenv`
1010 - if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
1013 - vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
1014 - AC_SUBST(vi_cv_perllib)
1015 - vi_cv_perl_extutils=unknown_perl_extutils_path
1016 - for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
1017 - xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
1018 - if test -f "$xsubpp_path"; then
1019 - vi_cv_perl_xsubpp="$xsubpp_path"
1022 - AC_SUBST(vi_cv_perl_xsubpp)
1023 - dnl Remove "-fno-something", it breaks using cproto.
1024 - dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
1025 - perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
1026 - -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
1027 - -e 's/-fdebug-prefix-map[[^ ]]*//g'`
1028 - dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
1029 - perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
1030 - sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
1031 - -e 's/-bE:perl.exp//' -e 's/-lc //'`
1032 - dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
1033 - dnl a test in configure may fail because of that.
1034 - perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
1035 - -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
1037 - dnl check that compiling a simple program still works with the flags
1038 - dnl added for Perl.
1039 - AC_MSG_CHECKING([if compile and link flags for Perl are sane])
1040 - cflags_save=$CFLAGS
1042 - ldflags_save=$LDFLAGS
1043 - CFLAGS="$CFLAGS $perlcppflags"
1044 - LIBS="$LIBS $perllibs"
1045 - perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'`
1046 - LDFLAGS="$perlldflags $LDFLAGS"
1048 - AC_MSG_RESULT(yes); perl_ok=yes,
1049 - AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
1050 - CFLAGS=$cflags_save
1052 - LDFLAGS=$ldflags_save
1053 - if test $perl_ok = yes; then
1054 - if test "X$perlcppflags" != "X"; then
1055 - dnl remove -pipe and -Wxxx, it confuses cproto
1056 - PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'`
1058 - if test "X$perlldflags" != "X"; then
1059 - if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then
1060 - LDFLAGS="$perlldflags $LDFLAGS"
1063 - PERL_LIBS=$perllibs
1064 - PERL_SRC="auto/if_perl.c if_perlsfio.c"
1065 - PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
1066 - PERL_PRO="if_perl.pro if_perlsfio.pro"
1067 - AC_DEFINE(FEAT_PERL)
1071 - AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
1075 - if test "x$MACOSX" = "xyes"; then
1076 - dnl Mac OS X 10.2 or later
1077 - dir=/System/Library/Perl
1078 - darwindir=$dir/darwin
1079 - if test -d $darwindir; then
1080 - PERL=/usr/bin/perl
1083 - dir=/System/Library/Perl/5.8.1
1084 - darwindir=$dir/darwin-thread-multi-2level
1085 - if test -d $darwindir; then
1086 - PERL=/usr/bin/perl
1089 - if test -n "$PERL"; then
1091 - PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
1092 - PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
1093 - PERL_LIBS="-L$darwindir/CORE -lperl"
1095 - dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
1096 - dnl be included if requested by passing --with-mac-arch to
1097 - dnl configure, so strip these flags first (if present)
1098 - PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
1099 - PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
1101 - if test "$enable_perlinterp" = "dynamic"; then
1102 - if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
1103 - AC_DEFINE(DYNAMIC_PERL)
1104 - PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS"
1108 - if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then
1109 - AC_MSG_ERROR([could not configure perl])
1113 - AC_SUBST(PERL_SRC)
1114 - AC_SUBST(PERL_OBJ)
1115 - AC_SUBST(PERL_PRO)
1116 - AC_SUBST(PERL_CFLAGS)
1117 - AC_SUBST(PERL_LIBS)
1119 - AC_MSG_CHECKING(--enable-pythoninterp argument)
1120 - AC_ARG_ENABLE(pythoninterp,
1121 - [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1122 - [enable_pythoninterp="no"])
1123 - AC_MSG_RESULT($enable_pythoninterp)
1124 - if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
1125 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
1126 - AC_MSG_ERROR([cannot use Python with tiny or small features])
1129 - dnl -- find the python executable
1130 - AC_PATH_PROGS(vi_cv_path_python, python2 python)
1131 - if test "X$vi_cv_path_python" != "X"; then
1133 - dnl -- get its version number
1134 - AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
1135 - [[vi_cv_var_python_version=`
1136 - ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
1139 - dnl -- it must be at least version 2.3
1140 - AC_MSG_CHECKING(Python is 2.3 or better)
1141 - if ${vi_cv_path_python} -c \
1142 - "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"
1144 - AC_MSG_RESULT(yep)
1146 - dnl -- find where python thinks it was installed
1147 - AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
1148 - [ vi_cv_path_python_pfx=`
1149 - ${vi_cv_path_python} -c \
1150 - "import sys; print sys.prefix"` ])
1152 - dnl -- and where it thinks it runs
1153 - AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
1154 - [ vi_cv_path_python_epfx=`
1155 - ${vi_cv_path_python} -c \
1156 - "import sys; print sys.exec_prefix"` ])
1158 - dnl -- python's internal library path
1160 - AC_CACHE_VAL(vi_cv_path_pythonpath,
1161 - [ vi_cv_path_pythonpath=`
1163 - ${vi_cv_path_python} -c \
1164 - "import sys, string; print string.join(sys.path,':')"` ])
1166 - dnl -- where the Python implementation library archives are
1168 - AC_ARG_WITH(python-config-dir,
1169 - [ --with-python-config-dir=PATH Python's config directory],
1170 - [ vi_cv_path_python_conf="${withval}" ] )
1172 - AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
1174 - vi_cv_path_python_conf=
1175 - d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
1176 - if test -d "$d" && test -f "$d/config.c"; then
1177 - vi_cv_path_python_conf="$d"
1179 - for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
1180 - for subdir in lib64 lib share; do
1181 - d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
1182 - if test -d "$d" && test -f "$d/config.c"; then
1183 - vi_cv_path_python_conf="$d"
1190 - PYTHON_CONFDIR="${vi_cv_path_python_conf}"
1192 - if test "X$PYTHON_CONFDIR" = "X"; then
1193 - AC_MSG_RESULT([can't find it!])
1196 - dnl -- we need to examine Python's config/Makefile too
1197 - dnl see what the interpreter is built from
1198 - AC_CACHE_VAL(vi_cv_path_python_plibs,
1201 - tmp_mkf="$pwd/config-PyMake$$"
1202 - cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
1204 - @echo "python_BASEMODLIBS='$(BASEMODLIBS)'"
1205 - @echo "python_LIBS='$(LIBS)'"
1206 - @echo "python_SYSLIBS='$(SYSLIBS)'"
1207 - @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
1208 - @echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
1209 - @echo "python_INSTSONAME='$(INSTSONAME)'"
1210 - @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'"
1211 - @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'"
1212 - @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'"
1214 - dnl -- delete the lines from make about Entering/Leaving directory
1215 - eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
1216 - rm -f -- "${tmp_mkf}"
1217 - if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
1218 - "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
1219 - vi_cv_path_python_plibs="-framework Python"
1220 - if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
1221 - vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
1224 - if test "${vi_cv_var_python_version}" = "1.4"; then
1225 - vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
1227 - vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
1229 - dnl -- Check if the path contained in python_LINKFORSHARED is
1230 - dnl usable for vim build. If not, make and try other
1232 - if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
1233 - python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]].*/\1/'`
1234 - python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]][[ \t]]*\(.*\)/\2/'`
1235 - if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
1236 - dnl -- The path looks relative. Guess the absolute one using
1237 - dnl the prefix and try that.
1238 - python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}"
1239 - if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
1240 - dnl -- A last resort.
1241 - python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}"
1242 - dnl -- No check is done. The last word is left to the
1243 - dnl "sanity" test on link flags that follows shortly.
1245 - python_LINKFORSHARED="${python_link_symbol} ${python_link_path}"
1248 - vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
1249 - dnl remove -ltermcap, it can conflict with an earlier -lncurses
1250 - vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
1253 - AC_CACHE_CHECK(Python's dll name,vi_cv_dll_name_python,
1255 - if test "X$python_DLLLIBRARY" != "X"; then
1256 - vi_cv_dll_name_python="$python_DLLLIBRARY"
1258 - vi_cv_dll_name_python="$python_INSTSONAME"
1262 - PYTHON_LIBS="${vi_cv_path_python_plibs}"
1263 - if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
1264 - PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
1266 - 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}\"'"
1268 - PYTHON_SRC="if_python.c"
1269 - PYTHON_OBJ="objects/if_python.o"
1270 - if test "${vi_cv_var_python_version}" = "1.4"; then
1271 - PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
1273 - PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
1275 - dnl On FreeBSD linking with "-pthread" is required to use threads.
1276 - dnl _THREAD_SAFE must be used for compiling then.
1277 - dnl The "-pthread" is added to $LIBS, so that the following check for
1278 - dnl sigaltstack() will look in libc_r (it's there in libc!).
1279 - dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
1280 - dnl will then define target-specific defines, e.g., -D_REENTRANT.
1281 - dnl Don't do this for Mac OSX, -pthread will generate a warning.
1282 - AC_MSG_CHECKING([if -pthread should be used])
1285 - dnl if test "x$MACOSX" != "xyes"; then
1286 - if test "`(uname) 2>/dev/null`" != Darwin; then
1287 - test "$GCC" = yes && threadsafe_flag="-pthread"
1288 - if test "`(uname) 2>/dev/null`" = FreeBSD; then
1289 - threadsafe_flag="-D_THREAD_SAFE"
1290 - thread_lib="-pthread"
1292 - if test "`(uname) 2>/dev/null`" = SunOS; then
1293 - threadsafe_flag="-pthreads"
1296 - libs_save_old=$LIBS
1297 - if test -n "$threadsafe_flag"; then
1298 - cflags_save=$CFLAGS
1299 - CFLAGS="$CFLAGS $threadsafe_flag"
1300 - LIBS="$LIBS $thread_lib"
1302 - AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
1303 - AC_MSG_RESULT(no); LIBS=$libs_save_old
1305 - CFLAGS=$cflags_save
1310 - dnl Check that compiling a simple program still works with the flags
1311 - dnl added for Python.
1312 - AC_MSG_CHECKING([if compile and link flags for Python are sane])
1313 - cflags_save=$CFLAGS
1315 - CFLAGS="$CFLAGS $PYTHON_CFLAGS"
1316 - LIBS="$LIBS $PYTHON_LIBS"
1318 - AC_MSG_RESULT(yes); python_ok=yes,
1319 - AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
1320 - CFLAGS=$cflags_save
1322 - if test $python_ok = yes; then
1323 - AC_DEFINE(FEAT_PYTHON)
1325 - LIBS=$libs_save_old
1333 - AC_MSG_RESULT(too old)
1337 - if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then
1338 - AC_MSG_ERROR([could not configure python])
1342 - AC_SUBST(PYTHON_CONFDIR)
1343 - AC_SUBST(PYTHON_LIBS)
1344 - AC_SUBST(PYTHON_GETPATH_CFLAGS)
1345 - AC_SUBST(PYTHON_CFLAGS)
1346 - AC_SUBST(PYTHON_SRC)
1347 - AC_SUBST(PYTHON_OBJ)
1350 - AC_MSG_CHECKING(--enable-python3interp argument)
1351 - AC_ARG_ENABLE(python3interp,
1352 - [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1353 - [enable_python3interp="no"])
1354 - AC_MSG_RESULT($enable_python3interp)
1355 - if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
1356 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
1357 - AC_MSG_ERROR([cannot use Python with tiny or small features])
1360 - dnl -- find the python3 executable
1361 - AC_PATH_PROGS(vi_cv_path_python3, python3 python)
1362 - if test "X$vi_cv_path_python3" != "X"; then
1364 - dnl -- get its version number
1365 - AC_CACHE_CHECK(Python version,vi_cv_var_python3_version,
1366 - [[vi_cv_var_python3_version=`
1367 - ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
1370 - dnl -- it must be at least version 3
1371 - AC_MSG_CHECKING(Python is 3.0 or better)
1372 - if ${vi_cv_path_python3} -c \
1373 - "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)"
1375 - AC_MSG_RESULT(yep)
1377 - dnl -- get abiflags for python 3.2 or higher (PEP 3149)
1378 - AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
1380 - vi_cv_var_python3_abiflags=
1381 - if ${vi_cv_path_python3} -c \
1382 - "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
1384 - vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
1385 - "import sys; print(sys.abiflags)"`
1388 - dnl -- find where python3 thinks it was installed
1389 - AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
1390 - [ vi_cv_path_python3_pfx=`
1391 - ${vi_cv_path_python3} -c \
1392 - "import sys; print(sys.prefix)"` ])
1394 - dnl -- and where it thinks it runs
1395 - AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx,
1396 - [ vi_cv_path_python3_epfx=`
1397 - ${vi_cv_path_python3} -c \
1398 - "import sys; print(sys.exec_prefix)"` ])
1400 - dnl -- python3's internal library path
1402 - AC_CACHE_VAL(vi_cv_path_python3path,
1403 - [ vi_cv_path_python3path=`
1405 - ${vi_cv_path_python3} -c \
1406 - "import sys, string; print(':'.join(sys.path))"` ])
1408 - dnl -- where the Python implementation library archives are
1410 - AC_ARG_WITH(python3-config-dir,
1411 - [ --with-python3-config-dir=PATH Python's config directory],
1412 - [ vi_cv_path_python3_conf="${withval}" ] )
1414 - AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
1416 - vi_cv_path_python3_conf=
1417 - config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
1418 - d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
1419 - if test -d "$d" && test -f "$d/config.c"; then
1420 - vi_cv_path_python3_conf="$d"
1422 - for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
1423 - for subdir in lib64 lib share; do
1424 - d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
1425 - if test -d "$d" && test -f "$d/config.c"; then
1426 - vi_cv_path_python3_conf="$d"
1433 - PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
1435 - if test "X$PYTHON3_CONFDIR" = "X"; then
1436 - AC_MSG_RESULT([can't find it!])
1439 - dnl -- we need to examine Python's config/Makefile too
1440 - dnl see what the interpreter is built from
1441 - AC_CACHE_VAL(vi_cv_path_python3_plibs,
1444 - tmp_mkf="$pwd/config-PyMake$$"
1445 - cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
1447 - @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
1448 - @echo "python3_LIBS='$(LIBS)'"
1449 - @echo "python3_SYSLIBS='$(SYSLIBS)'"
1450 - @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'"
1451 - @echo "python3_INSTSONAME='$(INSTSONAME)'"
1453 - dnl -- delete the lines from make about Entering/Leaving directory
1454 - eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
1455 - rm -f -- "${tmp_mkf}"
1456 - vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
1457 - vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
1458 - dnl remove -ltermcap, it can conflict with an earlier -lncurses
1459 - vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
1460 - vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
1462 - AC_CACHE_CHECK(Python3's dll name,vi_cv_dll_name_python3,
1464 - if test "X$python3_DLLLIBRARY" != "X"; then
1465 - vi_cv_dll_name_python3="$python3_DLLLIBRARY"
1467 - vi_cv_dll_name_python3="$python3_INSTSONAME"
1471 - PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
1472 - if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
1473 - 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}\"'"
1475 - 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}\"'"
1477 - PYTHON3_SRC="if_python3.c"
1478 - PYTHON3_OBJ="objects/if_python3.o"
1480 - dnl On FreeBSD linking with "-pthread" is required to use threads.
1481 - dnl _THREAD_SAFE must be used for compiling then.
1482 - dnl The "-pthread" is added to $LIBS, so that the following check for
1483 - dnl sigaltstack() will look in libc_r (it's there in libc!).
1484 - dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
1485 - dnl will then define target-specific defines, e.g., -D_REENTRANT.
1486 - dnl Don't do this for Mac OSX, -pthread will generate a warning.
1487 - AC_MSG_CHECKING([if -pthread should be used])
1490 - dnl if test "x$MACOSX" != "xyes"; then
1491 - if test "`(uname) 2>/dev/null`" != Darwin; then
1492 - test "$GCC" = yes && threadsafe_flag="-pthread"
1493 - if test "`(uname) 2>/dev/null`" = FreeBSD; then
1494 - threadsafe_flag="-D_THREAD_SAFE"
1495 - thread_lib="-pthread"
1497 - if test "`(uname) 2>/dev/null`" = SunOS; then
1498 - threadsafe_flag="-pthreads"
1501 - libs_save_old=$LIBS
1502 - if test -n "$threadsafe_flag"; then
1503 - cflags_save=$CFLAGS
1504 - CFLAGS="$CFLAGS $threadsafe_flag"
1505 - LIBS="$LIBS $thread_lib"
1507 - AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag",
1508 - AC_MSG_RESULT(no); LIBS=$libs_save_old
1510 - CFLAGS=$cflags_save
1515 - dnl check that compiling a simple program still works with the flags
1516 - dnl added for Python.
1517 - AC_MSG_CHECKING([if compile and link flags for Python 3 are sane])
1518 - cflags_save=$CFLAGS
1520 - CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
1521 - LIBS="$LIBS $PYTHON3_LIBS"
1523 - AC_MSG_RESULT(yes); python3_ok=yes,
1524 - AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no)
1525 - CFLAGS=$cflags_save
1527 - if test "$python3_ok" = yes; then
1528 - AC_DEFINE(FEAT_PYTHON3)
1530 - LIBS=$libs_save_old
1538 - AC_MSG_RESULT(too old)
1541 - if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then
1542 - AC_MSG_ERROR([could not configure python3])
1546 - AC_SUBST(PYTHON3_CONFDIR)
1547 - AC_SUBST(PYTHON3_LIBS)
1548 - AC_SUBST(PYTHON3_CFLAGS)
1549 - AC_SUBST(PYTHON3_SRC)
1550 - AC_SUBST(PYTHON3_OBJ)
1552 - dnl if python2.x and python3.x are enabled one can only link in code
1553 - dnl with dlopen(), dlsym(), dlclose()
1554 - if test "$python_ok" = yes && test "$python3_ok" = yes; then
1555 - AC_DEFINE(DYNAMIC_PYTHON)
1556 - AC_DEFINE(DYNAMIC_PYTHON3)
1557 - AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
1558 - cflags_save=$CFLAGS
1559 - CFLAGS="$CFLAGS $PYTHON_CFLAGS"
1561 - dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
1563 - AC_RUN_IFELSE([AC_LANG_SOURCE([
1564 - #include <dlfcn.h>
1565 - /* If this program fails, then RTLD_GLOBAL is needed.
1566 - * RTLD_GLOBAL will be used and then it is not possible to
1567 - * have both python versions enabled in the same vim instance.
1568 - * Only the first python version used will be switched on.
1571 - int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
1574 - void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
1577 - void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
1578 - void (*init)(void) = dlsym(pylib, "Py_Initialize");
1579 - int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
1580 - void (*final)(void) = dlsym(pylib, "Py_Finalize");
1583 - needed = (*simple)("import termios") == -1;
1590 - int main(int argc, char** argv)
1592 - int not_needed = 0;
1593 - if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}"))
1595 - return !not_needed;
1597 - [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
1599 - CFLAGS=$cflags_save
1602 - AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
1603 - cflags_save=$CFLAGS
1604 - CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
1606 - dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
1608 - AC_RUN_IFELSE([AC_LANG_SOURCE([
1609 - #include <dlfcn.h>
1610 - #include <wchar.h>
1611 - /* If this program fails, then RTLD_GLOBAL is needed.
1612 - * RTLD_GLOBAL will be used and then it is not possible to
1613 - * have both python versions enabled in the same vim instance.
1614 - * Only the first python version used will be switched on.
1617 - int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
1620 - void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
1623 - void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
1624 - void (*init)(void) = dlsym(pylib, "Py_Initialize");
1625 - int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
1626 - void (*final)(void) = dlsym(pylib, "Py_Finalize");
1629 - needed = (*simple)("import termios") == -1;
1636 - int main(int argc, char** argv)
1638 - int not_needed = 0;
1639 - if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}"))
1641 - return !not_needed;
1643 - [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
1645 - CFLAGS=$cflags_save
1648 - PYTHON_SRC="if_python.c"
1649 - PYTHON_OBJ="objects/if_python.o"
1650 - PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\""
1652 - PYTHON3_SRC="if_python3.c"
1653 - PYTHON3_OBJ="objects/if_python3.o"
1654 - PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\""
1656 - elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then
1657 - AC_DEFINE(DYNAMIC_PYTHON)
1658 - PYTHON_SRC="if_python.c"
1659 - PYTHON_OBJ="objects/if_python.o"
1660 - PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\""
1662 - elif test "$python_ok" = yes; then
1663 - dnl Check that adding -fPIE works. It may be needed when using a static
1664 - dnl Python library.
1665 - AC_MSG_CHECKING([if -fPIE can be added for Python])
1666 - cflags_save=$CFLAGS
1668 - CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE"
1669 - LIBS="$LIBS $PYTHON_LIBS"
1671 - AC_MSG_RESULT(yes); fpie_ok=yes,
1672 - AC_MSG_RESULT(no); fpie_ok=no)
1673 - CFLAGS=$cflags_save
1675 - if test $fpie_ok = yes; then
1676 - PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE"
1678 - elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then
1679 - AC_DEFINE(DYNAMIC_PYTHON3)
1680 - PYTHON3_SRC="if_python3.c"
1681 - PYTHON3_OBJ="objects/if_python3.o"
1682 - PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\""
1684 - elif test "$python3_ok" = yes; then
1685 - dnl Check that adding -fPIE works. It may be needed when using a static
1686 - dnl Python library.
1687 - AC_MSG_CHECKING([if -fPIE can be added for Python3])
1688 - cflags_save=$CFLAGS
1690 - CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE"
1691 - LIBS="$LIBS $PYTHON3_LIBS"
1693 - AC_MSG_RESULT(yes); fpie_ok=yes,
1694 - AC_MSG_RESULT(no); fpie_ok=no)
1695 - CFLAGS=$cflags_save
1697 - if test $fpie_ok = yes; then
1698 - PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE"
1702 - AC_MSG_CHECKING(--enable-tclinterp argument)
1703 - AC_ARG_ENABLE(tclinterp,
1704 - [ --enable-tclinterp[=OPTS] Include Tcl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1705 - [enable_tclinterp="no"])
1706 - AC_MSG_RESULT($enable_tclinterp)
1708 - if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then
1710 - dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420]
1711 - AC_MSG_CHECKING(--with-tclsh argument)
1712 - AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
1713 - tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
1714 - tclsh_name="tclsh8.5"; AC_MSG_RESULT(no))
1715 - AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1716 - AC_SUBST(vi_cv_path_tcl)
1718 - dnl when no specific version specified, also try 8.4, 8.2 and 8.0
1719 - if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then
1720 - tclsh_name="tclsh8.4"
1721 - AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1723 - if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then
1724 - tclsh_name="tclsh8.2"
1725 - AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1727 - if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then
1728 - tclsh_name="tclsh8.0"
1729 - AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1731 - dnl still didn't find it, try without version number
1732 - if test "X$vi_cv_path_tcl" = "X"; then
1733 - tclsh_name="tclsh"
1734 - AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
1736 - if test "X$vi_cv_path_tcl" != "X"; then
1737 - AC_MSG_CHECKING(Tcl version)
1738 - if echo 'exit [[expr [info tclversion] < 8.0]]' | "$vi_cv_path_tcl" - ; then
1739 - tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
1740 - AC_MSG_RESULT($tclver - OK);
1741 - 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 -`
1742 - tcldll=`echo 'puts libtcl[[info tclversion]][[info sharedlibextension]]' | $vi_cv_path_tcl -`
1744 - AC_MSG_CHECKING(for location of Tcl include)
1745 - if test "x$MACOSX" != "xyes"; then
1746 - tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
1748 - dnl For Mac OS X 10.3, use the OS-provided framework location
1749 - tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
1752 - for try in $tclinc; do
1753 - if test -f "$try/tcl.h"; then
1754 - AC_MSG_RESULT($try/tcl.h)
1759 - if test -z "$TCL_INC"; then
1760 - AC_MSG_RESULT(<not found>)
1763 - if test -z "$SKIP_TCL"; then
1764 - AC_MSG_CHECKING(for location of tclConfig.sh script)
1765 - if test "x$MACOSX" != "xyes"; then
1766 - tclcnf=`echo $tclinc | sed s/include/lib/g`
1767 - tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
1769 - dnl For Mac OS X 10.3, use the OS-provided framework location
1770 - tclcnf="/System/Library/Frameworks/Tcl.framework"
1772 - for try in $tclcnf; do
1773 - if test -f "$try/tclConfig.sh"; then
1774 - AC_MSG_RESULT($try/tclConfig.sh)
1775 - . "$try/tclConfig.sh"
1776 - dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
1777 - if test "$enable_tclinterp" = "dynamic"; then
1778 - TCL_LIBS=`eval echo "$TCL_STUB_LIB_SPEC $TCL_LIBS"`
1780 - TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
1782 - dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
1783 - dnl "-D_ABC" items. Watch out for -DFOO=long\ long.
1784 - 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'`
1788 - if test -z "$TCL_LIBS"; then
1789 - AC_MSG_RESULT(<not found>)
1790 - AC_MSG_CHECKING(for Tcl library by myself)
1791 - tcllib=`echo $tclinc | sed s/include/lib/g`
1792 - tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`"
1793 - for ext in .so .a ; do
1794 - for ver in "" $tclver ; do
1795 - for try in $tcllib ; do
1796 - trylib=tcl$ver$ext
1797 - if test -f "$try/lib$trylib" ; then
1798 - AC_MSG_RESULT($try/lib$trylib)
1799 - TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
1800 - if test "`(uname) 2>/dev/null`" = SunOS &&
1801 - uname -r | grep '^5' >/dev/null; then
1802 - TCL_LIBS="$TCL_LIBS -R $try"
1809 - if test -z "$TCL_LIBS"; then
1810 - AC_MSG_RESULT(<not found>)
1814 - if test -z "$SKIP_TCL"; then
1815 - AC_DEFINE(FEAT_TCL)
1817 - TCL_OBJ=objects/if_tcl.o
1818 - TCL_PRO=if_tcl.pro
1819 - TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
1823 - AC_MSG_RESULT(too old; need Tcl version 8.0 or later)
1826 - if test "$enable_tclinterp" = "dynamic"; then
1827 - if test "X$TCL_SRC" != "X" -a "X$tcldll" != "X"; then
1828 - AC_DEFINE(DYNAMIC_TCL)
1829 - TCL_CFLAGS="-DDYNAMIC_TCL_DLL=\\\"$tcldll\\\" -DDYNAMIC_TCL_VER=\\\"$tclver\\\" $TCL_CFLAGS"
1832 - if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then
1833 - AC_MSG_ERROR([could not configure Tcl])
1839 - AC_SUBST(TCL_CFLAGS)
1840 - AC_SUBST(TCL_LIBS)
1842 - AC_MSG_CHECKING(--enable-rubyinterp argument)
1843 - AC_ARG_ENABLE(rubyinterp,
1844 - [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
1845 - [enable_rubyinterp="no"])
1846 - AC_MSG_RESULT($enable_rubyinterp)
1847 - if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
1848 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
1849 - AC_MSG_ERROR([cannot use Ruby with tiny or small features])
1852 - AC_MSG_CHECKING(--with-ruby-command argument)
1853 - AC_SUBST(vi_cv_path_ruby)
1854 - AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
1855 - RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD),
1856 - RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
1857 - AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
1858 - if test "X$vi_cv_path_ruby" != "X"; then
1859 - AC_MSG_CHECKING(Ruby version)
1860 - if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
1862 - AC_MSG_CHECKING(Ruby rbconfig)
1863 - ruby_rbconfig="RbConfig"
1864 - if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then
1865 - ruby_rbconfig="Config"
1867 - AC_MSG_RESULT($ruby_rbconfig)
1868 - AC_MSG_CHECKING(Ruby header files)
1869 - rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null`
1870 - if test "X$rubyhdrdir" != "X"; then
1871 - AC_MSG_RESULT($rubyhdrdir)
1872 - RUBY_CFLAGS="-I$rubyhdrdir"
1873 - rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"`
1874 - if test -d "$rubyarchdir"; then
1875 - RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
1877 - rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"`
1878 - if test "X$rubyversion" = "X"; then
1879 - rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[[0,2]]"`
1881 - RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
1882 - rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"`
1883 - if test "X$rubylibs" != "X"; then
1884 - RUBY_LIBS="$rubylibs"
1886 - librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"`
1887 - librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"`
1888 - rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"`
1889 - if test -f "$rubylibdir/$librubya"; then
1890 - librubyarg="$librubyarg"
1891 - RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1892 - elif test "$librubyarg" = "libruby.a"; then
1893 - dnl required on Mac OS 10.3 where libruby.a doesn't exist
1894 - librubyarg="-lruby"
1895 - RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1898 - if test "X$librubyarg" != "X"; then
1899 - RUBY_LIBS="$librubyarg $RUBY_LIBS"
1901 - rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"`
1902 - if test "X$rubyldflags" != "X"; then
1903 - dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
1904 - dnl be included if requested by passing --with-mac-arch to
1905 - dnl configure, so strip these flags first (if present)
1906 - rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
1907 - if test "X$rubyldflags" != "X"; then
1908 - if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$rubyldflags\"`" = "X"; then
1909 - LDFLAGS="$rubyldflags $LDFLAGS"
1913 - RUBY_SRC="if_ruby.c"
1914 - RUBY_OBJ="objects/if_ruby.o"
1915 - RUBY_PRO="if_ruby.pro"
1916 - AC_DEFINE(FEAT_RUBY)
1917 - if test "$enable_rubyinterp" = "dynamic"; then
1918 - libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"`
1919 - AC_DEFINE(DYNAMIC_RUBY)
1920 - RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
1924 - AC_MSG_RESULT(not found; disabling Ruby)
1927 - AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
1931 - if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then
1932 - AC_MSG_ERROR([could not configure Ruby])
1935 - AC_SUBST(RUBY_SRC)
1936 - AC_SUBST(RUBY_OBJ)
1937 - AC_SUBST(RUBY_PRO)
1938 - AC_SUBST(RUBY_CFLAGS)
1939 - AC_SUBST(RUBY_LIBS)
1941 - AC_MSG_CHECKING(--enable-cscope argument)
1942 - AC_ARG_ENABLE(cscope,
1943 - [ --enable-cscope Include cscope interface.], ,
1944 - [enable_cscope="no"])
1945 - AC_MSG_RESULT($enable_cscope)
1946 - if test "$enable_cscope" = "yes"; then
1947 - AC_DEFINE(FEAT_CSCOPE)
1950 - AC_MSG_CHECKING(--enable-workshop argument)
1951 - AC_ARG_ENABLE(workshop,
1952 - [ --enable-workshop Include Sun Visual Workshop support.], ,
1953 - [enable_workshop="no"])
1954 - AC_MSG_RESULT($enable_workshop)
1955 - if test "$enable_workshop" = "yes"; then
1956 - AC_DEFINE(FEAT_SUN_WORKSHOP)
1957 - WORKSHOP_SRC="workshop.c integration.c"
1958 - AC_SUBST(WORKSHOP_SRC)
1959 - WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
1960 - AC_SUBST(WORKSHOP_OBJ)
1961 - if test "${enable_gui-xxx}" = xxx; then
1966 - AC_MSG_CHECKING(--disable-netbeans argument)
1967 - AC_ARG_ENABLE(netbeans,
1968 - [ --disable-netbeans Disable NetBeans integration support.],
1969 - , [enable_netbeans="yes"])
1970 - if test "$enable_netbeans" = "yes"; then
1971 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
1972 - AC_MSG_RESULT([cannot use NetBeans with tiny or small features])
1973 - enable_netbeans="no"
1978 - AC_MSG_RESULT(yes)
1981 - AC_MSG_CHECKING(--disable-channel argument)
1982 - AC_ARG_ENABLE(channel,
1983 - [ --disable-channel Disable process communication support.],
1984 - , [enable_channel="yes"])
1985 - if test "$enable_channel" = "yes"; then
1986 - if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
1987 - AC_MSG_RESULT([cannot use channels with tiny or small features])
1988 - enable_channel="no"
1993 - if test "$enable_netbeans" = "yes"; then
1994 - AC_MSG_RESULT([yes, netbeans also disabled])
1995 - enable_netbeans="no"
1997 - AC_MSG_RESULT(yes)
2001 - if test "$enable_channel" = "yes"; then
2002 - dnl On Solaris we need the socket and nsl library.
2003 - AC_CHECK_LIB(socket, socket)
2004 - AC_CHECK_LIB(nsl, gethostbyname)
2005 - AC_MSG_CHECKING(whether compiling with process communication is possible)
2007 - #include <stdio.h>
2008 - #include <stdlib.h>
2009 - #include <stdarg.h>
2010 - #include <fcntl.h>
2011 - #include <netdb.h>
2012 - #include <netinet/in.h>
2013 - #include <errno.h>
2014 - #include <sys/types.h>
2015 - #include <sys/socket.h>
2016 - /* Check bitfields */
2018 - unsigned int initDone:1;
2019 - ushort signmaplen;
2022 - /* Check creating a socket. */
2023 - struct sockaddr_in server;
2024 - (void)socket(AF_INET, SOCK_STREAM, 0);
2026 - (void)gethostbyname("microsoft.com");
2027 - if (errno == ECONNREFUSED)
2028 - (void)connect(1, (struct sockaddr *)&server, sizeof(server));
2030 - AC_MSG_RESULT(yes),
2031 - AC_MSG_RESULT(no); enable_netbeans="no"; enable_channel="no")
2033 - if test "$enable_netbeans" = "yes"; then
2034 - AC_DEFINE(FEAT_NETBEANS_INTG)
2035 - NETBEANS_SRC="netbeans.c"
2036 - AC_SUBST(NETBEANS_SRC)
2037 - NETBEANS_OBJ="objects/netbeans.o"
2038 - AC_SUBST(NETBEANS_OBJ)
2040 - if test "$enable_channel" = "yes"; then
2041 - AC_DEFINE(FEAT_JOB_CHANNEL)
2042 - CHANNEL_SRC="channel.c"
2043 - AC_SUBST(CHANNEL_SRC)
2044 - CHANNEL_OBJ="objects/channel.o"
2045 - AC_SUBST(CHANNEL_OBJ)
2048 - AC_MSG_CHECKING(--enable-multibyte argument)
2049 - AC_ARG_ENABLE(multibyte,
2050 - [ --enable-multibyte Include multibyte editing support.], ,
2051 - [enable_multibyte="no"])
2052 - AC_MSG_RESULT($enable_multibyte)
2053 - if test "$enable_multibyte" = "yes"; then
2054 - AC_DEFINE(FEAT_MBYTE)
2057 - AC_MSG_CHECKING(--enable-hangulinput argument)
2058 - AC_ARG_ENABLE(hangulinput,
2059 - [ --enable-hangulinput Include Hangul input support.], ,
2060 - [enable_hangulinput="no"])
2061 - AC_MSG_RESULT($enable_hangulinput)
2063 - AC_MSG_CHECKING(--enable-xim argument)
2064 - AC_ARG_ENABLE(xim,
2065 - [ --enable-xim Include XIM input support.],
2066 - AC_MSG_RESULT($enable_xim),
2067 - [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
2069 - AC_MSG_CHECKING(--enable-fontset argument)
2070 - AC_ARG_ENABLE(fontset,
2071 - [ --enable-fontset Include X fontset output support.], ,
2072 - [enable_fontset="no"])
2073 - AC_MSG_RESULT($enable_fontset)
2074 - dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI
2076 - test -z "$with_x" && with_x=yes
2077 - test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
2078 - if test "$with_x" = no; then
2079 - AC_MSG_RESULT(defaulting to: don't HAVE_X11)
2081 - dnl Do this check early, so that its failure can override user requests.
2083 - AC_PATH_PROG(xmkmfpath, xmkmf)
2087 - dnl On z/OS Unix the X libraries are DLLs. To use them the code must
2088 - dnl be compiled with a special option.
2089 - dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS.
2090 - if test "$zOSUnix" = "yes"; then
2091 - CFLAGS="$CFLAGS -W c,dll"
2092 - LDFLAGS="$LDFLAGS -W l,dll"
2093 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
2096 - dnl On my HPUX system the X include dir is found, but the lib dir not.
2097 - dnl This is a desparate try to fix this.
2099 - if test -d "$x_includes" && test ! -d "$x_libraries"; then
2100 - x_libraries=`echo "$x_includes" | sed s/include/lib/`
2101 - AC_MSG_RESULT(Corrected X libraries to $x_libraries)
2102 - X_LIBS="$X_LIBS -L$x_libraries"
2103 - if test "`(uname) 2>/dev/null`" = SunOS &&
2104 - uname -r | grep '^5' >/dev/null; then
2105 - X_LIBS="$X_LIBS -R $x_libraries"
2109 - if test -d "$x_libraries" && test ! -d "$x_includes"; then
2110 - x_includes=`echo "$x_libraries" | sed s/lib/include/`
2111 - AC_MSG_RESULT(Corrected X includes to $x_includes)
2112 - X_CFLAGS="$X_CFLAGS -I$x_includes"
2115 - dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed.
2116 - X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
2117 - dnl Remove "-L/usr/lib " from X_LIBS, should not be needed.
2118 - X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
2119 - dnl Same for "-R/usr/lib ".
2120 - X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
2123 - dnl Check if the X11 header files are correctly installed. On some systems
2124 - dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h
2126 - AC_MSG_CHECKING(if X11 header files can be found)
2127 - cflags_save=$CFLAGS
2128 - CFLAGS="$CFLAGS $X_CFLAGS"
2129 - AC_TRY_COMPILE([#include <X11/Xlib.h>
2130 - #include <X11/Intrinsic.h>], ,
2131 - AC_MSG_RESULT(yes),
2132 - AC_MSG_RESULT(no); no_x=yes)
2133 - CFLAGS=$cflags_save
2135 - if test "${no_x-no}" = yes; then
2138 - AC_DEFINE(HAVE_X11)
2139 - X_LIB="-lXt -lX11";
2142 - ac_save_LDFLAGS="$LDFLAGS"
2143 - LDFLAGS="-L$x_libraries $LDFLAGS"
2145 - dnl Check for -lXdmcp (needed on SunOS 4.1.4)
2146 - dnl For HP-UX 10.20 it must be before -lSM -lICE
2147 - AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],,
2148 - [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp])
2150 - dnl Some systems need -lnsl -lsocket when testing for ICE.
2151 - dnl The check above doesn't do this, try here (again). Also needed to get
2152 - dnl them after Xdmcp. link.sh will remove them when not needed.
2153 - dnl Check for other function than above to avoid the cached value
2154 - AC_CHECK_LIB(ICE, IceOpenConnection,
2155 - [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
2157 - dnl Check for -lXpm (needed for some versions of Motif)
2158 - LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
2159 - AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
2160 - [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS])
2162 - dnl Check that the X11 header files don't use implicit declarations
2163 - AC_MSG_CHECKING(if X11 header files implicitly declare return values)
2164 - cflags_save=$CFLAGS
2165 - dnl -Werror is GCC only, others like Solaris Studio might not like it
2166 - if test "$GCC" = yes; then
2167 - CFLAGS="$CFLAGS $X_CFLAGS -Werror"
2169 - CFLAGS="$CFLAGS $X_CFLAGS"
2171 - AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
2172 - AC_MSG_RESULT(no),
2173 - CFLAGS="$CFLAGS -Wno-implicit-int"
2174 - AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
2175 - AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int",
2176 - AC_MSG_RESULT(test failed)
2179 - CFLAGS=$cflags_save
2181 - LDFLAGS="$ac_save_LDFLAGS"
2183 - AC_MSG_CHECKING(size of wchar_t is 2 bytes)
2184 - AC_CACHE_VAL(ac_cv_small_wchar_t,
2186 - #include <X11/Xlib.h>
2188 - # include <stdlib.h>
2189 - # include <stddef.h>
2193 - if (sizeof(wchar_t) <= 2)
2197 - ac_cv_small_wchar_t="no",
2198 - ac_cv_small_wchar_t="yes",
2199 - AC_MSG_ERROR(failed to compile test program))])
2200 - AC_MSG_RESULT($ac_cv_small_wchar_t)
2201 - if test "x$ac_cv_small_wchar_t" = "xyes" ; then
2202 - AC_DEFINE(SMALL_WCHAR_T)
2208 - test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
2210 - AC_MSG_CHECKING(--enable-gui argument)
2211 - AC_ARG_ENABLE(gui,
2212 - [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
2214 - dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
2215 - dnl Do not use character classes for portability with old tools.
2216 - enable_gui_canon=`echo "_$enable_gui" | \
2217 - sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2219 - dnl Skip everything by default.
2230 - if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
2232 - case "$enable_gui_canon" in
2233 - no) AC_MSG_RESULT(no GUI support)
2234 - SKIP_PHOTON=YES ;;
2235 - yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
2236 - auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
2237 - photon) AC_MSG_RESULT(Photon GUI support) ;;
2238 - *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
2239 - SKIP_PHOTON=YES ;;
2242 - elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
2244 - case "$enable_gui_canon" in
2245 - no) AC_MSG_RESULT(no GUI support)
2246 - SKIP_CARBON=YES ;;
2247 - yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
2248 - auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support)
2249 - SKIP_CARBON=YES ;;
2250 - carbon) AC_MSG_RESULT(Carbon GUI support) ;;
2251 - *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
2252 - SKIP_CARBON=YES ;;
2257 - case "$enable_gui_canon" in
2258 - no|none) AC_MSG_RESULT(no GUI support) ;;
2259 - yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
2266 - gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
2268 - gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
2271 - gtk3) AC_MSG_RESULT(GTK+ 3.x GUI support)
2273 - motif) AC_MSG_RESULT(Motif GUI support)
2275 - athena) AC_MSG_RESULT(Athena GUI support)
2277 - nextaw) AC_MSG_RESULT(neXtaw GUI support)
2279 - *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;;
2284 - if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
2285 - -a "$enable_gui_canon" != "gnome2"; then
2286 - AC_MSG_CHECKING(whether or not to look for GTK+ 2)
2287 - AC_ARG_ENABLE(gtk2-check,
2288 - [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]],
2289 - , enable_gtk2_check="yes")
2290 - AC_MSG_RESULT($enable_gtk2_check)
2291 - if test "x$enable_gtk2_check" = "xno"; then
2297 - if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then
2298 - AC_MSG_CHECKING(whether or not to look for GNOME)
2299 - AC_ARG_ENABLE(gnome-check,
2300 - [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
2301 - , enable_gnome_check="no")
2302 - AC_MSG_RESULT($enable_gnome_check)
2303 - if test "x$enable_gnome_check" = "xno"; then
2308 - if test "x$SKIP_GTK3" != "xYES" -a "$enable_gui_canon" != "gtk3"; then
2309 - AC_MSG_CHECKING(whether or not to look for GTK+ 3)
2310 - AC_ARG_ENABLE(gtk3-check,
2311 - [ --enable-gtk3-check If auto-select GUI, check for GTK+ 3 [default=yes]],
2312 - , enable_gtk3_check="yes")
2313 - AC_MSG_RESULT($enable_gtk3_check)
2314 - if test "x$enable_gtk3_check" = "xno"; then
2319 - if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
2320 - AC_MSG_CHECKING(whether or not to look for Motif)
2321 - AC_ARG_ENABLE(motif-check,
2322 - [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]],
2323 - , enable_motif_check="yes")
2324 - AC_MSG_RESULT($enable_motif_check)
2325 - if test "x$enable_motif_check" = "xno"; then
2330 - if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
2331 - AC_MSG_CHECKING(whether or not to look for Athena)
2332 - AC_ARG_ENABLE(athena-check,
2333 - [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]],
2334 - , enable_athena_check="yes")
2335 - AC_MSG_RESULT($enable_athena_check)
2336 - if test "x$enable_athena_check" = "xno"; then
2341 - if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
2342 - AC_MSG_CHECKING(whether or not to look for neXtaw)
2343 - AC_ARG_ENABLE(nextaw-check,
2344 - [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]],
2345 - , enable_nextaw_check="yes")
2346 - AC_MSG_RESULT($enable_nextaw_check);
2347 - if test "x$enable_nextaw_check" = "xno"; then
2352 - if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
2353 - AC_MSG_CHECKING(whether or not to look for Carbon)
2354 - AC_ARG_ENABLE(carbon-check,
2355 - [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]],
2356 - , enable_carbon_check="yes")
2357 - AC_MSG_RESULT($enable_carbon_check);
2358 - if test "x$enable_carbon_check" = "xno"; then
2364 - if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
2365 - AC_MSG_CHECKING(for Carbon GUI)
2366 - dnl already did the check, just give the message
2367 - AC_MSG_RESULT(yes);
2369 - if test "$VIMNAME" = "vim"; then
2373 - if test "x$MACARCH" = "xboth"; then
2374 - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
2376 - CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon"
2379 - dnl Default install directory is not /usr/local
2380 - if test x$prefix = xNONE; then
2381 - prefix=/Applications
2384 - dnl Sorry for the hard coded default
2385 - datadir='${prefix}/Vim.app/Contents/Resources'
2387 - dnl skip everything else
2397 - dnl define an autoconf function to check for a specified version of GTK, and
2398 - dnl try to compile/link a GTK program.
2400 - dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2401 - dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
2403 - AC_DEFUN(AM_PATH_GTK,
2405 - if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
2408 - if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
2409 - && $PKG_CONFIG --exists gtk+-2.0; then
2411 - min_gtk_version=ifelse([$1], ,2.2.0,$1)
2412 - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
2413 - dnl We should be using PKG_CHECK_MODULES() instead of this hack.
2414 - dnl But I guess the dependency on pkgconfig.m4 is not wanted or
2415 - dnl something like that.
2416 - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
2417 - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
2418 - GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
2419 - gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2420 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
2421 - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2422 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
2423 - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
2424 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
2426 - elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
2427 - && $PKG_CONFIG --exists gtk+-3.0; then
2429 - min_gtk_version=ifelse([$1], ,3.0.0,$1)
2430 - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
2432 - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0`
2433 - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0`
2434 - GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0`
2435 - gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
2436 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
2437 - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
2438 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
2439 - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
2440 - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
2446 - if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
2448 - ac_save_CFLAGS="$CFLAGS"
2449 - ac_save_LIBS="$LIBS"
2450 - CFLAGS="$CFLAGS $GTK_CFLAGS"
2451 - LIBS="$LIBS $GTK_LIBS"
2454 - dnl Now check if the installed GTK is sufficiently new.
2456 - rm -f conf.gtktest
2458 - #include <gtk/gtk.h>
2459 - #include <stdio.h>
2461 - # include <stdlib.h>
2462 - # include <stddef.h>
2468 - int major, minor, micro;
2469 - char *tmp_version;
2471 - system ("touch conf.gtktest");
2473 - /* HP/UX 9 (%@#!) writes to sscanf strings */
2474 - tmp_version = g_strdup("$min_gtk_version");
2475 - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
2476 - printf("%s, bad version string\n", "$min_gtk_version");
2480 - if ((gtk_major_version > major) ||
2481 - ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
2482 - ((gtk_major_version == major) && (gtk_minor_version == minor) &&
2483 - (gtk_micro_version >= micro)))
2489 - ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
2490 - CFLAGS="$ac_save_CFLAGS"
2491 - LIBS="$ac_save_LIBS"
2494 - if test "x$no_gtk" = x ; then
2495 - if test "x$enable_gtktest" = "xyes"; then
2496 - AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
2498 - AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
2500 - ifelse([$2], , :, [$2])
2506 - ifelse([$3], , :, [$3])
2513 - ifelse([$3], , :, [$3])
2515 - AC_SUBST(GTK_CFLAGS)
2516 - AC_SUBST(GTK_LIBS)
2517 - rm -f conf.gtktest
2520 - dnl ---------------------------------------------------------------------------
2522 - dnl ---------------------------------------------------------------------------
2523 - AC_DEFUN([GNOME_INIT_HOOK],
2525 - AC_SUBST(GNOME_LIBS)
2526 - AC_SUBST(GNOME_LIBDIR)
2527 - AC_SUBST(GNOME_INCLUDEDIR)
2529 - AC_ARG_WITH(gnome-includes,
2530 - [ --with-gnome-includes=DIR Specify location of GNOME headers],
2531 - [CFLAGS="$CFLAGS -I$withval"]
2534 - AC_ARG_WITH(gnome-libs,
2535 - [ --with-gnome-libs=DIR Specify location of GNOME libs],
2536 - [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval]
2539 - AC_ARG_WITH(gnome,
2540 - [ --with-gnome Specify prefix for GNOME files],
2541 - if test x$withval = xyes; then
2543 - ifelse([$1], [], :, [$1])
2545 - if test "x$withval" = xno; then
2549 - LDFLAGS="$LDFLAGS -L$withval/lib"
2550 - CFLAGS="$CFLAGS -I$withval/include"
2551 - gnome_prefix=$withval/lib
2556 - if test "x$want_gnome" = xyes; then
2558 - AC_MSG_CHECKING(for libgnomeui-2.0)
2559 - if $PKG_CONFIG --exists libgnomeui-2.0; then
2560 - AC_MSG_RESULT(yes)
2561 - GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
2562 - GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
2563 - GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
2565 - dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
2566 - dnl This might not be the right way but it works for me...
2567 - AC_MSG_CHECKING(for FreeBSD)
2568 - if test "`(uname) 2>/dev/null`" = FreeBSD; then
2569 - AC_MSG_RESULT(yes, adding -pthread)
2570 - GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
2571 - GNOME_LIBS="$GNOME_LIBS -pthread"
2577 - AC_MSG_RESULT(not found)
2578 - if test "x$2" = xfail; then
2579 - AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
2586 - AC_DEFUN([GNOME_INIT],[
2587 - GNOME_INIT_HOOK([],fail)
2591 - dnl ---------------------------------------------------------------------------
2592 - dnl Check for GTK2. If it fails, then continue on for Motif as before...
2593 - dnl ---------------------------------------------------------------------------
2594 - if test -z "$SKIP_GTK2"; then
2596 - AC_MSG_CHECKING(--disable-gtktest argument)
2597 - AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
2598 - , enable_gtktest=yes)
2599 - if test "x$enable_gtktest" = "xyes" ; then
2600 - AC_MSG_RESULT(gtk test enabled)
2602 - AC_MSG_RESULT(gtk test disabled)
2605 - if test "X$PKG_CONFIG" = "X"; then
2606 - AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2609 - if test "x$PKG_CONFIG" != "xno"; then
2610 - dnl First try finding version 2.2.0 or later. The 2.0.x series has
2611 - dnl problems (bold fonts, --remote doesn't work).
2612 - AM_PATH_GTK(2.2.0,
2613 - [GUI_LIB_LOC="$GTK_LIBDIR"
2614 - GTK_LIBNAME="$GTK_LIBS"
2615 - GUI_INC_LOC="$GTK_CFLAGS"], )
2616 - if test "x$GTK_CFLAGS" != "x"; then
2622 - AC_SUBST(GTK_LIBNAME)
2625 - if test "x$GUITYPE" = "xGTK"; then
2626 - if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
2627 - || test "0$gtk_minor_version" -ge 2; then
2628 - AC_DEFINE(HAVE_GTK_MULTIHEAD)
2631 - dnl if GTK exists, then check for GNOME.
2633 - if test -z "$SKIP_GNOME"; then
2635 - GNOME_INIT_HOOK([have_gnome=yes])
2636 - if test "x$have_gnome" = xyes ; then
2637 - AC_DEFINE(FEAT_GUI_GNOME)
2638 - GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
2639 - GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
2647 - dnl ---------------------------------------------------------------------------
2648 - dnl Check for GTK3.
2649 - dnl ---------------------------------------------------------------------------
2650 - if test -z "$SKIP_GTK3"; then
2652 - AC_MSG_CHECKING(--disable-gtktest argument)
2653 - AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
2654 - , enable_gtktest=yes)
2655 - if test "x$enable_gtktest" = "xyes" ; then
2656 - AC_MSG_RESULT(gtk test enabled)
2658 - AC_MSG_RESULT(gtk test disabled)
2661 - if test "X$PKG_CONFIG" = "X"; then
2662 - AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2665 - if test "x$PKG_CONFIG" != "xno"; then
2666 - AM_PATH_GTK(3.0.0,
2667 - [GUI_LIB_LOC="$GTK_LIBDIR"
2668 - GTK_LIBNAME="$GTK_LIBS"
2669 - GUI_INC_LOC="$GTK_CFLAGS"], )
2670 - if test "x$GTK_CFLAGS" != "x"; then
2677 - AC_SUBST(GTK_LIBNAME)
2678 - AC_DEFINE(HAVE_GTK_MULTIHEAD)
2679 - AC_DEFINE(USE_GTK3)
2684 - dnl Check the version of Gdk-Pixbuf. If the version is 2.31 or later and
2685 - dnl glib-compile-resources is found in PATH, use GResource.
2686 - if test "x$GUITYPE" = "xGTK"; then
2687 - AC_MSG_CHECKING([version of Gdk-Pixbuf])
2688 - gdk_pixbuf_version=`$PKG_CONFIG --modversion gdk-pixbuf-2.0`
2689 - if test "x$gdk_pixbuf_version" != x ; then
2690 - gdk_pixbuf_version_minor=`echo $gdk_pixbuf_version | \
2691 - sed -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/'`
2692 - if test "x$gdk_pixbuf_version_minor" != x -a \
2693 - $gdk_pixbuf_version_minor -ge 31 ; then
2694 - AC_MSG_RESULT([OK.])
2695 - AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no)
2696 - AC_MSG_CHECKING([glib-compile-resources])
2697 - if test "x$GLIB_COMPILE_RESOURCES" = xno ; then
2698 - GLIB_COMPILE_RESOURCES=""
2699 - AC_MSG_RESULT([cannot be found in PATH.])
2701 - AC_MSG_RESULT([usable.])
2702 - AC_DEFINE(USE_GRESOURCE)
2703 - GRESOURCE_SRC="auto/gui_gtk_gresources.c"
2704 - GRESOURCE_OBJ="objects/gui_gtk_gresources.o"
2707 - AC_MSG_RESULT([not usable.])
2710 - AC_MSG_RESULT([cannot obtain from pkg_config.])
2713 - AC_MSG_CHECKING([--disable-icon-cache-update argument])
2714 - AC_ARG_ENABLE(icon_cache_update,
2715 - [ --disable-icon-cache-update update disabled],
2717 - [enable_icon_cache_update="yes"])
2718 - if test "$enable_icon_cache_update" = "yes"; then
2719 - AC_MSG_RESULT([not set])
2720 - AC_PATH_PROG(GTK_UPDATE_ICON_CACHE,[gtk-update-icon-cache],no)
2721 - if test "x$GTK_UPDATE_ICON_CACHE" = "xno" ; then
2722 - AC_MSG_RESULT([not found in PATH.])
2725 - AC_MSG_RESULT([update disabled])
2728 - AC_MSG_CHECKING([--disable-desktop-database-update argument])
2729 - AC_ARG_ENABLE(desktop_database_update,
2730 - [ --disable-desktop-database-update update disabled],
2732 - [enable_desktop_database_update="yes"])
2733 - if test "$enable_desktop_database_update" = "yes"; then
2734 - AC_MSG_RESULT([not set])
2735 - AC_PATH_PROG(UPDATE_DESKTOP_DATABASE,[update-desktop-database],no)
2736 - if test "x$UPDATE_DESKTOP_DATABASE" = "xno" ; then
2737 - AC_MSG_RESULT([not found in PATH.])
2740 - AC_MSG_RESULT([update disabled])
2743 - AC_SUBST(GLIB_COMPILE_RESOURCES)
2744 - AC_SUBST(GRESOURCE_SRC)
2745 - AC_SUBST(GRESOURCE_OBJ)
2746 - AC_SUBST(GTK_UPDATE_ICON_CACHE)
2747 - AC_SUBST(UPDATE_DESKTOP_DATABASE)
2749 - dnl Check for Motif include files location.
2750 - dnl The LAST one found is used, this makes the highest version to be used,
2751 - dnl e.g. when Motif1.2 and Motif2.0 are both present.
2753 - if test -z "$SKIP_MOTIF"; then
2754 - 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"
2755 - dnl Remove "-I" from before $GUI_INC_LOC if it's there
2756 - GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
2758 - AC_MSG_CHECKING(for location of Motif GUI includes)
2759 - gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
2761 - for try in $gui_includes; do
2762 - if test -f "$try/Xm/Xm.h"; then
2766 - if test -n "$GUI_INC_LOC"; then
2767 - if test "$GUI_INC_LOC" = /usr/include; then
2769 - AC_MSG_RESULT(in default path)
2771 - AC_MSG_RESULT($GUI_INC_LOC)
2774 - AC_MSG_RESULT(<not found>)
2779 - dnl Check for Motif library files location. In the same order as the include
2780 - dnl files, to avoid a mixup if several versions are present
2782 - if test -z "$SKIP_MOTIF"; then
2783 - AC_MSG_CHECKING(--with-motif-lib argument)
2784 - AC_ARG_WITH(motif-lib,
2785 - [ --with-motif-lib=STRING Library for Motif ],
2786 - [ MOTIF_LIBNAME="${withval}" ] )
2788 - if test -n "$MOTIF_LIBNAME"; then
2789 - AC_MSG_RESULT($MOTIF_LIBNAME)
2794 - dnl Remove "-L" from before $GUI_LIB_LOC if it's there
2795 - GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
2797 - dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The
2798 - dnl linker will figure out which one to use, we only check if one exists.
2799 - AC_MSG_CHECKING(for location of Motif GUI libs)
2800 - gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC"
2802 - for try in $gui_libs; do
2803 - for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do
2804 - if test -f "$libtry"; then
2809 - if test -n "$GUI_LIB_LOC"; then
2810 - dnl Remove /usr/lib, it causes trouble on some systems
2811 - if test "$GUI_LIB_LOC" = /usr/lib \
2812 - -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \
2813 - -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then
2815 - AC_MSG_RESULT(in default path)
2817 - if test -n "$GUI_LIB_LOC"; then
2818 - AC_MSG_RESULT($GUI_LIB_LOC)
2819 - if test "`(uname) 2>/dev/null`" = SunOS &&
2820 - uname -r | grep '^5' >/dev/null; then
2821 - GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
2825 - MOTIF_LIBNAME=-lXm
2827 - AC_MSG_RESULT(<not found>)
2833 - if test -z "$SKIP_MOTIF"; then
2837 - AC_SUBST(MOTIF_LIBNAME)
2840 - dnl Check if the Athena files can be found
2844 - if test -z "$SKIP_ATHENA"; then
2845 - AC_MSG_CHECKING(if Athena header files can be found)
2846 - cflags_save=$CFLAGS
2847 - CFLAGS="$CFLAGS $X_CFLAGS"
2849 - #include <X11/Intrinsic.h>
2850 - #include <X11/Xaw/Paned.h>], ,
2851 - AC_MSG_RESULT(yes),
2852 - AC_MSG_RESULT(no); SKIP_ATHENA=YES )
2853 - CFLAGS=$cflags_save
2856 - if test -z "$SKIP_ATHENA"; then
2860 - if test -z "$SKIP_NEXTAW"; then
2861 - AC_MSG_CHECKING(if neXtaw header files can be found)
2862 - cflags_save=$CFLAGS
2863 - CFLAGS="$CFLAGS $X_CFLAGS"
2865 - #include <X11/Intrinsic.h>
2866 - #include <X11/neXtaw/Paned.h>], ,
2867 - AC_MSG_RESULT(yes),
2868 - AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
2869 - CFLAGS=$cflags_save
2872 - if test -z "$SKIP_NEXTAW"; then
2876 - if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
2877 - dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
2878 - dnl Avoid adding it when it twice
2879 - if test -n "$GUI_INC_LOC"; then
2880 - GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
2882 - if test -n "$GUI_LIB_LOC"; then
2883 - GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
2886 - dnl Check for -lXext and then for -lXmu
2887 - ldflags_save=$LDFLAGS
2888 - LDFLAGS="$X_LIBS $LDFLAGS"
2889 - AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
2890 - [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2891 - dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
2892 - AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
2893 - [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2894 - AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
2895 - [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2896 - AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
2897 - [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2898 - if test -z "$SKIP_MOTIF"; then
2899 - AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
2900 - [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
2902 - LDFLAGS=$ldflags_save
2904 - dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
2905 - AC_MSG_CHECKING(for extra X11 defines)
2907 - rm -fr conftestdir
2908 - if mkdir conftestdir; then
2910 - cat > Imakefile <<'EOF'
2912 - @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
2914 - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2915 - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2918 - rm -fr conftestdir
2920 - if test -z "$NARROW_PROTO"; then
2923 - AC_MSG_RESULT($NARROW_PROTO)
2925 - AC_SUBST(NARROW_PROTO)
2928 - dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
2929 - dnl use the X11 include path
2930 - if test "$enable_xsmp" = "yes"; then
2931 - cppflags_save=$CPPFLAGS
2932 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2933 - AC_CHECK_HEADERS(X11/SM/SMlib.h)
2934 - CPPFLAGS=$cppflags_save
2938 - if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then
2939 - dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
2940 - cppflags_save=$CPPFLAGS
2941 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2942 - AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
2944 - dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
2945 - if test ! "$enable_xim" = "no"; then
2946 - AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
2947 - AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
2948 - AC_MSG_RESULT(yes),
2949 - AC_MSG_RESULT(no; xim has been disabled); enable_xim="no")
2951 - CPPFLAGS=$cppflags_save
2953 - dnl automatically enable XIM when hangul input isn't enabled
2954 - if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
2955 - -a "x$GUITYPE" != "xNONE" ; then
2956 - AC_MSG_RESULT(X GUI selected; xim has been enabled)
2961 - if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
2962 - cppflags_save=$CPPFLAGS
2963 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2964 - dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h
2965 - AC_MSG_CHECKING([for X11/Xmu/Editres.h])
2967 - #include <X11/Intrinsic.h>
2968 - #include <X11/Xmu/Editres.h>],
2970 - AC_MSG_RESULT(yes)
2971 - AC_DEFINE(HAVE_X11_XMU_EDITRES_H),
2972 - AC_MSG_RESULT(no))
2973 - CPPFLAGS=$cppflags_save
2976 - dnl Only use the Xm directory when compiling Motif, don't use it for Athena
2977 - if test -z "$SKIP_MOTIF"; then
2978 - cppflags_save=$CPPFLAGS
2979 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2980 - if test "$zOSUnix" = "yes"; then
2981 - xmheader="Xm/Xm.h"
2983 - xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h
2984 - Xm/UnhighlightT.h Xm/Notebook.h"
2986 - AC_CHECK_HEADERS($xmheader)
2988 - if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then
2989 - dnl Solaris uses XpmAttributes_21, very annoying.
2990 - AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
2991 - AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
2992 - AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21),
2993 - AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
2996 - AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
2998 - CPPFLAGS=$cppflags_save
3001 - if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
3002 - AC_MSG_RESULT(no GUI selected; xim has been disabled)
3005 - if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
3006 - AC_MSG_RESULT(no GUI selected; fontset has been disabled)
3007 - enable_fontset="no"
3009 - if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then
3010 - AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
3011 - enable_fontset="no"
3014 - if test -z "$SKIP_PHOTON"; then
3018 - AC_SUBST(GUI_INC_LOC)
3019 - AC_SUBST(GUI_LIB_LOC)
3021 - AC_SUBST(GUI_X_LIBS)
3023 - if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
3024 - AC_MSG_ERROR([cannot use workshop without Motif])
3027 - dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
3028 - if test "$enable_xim" = "yes"; then
3029 - AC_DEFINE(FEAT_XIM)
3031 - if test "$enable_fontset" = "yes"; then
3032 - AC_DEFINE(FEAT_XFONTSET)
3036 - dnl ---------------------------------------------------------------------------
3037 - dnl end of GUI-checking
3038 - dnl ---------------------------------------------------------------------------
3040 - dnl Check for Cygwin, which needs an extra source file if not using X11
3041 - AC_MSG_CHECKING(for CYGWIN or MSYS environment)
3043 - CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes)
3044 - AC_MSG_CHECKING(for CYGWIN clipboard support)
3045 - if test "x$with_x" = "xno" ; then
3046 - OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o
3047 - AC_MSG_RESULT(yes)
3048 - AC_DEFINE(FEAT_CYGWIN_WIN32_CLIPBOARD)
3050 - AC_MSG_RESULT(no - using X11)
3053 - *) CYGWIN=no; AC_MSG_RESULT(no);;
3056 - dnl Only really enable hangul input when GUI and XFONTSET are available
3057 - if test "$enable_hangulinput" = "yes"; then
3058 - if test "x$GUITYPE" = "xNONE"; then
3059 - AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
3060 - enable_hangulinput=no
3062 - AC_DEFINE(FEAT_HANGULIN)
3063 - HANGULIN_SRC=hangulin.c
3064 - AC_SUBST(HANGULIN_SRC)
3065 - HANGULIN_OBJ=objects/hangulin.o
3066 - AC_SUBST(HANGULIN_OBJ)
3070 - dnl Checks for libraries and include files.
3072 - AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken],
3074 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3075 - #include "confdefs.h"
3076 - #include <ctype.h>
3078 - # include <stdlib.h>
3079 - # include <stddef.h>
3081 - main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
3083 - vim_cv_toupper_broken=yes
3085 - vim_cv_toupper_broken=no
3087 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken')
3090 - if test "x$vim_cv_toupper_broken" = "xyes" ; then
3091 - AC_DEFINE(BROKEN_TOUPPER)
3094 - AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
3095 - AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");],
3096 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
3097 - AC_MSG_RESULT(no))
3099 - AC_MSG_CHECKING(whether __attribute__((unused)) is allowed)
3100 - AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
3101 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED),
3102 - AC_MSG_RESULT(no))
3104 - dnl Checks for header files.
3105 - AC_CHECK_HEADER(elf.h, HAS_ELF=1)
3106 - dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
3107 - if test "$HAS_ELF" = 1; then
3108 - AC_CHECK_LIB(elf, main)
3113 - dnl If sys/wait.h is not found it might still exist but not be POSIX
3114 - dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
3115 - if test $ac_cv_header_sys_wait_h = no; then
3116 - AC_MSG_CHECKING([for sys/wait.h that defines union wait])
3117 - AC_TRY_COMPILE([#include <sys/wait.h>],
3118 - [union wait xx, yy; xx = yy],
3119 - AC_MSG_RESULT(yes)
3120 - AC_DEFINE(HAVE_SYS_WAIT_H)
3121 - AC_DEFINE(HAVE_UNION_WAIT),
3122 - AC_MSG_RESULT(no))
3125 - AC_CHECK_HEADERS(stdint.h stdlib.h string.h \
3126 - sys/select.h sys/utsname.h termcap.h fcntl.h \
3127 - sgtty.h sys/ioctl.h sys/time.h sys/types.h \
3128 - termio.h iconv.h inttypes.h langinfo.h math.h \
3129 - unistd.h stropts.h errno.h sys/resource.h \
3130 - sys/systeminfo.h locale.h sys/stream.h termios.h \
3131 - libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
3132 - utime.h sys/param.h libintl.h libgen.h \
3133 - util/debug.h util/msg18n.h frame.h sys/acl.h \
3134 - sys/access.h sys/sysinfo.h wchar.h wctype.h)
3136 - dnl sys/ptem.h depends on sys/stream.h on Solaris
3137 - AC_CHECK_HEADERS(sys/ptem.h, [], [],
3138 - [#if defined HAVE_SYS_STREAM_H
3139 - # include <sys/stream.h>
3142 - dnl sys/sysctl.h depends on sys/param.h on OpenBSD
3143 - AC_CHECK_HEADERS(sys/sysctl.h, [], [],
3144 - [#if defined HAVE_SYS_PARAM_H
3145 - # include <sys/param.h>
3149 - dnl pthread_np.h may exist but can only be used after including pthread.h
3150 - AC_MSG_CHECKING([for pthread_np.h])
3152 - #include <pthread.h>
3153 - #include <pthread_np.h>],
3155 - AC_MSG_RESULT(yes)
3156 - AC_DEFINE(HAVE_PTHREAD_NP_H),
3157 - AC_MSG_RESULT(no))
3159 - AC_CHECK_HEADERS(strings.h)
3160 - if test "x$MACOSX" = "xyes"; then
3161 - dnl The strings.h file on OS/X contains a warning and nothing useful.
3162 - AC_DEFINE(NO_STRINGS_WITH_STRING_H)
3165 - dnl Check if strings.h and string.h can both be included when defined.
3166 - AC_MSG_CHECKING([if strings.h can be included after string.h])
3167 - cppflags_save=$CPPFLAGS
3168 - CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3170 - #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
3171 - # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
3172 - /* but don't do it on AIX 5.1 (Uribarri) */
3174 - #ifdef HAVE_XM_XM_H
3175 - # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
3177 - #ifdef HAVE_STRING_H
3178 - # include <string.h>
3180 - #if defined(HAVE_STRINGS_H)
3181 - # include <strings.h>
3183 - ], [int i; i = 0;],
3184 - AC_MSG_RESULT(yes),
3185 - AC_DEFINE(NO_STRINGS_WITH_STRING_H)
3186 - AC_MSG_RESULT(no))
3187 - CPPFLAGS=$cppflags_save
3190 - dnl Checks for typedefs, structures, and compiler characteristics.
3191 - AC_PROG_GCC_TRADITIONAL
3202 - AC_CHECK_TYPE(ino_t, long)
3203 - AC_CHECK_TYPE(dev_t, unsigned)
3204 - AC_C_BIGENDIAN(,,,)
3207 - AC_MSG_CHECKING(for rlim_t)
3208 - if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
3209 - AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
3212 - changequote(<<,>>)dnl
3213 - <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
3216 - #include <sys/types.h>
3218 - # include <stdlib.h>
3219 - # include <stddef.h>
3221 - #ifdef HAVE_SYS_RESOURCE_H
3222 - # include <sys/resource.h>
3224 - ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
3225 - AC_MSG_RESULT($ac_cv_type_rlim_t)
3227 - if test $ac_cv_type_rlim_t = no; then
3228 - cat >> confdefs.h <<\EOF
3229 - #define rlim_t unsigned long
3233 - AC_MSG_CHECKING(for stack_t)
3234 - if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
3235 - AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
3237 - AC_EGREP_CPP(stack_t,
3239 - #include <sys/types.h>
3241 - # include <stdlib.h>
3242 - # include <stddef.h>
3244 - #include <signal.h>
3245 - ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
3246 - AC_MSG_RESULT($ac_cv_type_stack_t)
3248 - if test $ac_cv_type_stack_t = no; then
3249 - cat >> confdefs.h <<\EOF
3250 - #define stack_t struct sigaltstack
3254 - dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
3255 - AC_MSG_CHECKING(whether stack_t has an ss_base field)
3257 - #include <sys/types.h>
3259 - # include <stdlib.h>
3260 - # include <stddef.h>
3262 - #include <signal.h>
3263 - #include "confdefs.h"
3264 - ], [stack_t sigstk; sigstk.ss_base = 0; ],
3265 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
3266 - AC_MSG_RESULT(no))
3269 - AC_MSG_CHECKING(--with-tlib argument)
3270 - AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
3271 - if test -n "$with_tlib"; then
3272 - AC_MSG_RESULT($with_tlib)
3273 - LIBS="$LIBS -l$with_tlib"
3274 - AC_MSG_CHECKING(for linking with $with_tlib library)
3275 - AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED))
3276 - dnl Need to check for tgetent() below.
3279 - AC_MSG_RESULT([empty: automatic terminal library selection])
3280 - dnl On HP-UX 10.10 termcap or termlib should be used instead of
3281 - dnl curses, because curses is much slower.
3282 - dnl Newer versions of ncurses are preferred over anything, except
3283 - dnl when tinfo has been split off, it contains all we need.
3284 - dnl Older versions of ncurses have bugs, get a new one!
3285 - dnl Digital Unix (OSF1) should use curses (Ronald Schild).
3286 - dnl On SCO Openserver should prefer termlib (Roger Cornelius).
3287 - case "`uname -s 2>/dev/null`" in
3288 - OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";;
3289 - *) tlibs="tinfo ncurses termlib termcap curses";;
3291 - for libname in $tlibs; do
3292 - AC_CHECK_LIB(${libname}, tgetent,,)
3293 - if test "x$olibs" != "x$LIBS"; then
3294 - dnl It's possible that a library is found but it doesn't work
3295 - dnl e.g., shared library that cannot be found
3296 - dnl compile and run a test program to be sure
3298 - #ifdef HAVE_TERMCAP_H
3299 - # include <termcap.h>
3302 - # include <stdlib.h>
3303 - # include <stddef.h>
3305 - main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
3306 - res="OK", res="FAIL", res="FAIL")
3307 - if test "$res" = "OK"; then
3310 - AC_MSG_RESULT($libname library is not usable)
3314 - if test "x$olibs" = "x$LIBS"; then
3315 - AC_MSG_RESULT(no terminal library found)
3319 - if test "x$olibs" = "x$LIBS"; then
3320 - AC_MSG_CHECKING([for tgetent()])
3322 - [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
3323 - AC_MSG_RESULT(yes),
3324 - AC_MSG_ERROR([NOT FOUND!
3325 - You need to install a terminal library; for example ncurses.
3326 - Or specify the name of the library with --with-tlib.]))
3329 - AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo],
3331 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3332 - #include "confdefs.h"
3333 - #ifdef HAVE_TERMCAP_H
3334 - # include <termcap.h>
3336 - #ifdef HAVE_STRING_H
3337 - # include <string.h>
3340 - # include <stdlib.h>
3341 - # include <stddef.h>
3344 - {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
3346 - vim_cv_terminfo=no
3348 - vim_cv_terminfo=yes
3350 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo')
3354 - if test "x$vim_cv_terminfo" = "xyes" ; then
3355 - AC_DEFINE(TERMINFO)
3358 - if test "x$olibs" != "x$LIBS"; then
3359 - AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
3361 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3362 - #include "confdefs.h"
3363 - #ifdef HAVE_TERMCAP_H
3364 - # include <termcap.h>
3367 - # include <stdlib.h>
3368 - # include <stddef.h>
3371 - {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
3375 - vim_cv_tgent=non-zero
3377 - AC_MSG_ERROR(failed to compile test program.)
3381 - if test "x$vim_cv_tgent" = "xzero" ; then
3382 - AC_DEFINE(TGETENT_ZERO_ERR, 0)
3386 - AC_MSG_CHECKING(whether termcap.h contains ospeed)
3388 - #ifdef HAVE_TERMCAP_H
3389 - # include <termcap.h>
3391 - ], [ospeed = 20000],
3392 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
3393 - [AC_MSG_RESULT(no)
3394 - AC_MSG_CHECKING(whether ospeed can be extern)
3396 - #ifdef HAVE_TERMCAP_H
3397 - # include <termcap.h>
3399 - extern short ospeed;
3400 - ], [ospeed = 20000],
3401 - AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
3402 - AC_MSG_RESULT(no))]
3405 - AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
3407 - #ifdef HAVE_TERMCAP_H
3408 - # include <termcap.h>
3410 - ], [if (UP == 0 && BC == 0) PC = 1],
3411 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
3412 - [AC_MSG_RESULT(no)
3413 - AC_MSG_CHECKING([whether UP, BC and PC can be extern])
3415 - #ifdef HAVE_TERMCAP_H
3416 - # include <termcap.h>
3418 - extern char *UP, *BC, PC;
3419 - ], [if (UP == 0 && BC == 0) PC = 1],
3420 - AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
3421 - AC_MSG_RESULT(no))]
3424 - AC_MSG_CHECKING(whether tputs() uses outfuntype)
3426 - #ifdef HAVE_TERMCAP_H
3427 - # include <termcap.h>
3429 - ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
3430 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
3431 - AC_MSG_RESULT(no))
3433 - dnl On some SCO machines sys/select redefines struct timeval
3434 - AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
3436 - #include <sys/types.h>
3437 - #include <sys/time.h>
3438 - #include <sys/select.h>], ,
3439 - AC_MSG_RESULT(yes)
3440 - AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
3441 - AC_MSG_RESULT(no))
3443 - dnl AC_DECL_SYS_SIGLIST
3445 - dnl Checks for pty.c (copied from screen) ==========================
3446 - AC_MSG_CHECKING(for /dev/ptc)
3447 - if test -r /dev/ptc; then
3448 - AC_DEFINE(HAVE_DEV_PTC)
3449 - AC_MSG_RESULT(yes)
3454 - AC_MSG_CHECKING(for SVR4 ptys)
3455 - if test -c /dev/ptmx ; then
3456 - AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
3457 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
3458 - AC_MSG_RESULT(no))
3463 - AC_MSG_CHECKING(for ptyranges)
3464 - if test -d /dev/ptym ; then
3469 - dnl SCO uses ptyp%d
3474 - ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
3475 - dnl if test -c /dev/ptyp19; then
3476 - dnl ptys=`echo /dev/ptyp??`
3478 - dnl ptys=`echo $pdir/pty??`
3480 - if test "$ptys" != "$pdir/pty??" ; then
3481 - p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
3482 - p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
3483 - AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
3484 - AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
3485 - AC_MSG_RESULT([$p0 / $p1])
3487 - AC_MSG_RESULT([don't know])
3490 - dnl **** pty mode/group handling ****
3492 - dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
3493 - rm -f conftest_grp
3494 - AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group],
3496 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3497 - #include "confdefs.h"
3498 - #include <sys/types.h>
3500 - # include <stdlib.h>
3501 - # include <stddef.h>
3503 - #ifdef HAVE_UNISTD_H
3504 - #include <unistd.h>
3506 - #include <sys/stat.h>
3507 - #include <stdio.h>
3511 - char *x,*ttyname();
3515 - if (!(x = ttyname(0))) exit(1);
3516 - if (stat(x, &sb)) exit(1);
3518 - if (om & 002) exit(0);
3519 - m = system("mesg y");
3520 - if (m == -1 || m == 127) exit(1);
3521 - if (stat(x, &sb)) exit(1);
3523 - if (chmod(x, om)) exit(1);
3524 - if (m & 002) exit(0);
3525 - if (sb.st_gid == getgid()) exit(1);
3526 - if (!(fp=fopen("conftest_grp", "w")))
3528 - fprintf(fp, "%d\n", sb.st_gid);
3533 - if test -f conftest_grp; then
3534 - vim_cv_tty_group=`cat conftest_grp`
3535 - if test "x$vim_cv_tty_mode" = "x" ; then
3536 - vim_cv_tty_mode=0620
3538 - AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group])
3540 - vim_cv_tty_group=world
3541 - AC_MSG_RESULT([ptys are world accessible])
3544 - vim_cv_tty_group=world
3545 - AC_MSG_RESULT([can't determine - assume ptys are world accessible])
3547 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode')
3550 - rm -f conftest_grp
3552 - if test "x$vim_cv_tty_group" != "xworld" ; then
3553 - AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group)
3554 - if test "x$vim_cv_tty_mode" = "x" ; then
3555 - AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)])
3557 - AC_DEFINE(PTYMODE, 0620)
3561 - dnl Checks for library functions. ===================================
3565 - dnl find out what to use at the end of a signal function
3566 - if test $ac_cv_type_signal = void; then
3567 - AC_DEFINE(SIGRETURN, [return])
3569 - AC_DEFINE(SIGRETURN, [return 0])
3572 - dnl check if struct sigcontext is defined (used for SGI only)
3573 - AC_MSG_CHECKING(for struct sigcontext)
3575 - #include <signal.h>
3578 - struct sigcontext *scont;
3579 - scont = (struct sigcontext *)0;
3582 - AC_MSG_RESULT(yes)
3583 - AC_DEFINE(HAVE_SIGCONTEXT),
3584 - AC_MSG_RESULT(no))
3586 - dnl tricky stuff: try to find out if getcwd() is implemented with
3587 - dnl system("sh -c pwd")
3588 - AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken],
3590 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3591 - #include "confdefs.h"
3592 - #ifdef HAVE_UNISTD_H
3593 - #include <unistd.h>
3595 - char *dagger[] = { "IFS=pwd", 0 };
3599 - extern char **environ;
3601 - return getcwd(buffer, 500) ? 0 : 1;
3604 - vim_cv_getcwd_broken=no
3606 - vim_cv_getcwd_broken=yes
3608 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken')
3612 - if test "x$vim_cv_getcwd_broken" = "xyes" ; then
3613 - AC_DEFINE(BAD_GETCWD)
3616 - dnl Check for functions in one big call, to reduce the size of configure.
3617 - dnl Can only be used for functions that do not require any include.
3618 - AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
3619 - getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
3620 - memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
3621 - setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
3622 - sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
3623 - strnicmp strpbrk strtol tgetent towlower towupper iswupper \
3624 - usleep utime utimes)
3627 - dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
3628 - dnl appropriate, so that off_t is 64 bits when needed.
3631 - dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
3632 - AC_MSG_CHECKING(for st_blksize)
3634 - [#include <sys/types.h>
3635 - #include <sys/stat.h>],
3640 - n = (int)st.st_blksize;],
3641 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
3642 - AC_MSG_RESULT(no))
3644 - AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash],
3646 - AC_RUN_IFELSE([AC_LANG_SOURCE([[
3647 - #include "confdefs.h"
3649 - # include <stdlib.h>
3650 - # include <stddef.h>
3652 - #include <sys/types.h>
3653 - #include <sys/stat.h>
3654 - main() {struct stat st; exit(stat("configure/", &st) != 0); }
3656 - vim_cv_stat_ignores_slash=yes
3658 - vim_cv_stat_ignores_slash=no
3660 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash')
3664 - if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then
3665 - AC_DEFINE(STAT_IGNORES_SLASH)
3668 - dnl Link with iconv for charset translation, if not found without library.
3669 - dnl check for iconv() requires including iconv.h
3670 - dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
3671 - dnl has been installed.
3672 - AC_MSG_CHECKING(for iconv_open())
3674 - LIBS="$LIBS -liconv"
3676 - #ifdef HAVE_ICONV_H
3677 - # include <iconv.h>
3679 - ], [iconv_open("fr", "to");],
3680 - AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
3683 - #ifdef HAVE_ICONV_H
3684 - # include <iconv.h>
3686 - ], [iconv_open("fr", "to");],
3687 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
3688 - AC_MSG_RESULT(no)))
3691 - AC_MSG_CHECKING(for nl_langinfo(CODESET))
3693 - #ifdef HAVE_LANGINFO_H
3694 - # include <langinfo.h>
3696 - ], [char *cs = nl_langinfo(CODESET);],
3697 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
3698 - AC_MSG_RESULT(no))
3700 - dnl Need various functions for floating point support. Only enable
3701 - dnl floating point when they are all present.
3702 - AC_CHECK_LIB(m, strtod)
3703 - AC_MSG_CHECKING([for strtod() and other floating point functions])
3705 - #ifdef HAVE_MATH_H
3706 - # include <math.h>
3709 - # include <stdlib.h>
3710 - # include <stddef.h>
3712 - ], [char *s; double d;
3713 - d = strtod("1.1", &s);
3718 - d = pow(1.11, 2.22);
3724 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
3725 - AC_MSG_RESULT(no))
3727 - dnl isinf() and isnan() need to include header files and may need -lm.
3728 - AC_MSG_CHECKING([for isinf()])
3730 - #ifdef HAVE_MATH_H
3731 - # include <math.h>
3734 - # include <stdlib.h>
3735 - # include <stddef.h>
3737 - ], [int r = isinf(1.11); ],
3738 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF),
3739 - AC_MSG_RESULT(no))
3741 - AC_MSG_CHECKING([for isnan()])
3743 - #ifdef HAVE_MATH_H
3744 - # include <math.h>
3747 - # include <stdlib.h>
3748 - # include <stddef.h>
3750 - ], [int r = isnan(1.11); ],
3751 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN),
3752 - AC_MSG_RESULT(no))
3754 - dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
3755 - dnl when -lacl works, also try to use -lattr (required for Debian).
3756 - dnl On Solaris, use the acl_get/set functions in libsec, if present.
3757 - AC_MSG_CHECKING(--disable-acl argument)
3758 - AC_ARG_ENABLE(acl,
3759 - [ --disable-acl Don't check for ACL support.],
3760 - , [enable_acl="yes"])
3761 - if test "$enable_acl" = "yes"; then
3763 - AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
3764 - AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
3765 - AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
3767 - AC_MSG_CHECKING(for POSIX ACL support)
3769 - #include <sys/types.h>
3770 - #ifdef HAVE_SYS_ACL_H
3771 - # include <sys/acl.h>
3773 - acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
3774 - acl_set_file("foo", ACL_TYPE_ACCESS, acl);
3776 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
3777 - AC_MSG_RESULT(no))
3779 - AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)],
3780 - AC_MSG_CHECKING(for Solaris ACL support)
3782 - #ifdef HAVE_SYS_ACL_H
3783 - # include <sys/acl.h>
3784 - #endif], [acl("foo", GETACLCNT, 0, NULL);
3786 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
3787 - AC_MSG_RESULT(no)))
3789 - AC_MSG_CHECKING(for AIX ACL support)
3792 - # include <stdlib.h>
3793 - # include <stddef.h>
3795 - #ifdef HAVE_SYS_ACL_H
3796 - # include <sys/acl.h>
3798 - #ifdef HAVE_SYS_ACCESS_H
3799 - # include <sys/access.h>
3801 - #define _ALL_SOURCE
3803 - #include <sys/stat.h>
3806 - struct acl *aclent;], [aclsize = sizeof(struct acl);
3807 - aclent = (void *)malloc(aclsize);
3808 - statacl("foo", STX_NORMAL, aclent, aclsize);
3810 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
3811 - AC_MSG_RESULT(no))
3813 - AC_MSG_RESULT(yes)
3816 - if test "x$GTK_CFLAGS" != "x"; then
3817 - dnl pango_shape_full() is new, fall back to pango_shape().
3818 - AC_MSG_CHECKING(for pango_shape_full)
3819 - ac_save_CFLAGS="$CFLAGS"
3820 - ac_save_LIBS="$LIBS"
3821 - CFLAGS="$CFLAGS $GTK_CFLAGS"
3822 - LIBS="$LIBS $GTK_LIBS"
3824 - [#include <gtk/gtk.h>],
3825 - [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ],
3826 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL),
3827 - AC_MSG_RESULT(no))
3828 - CFLAGS="$ac_save_CFLAGS"
3829 - LIBS="$ac_save_LIBS"
3832 - AC_MSG_CHECKING(--disable-gpm argument)
3833 - AC_ARG_ENABLE(gpm,
3834 - [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
3835 - [enable_gpm="yes"])
3837 - if test "$enable_gpm" = "yes"; then
3839 - dnl Checking if gpm support can be compiled
3840 - AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
3841 - [olibs="$LIBS" ; LIBS="-lgpm"]
3844 - #include <linux/keyboard.h>],
3845 - [Gpm_GetLibVersion(NULL);],
3846 - dnl Configure defines HAVE_GPM, if it is defined feature.h defines
3847 - dnl FEAT_MOUSE_GPM if mouse support is included
3848 - [vi_cv_have_gpm=yes],
3849 - [vi_cv_have_gpm=no])
3852 - if test $vi_cv_have_gpm = yes; then
3853 - LIBS="$LIBS -lgpm"
3854 - AC_DEFINE(HAVE_GPM)
3857 - AC_MSG_RESULT(yes)
3860 - AC_MSG_CHECKING(--disable-sysmouse argument)
3861 - AC_ARG_ENABLE(sysmouse,
3862 - [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], ,
3863 - [enable_sysmouse="yes"])
3865 - if test "$enable_sysmouse" = "yes"; then
3867 - dnl Checking if sysmouse support can be compiled
3868 - dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h
3869 - dnl defines FEAT_SYSMOUSE if mouse support is included
3870 - AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse,
3872 - [#include <sys/consio.h>
3873 - #include <signal.h>
3874 - #include <sys/fbio.h>],
3875 - [struct mouse_info mouse;
3876 - mouse.operation = MOUSE_MODE;
3877 - mouse.operation = MOUSE_SHOW;
3878 - mouse.u.mode.mode = 0;
3879 - mouse.u.mode.signal = SIGUSR2;],
3880 - [vi_cv_have_sysmouse=yes],
3881 - [vi_cv_have_sysmouse=no])
3883 - if test $vi_cv_have_sysmouse = yes; then
3884 - AC_DEFINE(HAVE_SYSMOUSE)
3887 - AC_MSG_RESULT(yes)
3890 - dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
3891 - AC_MSG_CHECKING(for FD_CLOEXEC)
3894 - # include <fcntl.h>
3896 - [ int flag = FD_CLOEXEC;],
3897 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
3898 - AC_MSG_RESULT(not usable))
3900 - dnl rename needs to be checked separately to work on Nextstep with cc
3901 - AC_MSG_CHECKING(for rename)
3902 - AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
3903 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
3904 - AC_MSG_RESULT(no))
3906 - dnl sysctl() may exist but not the arguments we use
3907 - AC_MSG_CHECKING(for sysctl)
3909 - [#include <sys/types.h>
3910 - #include <sys/sysctl.h>],
3915 - mib[1] = HW_USERMEM;
3917 - (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
3919 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
3920 - AC_MSG_RESULT(not usable))
3922 - dnl sysinfo() may exist but not be Linux compatible
3923 - AC_MSG_CHECKING(for sysinfo)
3925 - [#include <sys/types.h>
3926 - #include <sys/sysinfo.h>],
3927 - [ struct sysinfo sinfo;
3930 - (void)sysinfo(&sinfo);
3931 - t = sinfo.totalram;
3933 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
3934 - AC_MSG_RESULT(not usable))
3936 - dnl struct sysinfo may have the mem_unit field or not
3937 - AC_MSG_CHECKING(for sysinfo.mem_unit)
3939 - [#include <sys/types.h>
3940 - #include <sys/sysinfo.h>],
3941 - [ struct sysinfo sinfo;
3942 - sinfo.mem_unit = 1;
3944 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT),
3945 - AC_MSG_RESULT(no))
3947 - dnl sysconf() may exist but not support what we want to use
3948 - AC_MSG_CHECKING(for sysconf)
3950 - [#include <unistd.h>],
3951 - [ (void)sysconf(_SC_PAGESIZE);
3952 - (void)sysconf(_SC_PHYS_PAGES);
3954 - AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
3955 - AC_MSG_RESULT(not usable))
3957 - AC_CHECK_SIZEOF([int])
3958 - AC_CHECK_SIZEOF([long])
3959 - AC_CHECK_SIZEOF([time_t])
3960 - AC_CHECK_SIZEOF([off_t])
3962 - dnl Use different names to avoid clashing with other header files.
3963 - AC_DEFINE_UNQUOTED(VIM_SIZEOF_INT, [$ac_cv_sizeof_int])
3964 - AC_DEFINE_UNQUOTED(VIM_SIZEOF_LONG, [$ac_cv_sizeof_long])
3966 - dnl Make sure that uint32_t is really 32 bits unsigned.
3967 - AC_MSG_CHECKING([uint32_t is 32 bits])
3969 - #ifdef HAVE_STDINT_H
3970 - # include <stdint.h>
3972 - #ifdef HAVE_INTTYPES_H
3973 - # include <inttypes.h>
3976 - uint32_t nr1 = (uint32_t)-1;
3977 - uint32_t nr2 = (uint32_t)0xffffffffUL;
3978 - if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1);
3981 - AC_MSG_RESULT(ok),
3982 - AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]),
3983 - AC_MSG_WARN([cannot check uint32_t when cross-compiling.]))
3985 - dnl Check for memmove() before bcopy(), makes memmove() be used when both are
3986 - dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
3988 - [bcopy_test_prog='
3989 - #include "confdefs.h"
3990 - #ifdef HAVE_STRING_H
3991 - # include <string.h>
3994 - # include <stdlib.h>
3995 - # include <stddef.h>
3999 - strcpy(buf, "abcdefghi");
4000 - mch_memmove(buf, buf + 2, 3);
4001 - if (strncmp(buf, "ababcf", 6))
4003 - strcpy(buf, "abcdefghi");
4004 - mch_memmove(buf + 2, buf, 3);
4005 - if (strncmp(buf, "cdedef", 6))
4007 - exit(0); /* libc version works properly. */
4010 - AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap],
4012 - AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]])],
4014 - vim_cv_memmove_handles_overlap=yes
4016 - vim_cv_memmove_handles_overlap=no
4018 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap')
4022 - if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then
4023 - AC_DEFINE(USEMEMMOVE)
4025 - AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap],
4027 - AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]])],
4029 - vim_cv_bcopy_handles_overlap=yes
4031 - vim_cv_bcopy_handles_overlap=no
4033 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap')
4037 - if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then
4038 - AC_DEFINE(USEBCOPY)
4040 - AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap],
4042 - AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]])],
4044 - vim_cv_memcpy_handles_overlap=yes
4046 - vim_cv_memcpy_handles_overlap=no
4048 - AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap')
4052 - if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then
4053 - AC_DEFINE(USEMEMCPY)
4059 - dnl Check for multibyte locale functions
4060 - dnl Find out if _Xsetlocale() is supported by libX11.
4061 - dnl Check if X_LOCALE should be defined.
4062 - if test "x$with_x" = "xyes"; then
4063 - cflags_save=$CFLAGS
4065 - LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
4066 - CFLAGS="$CFLAGS $X_CFLAGS"
4068 - AC_MSG_CHECKING(whether X_LOCALE needed)
4069 - AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
4070 - AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
4071 - AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
4072 - AC_MSG_RESULT(no))
4074 - AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used)
4075 - AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes)
4076 - AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no))
4078 - CFLAGS=$cflags_save
4082 - dnl Link with xpg4, it is said to make Korean locale working
4083 - AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
4085 - dnl Check how we can run ctags. Default to "ctags" when nothing works.
4086 - dnl Use --version to detect Exuberant ctags (preferred)
4087 - dnl Add --fields=+S to get function signatures for omni completion.
4088 - dnl -t for typedefs (many ctags have this)
4089 - dnl -s for static functions (Elvis ctags only?)
4090 - dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
4091 - dnl -i+m to test for older Exuberant ctags
4092 - AC_MSG_CHECKING(how to create tags)
4093 - test -f tags && mv tags tags.save
4094 - if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
4095 - TAGPRG="ctags -I INIT+ --fields=+S"
4096 - elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
4097 - TAGPRG="exctags -I INIT+ --fields=+S"
4098 - elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
4099 - TAGPRG="exuberant-ctags -I INIT+ --fields=+S"
4102 - (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
4103 - (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
4104 - (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
4105 - (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
4106 - (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
4107 - (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
4108 - (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
4110 - test -f tags.save && mv tags.save tags
4111 - AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
4113 - dnl Check how we can run man with a section number
4114 - AC_MSG_CHECKING(how to run man with a section nr)
4116 - (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
4117 - AC_MSG_RESULT($MANDEF)
4118 - if test "$MANDEF" = "man -s"; then
4119 - AC_DEFINE(USEMAN_S)
4122 - dnl Check if gettext() is working and if it needs -lintl
4123 - dnl We take care to base this on an empty LIBS: on some systems libelf would be
4124 - dnl in LIBS and implicitly take along libintl. The final LIBS would then not
4125 - dnl contain libintl, and the link step would fail due to -Wl,--as-needed.
4126 - AC_MSG_CHECKING(--disable-nls argument)
4127 - AC_ARG_ENABLE(nls,
4128 - [ --disable-nls Don't support NLS (gettext()).], ,
4129 - [enable_nls="yes"])
4131 - if test "$enable_nls" = "yes"; then
4134 - INSTALL_LANGS=install-languages
4135 - AC_SUBST(INSTALL_LANGS)
4136 - INSTALL_TOOL_LANGS=install-tool-languages
4137 - AC_SUBST(INSTALL_TOOL_LANGS)
4139 - AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
4140 - AC_MSG_CHECKING([for NLS])
4141 - if test -f po/Makefile; then
4143 - if test -n "$MSGFMT"; then
4147 - [#include <libintl.h>],
4148 - [gettext("Test");],
4149 - AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs,
4152 - [#include <libintl.h>],
4153 - [gettext("Test");],
4154 - AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes";
4155 - LIBS="$olibs -lintl",
4156 - AC_MSG_RESULT([gettext() doesn't work]);
4159 - AC_MSG_RESULT([msgfmt not found - disabled]);
4161 - if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
4162 - AC_DEFINE(HAVE_GETTEXT)
4165 - dnl this was added in GNU gettext 0.10.36
4166 - AC_CHECK_FUNCS(bind_textdomain_codeset)
4167 - dnl _nl_msg_cat_cntr is required for GNU gettext
4168 - AC_MSG_CHECKING([for _nl_msg_cat_cntr])
4170 - [#include <libintl.h>
4171 - extern int _nl_msg_cat_cntr;],
4172 - [++_nl_msg_cat_cntr;],
4173 - AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
4174 - AC_MSG_RESULT([no]))
4177 - AC_MSG_RESULT([no "po/Makefile" - disabled]);
4180 - AC_MSG_RESULT(yes)
4183 - dnl Check for dynamic linking loader
4184 - AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
4185 - if test x${DLL} = xdlfcn.h; then
4186 - AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
4187 - AC_MSG_CHECKING([for dlopen()])
4189 - extern void* dlopen();
4192 - AC_MSG_RESULT(yes);
4193 - AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
4194 - AC_MSG_RESULT(no);
4195 - AC_MSG_CHECKING([for dlopen() in -ldl])
4199 - extern void* dlopen();
4202 - AC_MSG_RESULT(yes);
4203 - AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
4204 - AC_MSG_RESULT(no);
4206 - dnl ReliantUNIX has dlopen() in libc but everything else in libdl
4208 - AC_MSG_CHECKING([for dlsym()])
4210 - extern void* dlsym();
4213 - AC_MSG_RESULT(yes);
4214 - AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
4215 - AC_MSG_RESULT(no);
4216 - AC_MSG_CHECKING([for dlsym() in -ldl])
4220 - extern void* dlsym();
4223 - AC_MSG_RESULT(yes);
4224 - AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
4225 - AC_MSG_RESULT(no);
4227 - elif test x${DLL} = xdl.h; then
4228 - AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
4229 - AC_MSG_CHECKING([for shl_load()])
4231 - extern void* shl_load();
4234 - AC_MSG_RESULT(yes);
4235 - AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
4236 - AC_MSG_RESULT(no);
4237 - AC_MSG_CHECKING([for shl_load() in -ldld])
4239 - LIBS="$LIBS -ldld"
4241 - extern void* shl_load();
4244 - AC_MSG_RESULT(yes);
4245 - AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
4246 - AC_MSG_RESULT(no);
4249 - AC_CHECK_HEADERS(setjmp.h)
4251 - if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
4252 - dnl -ldl must come after DynaLoader.a
4253 - if echo $LIBS | grep -e '-ldl' >/dev/null; then
4254 - LIBS=`echo $LIBS | sed s/-ldl//`
4255 - PERL_LIBS="$PERL_LIBS -ldl"
4259 - if test "x$MACOSX" = "xyes"; then
4260 - AC_MSG_CHECKING(whether we need -framework Cocoa)
4261 - dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is
4262 - dnl disabled during tiny build)
4263 - if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then
4264 - LIBS=$"$LIBS -framework Cocoa"
4265 - AC_MSG_RESULT(yes)
4269 - dnl As mentioned above, tiny build implies os_macosx.m isn't needed.
4270 - dnl Exclude it from OS_EXTRA_SRC so that linker won't complain about
4271 - dnl missing Objective-C symbols.
4272 - if test "x$features" = "xtiny"; then
4273 - OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
4274 - OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
4277 - if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then
4278 - LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
4281 - dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
4282 - dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
4283 - dnl But only when making dependencies, cproto and lint don't take "-isystem".
4284 - dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
4285 - dnl the number before the version number.
4286 - DEPEND_CFLAGS_FILTER=
4287 - if test "$GCC" = yes; then
4288 - AC_MSG_CHECKING(for GCC 3 or later)
4289 - gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
4290 - if test "$gccmajor" -gt "2"; then
4291 - DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
4292 - AC_MSG_RESULT(yes)
4296 - dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
4297 - dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
4298 - dnl Also remove duplicate _FORTIFY_SOURCE arguments.
4299 - dnl And undefine it first to avoid a warning.
4300 - AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
4301 - if test "$gccmajor" -gt "3"; then
4302 - CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
4303 - AC_MSG_RESULT(yes)
4308 - AC_SUBST(DEPEND_CFLAGS_FILTER)
4310 - dnl link.sh tries to avoid overlinking in a hackish way.
4311 - dnl At least GNU ld supports --as-needed which provides the same functionality
4312 - dnl at linker level. Let's use it.
4313 - AC_MSG_CHECKING(linker --as-needed support)
4315 - # Check if linker supports --as-needed and --no-as-needed options
4316 - if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then
4317 - LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'`
4318 - LINK_AS_NEEDED=yes
4320 - if test "$LINK_AS_NEEDED" = yes; then
4321 - AC_MSG_RESULT(yes)
4325 - AC_SUBST(LINK_AS_NEEDED)
4327 - # IBM z/OS reset CFLAGS for config.mk
4328 - if test "$zOSUnix" = "yes"; then
4329 - CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
4332 - dnl write output files
4333 - AC_OUTPUT(auto/config.mk:config.mk.in)
4335 - dnl vim: set sw=2 tw=78 fo+=l:
4337 *** ../vim-8.0.0081/src/configure.ac 2016-11-12 21:11:48.758573129 +0100
4338 --- src/configure.ac 2016-11-12 20:10:17.939642034 +0100
4342 + dnl configure.ac: autoconf script for Vim
4344 + dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
4345 + dnl Should also work with autoconf 2.54 and later.
4348 + AC_CONFIG_HEADER(auto/config.h:config.h.in)
4350 + dnl Being able to run configure means the system is Unix (compatible).
4354 + dnl Checks for programs.
4355 + AC_PROG_CC dnl required by almost everything
4356 + AC_PROG_CPP dnl required by header file checks
4357 + AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
4358 + AC_PROG_FGREP dnl finds working grep -F
4359 + AC_ISC_POSIX dnl required by AC_C_CROSS
4360 + AC_PROG_AWK dnl required for "make html" in ../doc
4362 + dnl Don't strip if we don't have it
4363 + AC_CHECK_PROG(STRIP, strip, strip, :)
4365 + dnl Check for extension of executables
4368 + dnl Check for standard headers. We don't use this in Vim but other stuff
4369 + dnl in autoconf needs it, where it uses STDC_HEADERS.
4371 + AC_HEADER_SYS_WAIT
4373 + dnl Check for the flag that fails if stuff are missing.
4375 + AC_MSG_CHECKING(--enable-fail-if-missing argument)
4376 + AC_ARG_ENABLE(fail_if_missing,
4377 + [ --enable-fail-if-missing Fail if dependencies on additional features
4378 + specified on the command line are missing.],
4379 + [fail_if_missing="yes"],
4380 + [fail_if_missing="no"])
4381 + AC_MSG_RESULT($fail_if_missing)
4383 + dnl Set default value for CFLAGS if none is defined or it's empty
4384 + if test -z "$CFLAGS"; then
4386 + test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
4388 + if test "$GCC" = yes; then
4389 + dnl method that should work for nearly all versions
4390 + gccversion=`$CC -dumpversion`
4391 + if test "x$gccversion" = "x"; then
4392 + dnl old method; fall-back for when -dumpversion doesn't work
4393 + gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
4395 + dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
4396 + if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
4397 + echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
4398 + CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
4400 + if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
4401 + echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
4402 + CFLAGS="$CFLAGS -fno-strength-reduce"
4407 + dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
4408 + dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
4409 + dnl the version number of the clang in use.
4410 + dnl Note that this does not work to get the version of clang 3.1 or 3.2.
4411 + AC_MSG_CHECKING(for recent clang version)
4412 + CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
4413 + if test x"$CLANG_VERSION_STRING" != x"" ; then
4414 + CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
4415 + CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
4416 + CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
4417 + CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
4418 + AC_MSG_RESULT($CLANG_VERSION)
4419 + dnl If you find the same issue with versions earlier than 500.2.75,
4420 + dnl change the constant 500002075 below appropriately. To get the
4421 + dnl integer corresponding to a version number, refer to the
4422 + dnl definition of CLANG_VERSION above.
4423 + if test "$CLANG_VERSION" -ge 500002075 ; then
4424 + CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
4430 + dnl If configure thinks we are cross compiling, there might be something
4431 + dnl wrong with the CC or CFLAGS settings, give a useful warning message
4433 + if test "$cross_compiling" = yes; then
4434 + AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS])
4437 + AC_SUBST(CROSS_COMPILING)
4439 + dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
4440 + dnl But gcc 3.1 changed the meaning! See near the end.
4441 + test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
4443 + if test -f ./toolcheck; then
4444 + AC_CHECKING(for buggy tools)
4445 + sh ./toolcheck 1>&AC_FD_MSG
4448 + OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
4450 + dnl Check for BeOS, which needs an extra source file
4451 + AC_MSG_CHECKING(for BeOS)
4453 + BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
4454 + BEOS=yes; AC_MSG_RESULT(yes);;
4455 + *) BEOS=no; AC_MSG_RESULT(no);;
4458 + dnl If QNX is found, assume we don't want to use Xphoton
4459 + dnl unless it was specifically asked for (--with-x)
4460 + AC_MSG_CHECKING(for QNX)
4462 + QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
4463 + test -z "$with_x" && with_x=no
4464 + QNX=yes; AC_MSG_RESULT(yes);;
4465 + *) QNX=no; AC_MSG_RESULT(no);;
4468 + dnl Check for Darwin and MacOS X
4469 + dnl We do a check for MacOS X in the very beginning because there
4470 + dnl are a lot of other things we need to change besides GUI stuff
4471 + AC_MSG_CHECKING([for Darwin (Mac OS X)])
4472 + if test "`(uname) 2>/dev/null`" = Darwin; then
4473 + AC_MSG_RESULT(yes)
4475 + AC_MSG_CHECKING(--disable-darwin argument)
4476 + AC_ARG_ENABLE(darwin,
4477 + [ --disable-darwin Disable Darwin (Mac OS X) support.],
4478 + , [enable_darwin="yes"])
4479 + if test "$enable_darwin" = "yes"; then
4481 + AC_MSG_CHECKING(if Darwin files are there)
4482 + if test -f os_macosx.m; then
4483 + AC_MSG_RESULT(yes)
4485 + AC_MSG_RESULT([no, Darwin support disabled])
4489 + AC_MSG_RESULT([yes, Darwin support excluded])
4492 + AC_MSG_CHECKING(--with-mac-arch argument)
4493 + AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
4494 + MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
4495 + MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
4497 + AC_MSG_CHECKING(--with-developer-dir argument)
4498 + AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools],
4499 + DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
4500 + AC_MSG_RESULT(not present))
4502 + if test "x$DEVELOPER_DIR" = "x"; then
4503 + AC_PATH_PROG(XCODE_SELECT, xcode-select)
4504 + if test "x$XCODE_SELECT" != "x"; then
4505 + AC_MSG_CHECKING(for developer dir using xcode-select)
4506 + DEVELOPER_DIR=`$XCODE_SELECT -print-path`
4507 + AC_MSG_RESULT([$DEVELOPER_DIR])
4509 + DEVELOPER_DIR=/Developer
4513 + if test "x$MACARCH" = "xboth"; then
4514 + AC_MSG_CHECKING(for 10.4 universal SDK)
4515 + dnl There is a terrible inconsistency (but we appear to get away with it):
4516 + dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
4517 + dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
4518 + dnl tests using the preprocessor are actually done with the wrong header
4519 + dnl files. $LDFLAGS is set at the end, because configure uses it together
4520 + dnl with $CFLAGS and we can only have one -sysroot argument.
4521 + save_cppflags="$CPPFLAGS"
4522 + save_cflags="$CFLAGS"
4523 + save_ldflags="$LDFLAGS"
4524 + CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
4525 + AC_TRY_LINK([ ], [ ],
4526 + AC_MSG_RESULT(found, will make universal binary),
4528 + AC_MSG_RESULT(not found)
4529 + CFLAGS="$save_cflags"
4530 + AC_MSG_CHECKING(if Intel architecture is supported)
4531 + CPPFLAGS="$CPPFLAGS -arch i386"
4532 + LDFLAGS="$save_ldflags -arch i386"
4533 + AC_TRY_LINK([ ], [ ],
4534 + AC_MSG_RESULT(yes); MACARCH="intel",
4535 + AC_MSG_RESULT(no, using PowerPC)
4537 + CPPFLAGS="$save_cppflags -arch ppc"
4538 + LDFLAGS="$save_ldflags -arch ppc"))
4539 + elif test "x$MACARCH" = "xintel"; then
4540 + CPPFLAGS="$CPPFLAGS -arch intel"
4541 + LDFLAGS="$LDFLAGS -arch intel"
4542 + elif test "x$MACARCH" = "xppc"; then
4543 + CPPFLAGS="$CPPFLAGS -arch ppc"
4544 + LDFLAGS="$LDFLAGS -arch ppc"
4547 + if test "$enable_darwin" = "yes"; then
4549 + OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
4550 + OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
4551 + dnl TODO: use -arch i386 on Intel machines
4552 + dnl Removed -no-cpp-precomp, only for very old compilers.
4553 + CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX"
4555 + dnl If Carbon is found, assume we don't want X11
4556 + dnl unless it was specifically asked for (--with-x)
4557 + dnl or Motif, Athena or GTK GUI is used.
4558 + AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
4559 + if test "x$CARBON" = "xyes"; then
4560 + if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then
4566 + dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
4567 + dnl free. This happens in expand_filename(), because the optimizer swaps
4568 + dnl two blocks of code, both using "repl", that can't be swapped.
4569 + if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
4570 + CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
4577 + dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon
4578 + dnl so we need to include it to have access to version macros.
4579 + AC_CHECK_HEADERS(AvailabilityMacros.h)
4581 + AC_SUBST(OS_EXTRA_SRC)
4582 + AC_SUBST(OS_EXTRA_OBJ)
4584 + dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
4585 + dnl Only when the directory exists and it wasn't there yet.
4586 + dnl For gcc don't do this when it is already in the default search path.
4587 + dnl Skip all of this when cross-compiling.
4588 + if test "$cross_compiling" = no; then
4589 + AC_MSG_CHECKING(--with-local-dir argument)
4590 + have_local_include=''
4592 + AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries.
4593 + --without-local-dir do not search /usr/local for local libraries.], [
4594 + local_dir="$withval"
4595 + case "$withval" in
4598 + # avoid adding local dir to LDFLAGS and CPPFLAGS
4599 + have_local_include=yes
4600 + have_local_lib=yes
4602 + *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;;
4604 + AC_MSG_RESULT($local_dir)
4606 + local_dir=/usr/local
4607 + AC_MSG_RESULT(Defaulting to $local_dir)
4609 + if test "$GCC" = yes -a "$local_dir" != no; then
4610 + echo 'void f(){}' > conftest.c
4611 + dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler)
4612 + have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
4613 + have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
4614 + rm -f conftest.c conftest.o
4616 + if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then
4617 + tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"`
4618 + if test "$tt" = "$LDFLAGS"; then
4619 + LDFLAGS="$LDFLAGS -L${local_dir}/lib"
4622 + if test -z "$have_local_include" -a -d "${local_dir}/include"; then
4623 + tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
4624 + if test "$tt" = "$CPPFLAGS"; then
4625 + CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
4630 + AC_MSG_CHECKING(--with-vim-name argument)
4631 + AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
4632 + VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
4633 + VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
4635 + AC_MSG_CHECKING(--with-ex-name argument)
4636 + AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
4637 + EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
4638 + EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
4640 + AC_MSG_CHECKING(--with-view-name argument)
4641 + AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
4642 + VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
4643 + VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
4644 + AC_SUBST(VIEWNAME)
4646 + AC_MSG_CHECKING(--with-global-runtime argument)
4647 + AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
4648 + AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
4649 + AC_MSG_RESULT(no))
4651 + AC_MSG_CHECKING(--with-modified-by argument)
4652 + AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
4653 + AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
4654 + AC_MSG_RESULT(no))
4656 + dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix
4657 + AC_MSG_CHECKING(if character set is EBCDIC)
4658 + AC_TRY_COMPILE([ ],
4659 + [ /* TryCompile function for CharSet.
4660 + Treat any failure as ASCII for compatibility with existing art.
4661 + Use compile-time rather than run-time tests for cross-compiler
4664 + make an error "Character set is not EBCDIC"
4666 + [ # TryCompile action if true
4667 + cf_cv_ebcdic=yes ],
4668 + [ # TryCompile action if false
4670 + # end of TryCompile ])
4671 + # end of CacheVal CvEbcdic
4672 + AC_MSG_RESULT($cf_cv_ebcdic)
4673 + case "$cf_cv_ebcdic" in #(vi
4674 + yes) AC_DEFINE(EBCDIC)
4675 + line_break='"\\n"'
4677 + *) line_break='"\\012"';;
4679 + AC_SUBST(line_break)
4681 + if test "$cf_cv_ebcdic" = "yes"; then
4682 + dnl If we have EBCDIC we most likely have z/OS Unix, let's test it!
4683 + AC_MSG_CHECKING(for z/OS Unix)
4685 + OS/390) zOSUnix="yes";
4686 + dnl If using cc the environment variable _CC_CCMODE must be
4687 + dnl set to "1", so that some compiler extensions are enabled.
4688 + dnl If using c89 the environment variable is named _CC_C89MODE.
4689 + dnl Note: compile with c89 never tested.
4690 + if test "$CC" = "cc"; then
4694 + if test "$CC" = "c89"; then
4695 + ccm="$_CC_C89MODE"
4701 + if test "$ccm" != "1"; then
4703 + echo "------------------------------------------"
4704 + echo " On z/OS Unix, the environment variable"
4705 + echo " _CC_${ccn}MODE must be set to \"1\"!"
4707 + echo " export _CC_${ccn}MODE=1"
4708 + echo " and then call configure again."
4709 + echo "------------------------------------------"
4712 + # Set CFLAGS for configure process.
4713 + # This will be reset later for config.mk.
4714 + # Use haltonmsg to force error for missing H files.
4715 + CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)";
4716 + LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
4717 + AC_MSG_RESULT(yes)
4725 + dnl Set QUOTESED. Needs additional backslashes on zOS
4726 + if test "$zOSUnix" = "yes"; then
4727 + QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'"
4729 + QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'"
4731 + AC_SUBST(QUOTESED)
4734 + dnl Link with -lsmack for Smack stuff; if not found
4735 + AC_MSG_CHECKING(--disable-smack argument)
4736 + AC_ARG_ENABLE(smack,
4737 + [ --disable-smack Do not check for Smack support.],
4738 + , enable_smack="yes")
4739 + if test "$enable_smack" = "yes"; then
4741 + AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
4743 + AC_MSG_RESULT(yes)
4745 + if test "$enable_smack" = "yes"; then
4746 + AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no")
4748 + if test "$enable_smack" = "yes"; then
4749 + AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h)
4750 + AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>],
4751 + AC_MSG_RESULT(yes),
4752 + AC_MSG_RESULT(no); enable_smack="no")
4754 + if test "$enable_smack" = "yes"; then
4755 + AC_CHECK_LIB(attr, setxattr,
4756 + [LIBS="$LIBS -lattr"
4758 + AC_DEFINE(HAVE_SMACK)])
4761 + dnl When smack was found don't search for SELinux
4762 + if test "x$found_smack" = "x"; then
4763 + dnl Link with -lselinux for SELinux stuff; if not found
4764 + AC_MSG_CHECKING(--disable-selinux argument)
4765 + AC_ARG_ENABLE(selinux,
4766 + [ --disable-selinux Do not check for SELinux support.],
4767 + , enable_selinux="yes")
4768 + if test "$enable_selinux" = "yes"; then
4770 + AC_CHECK_LIB(selinux, is_selinux_enabled,
4771 + [LIBS="$LIBS -lselinux"
4772 + AC_DEFINE(HAVE_SELINUX)])
4774 + AC_MSG_RESULT(yes)
4778 + dnl Check user requested features.
4780 + AC_MSG_CHECKING(--with-features argument)
4781 + AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: huge)],
4782 + features="$withval"; AC_MSG_RESULT($features),
4783 + features="huge"; AC_MSG_RESULT(Defaulting to huge))
4787 + case "$features" in
4788 + tiny) AC_DEFINE(FEAT_TINY) ;;
4789 + small) AC_DEFINE(FEAT_SMALL) ;;
4790 + normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
4791 + dogvimdiff="installgvimdiff" ;;
4792 + big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
4793 + dogvimdiff="installgvimdiff" ;;
4794 + huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
4795 + dogvimdiff="installgvimdiff" ;;
4796 + *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
4799 + AC_SUBST(dovimdiff)
4800 + AC_SUBST(dogvimdiff)
4802 + AC_MSG_CHECKING(--with-compiledby argument)
4803 + AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
4804 + compiledby="$withval"; AC_MSG_RESULT($withval),
4805 + compiledby=""; AC_MSG_RESULT(no))
4806 + AC_SUBST(compiledby)
4808 + AC_MSG_CHECKING(--disable-xsmp argument)
4809 + AC_ARG_ENABLE(xsmp,
4810 + [ --disable-xsmp Disable XSMP session management],
4811 + , enable_xsmp="yes")
4813 + if test "$enable_xsmp" = "yes"; then
4815 + AC_MSG_CHECKING(--disable-xsmp-interact argument)
4816 + AC_ARG_ENABLE(xsmp-interact,
4817 + [ --disable-xsmp-interact Disable XSMP interaction],
4818 + , enable_xsmp_interact="yes")
4819 + if test "$enable_xsmp_interact" = "yes"; then
4821 + AC_DEFINE(USE_XSMP_INTERACT)
4823 + AC_MSG_RESULT(yes)
4826 + AC_MSG_RESULT(yes)
4829 + dnl Check for Lua feature.
4830 + AC_MSG_CHECKING(--enable-luainterp argument)
4831 + AC_ARG_ENABLE(luainterp,
4832 + [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
4833 + [enable_luainterp="no"])
4834 + AC_MSG_RESULT($enable_luainterp)
4836 + if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
4837 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
4838 + AC_MSG_ERROR([cannot use Lua with tiny or small features])
4841 + dnl -- find the lua executable
4842 + AC_SUBST(vi_cv_path_lua)
4844 + AC_MSG_CHECKING(--with-lua-prefix argument)
4845 + AC_ARG_WITH(lua_prefix,
4846 + [ --with-lua-prefix=PFX Prefix where Lua is installed.],
4847 + with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
4848 + with_lua_prefix="";AC_MSG_RESULT(no))
4850 + if test "X$with_lua_prefix" != "X"; then
4851 + vi_cv_path_lua_pfx="$with_lua_prefix"
4853 + AC_MSG_CHECKING(LUA_PREFIX environment var)
4854 + if test "X$LUA_PREFIX" != "X"; then
4855 + AC_MSG_RESULT("$LUA_PREFIX")
4856 + vi_cv_path_lua_pfx="$LUA_PREFIX"
4858 + AC_MSG_RESULT([not set, default to /usr])
4859 + vi_cv_path_lua_pfx="/usr"
4863 + AC_MSG_CHECKING(--with-luajit)
4864 + AC_ARG_WITH(luajit,
4865 + [ --with-luajit Link with LuaJIT instead of Lua.],
4866 + [vi_cv_with_luajit="$withval"],
4867 + [vi_cv_with_luajit="no"])
4868 + AC_MSG_RESULT($vi_cv_with_luajit)
4871 + if test "X$vi_cv_path_lua_pfx" != "X"; then
4872 + if test "x$vi_cv_with_luajit" != "xno"; then
4873 + dnl -- try to find LuaJIT executable
4874 + AC_PATH_PROG(vi_cv_path_luajit, luajit)
4875 + if test "X$vi_cv_path_luajit" != "X"; then
4876 + dnl -- find LuaJIT version
4877 + AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit,
4878 + [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]*\)* .*/\1/'` ])
4879 + AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit,
4880 + [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ])
4881 + vi_cv_path_lua="$vi_cv_path_luajit"
4882 + vi_cv_version_lua="$vi_cv_version_lua_luajit"
4885 + dnl -- try to find Lua executable
4886 + AC_PATH_PROG(vi_cv_path_plain_lua, lua)
4887 + if test "X$vi_cv_path_plain_lua" != "X"; then
4888 + dnl -- find Lua version
4889 + AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua,
4890 + [ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
4892 + vi_cv_path_lua="$vi_cv_path_plain_lua"
4893 + vi_cv_version_lua="$vi_cv_version_plain_lua"
4895 + if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then
4896 + AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit)
4897 + if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then
4898 + AC_MSG_RESULT(yes)
4899 + LUA_INC=/luajit-$vi_cv_version_luajit
4902 + if test "X$LUA_INC" = "X"; then
4903 + AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
4904 + if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then
4905 + AC_MSG_RESULT(yes)
4908 + AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
4909 + if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
4910 + AC_MSG_RESULT(yes)
4911 + LUA_INC=/lua$vi_cv_version_lua
4914 + vi_cv_path_lua_pfx=
4920 + if test "X$vi_cv_path_lua_pfx" != "X"; then
4921 + if test "x$vi_cv_with_luajit" != "xno"; then
4922 + multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
4923 + if test "X$multiarch" != "X"; then
4924 + lib_multiarch="lib/${multiarch}"
4926 + lib_multiarch="lib"
4928 + if test "X$vi_cv_version_lua" = "X"; then
4929 + LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit"
4931 + LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua"
4934 + if test "X$LUA_INC" != "X"; then
4935 + dnl Test alternate location using version
4936 + LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
4938 + LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
4941 + if test "$enable_luainterp" = "dynamic"; then
4944 + AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane])
4946 + LIBS="$LIBS $LUA_LIBS"
4948 + AC_MSG_RESULT(yes); lua_ok="yes",
4949 + AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="")
4952 + if test "x$lua_ok" = "xyes"; then
4953 + LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}"
4954 + LUA_SRC="if_lua.c"
4955 + LUA_OBJ="objects/if_lua.o"
4956 + LUA_PRO="if_lua.pro"
4957 + AC_DEFINE(FEAT_LUA)
4959 + if test "$enable_luainterp" = "dynamic"; then
4960 + if test "x$vi_cv_with_luajit" != "xno"; then
4963 + if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
4964 + vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
4966 + if test "x$MACOSX" = "xyes"; then
4971 + indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9"
4972 + multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
4973 + if test "X$multiarch" != "X"; then
4974 + lib_multiarch="lib/${multiarch}"
4977 + dnl Determine the sover for the current version, but fallback to
4978 + dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found.
4979 + AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx)
4980 + for subdir in "${lib_multiarch}" lib64 lib; do
4981 + if test -z "$subdir"; then
4984 + for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \
4985 + ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do
4986 + for i in $indexes ""; do
4987 + if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then
4995 + if test "X$sover" = "X"; then
4998 + vi_cv_dll_name_lua="liblua${luajit}.${ext}"
5000 + AC_MSG_RESULT(yes)
5002 + vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2"
5005 + AC_DEFINE(DYNAMIC_LUA)
5007 + LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
5009 + if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
5010 + test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
5011 + test "`(uname -m) 2>/dev/null`" = "x86_64"; then
5012 + dnl OSX/x64 requires these flags. See http://luajit.org/install.html
5013 + LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
5016 + if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then
5017 + AC_MSG_ERROR([could not configure lua])
5022 + AC_SUBST(LUA_LIBS)
5023 + AC_SUBST(LUA_CFLAGS)
5027 + dnl Check for MzScheme feature.
5028 + AC_MSG_CHECKING(--enable-mzschemeinterp argument)
5029 + AC_ARG_ENABLE(mzschemeinterp,
5030 + [ --enable-mzschemeinterp Include MzScheme interpreter.], ,
5031 + [enable_mzschemeinterp="no"])
5032 + AC_MSG_RESULT($enable_mzschemeinterp)
5034 + if test "$enable_mzschemeinterp" = "yes"; then
5035 + dnl -- find the mzscheme executable
5036 + AC_SUBST(vi_cv_path_mzscheme)
5038 + AC_MSG_CHECKING(--with-plthome argument)
5039 + AC_ARG_WITH(plthome,
5040 + [ --with-plthome=PLTHOME Use PLTHOME.],
5041 + with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
5042 + with_plthome="";AC_MSG_RESULT("no"))
5044 + if test "X$with_plthome" != "X"; then
5045 + vi_cv_path_mzscheme_pfx="$with_plthome"
5046 + vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
5048 + AC_MSG_CHECKING(PLTHOME environment var)
5049 + if test "X$PLTHOME" != "X"; then
5050 + AC_MSG_RESULT("$PLTHOME")
5051 + vi_cv_path_mzscheme_pfx="$PLTHOME"
5052 + vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
5054 + AC_MSG_RESULT(not set)
5055 + dnl -- try to find MzScheme executable
5056 + AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
5058 + dnl resolve symbolic link, the executable is often elsewhere and there
5059 + dnl are no links for the include files.
5060 + if test "X$vi_cv_path_mzscheme" != "X"; then
5061 + lsout=`ls -l $vi_cv_path_mzscheme`
5062 + if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
5063 + vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
5067 + if test "X$vi_cv_path_mzscheme" != "X"; then
5068 + dnl -- find where MzScheme thinks it was installed
5069 + AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
5070 + dnl different versions of MzScheme differ in command line processing
5071 + dnl use universal approach
5072 + echo "(display (simplify-path \
5073 + (build-path (call-with-values \
5074 + (lambda () (split-path (find-system-path (quote exec-file)))) \
5075 + (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
5076 + dnl Remove a trailing slash
5077 + [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
5078 + sed -e 's+/$++'` ])
5084 + if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
5085 + AC_MSG_CHECKING(for racket include directory)
5086 + SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'`
5087 + if test "X$SCHEME_INC" != "X"; then
5088 + AC_MSG_RESULT(${SCHEME_INC})
5090 + AC_MSG_RESULT(not found)
5091 + AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
5092 + if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
5093 + SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
5094 + AC_MSG_RESULT(yes)
5097 + AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
5098 + if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
5099 + AC_MSG_RESULT(yes)
5100 + SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
5103 + AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
5104 + if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
5105 + AC_MSG_RESULT(yes)
5106 + SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
5109 + AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
5110 + if test -f /usr/include/plt/scheme.h; then
5111 + AC_MSG_RESULT(yes)
5112 + SCHEME_INC=/usr/include/plt
5115 + AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
5116 + if test -f /usr/include/racket/scheme.h; then
5117 + AC_MSG_RESULT(yes)
5118 + SCHEME_INC=/usr/include/racket
5121 + vi_cv_path_mzscheme_pfx=
5130 + if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
5132 + AC_MSG_CHECKING(for racket lib directory)
5133 + SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'`
5134 + if test "X$SCHEME_LIB" != "X"; then
5135 + AC_MSG_RESULT(${SCHEME_LIB})
5137 + AC_MSG_RESULT(not found)
5140 + for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
5141 + if test "X$path" != "X"; then
5142 + if test "x$MACOSX" = "xyes"; then
5143 + MZSCHEME_LIBS="-framework Racket"
5144 + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
5145 + elif test -f "${path}/libmzscheme3m.a"; then
5146 + MZSCHEME_LIBS="${path}/libmzscheme3m.a"
5147 + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
5148 + elif test -f "${path}/libracket3m.a"; then
5149 + MZSCHEME_LIBS="${path}/libracket3m.a"
5150 + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
5151 + elif test -f "${path}/libracket.a"; then
5152 + MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a"
5153 + elif test -f "${path}/libmzscheme.a"; then
5154 + MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a"
5156 + dnl Using shared objects
5157 + if test -f "${path}/libmzscheme3m.so"; then
5158 + MZSCHEME_LIBS="-L${path} -lmzscheme3m"
5159 + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
5160 + elif test -f "${path}/libracket3m.so"; then
5161 + MZSCHEME_LIBS="-L${path} -lracket3m"
5162 + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
5163 + elif test -f "${path}/libracket.so"; then
5164 + MZSCHEME_LIBS="-L${path} -lracket -lmzgc"
5166 + dnl try next until last
5167 + if test "$path" != "$SCHEME_LIB"; then
5170 + MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc"
5172 + if test "$GCC" = yes; then
5173 + dnl Make Vim remember the path to the library. For when it's not in
5174 + dnl $LD_LIBRARY_PATH.
5175 + MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
5176 + elif test "`(uname) 2>/dev/null`" = SunOS &&
5177 + uname -r | grep '^5' >/dev/null; then
5178 + MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
5182 + if test "X$MZSCHEME_LIBS" != "X"; then
5187 + AC_MSG_CHECKING([if racket requires -pthread])
5188 + if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then
5189 + AC_MSG_RESULT(yes)
5190 + MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread"
5191 + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread"
5196 + AC_MSG_CHECKING(for racket config directory)
5197 + SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'`
5198 + if test "X$SCHEME_CONFIGDIR" != "X"; then
5199 + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'"
5200 + AC_MSG_RESULT(${SCHEME_CONFIGDIR})
5202 + AC_MSG_RESULT(not found)
5205 + AC_MSG_CHECKING(for racket collects directory)
5206 + SCHEME_COLLECTS=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-collects-dir))) (when (path? p) (let-values (((base _1 _2) (split-path p))) (display base))))'`
5207 + if test "X$SCHEME_COLLECTS" = "X"; then
5208 + if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
5209 + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
5211 + if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
5212 + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
5214 + if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
5215 + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
5217 + if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
5218 + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
5224 + if test "X$SCHEME_COLLECTS" != "X" ; then
5225 + AC_MSG_RESULT(${SCHEME_COLLECTS})
5227 + AC_MSG_RESULT(not found)
5230 + AC_MSG_CHECKING(for mzscheme_base.c)
5231 + if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
5232 + MZSCHEME_EXTRA="mzscheme_base.c"
5233 + MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
5234 + MZSCHEME_MOD="++lib scheme/base"
5236 + if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then
5237 + MZSCHEME_EXTRA="mzscheme_base.c"
5238 + MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
5239 + MZSCHEME_MOD="++lib scheme/base"
5241 + if test -f "${SCHEME_COLLECTS}collects/racket/base.rkt" ; then
5242 + MZSCHEME_EXTRA="mzscheme_base.c"
5243 + MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/raco ctool"
5248 + if test "X$MZSCHEME_EXTRA" != "X" ; then
5249 + dnl need to generate bytecode for MzScheme base
5250 + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
5251 + AC_MSG_RESULT(needed)
5253 + AC_MSG_RESULT(not needed)
5256 + dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'".
5257 + AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"])
5259 + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
5260 + -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'"
5262 + dnl Test that we can compile a simple program with these CFLAGS and LIBS.
5263 + AC_MSG_CHECKING([if compile and link flags for MzScheme are sane])
5264 + cflags_save=$CFLAGS
5266 + CFLAGS="$CFLAGS $MZSCHEME_CFLAGS"
5267 + LIBS="$LIBS $MZSCHEME_LIBS"
5269 + AC_MSG_RESULT(yes); mzs_ok=yes,
5270 + AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no)
5271 + CFLAGS=$cflags_save
5273 + if test $mzs_ok = yes; then
5274 + MZSCHEME_SRC="if_mzsch.c"
5275 + MZSCHEME_OBJ="objects/if_mzsch.o"
5276 + MZSCHEME_PRO="if_mzsch.pro"
5277 + AC_DEFINE(FEAT_MZSCHEME)
5285 + AC_SUBST(MZSCHEME_SRC)
5286 + AC_SUBST(MZSCHEME_OBJ)
5287 + AC_SUBST(MZSCHEME_PRO)
5288 + AC_SUBST(MZSCHEME_LIBS)
5289 + AC_SUBST(MZSCHEME_CFLAGS)
5290 + AC_SUBST(MZSCHEME_EXTRA)
5291 + AC_SUBST(MZSCHEME_MZC)
5295 + AC_MSG_CHECKING(--enable-perlinterp argument)
5296 + AC_ARG_ENABLE(perlinterp,
5297 + [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
5298 + [enable_perlinterp="no"])
5299 + AC_MSG_RESULT($enable_perlinterp)
5300 + if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
5301 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
5302 + AC_MSG_ERROR([cannot use Perl with tiny or small features])
5304 + AC_SUBST(vi_cv_path_perl)
5305 + AC_PATH_PROG(vi_cv_path_perl, perl)
5306 + if test "X$vi_cv_path_perl" != "X"; then
5307 + AC_MSG_CHECKING(Perl version)
5308 + if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
5309 + eval `$vi_cv_path_perl -V:usethreads`
5310 + eval `$vi_cv_path_perl -V:libperl`
5311 + if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
5314 + if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
5315 + eval `$vi_cv_path_perl -V:use5005threads`
5316 + if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
5320 + AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
5324 + AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
5327 + if test $badthreads = no; then
5329 + eval `$vi_cv_path_perl -V:shrpenv`
5330 + if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
5333 + vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
5334 + AC_SUBST(vi_cv_perllib)
5335 + vi_cv_perl_extutils=unknown_perl_extutils_path
5336 + for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
5337 + xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
5338 + if test -f "$xsubpp_path"; then
5339 + vi_cv_perl_xsubpp="$xsubpp_path"
5342 + AC_SUBST(vi_cv_perl_xsubpp)
5343 + dnl Remove "-fno-something", it breaks using cproto.
5344 + dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
5345 + perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
5346 + -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
5347 + -e 's/-fdebug-prefix-map[[^ ]]*//g'`
5348 + dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
5349 + perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
5350 + sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
5351 + -e 's/-bE:perl.exp//' -e 's/-lc //'`
5352 + dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
5353 + dnl a test in configure may fail because of that.
5354 + perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
5355 + -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
5357 + dnl check that compiling a simple program still works with the flags
5358 + dnl added for Perl.
5359 + AC_MSG_CHECKING([if compile and link flags for Perl are sane])
5360 + cflags_save=$CFLAGS
5362 + ldflags_save=$LDFLAGS
5363 + CFLAGS="$CFLAGS $perlcppflags"
5364 + LIBS="$LIBS $perllibs"
5365 + perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'`
5366 + LDFLAGS="$perlldflags $LDFLAGS"
5368 + AC_MSG_RESULT(yes); perl_ok=yes,
5369 + AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
5370 + CFLAGS=$cflags_save
5372 + LDFLAGS=$ldflags_save
5373 + if test $perl_ok = yes; then
5374 + if test "X$perlcppflags" != "X"; then
5375 + dnl remove -pipe and -Wxxx, it confuses cproto
5376 + PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'`
5378 + if test "X$perlldflags" != "X"; then
5379 + if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then
5380 + LDFLAGS="$perlldflags $LDFLAGS"
5383 + PERL_LIBS=$perllibs
5384 + PERL_SRC="auto/if_perl.c if_perlsfio.c"
5385 + PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
5386 + PERL_PRO="if_perl.pro if_perlsfio.pro"
5387 + AC_DEFINE(FEAT_PERL)
5391 + AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
5395 + if test "x$MACOSX" = "xyes"; then
5396 + dnl Mac OS X 10.2 or later
5397 + dir=/System/Library/Perl
5398 + darwindir=$dir/darwin
5399 + if test -d $darwindir; then
5400 + PERL=/usr/bin/perl
5403 + dir=/System/Library/Perl/5.8.1
5404 + darwindir=$dir/darwin-thread-multi-2level
5405 + if test -d $darwindir; then
5406 + PERL=/usr/bin/perl
5409 + if test -n "$PERL"; then
5411 + PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
5412 + PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
5413 + PERL_LIBS="-L$darwindir/CORE -lperl"
5415 + dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
5416 + dnl be included if requested by passing --with-mac-arch to
5417 + dnl configure, so strip these flags first (if present)
5418 + PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
5419 + PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
5421 + if test "$enable_perlinterp" = "dynamic"; then
5422 + if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
5423 + AC_DEFINE(DYNAMIC_PERL)
5424 + PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS"
5428 + if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then
5429 + AC_MSG_ERROR([could not configure perl])
5433 + AC_SUBST(PERL_SRC)
5434 + AC_SUBST(PERL_OBJ)
5435 + AC_SUBST(PERL_PRO)
5436 + AC_SUBST(PERL_CFLAGS)
5437 + AC_SUBST(PERL_LIBS)
5439 + AC_MSG_CHECKING(--enable-pythoninterp argument)
5440 + AC_ARG_ENABLE(pythoninterp,
5441 + [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
5442 + [enable_pythoninterp="no"])
5443 + AC_MSG_RESULT($enable_pythoninterp)
5444 + if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
5445 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
5446 + AC_MSG_ERROR([cannot use Python with tiny or small features])
5449 + dnl -- find the python executable
5450 + AC_PATH_PROGS(vi_cv_path_python, python2 python)
5451 + if test "X$vi_cv_path_python" != "X"; then
5453 + dnl -- get its version number
5454 + AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
5455 + [[vi_cv_var_python_version=`
5456 + ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
5459 + dnl -- it must be at least version 2.3
5460 + AC_MSG_CHECKING(Python is 2.3 or better)
5461 + if ${vi_cv_path_python} -c \
5462 + "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"
5464 + AC_MSG_RESULT(yep)
5466 + dnl -- find where python thinks it was installed
5467 + AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
5468 + [ vi_cv_path_python_pfx=`
5469 + ${vi_cv_path_python} -c \
5470 + "import sys; print sys.prefix"` ])
5472 + dnl -- and where it thinks it runs
5473 + AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
5474 + [ vi_cv_path_python_epfx=`
5475 + ${vi_cv_path_python} -c \
5476 + "import sys; print sys.exec_prefix"` ])
5478 + dnl -- python's internal library path
5480 + AC_CACHE_VAL(vi_cv_path_pythonpath,
5481 + [ vi_cv_path_pythonpath=`
5483 + ${vi_cv_path_python} -c \
5484 + "import sys, string; print string.join(sys.path,':')"` ])
5486 + dnl -- where the Python implementation library archives are
5488 + AC_ARG_WITH(python-config-dir,
5489 + [ --with-python-config-dir=PATH Python's config directory],
5490 + [ vi_cv_path_python_conf="${withval}" ] )
5492 + AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
5494 + vi_cv_path_python_conf=
5495 + d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
5496 + if test -d "$d" && test -f "$d/config.c"; then
5497 + vi_cv_path_python_conf="$d"
5499 + for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
5500 + for subdir in lib64 lib share; do
5501 + d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
5502 + if test -d "$d" && test -f "$d/config.c"; then
5503 + vi_cv_path_python_conf="$d"
5510 + PYTHON_CONFDIR="${vi_cv_path_python_conf}"
5512 + if test "X$PYTHON_CONFDIR" = "X"; then
5513 + AC_MSG_RESULT([can't find it!])
5516 + dnl -- we need to examine Python's config/Makefile too
5517 + dnl see what the interpreter is built from
5518 + AC_CACHE_VAL(vi_cv_path_python_plibs,
5521 + tmp_mkf="$pwd/config-PyMake$$"
5522 + cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
5524 + @echo "python_BASEMODLIBS='$(BASEMODLIBS)'"
5525 + @echo "python_LIBS='$(LIBS)'"
5526 + @echo "python_SYSLIBS='$(SYSLIBS)'"
5527 + @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
5528 + @echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
5529 + @echo "python_INSTSONAME='$(INSTSONAME)'"
5530 + @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'"
5531 + @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'"
5532 + @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'"
5534 + dnl -- delete the lines from make about Entering/Leaving directory
5535 + eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
5536 + rm -f -- "${tmp_mkf}"
5537 + if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
5538 + "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
5539 + vi_cv_path_python_plibs="-framework Python"
5540 + if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
5541 + vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
5544 + if test "${vi_cv_var_python_version}" = "1.4"; then
5545 + vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
5547 + vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
5549 + dnl -- Check if the path contained in python_LINKFORSHARED is
5550 + dnl usable for vim build. If not, make and try other
5552 + if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
5553 + python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]].*/\1/'`
5554 + python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]][[ \t]]*\(.*\)/\2/'`
5555 + if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
5556 + dnl -- The path looks relative. Guess the absolute one using
5557 + dnl the prefix and try that.
5558 + python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}"
5559 + if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then
5560 + dnl -- A last resort.
5561 + python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}"
5562 + dnl -- No check is done. The last word is left to the
5563 + dnl "sanity" test on link flags that follows shortly.
5565 + python_LINKFORSHARED="${python_link_symbol} ${python_link_path}"
5568 + vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
5569 + dnl remove -ltermcap, it can conflict with an earlier -lncurses
5570 + vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
5573 + AC_CACHE_CHECK(Python's dll name,vi_cv_dll_name_python,
5575 + if test "X$python_DLLLIBRARY" != "X"; then
5576 + vi_cv_dll_name_python="$python_DLLLIBRARY"
5578 + vi_cv_dll_name_python="$python_INSTSONAME"
5582 + PYTHON_LIBS="${vi_cv_path_python_plibs}"
5583 + if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
5584 + PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'"
5586 + 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}\"'"
5588 + PYTHON_SRC="if_python.c"
5589 + PYTHON_OBJ="objects/if_python.o"
5590 + if test "${vi_cv_var_python_version}" = "1.4"; then
5591 + PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
5593 + PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
5595 + dnl On FreeBSD linking with "-pthread" is required to use threads.
5596 + dnl _THREAD_SAFE must be used for compiling then.
5597 + dnl The "-pthread" is added to $LIBS, so that the following check for
5598 + dnl sigaltstack() will look in libc_r (it's there in libc!).
5599 + dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
5600 + dnl will then define target-specific defines, e.g., -D_REENTRANT.
5601 + dnl Don't do this for Mac OSX, -pthread will generate a warning.
5602 + AC_MSG_CHECKING([if -pthread should be used])
5605 + dnl if test "x$MACOSX" != "xyes"; then
5606 + if test "`(uname) 2>/dev/null`" != Darwin; then
5607 + test "$GCC" = yes && threadsafe_flag="-pthread"
5608 + if test "`(uname) 2>/dev/null`" = FreeBSD; then
5609 + threadsafe_flag="-D_THREAD_SAFE"
5610 + thread_lib="-pthread"
5612 + if test "`(uname) 2>/dev/null`" = SunOS; then
5613 + threadsafe_flag="-pthreads"
5616 + libs_save_old=$LIBS
5617 + if test -n "$threadsafe_flag"; then
5618 + cflags_save=$CFLAGS
5619 + CFLAGS="$CFLAGS $threadsafe_flag"
5620 + LIBS="$LIBS $thread_lib"
5622 + AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
5623 + AC_MSG_RESULT(no); LIBS=$libs_save_old
5625 + CFLAGS=$cflags_save
5630 + dnl Check that compiling a simple program still works with the flags
5631 + dnl added for Python.
5632 + AC_MSG_CHECKING([if compile and link flags for Python are sane])
5633 + cflags_save=$CFLAGS
5635 + CFLAGS="$CFLAGS $PYTHON_CFLAGS"
5636 + LIBS="$LIBS $PYTHON_LIBS"
5638 + AC_MSG_RESULT(yes); python_ok=yes,
5639 + AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
5640 + CFLAGS=$cflags_save
5642 + if test $python_ok = yes; then
5643 + AC_DEFINE(FEAT_PYTHON)
5645 + LIBS=$libs_save_old
5653 + AC_MSG_RESULT(too old)
5657 + if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then
5658 + AC_MSG_ERROR([could not configure python])
5662 + AC_SUBST(PYTHON_CONFDIR)
5663 + AC_SUBST(PYTHON_LIBS)
5664 + AC_SUBST(PYTHON_GETPATH_CFLAGS)
5665 + AC_SUBST(PYTHON_CFLAGS)
5666 + AC_SUBST(PYTHON_SRC)
5667 + AC_SUBST(PYTHON_OBJ)
5670 + AC_MSG_CHECKING(--enable-python3interp argument)
5671 + AC_ARG_ENABLE(python3interp,
5672 + [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
5673 + [enable_python3interp="no"])
5674 + AC_MSG_RESULT($enable_python3interp)
5675 + if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
5676 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
5677 + AC_MSG_ERROR([cannot use Python with tiny or small features])
5680 + dnl -- find the python3 executable
5681 + AC_PATH_PROGS(vi_cv_path_python3, python3 python)
5682 + if test "X$vi_cv_path_python3" != "X"; then
5684 + dnl -- get its version number
5685 + AC_CACHE_CHECK(Python version,vi_cv_var_python3_version,
5686 + [[vi_cv_var_python3_version=`
5687 + ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
5690 + dnl -- it must be at least version 3
5691 + AC_MSG_CHECKING(Python is 3.0 or better)
5692 + if ${vi_cv_path_python3} -c \
5693 + "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)"
5695 + AC_MSG_RESULT(yep)
5697 + dnl -- get abiflags for python 3.2 or higher (PEP 3149)
5698 + AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
5700 + vi_cv_var_python3_abiflags=
5701 + if ${vi_cv_path_python3} -c \
5702 + "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
5704 + vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
5705 + "import sys; print(sys.abiflags)"`
5708 + dnl -- find where python3 thinks it was installed
5709 + AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
5710 + [ vi_cv_path_python3_pfx=`
5711 + ${vi_cv_path_python3} -c \
5712 + "import sys; print(sys.prefix)"` ])
5714 + dnl -- and where it thinks it runs
5715 + AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx,
5716 + [ vi_cv_path_python3_epfx=`
5717 + ${vi_cv_path_python3} -c \
5718 + "import sys; print(sys.exec_prefix)"` ])
5720 + dnl -- python3's internal library path
5722 + AC_CACHE_VAL(vi_cv_path_python3path,
5723 + [ vi_cv_path_python3path=`
5725 + ${vi_cv_path_python3} -c \
5726 + "import sys, string; print(':'.join(sys.path))"` ])
5728 + dnl -- where the Python implementation library archives are
5730 + AC_ARG_WITH(python3-config-dir,
5731 + [ --with-python3-config-dir=PATH Python's config directory],
5732 + [ vi_cv_path_python3_conf="${withval}" ] )
5734 + AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
5736 + vi_cv_path_python3_conf=
5737 + config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5738 + d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
5739 + if test -d "$d" && test -f "$d/config.c"; then
5740 + vi_cv_path_python3_conf="$d"
5742 + for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
5743 + for subdir in lib64 lib share; do
5744 + d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
5745 + if test -d "$d" && test -f "$d/config.c"; then
5746 + vi_cv_path_python3_conf="$d"
5753 + PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
5755 + if test "X$PYTHON3_CONFDIR" = "X"; then
5756 + AC_MSG_RESULT([can't find it!])
5759 + dnl -- we need to examine Python's config/Makefile too
5760 + dnl see what the interpreter is built from
5761 + AC_CACHE_VAL(vi_cv_path_python3_plibs,
5764 + tmp_mkf="$pwd/config-PyMake$$"
5765 + cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
5767 + @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
5768 + @echo "python3_LIBS='$(LIBS)'"
5769 + @echo "python3_SYSLIBS='$(SYSLIBS)'"
5770 + @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'"
5771 + @echo "python3_INSTSONAME='$(INSTSONAME)'"
5773 + dnl -- delete the lines from make about Entering/Leaving directory
5774 + eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
5775 + rm -f -- "${tmp_mkf}"
5776 + vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5777 + vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
5778 + dnl remove -ltermcap, it can conflict with an earlier -lncurses
5779 + vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
5780 + vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
5782 + AC_CACHE_CHECK(Python3's dll name,vi_cv_dll_name_python3,
5784 + if test "X$python3_DLLLIBRARY" != "X"; then
5785 + vi_cv_dll_name_python3="$python3_DLLLIBRARY"
5787 + vi_cv_dll_name_python3="$python3_INSTSONAME"
5791 + PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
5792 + if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
5793 + 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}\"'"
5795 + 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}\"'"
5797 + PYTHON3_SRC="if_python3.c"
5798 + PYTHON3_OBJ="objects/if_python3.o"
5800 + dnl On FreeBSD linking with "-pthread" is required to use threads.
5801 + dnl _THREAD_SAFE must be used for compiling then.
5802 + dnl The "-pthread" is added to $LIBS, so that the following check for
5803 + dnl sigaltstack() will look in libc_r (it's there in libc!).
5804 + dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
5805 + dnl will then define target-specific defines, e.g., -D_REENTRANT.
5806 + dnl Don't do this for Mac OSX, -pthread will generate a warning.
5807 + AC_MSG_CHECKING([if -pthread should be used])
5810 + dnl if test "x$MACOSX" != "xyes"; then
5811 + if test "`(uname) 2>/dev/null`" != Darwin; then
5812 + test "$GCC" = yes && threadsafe_flag="-pthread"
5813 + if test "`(uname) 2>/dev/null`" = FreeBSD; then
5814 + threadsafe_flag="-D_THREAD_SAFE"
5815 + thread_lib="-pthread"
5817 + if test "`(uname) 2>/dev/null`" = SunOS; then
5818 + threadsafe_flag="-pthreads"
5821 + libs_save_old=$LIBS
5822 + if test -n "$threadsafe_flag"; then
5823 + cflags_save=$CFLAGS
5824 + CFLAGS="$CFLAGS $threadsafe_flag"
5825 + LIBS="$LIBS $thread_lib"
5827 + AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag",
5828 + AC_MSG_RESULT(no); LIBS=$libs_save_old
5830 + CFLAGS=$cflags_save
5835 + dnl check that compiling a simple program still works with the flags
5836 + dnl added for Python.
5837 + AC_MSG_CHECKING([if compile and link flags for Python 3 are sane])
5838 + cflags_save=$CFLAGS
5840 + CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
5841 + LIBS="$LIBS $PYTHON3_LIBS"
5843 + AC_MSG_RESULT(yes); python3_ok=yes,
5844 + AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no)
5845 + CFLAGS=$cflags_save
5847 + if test "$python3_ok" = yes; then
5848 + AC_DEFINE(FEAT_PYTHON3)
5850 + LIBS=$libs_save_old
5858 + AC_MSG_RESULT(too old)
5861 + if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then
5862 + AC_MSG_ERROR([could not configure python3])
5866 + AC_SUBST(PYTHON3_CONFDIR)
5867 + AC_SUBST(PYTHON3_LIBS)
5868 + AC_SUBST(PYTHON3_CFLAGS)
5869 + AC_SUBST(PYTHON3_SRC)
5870 + AC_SUBST(PYTHON3_OBJ)
5872 + dnl if python2.x and python3.x are enabled one can only link in code
5873 + dnl with dlopen(), dlsym(), dlclose()
5874 + if test "$python_ok" = yes && test "$python3_ok" = yes; then
5875 + AC_DEFINE(DYNAMIC_PYTHON)
5876 + AC_DEFINE(DYNAMIC_PYTHON3)
5877 + AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
5878 + cflags_save=$CFLAGS
5879 + CFLAGS="$CFLAGS $PYTHON_CFLAGS"
5881 + dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
5883 + AC_RUN_IFELSE([AC_LANG_SOURCE([
5884 + #include <dlfcn.h>
5885 + /* If this program fails, then RTLD_GLOBAL is needed.
5886 + * RTLD_GLOBAL will be used and then it is not possible to
5887 + * have both python versions enabled in the same vim instance.
5888 + * Only the first python version used will be switched on.
5891 + int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
5894 + void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
5897 + void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
5898 + void (*init)(void) = dlsym(pylib, "Py_Initialize");
5899 + int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
5900 + void (*final)(void) = dlsym(pylib, "Py_Finalize");
5903 + needed = (*simple)("import termios") == -1;
5910 + int main(int argc, char** argv)
5912 + int not_needed = 0;
5913 + if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}"))
5915 + return !not_needed;
5917 + [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
5919 + CFLAGS=$cflags_save
5922 + AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
5923 + cflags_save=$CFLAGS
5924 + CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
5926 + dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
5928 + AC_RUN_IFELSE([AC_LANG_SOURCE([
5929 + #include <dlfcn.h>
5930 + #include <wchar.h>
5931 + /* If this program fails, then RTLD_GLOBAL is needed.
5932 + * RTLD_GLOBAL will be used and then it is not possible to
5933 + * have both python versions enabled in the same vim instance.
5934 + * Only the first python version used will be switched on.
5937 + int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
5940 + void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL);
5943 + void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
5944 + void (*init)(void) = dlsym(pylib, "Py_Initialize");
5945 + int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
5946 + void (*final)(void) = dlsym(pylib, "Py_Finalize");
5949 + needed = (*simple)("import termios") == -1;
5956 + int main(int argc, char** argv)
5958 + int not_needed = 0;
5959 + if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}"))
5961 + return !not_needed;
5963 + [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
5965 + CFLAGS=$cflags_save
5968 + PYTHON_SRC="if_python.c"
5969 + PYTHON_OBJ="objects/if_python.o"
5970 + PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\""
5972 + PYTHON3_SRC="if_python3.c"
5973 + PYTHON3_OBJ="objects/if_python3.o"
5974 + PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\""
5976 + elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then
5977 + AC_DEFINE(DYNAMIC_PYTHON)
5978 + PYTHON_SRC="if_python.c"
5979 + PYTHON_OBJ="objects/if_python.o"
5980 + PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\""
5982 + elif test "$python_ok" = yes; then
5983 + dnl Check that adding -fPIE works. It may be needed when using a static
5984 + dnl Python library.
5985 + AC_MSG_CHECKING([if -fPIE can be added for Python])
5986 + cflags_save=$CFLAGS
5988 + CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE"
5989 + LIBS="$LIBS $PYTHON_LIBS"
5991 + AC_MSG_RESULT(yes); fpie_ok=yes,
5992 + AC_MSG_RESULT(no); fpie_ok=no)
5993 + CFLAGS=$cflags_save
5995 + if test $fpie_ok = yes; then
5996 + PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE"
5998 + elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then
5999 + AC_DEFINE(DYNAMIC_PYTHON3)
6000 + PYTHON3_SRC="if_python3.c"
6001 + PYTHON3_OBJ="objects/if_python3.o"
6002 + PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\""
6004 + elif test "$python3_ok" = yes; then
6005 + dnl Check that adding -fPIE works. It may be needed when using a static
6006 + dnl Python library.
6007 + AC_MSG_CHECKING([if -fPIE can be added for Python3])
6008 + cflags_save=$CFLAGS
6010 + CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE"
6011 + LIBS="$LIBS $PYTHON3_LIBS"
6013 + AC_MSG_RESULT(yes); fpie_ok=yes,
6014 + AC_MSG_RESULT(no); fpie_ok=no)
6015 + CFLAGS=$cflags_save
6017 + if test $fpie_ok = yes; then
6018 + PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE"
6022 + AC_MSG_CHECKING(--enable-tclinterp argument)
6023 + AC_ARG_ENABLE(tclinterp,
6024 + [ --enable-tclinterp[=OPTS] Include Tcl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
6025 + [enable_tclinterp="no"])
6026 + AC_MSG_RESULT($enable_tclinterp)
6028 + if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then
6030 + dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420]
6031 + AC_MSG_CHECKING(--with-tclsh argument)
6032 + AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
6033 + tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
6034 + tclsh_name="tclsh8.5"; AC_MSG_RESULT(no))
6035 + AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
6036 + AC_SUBST(vi_cv_path_tcl)
6038 + dnl when no specific version specified, also try 8.4, 8.2 and 8.0
6039 + if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then
6040 + tclsh_name="tclsh8.4"
6041 + AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
6043 + if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then
6044 + tclsh_name="tclsh8.2"
6045 + AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
6047 + if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then
6048 + tclsh_name="tclsh8.0"
6049 + AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
6051 + dnl still didn't find it, try without version number
6052 + if test "X$vi_cv_path_tcl" = "X"; then
6053 + tclsh_name="tclsh"
6054 + AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
6056 + if test "X$vi_cv_path_tcl" != "X"; then
6057 + AC_MSG_CHECKING(Tcl version)
6058 + if echo 'exit [[expr [info tclversion] < 8.0]]' | "$vi_cv_path_tcl" - ; then
6059 + tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
6060 + AC_MSG_RESULT($tclver - OK);
6061 + 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 -`
6062 + tcldll=`echo 'puts libtcl[[info tclversion]][[info sharedlibextension]]' | $vi_cv_path_tcl -`
6064 + AC_MSG_CHECKING(for location of Tcl include)
6065 + if test "x$MACOSX" != "xyes"; then
6066 + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
6068 + dnl For Mac OS X 10.3, use the OS-provided framework location
6069 + tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
6072 + for try in $tclinc; do
6073 + if test -f "$try/tcl.h"; then
6074 + AC_MSG_RESULT($try/tcl.h)
6079 + if test -z "$TCL_INC"; then
6080 + AC_MSG_RESULT(<not found>)
6083 + if test -z "$SKIP_TCL"; then
6084 + AC_MSG_CHECKING(for location of tclConfig.sh script)
6085 + if test "x$MACOSX" != "xyes"; then
6086 + tclcnf=`echo $tclinc | sed s/include/lib/g`
6087 + tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
6089 + dnl For Mac OS X 10.3, use the OS-provided framework location
6090 + tclcnf="/System/Library/Frameworks/Tcl.framework"
6092 + for try in $tclcnf; do
6093 + if test -f "$try/tclConfig.sh"; then
6094 + AC_MSG_RESULT($try/tclConfig.sh)
6095 + . "$try/tclConfig.sh"
6096 + dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
6097 + if test "$enable_tclinterp" = "dynamic"; then
6098 + TCL_LIBS=`eval echo "$TCL_STUB_LIB_SPEC $TCL_LIBS"`
6100 + TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
6102 + dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
6103 + dnl "-D_ABC" items. Watch out for -DFOO=long\ long.
6104 + 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'`
6108 + if test -z "$TCL_LIBS"; then
6109 + AC_MSG_RESULT(<not found>)
6110 + AC_MSG_CHECKING(for Tcl library by myself)
6111 + tcllib=`echo $tclinc | sed s/include/lib/g`
6112 + tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`"
6113 + for ext in .so .a ; do
6114 + for ver in "" $tclver ; do
6115 + for try in $tcllib ; do
6116 + trylib=tcl$ver$ext
6117 + if test -f "$try/lib$trylib" ; then
6118 + AC_MSG_RESULT($try/lib$trylib)
6119 + TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
6120 + if test "`(uname) 2>/dev/null`" = SunOS &&
6121 + uname -r | grep '^5' >/dev/null; then
6122 + TCL_LIBS="$TCL_LIBS -R $try"
6129 + if test -z "$TCL_LIBS"; then
6130 + AC_MSG_RESULT(<not found>)
6134 + if test -z "$SKIP_TCL"; then
6135 + AC_DEFINE(FEAT_TCL)
6137 + TCL_OBJ=objects/if_tcl.o
6138 + TCL_PRO=if_tcl.pro
6139 + TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
6143 + AC_MSG_RESULT(too old; need Tcl version 8.0 or later)
6146 + if test "$enable_tclinterp" = "dynamic"; then
6147 + if test "X$TCL_SRC" != "X" -a "X$tcldll" != "X"; then
6148 + AC_DEFINE(DYNAMIC_TCL)
6149 + TCL_CFLAGS="-DDYNAMIC_TCL_DLL=\\\"$tcldll\\\" -DDYNAMIC_TCL_VER=\\\"$tclver\\\" $TCL_CFLAGS"
6152 + if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then
6153 + AC_MSG_ERROR([could not configure Tcl])
6159 + AC_SUBST(TCL_CFLAGS)
6160 + AC_SUBST(TCL_LIBS)
6162 + AC_MSG_CHECKING(--enable-rubyinterp argument)
6163 + AC_ARG_ENABLE(rubyinterp,
6164 + [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
6165 + [enable_rubyinterp="no"])
6166 + AC_MSG_RESULT($enable_rubyinterp)
6167 + if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
6168 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
6169 + AC_MSG_ERROR([cannot use Ruby with tiny or small features])
6172 + AC_MSG_CHECKING(--with-ruby-command argument)
6173 + AC_SUBST(vi_cv_path_ruby)
6174 + AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
6175 + RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD),
6176 + RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
6177 + AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
6178 + if test "X$vi_cv_path_ruby" != "X"; then
6179 + AC_MSG_CHECKING(Ruby version)
6180 + if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
6182 + AC_MSG_CHECKING(Ruby rbconfig)
6183 + ruby_rbconfig="RbConfig"
6184 + if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then
6185 + ruby_rbconfig="Config"
6187 + AC_MSG_RESULT($ruby_rbconfig)
6188 + AC_MSG_CHECKING(Ruby header files)
6189 + rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null`
6190 + if test "X$rubyhdrdir" != "X"; then
6191 + AC_MSG_RESULT($rubyhdrdir)
6192 + RUBY_CFLAGS="-I$rubyhdrdir"
6193 + rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"`
6194 + if test -d "$rubyarchdir"; then
6195 + RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
6197 + rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"`
6198 + if test "X$rubyversion" = "X"; then
6199 + rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[[0,2]]"`
6201 + RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
6202 + rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"`
6203 + if test "X$rubylibs" != "X"; then
6204 + RUBY_LIBS="$rubylibs"
6206 + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"`
6207 + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"`
6208 + rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"`
6209 + if test -f "$rubylibdir/$librubya"; then
6210 + librubyarg="$librubyarg"
6211 + RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
6212 + elif test "$librubyarg" = "libruby.a"; then
6213 + dnl required on Mac OS 10.3 where libruby.a doesn't exist
6214 + librubyarg="-lruby"
6215 + RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
6218 + if test "X$librubyarg" != "X"; then
6219 + RUBY_LIBS="$librubyarg $RUBY_LIBS"
6221 + rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"`
6222 + if test "X$rubyldflags" != "X"; then
6223 + dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
6224 + dnl be included if requested by passing --with-mac-arch to
6225 + dnl configure, so strip these flags first (if present)
6226 + rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
6227 + if test "X$rubyldflags" != "X"; then
6228 + if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$rubyldflags\"`" = "X"; then
6229 + LDFLAGS="$rubyldflags $LDFLAGS"
6233 + RUBY_SRC="if_ruby.c"
6234 + RUBY_OBJ="objects/if_ruby.o"
6235 + RUBY_PRO="if_ruby.pro"
6236 + AC_DEFINE(FEAT_RUBY)
6237 + if test "$enable_rubyinterp" = "dynamic"; then
6238 + libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"`
6239 + AC_DEFINE(DYNAMIC_RUBY)
6240 + RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
6244 + AC_MSG_RESULT(not found; disabling Ruby)
6247 + AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
6251 + if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then
6252 + AC_MSG_ERROR([could not configure Ruby])
6255 + AC_SUBST(RUBY_SRC)
6256 + AC_SUBST(RUBY_OBJ)
6257 + AC_SUBST(RUBY_PRO)
6258 + AC_SUBST(RUBY_CFLAGS)
6259 + AC_SUBST(RUBY_LIBS)
6261 + AC_MSG_CHECKING(--enable-cscope argument)
6262 + AC_ARG_ENABLE(cscope,
6263 + [ --enable-cscope Include cscope interface.], ,
6264 + [enable_cscope="no"])
6265 + AC_MSG_RESULT($enable_cscope)
6266 + if test "$enable_cscope" = "yes"; then
6267 + AC_DEFINE(FEAT_CSCOPE)
6270 + AC_MSG_CHECKING(--enable-workshop argument)
6271 + AC_ARG_ENABLE(workshop,
6272 + [ --enable-workshop Include Sun Visual Workshop support.], ,
6273 + [enable_workshop="no"])
6274 + AC_MSG_RESULT($enable_workshop)
6275 + if test "$enable_workshop" = "yes"; then
6276 + AC_DEFINE(FEAT_SUN_WORKSHOP)
6277 + WORKSHOP_SRC="workshop.c integration.c"
6278 + AC_SUBST(WORKSHOP_SRC)
6279 + WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
6280 + AC_SUBST(WORKSHOP_OBJ)
6281 + if test "${enable_gui-xxx}" = xxx; then
6286 + AC_MSG_CHECKING(--disable-netbeans argument)
6287 + AC_ARG_ENABLE(netbeans,
6288 + [ --disable-netbeans Disable NetBeans integration support.],
6289 + , [enable_netbeans="yes"])
6290 + if test "$enable_netbeans" = "yes"; then
6291 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
6292 + AC_MSG_RESULT([cannot use NetBeans with tiny or small features])
6293 + enable_netbeans="no"
6298 + AC_MSG_RESULT(yes)
6301 + AC_MSG_CHECKING(--disable-channel argument)
6302 + AC_ARG_ENABLE(channel,
6303 + [ --disable-channel Disable process communication support.],
6304 + , [enable_channel="yes"])
6305 + if test "$enable_channel" = "yes"; then
6306 + if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
6307 + AC_MSG_RESULT([cannot use channels with tiny or small features])
6308 + enable_channel="no"
6313 + if test "$enable_netbeans" = "yes"; then
6314 + AC_MSG_RESULT([yes, netbeans also disabled])
6315 + enable_netbeans="no"
6317 + AC_MSG_RESULT(yes)
6321 + if test "$enable_channel" = "yes"; then
6322 + dnl On Solaris we need the socket and nsl library.
6323 + AC_CHECK_LIB(socket, socket)
6324 + AC_CHECK_LIB(nsl, gethostbyname)
6325 + AC_MSG_CHECKING(whether compiling with process communication is possible)
6327 + #include <stdio.h>
6328 + #include <stdlib.h>
6329 + #include <stdarg.h>
6330 + #include <fcntl.h>
6331 + #include <netdb.h>
6332 + #include <netinet/in.h>
6333 + #include <errno.h>
6334 + #include <sys/types.h>
6335 + #include <sys/socket.h>
6336 + /* Check bitfields */
6338 + unsigned int initDone:1;
6339 + ushort signmaplen;
6342 + /* Check creating a socket. */
6343 + struct sockaddr_in server;
6344 + (void)socket(AF_INET, SOCK_STREAM, 0);
6346 + (void)gethostbyname("microsoft.com");
6347 + if (errno == ECONNREFUSED)
6348 + (void)connect(1, (struct sockaddr *)&server, sizeof(server));
6350 + AC_MSG_RESULT(yes),
6351 + AC_MSG_RESULT(no); enable_netbeans="no"; enable_channel="no")
6353 + if test "$enable_netbeans" = "yes"; then
6354 + AC_DEFINE(FEAT_NETBEANS_INTG)
6355 + NETBEANS_SRC="netbeans.c"
6356 + AC_SUBST(NETBEANS_SRC)
6357 + NETBEANS_OBJ="objects/netbeans.o"
6358 + AC_SUBST(NETBEANS_OBJ)
6360 + if test "$enable_channel" = "yes"; then
6361 + AC_DEFINE(FEAT_JOB_CHANNEL)
6362 + CHANNEL_SRC="channel.c"
6363 + AC_SUBST(CHANNEL_SRC)
6364 + CHANNEL_OBJ="objects/channel.o"
6365 + AC_SUBST(CHANNEL_OBJ)
6368 + AC_MSG_CHECKING(--enable-multibyte argument)
6369 + AC_ARG_ENABLE(multibyte,
6370 + [ --enable-multibyte Include multibyte editing support.], ,
6371 + [enable_multibyte="no"])
6372 + AC_MSG_RESULT($enable_multibyte)
6373 + if test "$enable_multibyte" = "yes"; then
6374 + AC_DEFINE(FEAT_MBYTE)
6377 + AC_MSG_CHECKING(--enable-hangulinput argument)
6378 + AC_ARG_ENABLE(hangulinput,
6379 + [ --enable-hangulinput Include Hangul input support.], ,
6380 + [enable_hangulinput="no"])
6381 + AC_MSG_RESULT($enable_hangulinput)
6383 + AC_MSG_CHECKING(--enable-xim argument)
6384 + AC_ARG_ENABLE(xim,
6385 + [ --enable-xim Include XIM input support.],
6386 + AC_MSG_RESULT($enable_xim),
6387 + [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
6389 + AC_MSG_CHECKING(--enable-fontset argument)
6390 + AC_ARG_ENABLE(fontset,
6391 + [ --enable-fontset Include X fontset output support.], ,
6392 + [enable_fontset="no"])
6393 + AC_MSG_RESULT($enable_fontset)
6394 + dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI
6396 + test -z "$with_x" && with_x=yes
6397 + test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
6398 + if test "$with_x" = no; then
6399 + AC_MSG_RESULT(defaulting to: don't HAVE_X11)
6401 + dnl Do this check early, so that its failure can override user requests.
6403 + AC_PATH_PROG(xmkmfpath, xmkmf)
6407 + dnl On z/OS Unix the X libraries are DLLs. To use them the code must
6408 + dnl be compiled with a special option.
6409 + dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS.
6410 + if test "$zOSUnix" = "yes"; then
6411 + CFLAGS="$CFLAGS -W c,dll"
6412 + LDFLAGS="$LDFLAGS -W l,dll"
6413 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
6416 + dnl On my HPUX system the X include dir is found, but the lib dir not.
6417 + dnl This is a desparate try to fix this.
6419 + if test -d "$x_includes" && test ! -d "$x_libraries"; then
6420 + x_libraries=`echo "$x_includes" | sed s/include/lib/`
6421 + AC_MSG_RESULT(Corrected X libraries to $x_libraries)
6422 + X_LIBS="$X_LIBS -L$x_libraries"
6423 + if test "`(uname) 2>/dev/null`" = SunOS &&
6424 + uname -r | grep '^5' >/dev/null; then
6425 + X_LIBS="$X_LIBS -R $x_libraries"
6429 + if test -d "$x_libraries" && test ! -d "$x_includes"; then
6430 + x_includes=`echo "$x_libraries" | sed s/lib/include/`
6431 + AC_MSG_RESULT(Corrected X includes to $x_includes)
6432 + X_CFLAGS="$X_CFLAGS -I$x_includes"
6435 + dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed.
6436 + X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
6437 + dnl Remove "-L/usr/lib " from X_LIBS, should not be needed.
6438 + X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
6439 + dnl Same for "-R/usr/lib ".
6440 + X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
6443 + dnl Check if the X11 header files are correctly installed. On some systems
6444 + dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h
6446 + AC_MSG_CHECKING(if X11 header files can be found)
6447 + cflags_save=$CFLAGS
6448 + CFLAGS="$CFLAGS $X_CFLAGS"
6449 + AC_TRY_COMPILE([#include <X11/Xlib.h>
6450 + #include <X11/Intrinsic.h>], ,
6451 + AC_MSG_RESULT(yes),
6452 + AC_MSG_RESULT(no); no_x=yes)
6453 + CFLAGS=$cflags_save
6455 + if test "${no_x-no}" = yes; then
6458 + AC_DEFINE(HAVE_X11)
6459 + X_LIB="-lXt -lX11";
6462 + ac_save_LDFLAGS="$LDFLAGS"
6463 + LDFLAGS="-L$x_libraries $LDFLAGS"
6465 + dnl Check for -lXdmcp (needed on SunOS 4.1.4)
6466 + dnl For HP-UX 10.20 it must be before -lSM -lICE
6467 + AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],,
6468 + [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp])
6470 + dnl Some systems need -lnsl -lsocket when testing for ICE.
6471 + dnl The check above doesn't do this, try here (again). Also needed to get
6472 + dnl them after Xdmcp. link.sh will remove them when not needed.
6473 + dnl Check for other function than above to avoid the cached value
6474 + AC_CHECK_LIB(ICE, IceOpenConnection,
6475 + [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
6477 + dnl Check for -lXpm (needed for some versions of Motif)
6478 + LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
6479 + AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
6480 + [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS])
6482 + dnl Check that the X11 header files don't use implicit declarations
6483 + AC_MSG_CHECKING(if X11 header files implicitly declare return values)
6484 + cflags_save=$CFLAGS
6485 + dnl -Werror is GCC only, others like Solaris Studio might not like it
6486 + if test "$GCC" = yes; then
6487 + CFLAGS="$CFLAGS $X_CFLAGS -Werror"
6489 + CFLAGS="$CFLAGS $X_CFLAGS"
6491 + AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
6492 + AC_MSG_RESULT(no),
6493 + CFLAGS="$CFLAGS -Wno-implicit-int"
6494 + AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
6495 + AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int",
6496 + AC_MSG_RESULT(test failed)
6499 + CFLAGS=$cflags_save
6501 + LDFLAGS="$ac_save_LDFLAGS"
6503 + AC_MSG_CHECKING(size of wchar_t is 2 bytes)
6504 + AC_CACHE_VAL(ac_cv_small_wchar_t,
6506 + #include <X11/Xlib.h>
6508 + # include <stdlib.h>
6509 + # include <stddef.h>
6513 + if (sizeof(wchar_t) <= 2)
6517 + ac_cv_small_wchar_t="no",
6518 + ac_cv_small_wchar_t="yes",
6519 + AC_MSG_ERROR(failed to compile test program))])
6520 + AC_MSG_RESULT($ac_cv_small_wchar_t)
6521 + if test "x$ac_cv_small_wchar_t" = "xyes" ; then
6522 + AC_DEFINE(SMALL_WCHAR_T)
6528 + test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
6530 + AC_MSG_CHECKING(--enable-gui argument)
6531 + AC_ARG_ENABLE(gui,
6532 + [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
6534 + dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
6535 + dnl Do not use character classes for portability with old tools.
6536 + enable_gui_canon=`echo "_$enable_gui" | \
6537 + sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
6539 + dnl Skip everything by default.
6550 + if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
6552 + case "$enable_gui_canon" in
6553 + no) AC_MSG_RESULT(no GUI support)
6554 + SKIP_PHOTON=YES ;;
6555 + yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
6556 + auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
6557 + photon) AC_MSG_RESULT(Photon GUI support) ;;
6558 + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
6559 + SKIP_PHOTON=YES ;;
6562 + elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
6564 + case "$enable_gui_canon" in
6565 + no) AC_MSG_RESULT(no GUI support)
6566 + SKIP_CARBON=YES ;;
6567 + yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
6568 + auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support)
6569 + SKIP_CARBON=YES ;;
6570 + carbon) AC_MSG_RESULT(Carbon GUI support) ;;
6571 + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
6572 + SKIP_CARBON=YES ;;
6577 + case "$enable_gui_canon" in
6578 + no|none) AC_MSG_RESULT(no GUI support) ;;
6579 + yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
6586 + gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
6588 + gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
6591 + gtk3) AC_MSG_RESULT(GTK+ 3.x GUI support)
6593 + motif) AC_MSG_RESULT(Motif GUI support)
6595 + athena) AC_MSG_RESULT(Athena GUI support)
6597 + nextaw) AC_MSG_RESULT(neXtaw GUI support)
6599 + *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;;
6604 + if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
6605 + -a "$enable_gui_canon" != "gnome2"; then
6606 + AC_MSG_CHECKING(whether or not to look for GTK+ 2)
6607 + AC_ARG_ENABLE(gtk2-check,
6608 + [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]],
6609 + , enable_gtk2_check="yes")
6610 + AC_MSG_RESULT($enable_gtk2_check)
6611 + if test "x$enable_gtk2_check" = "xno"; then
6617 + if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then
6618 + AC_MSG_CHECKING(whether or not to look for GNOME)
6619 + AC_ARG_ENABLE(gnome-check,
6620 + [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
6621 + , enable_gnome_check="no")
6622 + AC_MSG_RESULT($enable_gnome_check)
6623 + if test "x$enable_gnome_check" = "xno"; then
6628 + if test "x$SKIP_GTK3" != "xYES" -a "$enable_gui_canon" != "gtk3"; then
6629 + AC_MSG_CHECKING(whether or not to look for GTK+ 3)
6630 + AC_ARG_ENABLE(gtk3-check,
6631 + [ --enable-gtk3-check If auto-select GUI, check for GTK+ 3 [default=yes]],
6632 + , enable_gtk3_check="yes")
6633 + AC_MSG_RESULT($enable_gtk3_check)
6634 + if test "x$enable_gtk3_check" = "xno"; then
6639 + if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
6640 + AC_MSG_CHECKING(whether or not to look for Motif)
6641 + AC_ARG_ENABLE(motif-check,
6642 + [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]],
6643 + , enable_motif_check="yes")
6644 + AC_MSG_RESULT($enable_motif_check)
6645 + if test "x$enable_motif_check" = "xno"; then
6650 + if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
6651 + AC_MSG_CHECKING(whether or not to look for Athena)
6652 + AC_ARG_ENABLE(athena-check,
6653 + [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]],
6654 + , enable_athena_check="yes")
6655 + AC_MSG_RESULT($enable_athena_check)
6656 + if test "x$enable_athena_check" = "xno"; then
6661 + if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
6662 + AC_MSG_CHECKING(whether or not to look for neXtaw)
6663 + AC_ARG_ENABLE(nextaw-check,
6664 + [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]],
6665 + , enable_nextaw_check="yes")
6666 + AC_MSG_RESULT($enable_nextaw_check);
6667 + if test "x$enable_nextaw_check" = "xno"; then
6672 + if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
6673 + AC_MSG_CHECKING(whether or not to look for Carbon)
6674 + AC_ARG_ENABLE(carbon-check,
6675 + [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]],
6676 + , enable_carbon_check="yes")
6677 + AC_MSG_RESULT($enable_carbon_check);
6678 + if test "x$enable_carbon_check" = "xno"; then
6684 + if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
6685 + AC_MSG_CHECKING(for Carbon GUI)
6686 + dnl already did the check, just give the message
6687 + AC_MSG_RESULT(yes);
6689 + if test "$VIMNAME" = "vim"; then
6693 + if test "x$MACARCH" = "xboth"; then
6694 + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
6696 + CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon"
6699 + dnl Default install directory is not /usr/local
6700 + if test x$prefix = xNONE; then
6701 + prefix=/Applications
6704 + dnl Sorry for the hard coded default
6705 + datadir='${prefix}/Vim.app/Contents/Resources'
6707 + dnl skip everything else
6717 + dnl define an autoconf function to check for a specified version of GTK, and
6718 + dnl try to compile/link a GTK program.
6720 + dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
6721 + dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS
6723 + AC_DEFUN(AM_PATH_GTK,
6725 + if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
6728 + if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
6729 + && $PKG_CONFIG --exists gtk+-2.0; then
6731 + min_gtk_version=ifelse([$1], ,2.2.0,$1)
6732 + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
6733 + dnl We should be using PKG_CHECK_MODULES() instead of this hack.
6734 + dnl But I guess the dependency on pkgconfig.m4 is not wanted or
6735 + dnl something like that.
6736 + GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
6737 + GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0`
6738 + GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
6739 + gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
6740 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
6741 + gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
6742 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
6743 + gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
6744 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
6746 + elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
6747 + && $PKG_CONFIG --exists gtk+-3.0; then
6749 + min_gtk_version=ifelse([$1], ,3.0.0,$1)
6750 + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
6752 + GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0`
6753 + GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0`
6754 + GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0`
6755 + gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
6756 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
6757 + gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
6758 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
6759 + gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
6760 + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
6766 + if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
6768 + ac_save_CFLAGS="$CFLAGS"
6769 + ac_save_LIBS="$LIBS"
6770 + CFLAGS="$CFLAGS $GTK_CFLAGS"
6771 + LIBS="$LIBS $GTK_LIBS"
6774 + dnl Now check if the installed GTK is sufficiently new.
6776 + rm -f conf.gtktest
6778 + #include <gtk/gtk.h>
6779 + #include <stdio.h>
6781 + # include <stdlib.h>
6782 + # include <stddef.h>
6788 + int major, minor, micro;
6789 + char *tmp_version;
6791 + system ("touch conf.gtktest");
6793 + /* HP/UX 9 (%@#!) writes to sscanf strings */
6794 + tmp_version = g_strdup("$min_gtk_version");
6795 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
6796 + printf("%s, bad version string\n", "$min_gtk_version");
6800 + if ((gtk_major_version > major) ||
6801 + ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
6802 + ((gtk_major_version == major) && (gtk_minor_version == minor) &&
6803 + (gtk_micro_version >= micro)))
6809 + ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
6810 + CFLAGS="$ac_save_CFLAGS"
6811 + LIBS="$ac_save_LIBS"
6814 + if test "x$no_gtk" = x ; then
6815 + if test "x$enable_gtktest" = "xyes"; then
6816 + AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
6818 + AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
6820 + ifelse([$2], , :, [$2])
6826 + ifelse([$3], , :, [$3])
6833 + ifelse([$3], , :, [$3])
6835 + AC_SUBST(GTK_CFLAGS)
6836 + AC_SUBST(GTK_LIBS)
6837 + rm -f conf.gtktest
6840 + dnl ---------------------------------------------------------------------------
6842 + dnl ---------------------------------------------------------------------------
6843 + AC_DEFUN([GNOME_INIT_HOOK],
6845 + AC_SUBST(GNOME_LIBS)
6846 + AC_SUBST(GNOME_LIBDIR)
6847 + AC_SUBST(GNOME_INCLUDEDIR)
6849 + AC_ARG_WITH(gnome-includes,
6850 + [ --with-gnome-includes=DIR Specify location of GNOME headers],
6851 + [CFLAGS="$CFLAGS -I$withval"]
6854 + AC_ARG_WITH(gnome-libs,
6855 + [ --with-gnome-libs=DIR Specify location of GNOME libs],
6856 + [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval]
6859 + AC_ARG_WITH(gnome,
6860 + [ --with-gnome Specify prefix for GNOME files],
6861 + if test x$withval = xyes; then
6863 + ifelse([$1], [], :, [$1])
6865 + if test "x$withval" = xno; then
6869 + LDFLAGS="$LDFLAGS -L$withval/lib"
6870 + CFLAGS="$CFLAGS -I$withval/include"
6871 + gnome_prefix=$withval/lib
6876 + if test "x$want_gnome" = xyes; then
6878 + AC_MSG_CHECKING(for libgnomeui-2.0)
6879 + if $PKG_CONFIG --exists libgnomeui-2.0; then
6880 + AC_MSG_RESULT(yes)
6881 + GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
6882 + GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
6883 + GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
6885 + dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
6886 + dnl This might not be the right way but it works for me...
6887 + AC_MSG_CHECKING(for FreeBSD)
6888 + if test "`(uname) 2>/dev/null`" = FreeBSD; then
6889 + AC_MSG_RESULT(yes, adding -pthread)
6890 + GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
6891 + GNOME_LIBS="$GNOME_LIBS -pthread"
6897 + AC_MSG_RESULT(not found)
6898 + if test "x$2" = xfail; then
6899 + AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
6906 + AC_DEFUN([GNOME_INIT],[
6907 + GNOME_INIT_HOOK([],fail)
6911 + dnl ---------------------------------------------------------------------------
6912 + dnl Check for GTK2. If it fails, then continue on for Motif as before...
6913 + dnl ---------------------------------------------------------------------------
6914 + if test -z "$SKIP_GTK2"; then
6916 + AC_MSG_CHECKING(--disable-gtktest argument)
6917 + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
6918 + , enable_gtktest=yes)
6919 + if test "x$enable_gtktest" = "xyes" ; then
6920 + AC_MSG_RESULT(gtk test enabled)
6922 + AC_MSG_RESULT(gtk test disabled)
6925 + if test "X$PKG_CONFIG" = "X"; then
6926 + AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
6929 + if test "x$PKG_CONFIG" != "xno"; then
6930 + dnl First try finding version 2.2.0 or later. The 2.0.x series has
6931 + dnl problems (bold fonts, --remote doesn't work).
6932 + AM_PATH_GTK(2.2.0,
6933 + [GUI_LIB_LOC="$GTK_LIBDIR"
6934 + GTK_LIBNAME="$GTK_LIBS"
6935 + GUI_INC_LOC="$GTK_CFLAGS"], )
6936 + if test "x$GTK_CFLAGS" != "x"; then
6942 + AC_SUBST(GTK_LIBNAME)
6945 + if test "x$GUITYPE" = "xGTK"; then
6946 + if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
6947 + || test "0$gtk_minor_version" -ge 2; then
6948 + AC_DEFINE(HAVE_GTK_MULTIHEAD)
6951 + dnl if GTK exists, then check for GNOME.
6953 + if test -z "$SKIP_GNOME"; then
6955 + GNOME_INIT_HOOK([have_gnome=yes])
6956 + if test "x$have_gnome" = xyes ; then
6957 + AC_DEFINE(FEAT_GUI_GNOME)
6958 + GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
6959 + GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
6967 + dnl ---------------------------------------------------------------------------
6968 + dnl Check for GTK3.
6969 + dnl ---------------------------------------------------------------------------
6970 + if test -z "$SKIP_GTK3"; then
6972 + AC_MSG_CHECKING(--disable-gtktest argument)
6973 + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
6974 + , enable_gtktest=yes)
6975 + if test "x$enable_gtktest" = "xyes" ; then
6976 + AC_MSG_RESULT(gtk test enabled)
6978 + AC_MSG_RESULT(gtk test disabled)
6981 + if test "X$PKG_CONFIG" = "X"; then
6982 + AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
6985 + if test "x$PKG_CONFIG" != "xno"; then
6986 + AM_PATH_GTK(3.0.0,
6987 + [GUI_LIB_LOC="$GTK_LIBDIR"
6988 + GTK_LIBNAME="$GTK_LIBS"
6989 + GUI_INC_LOC="$GTK_CFLAGS"], )
6990 + if test "x$GTK_CFLAGS" != "x"; then
6997 + AC_SUBST(GTK_LIBNAME)
6998 + AC_DEFINE(HAVE_GTK_MULTIHEAD)
6999 + AC_DEFINE(USE_GTK3)
7004 + dnl Check the version of Gdk-Pixbuf. If the version is 2.31 or later and
7005 + dnl glib-compile-resources is found in PATH, use GResource.
7006 + if test "x$GUITYPE" = "xGTK"; then
7007 + AC_MSG_CHECKING([version of Gdk-Pixbuf])
7008 + gdk_pixbuf_version=`$PKG_CONFIG --modversion gdk-pixbuf-2.0`
7009 + if test "x$gdk_pixbuf_version" != x ; then
7010 + gdk_pixbuf_version_minor=`echo $gdk_pixbuf_version | \
7011 + sed -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/'`
7012 + if test "x$gdk_pixbuf_version_minor" != x -a \
7013 + $gdk_pixbuf_version_minor -ge 31 ; then
7014 + AC_MSG_RESULT([OK.])
7015 + AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no)
7016 + AC_MSG_CHECKING([glib-compile-resources])
7017 + if test "x$GLIB_COMPILE_RESOURCES" = xno ; then
7018 + GLIB_COMPILE_RESOURCES=""
7019 + AC_MSG_RESULT([cannot be found in PATH.])
7021 + AC_MSG_RESULT([usable.])
7022 + AC_DEFINE(USE_GRESOURCE)
7023 + GRESOURCE_SRC="auto/gui_gtk_gresources.c"
7024 + GRESOURCE_OBJ="objects/gui_gtk_gresources.o"
7027 + AC_MSG_RESULT([not usable.])
7030 + AC_MSG_RESULT([cannot obtain from pkg_config.])
7033 + AC_MSG_CHECKING([--disable-icon-cache-update argument])
7034 + AC_ARG_ENABLE(icon_cache_update,
7035 + [ --disable-icon-cache-update update disabled],
7037 + [enable_icon_cache_update="yes"])
7038 + if test "$enable_icon_cache_update" = "yes"; then
7039 + AC_MSG_RESULT([not set])
7040 + AC_PATH_PROG(GTK_UPDATE_ICON_CACHE,[gtk-update-icon-cache],no)
7041 + if test "x$GTK_UPDATE_ICON_CACHE" = "xno" ; then
7042 + AC_MSG_RESULT([not found in PATH.])
7045 + AC_MSG_RESULT([update disabled])
7048 + AC_MSG_CHECKING([--disable-desktop-database-update argument])
7049 + AC_ARG_ENABLE(desktop_database_update,
7050 + [ --disable-desktop-database-update update disabled],
7052 + [enable_desktop_database_update="yes"])
7053 + if test "$enable_desktop_database_update" = "yes"; then
7054 + AC_MSG_RESULT([not set])
7055 + AC_PATH_PROG(UPDATE_DESKTOP_DATABASE,[update-desktop-database],no)
7056 + if test "x$UPDATE_DESKTOP_DATABASE" = "xno" ; then
7057 + AC_MSG_RESULT([not found in PATH.])
7060 + AC_MSG_RESULT([update disabled])
7063 + AC_SUBST(GLIB_COMPILE_RESOURCES)
7064 + AC_SUBST(GRESOURCE_SRC)
7065 + AC_SUBST(GRESOURCE_OBJ)
7066 + AC_SUBST(GTK_UPDATE_ICON_CACHE)
7067 + AC_SUBST(UPDATE_DESKTOP_DATABASE)
7069 + dnl Check for Motif include files location.
7070 + dnl The LAST one found is used, this makes the highest version to be used,
7071 + dnl e.g. when Motif1.2 and Motif2.0 are both present.
7073 + if test -z "$SKIP_MOTIF"; then
7074 + 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"
7075 + dnl Remove "-I" from before $GUI_INC_LOC if it's there
7076 + GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
7078 + AC_MSG_CHECKING(for location of Motif GUI includes)
7079 + gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
7081 + for try in $gui_includes; do
7082 + if test -f "$try/Xm/Xm.h"; then
7086 + if test -n "$GUI_INC_LOC"; then
7087 + if test "$GUI_INC_LOC" = /usr/include; then
7089 + AC_MSG_RESULT(in default path)
7091 + AC_MSG_RESULT($GUI_INC_LOC)
7094 + AC_MSG_RESULT(<not found>)
7099 + dnl Check for Motif library files location. In the same order as the include
7100 + dnl files, to avoid a mixup if several versions are present
7102 + if test -z "$SKIP_MOTIF"; then
7103 + AC_MSG_CHECKING(--with-motif-lib argument)
7104 + AC_ARG_WITH(motif-lib,
7105 + [ --with-motif-lib=STRING Library for Motif ],
7106 + [ MOTIF_LIBNAME="${withval}" ] )
7108 + if test -n "$MOTIF_LIBNAME"; then
7109 + AC_MSG_RESULT($MOTIF_LIBNAME)
7114 + dnl Remove "-L" from before $GUI_LIB_LOC if it's there
7115 + GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
7117 + dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The
7118 + dnl linker will figure out which one to use, we only check if one exists.
7119 + AC_MSG_CHECKING(for location of Motif GUI libs)
7120 + gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC"
7122 + for try in $gui_libs; do
7123 + for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do
7124 + if test -f "$libtry"; then
7129 + if test -n "$GUI_LIB_LOC"; then
7130 + dnl Remove /usr/lib, it causes trouble on some systems
7131 + if test "$GUI_LIB_LOC" = /usr/lib \
7132 + -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \
7133 + -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then
7135 + AC_MSG_RESULT(in default path)
7137 + if test -n "$GUI_LIB_LOC"; then
7138 + AC_MSG_RESULT($GUI_LIB_LOC)
7139 + if test "`(uname) 2>/dev/null`" = SunOS &&
7140 + uname -r | grep '^5' >/dev/null; then
7141 + GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
7145 + MOTIF_LIBNAME=-lXm
7147 + AC_MSG_RESULT(<not found>)
7153 + if test -z "$SKIP_MOTIF"; then
7157 + AC_SUBST(MOTIF_LIBNAME)
7160 + dnl Check if the Athena files can be found
7164 + if test -z "$SKIP_ATHENA"; then
7165 + AC_MSG_CHECKING(if Athena header files can be found)
7166 + cflags_save=$CFLAGS
7167 + CFLAGS="$CFLAGS $X_CFLAGS"
7169 + #include <X11/Intrinsic.h>
7170 + #include <X11/Xaw/Paned.h>], ,
7171 + AC_MSG_RESULT(yes),
7172 + AC_MSG_RESULT(no); SKIP_ATHENA=YES )
7173 + CFLAGS=$cflags_save
7176 + if test -z "$SKIP_ATHENA"; then
7180 + if test -z "$SKIP_NEXTAW"; then
7181 + AC_MSG_CHECKING(if neXtaw header files can be found)
7182 + cflags_save=$CFLAGS
7183 + CFLAGS="$CFLAGS $X_CFLAGS"
7185 + #include <X11/Intrinsic.h>
7186 + #include <X11/neXtaw/Paned.h>], ,
7187 + AC_MSG_RESULT(yes),
7188 + AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
7189 + CFLAGS=$cflags_save
7192 + if test -z "$SKIP_NEXTAW"; then
7196 + if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
7197 + dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
7198 + dnl Avoid adding it when it twice
7199 + if test -n "$GUI_INC_LOC"; then
7200 + GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
7202 + if test -n "$GUI_LIB_LOC"; then
7203 + GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
7206 + dnl Check for -lXext and then for -lXmu
7207 + ldflags_save=$LDFLAGS
7208 + LDFLAGS="$X_LIBS $LDFLAGS"
7209 + AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
7210 + [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
7211 + dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
7212 + AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
7213 + [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
7214 + AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
7215 + [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
7216 + AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
7217 + [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
7218 + if test -z "$SKIP_MOTIF"; then
7219 + AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
7220 + [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
7222 + LDFLAGS=$ldflags_save
7224 + dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
7225 + AC_MSG_CHECKING(for extra X11 defines)
7227 + rm -fr conftestdir
7228 + if mkdir conftestdir; then
7230 + cat > Imakefile <<'EOF'
7232 + @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
7234 + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
7235 + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
7238 + rm -fr conftestdir
7240 + if test -z "$NARROW_PROTO"; then
7243 + AC_MSG_RESULT($NARROW_PROTO)
7245 + AC_SUBST(NARROW_PROTO)
7248 + dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
7249 + dnl use the X11 include path
7250 + if test "$enable_xsmp" = "yes"; then
7251 + cppflags_save=$CPPFLAGS
7252 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7253 + AC_CHECK_HEADERS(X11/SM/SMlib.h)
7254 + CPPFLAGS=$cppflags_save
7258 + if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then
7259 + dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
7260 + cppflags_save=$CPPFLAGS
7261 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7262 + AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
7264 + dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
7265 + if test ! "$enable_xim" = "no"; then
7266 + AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
7267 + AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
7268 + AC_MSG_RESULT(yes),
7269 + AC_MSG_RESULT(no; xim has been disabled); enable_xim="no")
7271 + CPPFLAGS=$cppflags_save
7273 + dnl automatically enable XIM when hangul input isn't enabled
7274 + if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
7275 + -a "x$GUITYPE" != "xNONE" ; then
7276 + AC_MSG_RESULT(X GUI selected; xim has been enabled)
7281 + if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
7282 + cppflags_save=$CPPFLAGS
7283 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7284 + dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h
7285 + AC_MSG_CHECKING([for X11/Xmu/Editres.h])
7287 + #include <X11/Intrinsic.h>
7288 + #include <X11/Xmu/Editres.h>],
7290 + AC_MSG_RESULT(yes)
7291 + AC_DEFINE(HAVE_X11_XMU_EDITRES_H),
7292 + AC_MSG_RESULT(no))
7293 + CPPFLAGS=$cppflags_save
7296 + dnl Only use the Xm directory when compiling Motif, don't use it for Athena
7297 + if test -z "$SKIP_MOTIF"; then
7298 + cppflags_save=$CPPFLAGS
7299 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7300 + if test "$zOSUnix" = "yes"; then
7301 + xmheader="Xm/Xm.h"
7303 + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h
7304 + Xm/UnhighlightT.h Xm/Notebook.h"
7306 + AC_CHECK_HEADERS($xmheader)
7308 + if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then
7309 + dnl Solaris uses XpmAttributes_21, very annoying.
7310 + AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
7311 + AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
7312 + AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21),
7313 + AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
7316 + AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
7318 + CPPFLAGS=$cppflags_save
7321 + if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
7322 + AC_MSG_RESULT(no GUI selected; xim has been disabled)
7325 + if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
7326 + AC_MSG_RESULT(no GUI selected; fontset has been disabled)
7327 + enable_fontset="no"
7329 + if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then
7330 + AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
7331 + enable_fontset="no"
7334 + if test -z "$SKIP_PHOTON"; then
7338 + AC_SUBST(GUI_INC_LOC)
7339 + AC_SUBST(GUI_LIB_LOC)
7341 + AC_SUBST(GUI_X_LIBS)
7343 + if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
7344 + AC_MSG_ERROR([cannot use workshop without Motif])
7347 + dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
7348 + if test "$enable_xim" = "yes"; then
7349 + AC_DEFINE(FEAT_XIM)
7351 + if test "$enable_fontset" = "yes"; then
7352 + AC_DEFINE(FEAT_XFONTSET)
7356 + dnl ---------------------------------------------------------------------------
7357 + dnl end of GUI-checking
7358 + dnl ---------------------------------------------------------------------------
7360 + dnl Check for Cygwin, which needs an extra source file if not using X11
7361 + AC_MSG_CHECKING(for CYGWIN or MSYS environment)
7363 + CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes)
7364 + AC_MSG_CHECKING(for CYGWIN clipboard support)
7365 + if test "x$with_x" = "xno" ; then
7366 + OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o
7367 + AC_MSG_RESULT(yes)
7368 + AC_DEFINE(FEAT_CYGWIN_WIN32_CLIPBOARD)
7370 + AC_MSG_RESULT(no - using X11)
7373 + *) CYGWIN=no; AC_MSG_RESULT(no);;
7376 + dnl Only really enable hangul input when GUI and XFONTSET are available
7377 + if test "$enable_hangulinput" = "yes"; then
7378 + if test "x$GUITYPE" = "xNONE"; then
7379 + AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
7380 + enable_hangulinput=no
7382 + AC_DEFINE(FEAT_HANGULIN)
7383 + HANGULIN_SRC=hangulin.c
7384 + AC_SUBST(HANGULIN_SRC)
7385 + HANGULIN_OBJ=objects/hangulin.o
7386 + AC_SUBST(HANGULIN_OBJ)
7390 + dnl Checks for libraries and include files.
7392 + AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken],
7394 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7395 + #include "confdefs.h"
7396 + #include <ctype.h>
7398 + # include <stdlib.h>
7399 + # include <stddef.h>
7401 + main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
7403 + vim_cv_toupper_broken=yes
7405 + vim_cv_toupper_broken=no
7407 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken')
7410 + if test "x$vim_cv_toupper_broken" = "xyes" ; then
7411 + AC_DEFINE(BROKEN_TOUPPER)
7414 + AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
7415 + AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");],
7416 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
7417 + AC_MSG_RESULT(no))
7419 + AC_MSG_CHECKING(whether __attribute__((unused)) is allowed)
7420 + AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
7421 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED),
7422 + AC_MSG_RESULT(no))
7424 + dnl Checks for header files.
7425 + AC_CHECK_HEADER(elf.h, HAS_ELF=1)
7426 + dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
7427 + if test "$HAS_ELF" = 1; then
7428 + AC_CHECK_LIB(elf, main)
7433 + dnl If sys/wait.h is not found it might still exist but not be POSIX
7434 + dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
7435 + if test $ac_cv_header_sys_wait_h = no; then
7436 + AC_MSG_CHECKING([for sys/wait.h that defines union wait])
7437 + AC_TRY_COMPILE([#include <sys/wait.h>],
7438 + [union wait xx, yy; xx = yy],
7439 + AC_MSG_RESULT(yes)
7440 + AC_DEFINE(HAVE_SYS_WAIT_H)
7441 + AC_DEFINE(HAVE_UNION_WAIT),
7442 + AC_MSG_RESULT(no))
7445 + AC_CHECK_HEADERS(stdint.h stdlib.h string.h \
7446 + sys/select.h sys/utsname.h termcap.h fcntl.h \
7447 + sgtty.h sys/ioctl.h sys/time.h sys/types.h \
7448 + termio.h iconv.h inttypes.h langinfo.h math.h \
7449 + unistd.h stropts.h errno.h sys/resource.h \
7450 + sys/systeminfo.h locale.h sys/stream.h termios.h \
7451 + libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
7452 + utime.h sys/param.h libintl.h libgen.h \
7453 + util/debug.h util/msg18n.h frame.h sys/acl.h \
7454 + sys/access.h sys/sysinfo.h wchar.h wctype.h)
7456 + dnl sys/ptem.h depends on sys/stream.h on Solaris
7457 + AC_CHECK_HEADERS(sys/ptem.h, [], [],
7458 + [#if defined HAVE_SYS_STREAM_H
7459 + # include <sys/stream.h>
7462 + dnl sys/sysctl.h depends on sys/param.h on OpenBSD
7463 + AC_CHECK_HEADERS(sys/sysctl.h, [], [],
7464 + [#if defined HAVE_SYS_PARAM_H
7465 + # include <sys/param.h>
7469 + dnl pthread_np.h may exist but can only be used after including pthread.h
7470 + AC_MSG_CHECKING([for pthread_np.h])
7472 + #include <pthread.h>
7473 + #include <pthread_np.h>],
7475 + AC_MSG_RESULT(yes)
7476 + AC_DEFINE(HAVE_PTHREAD_NP_H),
7477 + AC_MSG_RESULT(no))
7479 + AC_CHECK_HEADERS(strings.h)
7480 + if test "x$MACOSX" = "xyes"; then
7481 + dnl The strings.h file on OS/X contains a warning and nothing useful.
7482 + AC_DEFINE(NO_STRINGS_WITH_STRING_H)
7485 + dnl Check if strings.h and string.h can both be included when defined.
7486 + AC_MSG_CHECKING([if strings.h can be included after string.h])
7487 + cppflags_save=$CPPFLAGS
7488 + CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7490 + #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
7491 + # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
7492 + /* but don't do it on AIX 5.1 (Uribarri) */
7494 + #ifdef HAVE_XM_XM_H
7495 + # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
7497 + #ifdef HAVE_STRING_H
7498 + # include <string.h>
7500 + #if defined(HAVE_STRINGS_H)
7501 + # include <strings.h>
7503 + ], [int i; i = 0;],
7504 + AC_MSG_RESULT(yes),
7505 + AC_DEFINE(NO_STRINGS_WITH_STRING_H)
7506 + AC_MSG_RESULT(no))
7507 + CPPFLAGS=$cppflags_save
7510 + dnl Checks for typedefs, structures, and compiler characteristics.
7511 + AC_PROG_GCC_TRADITIONAL
7522 + AC_CHECK_TYPE(ino_t, long)
7523 + AC_CHECK_TYPE(dev_t, unsigned)
7524 + AC_C_BIGENDIAN(,,,)
7527 + AC_MSG_CHECKING(for rlim_t)
7528 + if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
7529 + AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
7532 + changequote(<<,>>)dnl
7533 + <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
7536 + #include <sys/types.h>
7538 + # include <stdlib.h>
7539 + # include <stddef.h>
7541 + #ifdef HAVE_SYS_RESOURCE_H
7542 + # include <sys/resource.h>
7544 + ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
7545 + AC_MSG_RESULT($ac_cv_type_rlim_t)
7547 + if test $ac_cv_type_rlim_t = no; then
7548 + cat >> confdefs.h <<\EOF
7549 + #define rlim_t unsigned long
7553 + AC_MSG_CHECKING(for stack_t)
7554 + if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
7555 + AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
7557 + AC_EGREP_CPP(stack_t,
7559 + #include <sys/types.h>
7561 + # include <stdlib.h>
7562 + # include <stddef.h>
7564 + #include <signal.h>
7565 + ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
7566 + AC_MSG_RESULT($ac_cv_type_stack_t)
7568 + if test $ac_cv_type_stack_t = no; then
7569 + cat >> confdefs.h <<\EOF
7570 + #define stack_t struct sigaltstack
7574 + dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
7575 + AC_MSG_CHECKING(whether stack_t has an ss_base field)
7577 + #include <sys/types.h>
7579 + # include <stdlib.h>
7580 + # include <stddef.h>
7582 + #include <signal.h>
7583 + #include "confdefs.h"
7584 + ], [stack_t sigstk; sigstk.ss_base = 0; ],
7585 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
7586 + AC_MSG_RESULT(no))
7589 + AC_MSG_CHECKING(--with-tlib argument)
7590 + AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
7591 + if test -n "$with_tlib"; then
7592 + AC_MSG_RESULT($with_tlib)
7593 + LIBS="$LIBS -l$with_tlib"
7594 + AC_MSG_CHECKING(for linking with $with_tlib library)
7595 + AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED))
7596 + dnl Need to check for tgetent() below.
7599 + AC_MSG_RESULT([empty: automatic terminal library selection])
7600 + dnl On HP-UX 10.10 termcap or termlib should be used instead of
7601 + dnl curses, because curses is much slower.
7602 + dnl Newer versions of ncurses are preferred over anything, except
7603 + dnl when tinfo has been split off, it contains all we need.
7604 + dnl Older versions of ncurses have bugs, get a new one!
7605 + dnl Digital Unix (OSF1) should use curses (Ronald Schild).
7606 + dnl On SCO Openserver should prefer termlib (Roger Cornelius).
7607 + case "`uname -s 2>/dev/null`" in
7608 + OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";;
7609 + *) tlibs="tinfo ncurses termlib termcap curses";;
7611 + for libname in $tlibs; do
7612 + AC_CHECK_LIB(${libname}, tgetent,,)
7613 + if test "x$olibs" != "x$LIBS"; then
7614 + dnl It's possible that a library is found but it doesn't work
7615 + dnl e.g., shared library that cannot be found
7616 + dnl compile and run a test program to be sure
7618 + #ifdef HAVE_TERMCAP_H
7619 + # include <termcap.h>
7622 + # include <stdlib.h>
7623 + # include <stddef.h>
7625 + main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
7626 + res="OK", res="FAIL", res="FAIL")
7627 + if test "$res" = "OK"; then
7630 + AC_MSG_RESULT($libname library is not usable)
7634 + if test "x$olibs" = "x$LIBS"; then
7635 + AC_MSG_RESULT(no terminal library found)
7639 + if test "x$olibs" = "x$LIBS"; then
7640 + AC_MSG_CHECKING([for tgetent()])
7642 + [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
7643 + AC_MSG_RESULT(yes),
7644 + AC_MSG_ERROR([NOT FOUND!
7645 + You need to install a terminal library; for example ncurses.
7646 + Or specify the name of the library with --with-tlib.]))
7649 + AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo],
7651 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7652 + #include "confdefs.h"
7653 + #ifdef HAVE_TERMCAP_H
7654 + # include <termcap.h>
7656 + #ifdef HAVE_STRING_H
7657 + # include <string.h>
7660 + # include <stdlib.h>
7661 + # include <stddef.h>
7664 + {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
7666 + vim_cv_terminfo=no
7668 + vim_cv_terminfo=yes
7670 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo')
7674 + if test "x$vim_cv_terminfo" = "xyes" ; then
7675 + AC_DEFINE(TERMINFO)
7678 + if test "x$olibs" != "x$LIBS"; then
7679 + AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
7681 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7682 + #include "confdefs.h"
7683 + #ifdef HAVE_TERMCAP_H
7684 + # include <termcap.h>
7687 + # include <stdlib.h>
7688 + # include <stddef.h>
7691 + {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
7695 + vim_cv_tgent=non-zero
7697 + AC_MSG_ERROR(failed to compile test program.)
7701 + if test "x$vim_cv_tgent" = "xzero" ; then
7702 + AC_DEFINE(TGETENT_ZERO_ERR, 0)
7706 + AC_MSG_CHECKING(whether termcap.h contains ospeed)
7708 + #ifdef HAVE_TERMCAP_H
7709 + # include <termcap.h>
7711 + ], [ospeed = 20000],
7712 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
7713 + [AC_MSG_RESULT(no)
7714 + AC_MSG_CHECKING(whether ospeed can be extern)
7716 + #ifdef HAVE_TERMCAP_H
7717 + # include <termcap.h>
7719 + extern short ospeed;
7720 + ], [ospeed = 20000],
7721 + AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
7722 + AC_MSG_RESULT(no))]
7725 + AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
7727 + #ifdef HAVE_TERMCAP_H
7728 + # include <termcap.h>
7730 + ], [if (UP == 0 && BC == 0) PC = 1],
7731 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
7732 + [AC_MSG_RESULT(no)
7733 + AC_MSG_CHECKING([whether UP, BC and PC can be extern])
7735 + #ifdef HAVE_TERMCAP_H
7736 + # include <termcap.h>
7738 + extern char *UP, *BC, PC;
7739 + ], [if (UP == 0 && BC == 0) PC = 1],
7740 + AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
7741 + AC_MSG_RESULT(no))]
7744 + AC_MSG_CHECKING(whether tputs() uses outfuntype)
7746 + #ifdef HAVE_TERMCAP_H
7747 + # include <termcap.h>
7749 + ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
7750 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
7751 + AC_MSG_RESULT(no))
7753 + dnl On some SCO machines sys/select redefines struct timeval
7754 + AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
7756 + #include <sys/types.h>
7757 + #include <sys/time.h>
7758 + #include <sys/select.h>], ,
7759 + AC_MSG_RESULT(yes)
7760 + AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
7761 + AC_MSG_RESULT(no))
7763 + dnl AC_DECL_SYS_SIGLIST
7765 + dnl Checks for pty.c (copied from screen) ==========================
7766 + AC_MSG_CHECKING(for /dev/ptc)
7767 + if test -r /dev/ptc; then
7768 + AC_DEFINE(HAVE_DEV_PTC)
7769 + AC_MSG_RESULT(yes)
7774 + AC_MSG_CHECKING(for SVR4 ptys)
7775 + if test -c /dev/ptmx ; then
7776 + AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
7777 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
7778 + AC_MSG_RESULT(no))
7783 + AC_MSG_CHECKING(for ptyranges)
7784 + if test -d /dev/ptym ; then
7789 + dnl SCO uses ptyp%d
7794 + ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
7795 + dnl if test -c /dev/ptyp19; then
7796 + dnl ptys=`echo /dev/ptyp??`
7798 + dnl ptys=`echo $pdir/pty??`
7800 + if test "$ptys" != "$pdir/pty??" ; then
7801 + p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
7802 + p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
7803 + AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
7804 + AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
7805 + AC_MSG_RESULT([$p0 / $p1])
7807 + AC_MSG_RESULT([don't know])
7810 + dnl **** pty mode/group handling ****
7812 + dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
7813 + rm -f conftest_grp
7814 + AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group],
7816 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7817 + #include "confdefs.h"
7818 + #include <sys/types.h>
7820 + # include <stdlib.h>
7821 + # include <stddef.h>
7823 + #ifdef HAVE_UNISTD_H
7824 + #include <unistd.h>
7826 + #include <sys/stat.h>
7827 + #include <stdio.h>
7831 + char *x,*ttyname();
7835 + if (!(x = ttyname(0))) exit(1);
7836 + if (stat(x, &sb)) exit(1);
7838 + if (om & 002) exit(0);
7839 + m = system("mesg y");
7840 + if (m == -1 || m == 127) exit(1);
7841 + if (stat(x, &sb)) exit(1);
7843 + if (chmod(x, om)) exit(1);
7844 + if (m & 002) exit(0);
7845 + if (sb.st_gid == getgid()) exit(1);
7846 + if (!(fp=fopen("conftest_grp", "w")))
7848 + fprintf(fp, "%d\n", sb.st_gid);
7853 + if test -f conftest_grp; then
7854 + vim_cv_tty_group=`cat conftest_grp`
7855 + if test "x$vim_cv_tty_mode" = "x" ; then
7856 + vim_cv_tty_mode=0620
7858 + AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group])
7860 + vim_cv_tty_group=world
7861 + AC_MSG_RESULT([ptys are world accessible])
7864 + vim_cv_tty_group=world
7865 + AC_MSG_RESULT([can't determine - assume ptys are world accessible])
7867 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode')
7870 + rm -f conftest_grp
7872 + if test "x$vim_cv_tty_group" != "xworld" ; then
7873 + AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group)
7874 + if test "x$vim_cv_tty_mode" = "x" ; then
7875 + AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)])
7877 + AC_DEFINE(PTYMODE, 0620)
7881 + dnl Checks for library functions. ===================================
7885 + dnl find out what to use at the end of a signal function
7886 + if test $ac_cv_type_signal = void; then
7887 + AC_DEFINE(SIGRETURN, [return])
7889 + AC_DEFINE(SIGRETURN, [return 0])
7892 + dnl check if struct sigcontext is defined (used for SGI only)
7893 + AC_MSG_CHECKING(for struct sigcontext)
7895 + #include <signal.h>
7898 + struct sigcontext *scont;
7899 + scont = (struct sigcontext *)0;
7902 + AC_MSG_RESULT(yes)
7903 + AC_DEFINE(HAVE_SIGCONTEXT),
7904 + AC_MSG_RESULT(no))
7906 + dnl tricky stuff: try to find out if getcwd() is implemented with
7907 + dnl system("sh -c pwd")
7908 + AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken],
7910 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7911 + #include "confdefs.h"
7912 + #ifdef HAVE_UNISTD_H
7913 + #include <unistd.h>
7915 + char *dagger[] = { "IFS=pwd", 0 };
7919 + extern char **environ;
7921 + return getcwd(buffer, 500) ? 0 : 1;
7924 + vim_cv_getcwd_broken=no
7926 + vim_cv_getcwd_broken=yes
7928 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken')
7932 + if test "x$vim_cv_getcwd_broken" = "xyes" ; then
7933 + AC_DEFINE(BAD_GETCWD)
7936 + dnl Check for functions in one big call, to reduce the size of configure.
7937 + dnl Can only be used for functions that do not require any include.
7938 + AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
7939 + getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
7940 + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
7941 + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
7942 + sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
7943 + strnicmp strpbrk strtol tgetent towlower towupper iswupper \
7944 + usleep utime utimes)
7947 + dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
7948 + dnl appropriate, so that off_t is 64 bits when needed.
7951 + dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
7952 + AC_MSG_CHECKING(for st_blksize)
7954 + [#include <sys/types.h>
7955 + #include <sys/stat.h>],
7960 + n = (int)st.st_blksize;],
7961 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
7962 + AC_MSG_RESULT(no))
7964 + AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash],
7966 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
7967 + #include "confdefs.h"
7969 + # include <stdlib.h>
7970 + # include <stddef.h>
7972 + #include <sys/types.h>
7973 + #include <sys/stat.h>
7974 + main() {struct stat st; exit(stat("configure/", &st) != 0); }
7976 + vim_cv_stat_ignores_slash=yes
7978 + vim_cv_stat_ignores_slash=no
7980 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash')
7984 + if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then
7985 + AC_DEFINE(STAT_IGNORES_SLASH)
7988 + dnl Link with iconv for charset translation, if not found without library.
7989 + dnl check for iconv() requires including iconv.h
7990 + dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
7991 + dnl has been installed.
7992 + AC_MSG_CHECKING(for iconv_open())
7994 + LIBS="$LIBS -liconv"
7996 + #ifdef HAVE_ICONV_H
7997 + # include <iconv.h>
7999 + ], [iconv_open("fr", "to");],
8000 + AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
8003 + #ifdef HAVE_ICONV_H
8004 + # include <iconv.h>
8006 + ], [iconv_open("fr", "to");],
8007 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
8008 + AC_MSG_RESULT(no)))
8011 + AC_MSG_CHECKING(for nl_langinfo(CODESET))
8013 + #ifdef HAVE_LANGINFO_H
8014 + # include <langinfo.h>
8016 + ], [char *cs = nl_langinfo(CODESET);],
8017 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
8018 + AC_MSG_RESULT(no))
8020 + dnl Need various functions for floating point support. Only enable
8021 + dnl floating point when they are all present.
8022 + AC_CHECK_LIB(m, strtod)
8023 + AC_MSG_CHECKING([for strtod() and other floating point functions])
8025 + #ifdef HAVE_MATH_H
8026 + # include <math.h>
8029 + # include <stdlib.h>
8030 + # include <stddef.h>
8032 + ], [char *s; double d;
8033 + d = strtod("1.1", &s);
8038 + d = pow(1.11, 2.22);
8044 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
8045 + AC_MSG_RESULT(no))
8047 + dnl isinf() and isnan() need to include header files and may need -lm.
8048 + AC_MSG_CHECKING([for isinf()])
8050 + #ifdef HAVE_MATH_H
8051 + # include <math.h>
8054 + # include <stdlib.h>
8055 + # include <stddef.h>
8057 + ], [int r = isinf(1.11); ],
8058 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF),
8059 + AC_MSG_RESULT(no))
8061 + AC_MSG_CHECKING([for isnan()])
8063 + #ifdef HAVE_MATH_H
8064 + # include <math.h>
8067 + # include <stdlib.h>
8068 + # include <stddef.h>
8070 + ], [int r = isnan(1.11); ],
8071 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN),
8072 + AC_MSG_RESULT(no))
8074 + dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
8075 + dnl when -lacl works, also try to use -lattr (required for Debian).
8076 + dnl On Solaris, use the acl_get/set functions in libsec, if present.
8077 + AC_MSG_CHECKING(--disable-acl argument)
8078 + AC_ARG_ENABLE(acl,
8079 + [ --disable-acl Don't check for ACL support.],
8080 + , [enable_acl="yes"])
8081 + if test "$enable_acl" = "yes"; then
8083 + AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
8084 + AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
8085 + AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
8087 + AC_MSG_CHECKING(for POSIX ACL support)
8089 + #include <sys/types.h>
8090 + #ifdef HAVE_SYS_ACL_H
8091 + # include <sys/acl.h>
8093 + acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
8094 + acl_set_file("foo", ACL_TYPE_ACCESS, acl);
8096 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
8097 + AC_MSG_RESULT(no))
8099 + AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)],
8100 + AC_MSG_CHECKING(for Solaris ACL support)
8102 + #ifdef HAVE_SYS_ACL_H
8103 + # include <sys/acl.h>
8104 + #endif], [acl("foo", GETACLCNT, 0, NULL);
8106 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
8107 + AC_MSG_RESULT(no)))
8109 + AC_MSG_CHECKING(for AIX ACL support)
8112 + # include <stdlib.h>
8113 + # include <stddef.h>
8115 + #ifdef HAVE_SYS_ACL_H
8116 + # include <sys/acl.h>
8118 + #ifdef HAVE_SYS_ACCESS_H
8119 + # include <sys/access.h>
8121 + #define _ALL_SOURCE
8123 + #include <sys/stat.h>
8126 + struct acl *aclent;], [aclsize = sizeof(struct acl);
8127 + aclent = (void *)malloc(aclsize);
8128 + statacl("foo", STX_NORMAL, aclent, aclsize);
8130 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
8131 + AC_MSG_RESULT(no))
8133 + AC_MSG_RESULT(yes)
8136 + if test "x$GTK_CFLAGS" != "x"; then
8137 + dnl pango_shape_full() is new, fall back to pango_shape().
8138 + AC_MSG_CHECKING(for pango_shape_full)
8139 + ac_save_CFLAGS="$CFLAGS"
8140 + ac_save_LIBS="$LIBS"
8141 + CFLAGS="$CFLAGS $GTK_CFLAGS"
8142 + LIBS="$LIBS $GTK_LIBS"
8144 + [#include <gtk/gtk.h>],
8145 + [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ],
8146 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL),
8147 + AC_MSG_RESULT(no))
8148 + CFLAGS="$ac_save_CFLAGS"
8149 + LIBS="$ac_save_LIBS"
8152 + AC_MSG_CHECKING(--disable-gpm argument)
8153 + AC_ARG_ENABLE(gpm,
8154 + [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
8155 + [enable_gpm="yes"])
8157 + if test "$enable_gpm" = "yes"; then
8159 + dnl Checking if gpm support can be compiled
8160 + AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
8161 + [olibs="$LIBS" ; LIBS="-lgpm"]
8164 + #include <linux/keyboard.h>],
8165 + [Gpm_GetLibVersion(NULL);],
8166 + dnl Configure defines HAVE_GPM, if it is defined feature.h defines
8167 + dnl FEAT_MOUSE_GPM if mouse support is included
8168 + [vi_cv_have_gpm=yes],
8169 + [vi_cv_have_gpm=no])
8172 + if test $vi_cv_have_gpm = yes; then
8173 + LIBS="$LIBS -lgpm"
8174 + AC_DEFINE(HAVE_GPM)
8177 + AC_MSG_RESULT(yes)
8180 + AC_MSG_CHECKING(--disable-sysmouse argument)
8181 + AC_ARG_ENABLE(sysmouse,
8182 + [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], ,
8183 + [enable_sysmouse="yes"])
8185 + if test "$enable_sysmouse" = "yes"; then
8187 + dnl Checking if sysmouse support can be compiled
8188 + dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h
8189 + dnl defines FEAT_SYSMOUSE if mouse support is included
8190 + AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse,
8192 + [#include <sys/consio.h>
8193 + #include <signal.h>
8194 + #include <sys/fbio.h>],
8195 + [struct mouse_info mouse;
8196 + mouse.operation = MOUSE_MODE;
8197 + mouse.operation = MOUSE_SHOW;
8198 + mouse.u.mode.mode = 0;
8199 + mouse.u.mode.signal = SIGUSR2;],
8200 + [vi_cv_have_sysmouse=yes],
8201 + [vi_cv_have_sysmouse=no])
8203 + if test $vi_cv_have_sysmouse = yes; then
8204 + AC_DEFINE(HAVE_SYSMOUSE)
8207 + AC_MSG_RESULT(yes)
8210 + dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
8211 + AC_MSG_CHECKING(for FD_CLOEXEC)
8214 + # include <fcntl.h>
8216 + [ int flag = FD_CLOEXEC;],
8217 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
8218 + AC_MSG_RESULT(not usable))
8220 + dnl rename needs to be checked separately to work on Nextstep with cc
8221 + AC_MSG_CHECKING(for rename)
8222 + AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
8223 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
8224 + AC_MSG_RESULT(no))
8226 + dnl sysctl() may exist but not the arguments we use
8227 + AC_MSG_CHECKING(for sysctl)
8229 + [#include <sys/types.h>
8230 + #include <sys/sysctl.h>],
8235 + mib[1] = HW_USERMEM;
8237 + (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
8239 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
8240 + AC_MSG_RESULT(not usable))
8242 + dnl sysinfo() may exist but not be Linux compatible
8243 + AC_MSG_CHECKING(for sysinfo)
8245 + [#include <sys/types.h>
8246 + #include <sys/sysinfo.h>],
8247 + [ struct sysinfo sinfo;
8250 + (void)sysinfo(&sinfo);
8251 + t = sinfo.totalram;
8253 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
8254 + AC_MSG_RESULT(not usable))
8256 + dnl struct sysinfo may have the mem_unit field or not
8257 + AC_MSG_CHECKING(for sysinfo.mem_unit)
8259 + [#include <sys/types.h>
8260 + #include <sys/sysinfo.h>],
8261 + [ struct sysinfo sinfo;
8262 + sinfo.mem_unit = 1;
8264 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT),
8265 + AC_MSG_RESULT(no))
8267 + dnl sysconf() may exist but not support what we want to use
8268 + AC_MSG_CHECKING(for sysconf)
8270 + [#include <unistd.h>],
8271 + [ (void)sysconf(_SC_PAGESIZE);
8272 + (void)sysconf(_SC_PHYS_PAGES);
8274 + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
8275 + AC_MSG_RESULT(not usable))
8277 + AC_CHECK_SIZEOF([int])
8278 + AC_CHECK_SIZEOF([long])
8279 + AC_CHECK_SIZEOF([time_t])
8280 + AC_CHECK_SIZEOF([off_t])
8282 + dnl Use different names to avoid clashing with other header files.
8283 + AC_DEFINE_UNQUOTED(VIM_SIZEOF_INT, [$ac_cv_sizeof_int])
8284 + AC_DEFINE_UNQUOTED(VIM_SIZEOF_LONG, [$ac_cv_sizeof_long])
8286 + dnl Make sure that uint32_t is really 32 bits unsigned.
8287 + AC_MSG_CHECKING([uint32_t is 32 bits])
8289 + #ifdef HAVE_STDINT_H
8290 + # include <stdint.h>
8292 + #ifdef HAVE_INTTYPES_H
8293 + # include <inttypes.h>
8296 + uint32_t nr1 = (uint32_t)-1;
8297 + uint32_t nr2 = (uint32_t)0xffffffffUL;
8298 + if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1);
8301 + AC_MSG_RESULT(ok),
8302 + AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]),
8303 + AC_MSG_WARN([cannot check uint32_t when cross-compiling.]))
8305 + dnl Check for memmove() before bcopy(), makes memmove() be used when both are
8306 + dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
8308 + [bcopy_test_prog='
8309 + #include "confdefs.h"
8310 + #ifdef HAVE_STRING_H
8311 + # include <string.h>
8314 + # include <stdlib.h>
8315 + # include <stddef.h>
8319 + strcpy(buf, "abcdefghi");
8320 + mch_memmove(buf, buf + 2, 3);
8321 + if (strncmp(buf, "ababcf", 6))
8323 + strcpy(buf, "abcdefghi");
8324 + mch_memmove(buf + 2, buf, 3);
8325 + if (strncmp(buf, "cdedef", 6))
8327 + exit(0); /* libc version works properly. */
8330 + AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap],
8332 + AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]])],
8334 + vim_cv_memmove_handles_overlap=yes
8336 + vim_cv_memmove_handles_overlap=no
8338 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap')
8342 + if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then
8343 + AC_DEFINE(USEMEMMOVE)
8345 + AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap],
8347 + AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]])],
8349 + vim_cv_bcopy_handles_overlap=yes
8351 + vim_cv_bcopy_handles_overlap=no
8353 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap')
8357 + if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then
8358 + AC_DEFINE(USEBCOPY)
8360 + AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap],
8362 + AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]])],
8364 + vim_cv_memcpy_handles_overlap=yes
8366 + vim_cv_memcpy_handles_overlap=no
8368 + AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap')
8372 + if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then
8373 + AC_DEFINE(USEMEMCPY)
8379 + dnl Check for multibyte locale functions
8380 + dnl Find out if _Xsetlocale() is supported by libX11.
8381 + dnl Check if X_LOCALE should be defined.
8382 + if test "x$with_x" = "xyes"; then
8383 + cflags_save=$CFLAGS
8385 + LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
8386 + CFLAGS="$CFLAGS $X_CFLAGS"
8388 + AC_MSG_CHECKING(whether X_LOCALE needed)
8389 + AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
8390 + AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
8391 + AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
8392 + AC_MSG_RESULT(no))
8394 + AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used)
8395 + AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes)
8396 + AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no))
8398 + CFLAGS=$cflags_save
8402 + dnl Link with xpg4, it is said to make Korean locale working
8403 + AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
8405 + dnl Check how we can run ctags. Default to "ctags" when nothing works.
8406 + dnl Use --version to detect Exuberant ctags (preferred)
8407 + dnl Add --fields=+S to get function signatures for omni completion.
8408 + dnl -t for typedefs (many ctags have this)
8409 + dnl -s for static functions (Elvis ctags only?)
8410 + dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
8411 + dnl -i+m to test for older Exuberant ctags
8412 + AC_MSG_CHECKING(how to create tags)
8413 + test -f tags && mv tags tags.save
8414 + if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
8415 + TAGPRG="ctags -I INIT+ --fields=+S"
8416 + elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
8417 + TAGPRG="exctags -I INIT+ --fields=+S"
8418 + elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
8419 + TAGPRG="exuberant-ctags -I INIT+ --fields=+S"
8422 + (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
8423 + (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
8424 + (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
8425 + (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
8426 + (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
8427 + (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
8428 + (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
8430 + test -f tags.save && mv tags.save tags
8431 + AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
8433 + dnl Check how we can run man with a section number
8434 + AC_MSG_CHECKING(how to run man with a section nr)
8436 + (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
8437 + AC_MSG_RESULT($MANDEF)
8438 + if test "$MANDEF" = "man -s"; then
8439 + AC_DEFINE(USEMAN_S)
8442 + dnl Check if gettext() is working and if it needs -lintl
8443 + dnl We take care to base this on an empty LIBS: on some systems libelf would be
8444 + dnl in LIBS and implicitly take along libintl. The final LIBS would then not
8445 + dnl contain libintl, and the link step would fail due to -Wl,--as-needed.
8446 + AC_MSG_CHECKING(--disable-nls argument)
8447 + AC_ARG_ENABLE(nls,
8448 + [ --disable-nls Don't support NLS (gettext()).], ,
8449 + [enable_nls="yes"])
8451 + if test "$enable_nls" = "yes"; then
8454 + INSTALL_LANGS=install-languages
8455 + AC_SUBST(INSTALL_LANGS)
8456 + INSTALL_TOOL_LANGS=install-tool-languages
8457 + AC_SUBST(INSTALL_TOOL_LANGS)
8459 + AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
8460 + AC_MSG_CHECKING([for NLS])
8461 + if test -f po/Makefile; then
8463 + if test -n "$MSGFMT"; then
8467 + [#include <libintl.h>],
8468 + [gettext("Test");],
8469 + AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs,
8472 + [#include <libintl.h>],
8473 + [gettext("Test");],
8474 + AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes";
8475 + LIBS="$olibs -lintl",
8476 + AC_MSG_RESULT([gettext() doesn't work]);
8479 + AC_MSG_RESULT([msgfmt not found - disabled]);
8481 + if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
8482 + AC_DEFINE(HAVE_GETTEXT)
8485 + dnl this was added in GNU gettext 0.10.36
8486 + AC_CHECK_FUNCS(bind_textdomain_codeset)
8487 + dnl _nl_msg_cat_cntr is required for GNU gettext
8488 + AC_MSG_CHECKING([for _nl_msg_cat_cntr])
8490 + [#include <libintl.h>
8491 + extern int _nl_msg_cat_cntr;],
8492 + [++_nl_msg_cat_cntr;],
8493 + AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
8494 + AC_MSG_RESULT([no]))
8497 + AC_MSG_RESULT([no "po/Makefile" - disabled]);
8500 + AC_MSG_RESULT(yes)
8503 + dnl Check for dynamic linking loader
8504 + AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
8505 + if test x${DLL} = xdlfcn.h; then
8506 + AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
8507 + AC_MSG_CHECKING([for dlopen()])
8509 + extern void* dlopen();
8512 + AC_MSG_RESULT(yes);
8513 + AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
8514 + AC_MSG_RESULT(no);
8515 + AC_MSG_CHECKING([for dlopen() in -ldl])
8519 + extern void* dlopen();
8522 + AC_MSG_RESULT(yes);
8523 + AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
8524 + AC_MSG_RESULT(no);
8526 + dnl ReliantUNIX has dlopen() in libc but everything else in libdl
8528 + AC_MSG_CHECKING([for dlsym()])
8530 + extern void* dlsym();
8533 + AC_MSG_RESULT(yes);
8534 + AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
8535 + AC_MSG_RESULT(no);
8536 + AC_MSG_CHECKING([for dlsym() in -ldl])
8540 + extern void* dlsym();
8543 + AC_MSG_RESULT(yes);
8544 + AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
8545 + AC_MSG_RESULT(no);
8547 + elif test x${DLL} = xdl.h; then
8548 + AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
8549 + AC_MSG_CHECKING([for shl_load()])
8551 + extern void* shl_load();
8554 + AC_MSG_RESULT(yes);
8555 + AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
8556 + AC_MSG_RESULT(no);
8557 + AC_MSG_CHECKING([for shl_load() in -ldld])
8559 + LIBS="$LIBS -ldld"
8561 + extern void* shl_load();
8564 + AC_MSG_RESULT(yes);
8565 + AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
8566 + AC_MSG_RESULT(no);
8569 + AC_CHECK_HEADERS(setjmp.h)
8571 + if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
8572 + dnl -ldl must come after DynaLoader.a
8573 + if echo $LIBS | grep -e '-ldl' >/dev/null; then
8574 + LIBS=`echo $LIBS | sed s/-ldl//`
8575 + PERL_LIBS="$PERL_LIBS -ldl"
8579 + if test "x$MACOSX" = "xyes"; then
8580 + AC_MSG_CHECKING(whether we need -framework Cocoa)
8581 + dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is
8582 + dnl disabled during tiny build)
8583 + if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then
8584 + LIBS=$"$LIBS -framework Cocoa"
8585 + AC_MSG_RESULT(yes)
8589 + dnl As mentioned above, tiny build implies os_macosx.m isn't needed.
8590 + dnl Exclude it from OS_EXTRA_SRC so that linker won't complain about
8591 + dnl missing Objective-C symbols.
8592 + if test "x$features" = "xtiny"; then
8593 + OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
8594 + OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
8597 + if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then
8598 + LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
8601 + dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
8602 + dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
8603 + dnl But only when making dependencies, cproto and lint don't take "-isystem".
8604 + dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
8605 + dnl the number before the version number.
8606 + DEPEND_CFLAGS_FILTER=
8607 + if test "$GCC" = yes; then
8608 + AC_MSG_CHECKING(for GCC 3 or later)
8609 + gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
8610 + if test "$gccmajor" -gt "2"; then
8611 + DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
8612 + AC_MSG_RESULT(yes)
8616 + dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
8617 + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
8618 + dnl Also remove duplicate _FORTIFY_SOURCE arguments.
8619 + dnl And undefine it first to avoid a warning.
8620 + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
8621 + if test "$gccmajor" -gt "3"; then
8622 + CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
8623 + AC_MSG_RESULT(yes)
8628 + AC_SUBST(DEPEND_CFLAGS_FILTER)
8630 + dnl link.sh tries to avoid overlinking in a hackish way.
8631 + dnl At least GNU ld supports --as-needed which provides the same functionality
8632 + dnl at linker level. Let's use it.
8633 + AC_MSG_CHECKING(linker --as-needed support)
8635 + # Check if linker supports --as-needed and --no-as-needed options
8636 + if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then
8637 + LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'`
8638 + LINK_AS_NEEDED=yes
8640 + if test "$LINK_AS_NEEDED" = yes; then
8641 + AC_MSG_RESULT(yes)
8645 + AC_SUBST(LINK_AS_NEEDED)
8647 + # IBM z/OS reset CFLAGS for config.mk
8648 + if test "$zOSUnix" = "yes"; then
8649 + CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
8652 + dnl write output files
8653 + AC_OUTPUT(auto/config.mk:config.mk.in)
8655 + dnl vim: set sw=2 tw=78 fo+=l:
8656 *** ../vim-8.0.0081/Filelist 2016-08-28 20:13:39.000000000 +0200
8657 --- Filelist 2016-11-12 20:12:35.618728568 +0100
8660 src/config.mk.dist \
8663 ! src/configure.in \
8668 src/config.mk.dist \
8671 ! src/configure.ac \
8675 *** ../vim-8.0.0081/src/Makefile 2016-11-10 20:01:41.201582868 +0100
8676 --- src/Makefile 2016-11-12 20:11:51.591020603 +0100
8679 #####################################################
8681 ### Uncomment things here only if the values chosen by configure are wrong.
8682 ! ### It's better to adjust configure.in and "make autoconf", if you can!
8683 ! ### Then send the required changes to configure.in to the bugs list.
8685 ### (1) BSD/OS 2.0.1, 2.1 or 3.0 using shared libraries
8688 #####################################################
8690 ### Uncomment things here only if the values chosen by configure are wrong.
8691 ! ### It's better to adjust configure.ac and "make autoconf", if you can!
8692 ! ### Then send the required changes to configure.ac to the bugs list.
8694 ### (1) BSD/OS 2.0.1, 2.1 or 3.0 using shared libraries
8698 # - DO NOT RUN autoconf MANUALLY! It will overwrite ./configure instead of
8699 # producing auto/configure.
8700 # - autoconf is not run automatically, because a patch usually changes both
8701 ! # configure.in and auto/configure but can't update the timestamps. People
8702 # who do not have (the correct version of) autoconf would run into trouble.
8704 # Two tricks are required to make autoconf put its output in the "auto" dir:
8706 # - DO NOT RUN autoconf MANUALLY! It will overwrite ./configure instead of
8707 # producing auto/configure.
8708 # - autoconf is not run automatically, because a patch usually changes both
8709 ! # configure.ac and auto/configure but can't update the timestamps. People
8710 # who do not have (the correct version of) autoconf would run into trouble.
8712 # Two tricks are required to make autoconf put its output in the "auto" dir:
8713 *** ../vim-8.0.0081/src/blowfish.c 2016-11-10 20:01:41.181582995 +0100
8714 --- src/blowfish.c 2016-11-12 20:08:09.272496358 +0100
8717 /* MS-Windows is always little endian */
8719 # ifdef HAVE_CONFIG_H
8720 ! /* in configure.in AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed */
8723 Please change this code to define WORDS_BIGENDIAN for big-endian machines.
8725 /* MS-Windows is always little endian */
8727 # ifdef HAVE_CONFIG_H
8728 ! /* in configure.ac AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed */
8731 Please change this code to define WORDS_BIGENDIAN for big-endian machines.
8732 *** ../vim-8.0.0081/src/channel.c 2016-11-11 21:13:56.836753930 +0100
8733 --- src/channel.c 2016-11-12 20:08:27.040378345 +0100
8736 # define CH_HAS_GUI (gui.in_use || gui.starting)
8739 ! /* Note: when making changes here also adjust configure.in. */
8741 /* WinSock API is separated from C API, thus we can't use read(), write(),
8744 # define CH_HAS_GUI (gui.in_use || gui.starting)
8747 ! /* Note: when making changes here also adjust configure.ac. */
8749 /* WinSock API is separated from C API, thus we can't use read(), write(),
8751 *** ../vim-8.0.0081/src/config.h.in 2016-10-18 16:27:20.540756047 +0200
8752 --- src/config.h.in 2016-11-12 20:09:15.712055133 +0100
8756 ! * config.h.in. Generated automatically from configure.in by autoheader, and
8757 ! * manually changed after that.
8760 /* Define if we have EBCDIC code */
8763 ! * config.h.in. Originally generated automatically from configure.ac by
8764 ! * autoheader and manually changed after that.
8767 /* Define if we have EBCDIC code */
8768 *** ../vim-8.0.0081/src/main.aap 2016-09-25 21:44:59.441600148 +0200
8769 --- src/main.aap 2016-11-12 20:10:45.471459311 +0100
8775 ! # Run autoconf when configure.in has been changed since it was last run.
8776 # This is skipped when the signatures in "mysign" are up-to-date. When
8777 # there is no autoconf program skip this (the signature is often the only
8778 # thing that's outdated)
8779 ! auto/configure {signfile = mysign} : configure.in
8780 @if not program_path("autoconf"):
8781 :print Can't find autoconf, using existing configure script.
8787 ! # Run autoconf when configure.ac has been changed since it was last run.
8788 # This is skipped when the signatures in "mysign" are up-to-date. When
8789 # there is no autoconf program skip this (the signature is often the only
8790 # thing that's outdated)
8791 ! auto/configure {signfile = mysign} : configure.ac
8792 @if not program_path("autoconf"):
8793 :print Can't find autoconf, using existing configure script.
8795 *** ../vim-8.0.0081/src/os_unix.c 2016-11-07 22:42:48.828350757 +0100
8796 --- src/os_unix.c 2016-11-12 20:11:05.415326964 +0100
8799 * that describe the signals. That is nearly what we want here. But
8800 * autoconf does only check for sys_siglist (without the underscore), I
8801 * do not want to change everything today.... jw.
8802 ! * This is why AC_DECL_SYS_SIGLIST is commented out in configure.in
8807 * that describe the signals. That is nearly what we want here. But
8808 * autoconf does only check for sys_siglist (without the underscore), I
8809 * do not want to change everything today.... jw.
8810 ! * This is why AC_DECL_SYS_SIGLIST is commented out in configure.ac.
8814 *** ../vim-8.0.0081/src/INSTALL 2016-04-12 22:44:00.000000000 +0200
8815 --- src/INSTALL 2016-11-12 20:11:25.459193970 +0100
8818 be considered for the next release. If at some point `config.cache'
8819 contains results you don't want to keep, you may remove or edit it.
8821 ! The file `configure.in' is used to create `configure' by a program
8822 ! called `autoconf'. You only need `configure.in' if you want to change
8823 it or regenerate `configure' using a newer version of `autoconf'.
8825 The simplest way to compile this package is:
8827 be considered for the next release. If at some point `config.cache'
8828 contains results you don't want to keep, you may remove or edit it.
8830 ! The file `configure.ac' is used to create `configure' by a program
8831 ! called `autoconf'. You only need `configure.ac' if you want to change
8832 it or regenerate `configure' using a newer version of `autoconf'.
8834 The simplest way to compile this package is:
8835 *** ../vim-8.0.0081/src/mysign 2010-05-15 13:04:12.000000000 +0200
8836 --- src/mysign 2016-11-12 21:01:30.478617518 +0100
8839 ! =auto/configure
\e-lastupdate=1178970549.78
\e-@buildcheck=dfc15c059b7ce88a951584995c49a201
\e=configure.in@md5=e0d6e9a7d7b986d63ce4e8e7362fd0b9
\e
8841 ! =auto/configure
\e-lastupdate=1178970549.78
\e-@buildcheck=dfc15c059b7ce88a951584995c49a201
\e=configure.ac@md5=e0d6e9a7d7b986d63ce4e8e7362fd0b9
\e
8842 *** ../vim-8.0.0081/src/version.c 2016-11-12 19:16:42.216999886 +0100
8843 --- src/version.c 2016-11-12 20:06:39.673091660 +0100
8847 { /* Add new patch number below this line */
8853 hundred-and-one symptoms of being an internet addict:
8854 27. You refer to your age as 3.x.
8856 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
8857 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8858 \\\ an exciting new programming language -- http://www.Zimbu.org ///
8859 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///