Bram Moolenaar | 3f7d090 | 2016-11-12 21:13:42 +0100 | [diff] [blame] | 1 | dnl configure.ac: autoconf script for Vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | dnl Process this file with autoconf 2.12 or 2.13 to produce "configure". |
| 4 | dnl Should also work with autoconf 2.54 and later. |
| 5 | |
| 6 | AC_INIT(vim.h) |
| 7 | AC_CONFIG_HEADER(auto/config.h:config.h.in) |
| 8 | |
| 9 | dnl Being able to run configure means the system is Unix (compatible). |
| 10 | AC_DEFINE(UNIX) |
| 11 | AC_PROG_MAKE_SET |
| 12 | |
| 13 | dnl Checks for programs. |
Bram Moolenaar | 2264008 | 2018-04-19 20:39:41 +0200 | [diff] [blame] | 14 | AC_PROG_CC_C99 dnl required by almost everything |
Bram Moolenaar | c039441 | 2017-04-20 20:20:23 +0200 | [diff] [blame] | 15 | AC_PROG_CPP dnl required by header file checks |
| 16 | AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP |
| 17 | AC_PROG_FGREP dnl finds working grep -F |
| 18 | AC_ISC_POSIX dnl required by AC_C_CROSS |
| 19 | AC_PROG_AWK dnl required for "make html" in ../doc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 20 | |
| 21 | dnl Don't strip if we don't have it |
| 22 | AC_CHECK_PROG(STRIP, strip, strip, :) |
| 23 | |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 24 | dnl Check for extension of executables |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 25 | AC_EXEEXT |
| 26 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 27 | dnl Check for standard headers. We don't use this in Vim but other stuff |
| 28 | dnl in autoconf needs it, where it uses STDC_HEADERS. |
| 29 | AC_HEADER_STDC |
| 30 | AC_HEADER_SYS_WAIT |
| 31 | |
Bram Moolenaar | 561f8a5 | 2018-04-17 22:02:45 +0200 | [diff] [blame] | 32 | dnl Check that the C99 features that Vim uses are supported: |
Bram Moolenaar | 2264008 | 2018-04-19 20:39:41 +0200 | [diff] [blame] | 33 | if test x"$ac_cv_prog_cc_c99" != xno; then |
| 34 | dnl If the compiler doesn't explicitly support C99, then check |
| 35 | dnl for the specific features Vim uses |
| 36 | |
| 37 | AC_TYPE_LONG_LONG_INT |
| 38 | if test "$ac_cv_type_long_long_int" = no; then |
| 39 | AC_MSG_FAILURE([Compiler does not support long long int]) |
| 40 | fi |
| 41 | |
| 42 | AC_MSG_CHECKING([if the compiler supports trailing commas]) |
| 43 | trailing_commas=no |
| 44 | AC_TRY_COMPILE([], [ |
| 45 | enum { |
| 46 | one, |
| 47 | };], |
| 48 | [AC_MSG_RESULT(yes); trailing_commas=yes], |
| 49 | [AC_MSG_RESULT(no)]) |
| 50 | if test "$trailing_commas" = no; then |
| 51 | AC_MSG_FAILURE([Compiler does not support trailing comma in enum]) |
| 52 | fi |
| 53 | |
| 54 | AC_MSG_CHECKING([if the compiler supports C++ comments]) |
| 55 | slash_comments=no |
| 56 | AC_TRY_COMPILE([], |
| 57 | [// C++ comments?], |
| 58 | [AC_MSG_RESULT(yes); slash_comments=yes], |
| 59 | [AC_MSG_RESULT(no)]) |
| 60 | if test "$slash_comments" = no; then |
| 61 | AC_MSG_FAILURE([Compiler does not support C++ comments]) |
| 62 | fi |
| 63 | fi |
Bram Moolenaar | 561f8a5 | 2018-04-17 22:02:45 +0200 | [diff] [blame] | 64 | |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 65 | dnl Check for the flag that fails if stuff are missing. |
| 66 | |
| 67 | AC_MSG_CHECKING(--enable-fail-if-missing argument) |
| 68 | AC_ARG_ENABLE(fail_if_missing, |
| 69 | [ --enable-fail-if-missing Fail if dependencies on additional features |
| 70 | specified on the command line are missing.], |
| 71 | [fail_if_missing="yes"], |
| 72 | [fail_if_missing="no"]) |
| 73 | AC_MSG_RESULT($fail_if_missing) |
| 74 | |
Bram Moolenaar | d2a0549 | 2018-07-27 22:35:15 +0200 | [diff] [blame] | 75 | dnl Keep original value to check later. |
| 76 | with_x_arg="$with_x" |
| 77 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 78 | dnl Set default value for CFLAGS if none is defined or it's empty |
| 79 | if test -z "$CFLAGS"; then |
| 80 | CFLAGS="-O" |
| 81 | test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" |
| 82 | fi |
| 83 | if test "$GCC" = yes; then |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 84 | dnl method that should work for nearly all versions |
Bram Moolenaar | c8836f7 | 2014-04-12 13:12:24 +0200 | [diff] [blame] | 85 | gccversion=`$CC -dumpversion` |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 86 | if test "x$gccversion" = "x"; then |
| 87 | dnl old method; fall-back for when -dumpversion doesn't work |
Bram Moolenaar | c8836f7 | 2014-04-12 13:12:24 +0200 | [diff] [blame] | 88 | gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 89 | fi |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 90 | dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki |
| 91 | if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 92 | echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 93 | CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'` |
| 94 | else |
| 95 | if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then |
| 96 | echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"' |
| 97 | CFLAGS="$CFLAGS -fno-strength-reduce" |
| 98 | fi |
| 99 | fi |
| 100 | fi |
| 101 | |
Bram Moolenaar | 0c6ccfd | 2013-10-02 18:23:07 +0200 | [diff] [blame] | 102 | dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a |
| 103 | dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on |
| 104 | dnl the version number of the clang in use. |
| 105 | dnl Note that this does not work to get the version of clang 3.1 or 3.2. |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 106 | AC_MSG_CHECKING(for clang version) |
| 107 | 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]][[0-9]]*\).*$/\1/p'` |
Bram Moolenaar | 0c6ccfd | 2013-10-02 18:23:07 +0200 | [diff] [blame] | 108 | if test x"$CLANG_VERSION_STRING" != x"" ; then |
| 109 | CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'` |
| 110 | CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'` |
| 111 | CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'` |
| 112 | CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION` |
| 113 | AC_MSG_RESULT($CLANG_VERSION) |
| 114 | dnl If you find the same issue with versions earlier than 500.2.75, |
| 115 | dnl change the constant 500002075 below appropriately. To get the |
| 116 | dnl integer corresponding to a version number, refer to the |
| 117 | dnl definition of CLANG_VERSION above. |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 118 | AC_MSG_CHECKING(if clang supports -fno-strength-reduce) |
Bram Moolenaar | 0c6ccfd | 2013-10-02 18:23:07 +0200 | [diff] [blame] | 119 | if test "$CLANG_VERSION" -ge 500002075 ; then |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 120 | AC_MSG_RESULT(no) |
| 121 | CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'` |
| 122 | else |
| 123 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 0c6ccfd | 2013-10-02 18:23:07 +0200 | [diff] [blame] | 124 | fi |
| 125 | else |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 126 | AC_MSG_RESULT(N/A) |
Bram Moolenaar | 0c6ccfd | 2013-10-02 18:23:07 +0200 | [diff] [blame] | 127 | fi |
| 128 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 129 | dnl If configure thinks we are cross compiling, there might be something |
| 130 | dnl wrong with the CC or CFLAGS settings, give a useful warning message |
Bram Moolenaar | 839e954 | 2016-04-14 16:46:02 +0200 | [diff] [blame] | 131 | CROSS_COMPILING= |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 132 | if test "$cross_compiling" = yes; then |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 133 | AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS]) |
Bram Moolenaar | 839e954 | 2016-04-14 16:46:02 +0200 | [diff] [blame] | 134 | CROSS_COMPILING=1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 135 | fi |
Bram Moolenaar | 839e954 | 2016-04-14 16:46:02 +0200 | [diff] [blame] | 136 | AC_SUBST(CROSS_COMPILING) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 137 | |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 138 | dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies. |
| 139 | dnl But gcc 3.1 changed the meaning! See near the end. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 140 | test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM) |
| 141 | |
| 142 | if test -f ./toolcheck; then |
| 143 | AC_CHECKING(for buggy tools) |
| 144 | sh ./toolcheck 1>&AC_FD_MSG |
| 145 | fi |
| 146 | |
| 147 | OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" |
| 148 | |
| 149 | dnl Check for BeOS, which needs an extra source file |
| 150 | AC_MSG_CHECKING(for BeOS) |
| 151 | case `uname` in |
| 152 | BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o |
| 153 | BEOS=yes; AC_MSG_RESULT(yes);; |
| 154 | *) BEOS=no; AC_MSG_RESULT(no);; |
| 155 | esac |
| 156 | |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 157 | AC_MSG_CHECKING(for Haiku) |
| 158 | case `uname` in |
| 159 | Haiku) HAIKU=yes; AC_MSG_RESULT(yes);; |
| 160 | *) HAIKU=no; AC_MSG_RESULT(no);; |
| 161 | esac |
| 162 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 163 | dnl If QNX is found, assume we don't want to use Xphoton |
| 164 | dnl unless it was specifically asked for (--with-x) |
| 165 | AC_MSG_CHECKING(for QNX) |
| 166 | case `uname` in |
| 167 | QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o |
| 168 | test -z "$with_x" && with_x=no |
| 169 | QNX=yes; AC_MSG_RESULT(yes);; |
| 170 | *) QNX=no; AC_MSG_RESULT(no);; |
| 171 | esac |
| 172 | |
| 173 | dnl Check for Darwin and MacOS X |
| 174 | dnl We do a check for MacOS X in the very beginning because there |
| 175 | dnl are a lot of other things we need to change besides GUI stuff |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 176 | AC_MSG_CHECKING([for Darwin (Mac OS X)]) |
| 177 | if test "`(uname) 2>/dev/null`" = Darwin; then |
| 178 | AC_MSG_RESULT(yes) |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 179 | MACOS_X=yes |
Bram Moolenaar | 52ecaaa | 2018-05-12 21:38:13 +0200 | [diff] [blame] | 180 | CPPFLAGS="$CPPFLAGS -DMACOS_X" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 181 | |
| 182 | AC_MSG_CHECKING(--disable-darwin argument) |
| 183 | AC_ARG_ENABLE(darwin, |
| 184 | [ --disable-darwin Disable Darwin (Mac OS X) support.], |
| 185 | , [enable_darwin="yes"]) |
| 186 | if test "$enable_darwin" = "yes"; then |
| 187 | AC_MSG_RESULT(no) |
| 188 | AC_MSG_CHECKING(if Darwin files are there) |
Bram Moolenaar | 164fca3 | 2010-07-14 13:58:07 +0200 | [diff] [blame] | 189 | if test -f os_macosx.m; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 190 | AC_MSG_RESULT(yes) |
| 191 | else |
| 192 | AC_MSG_RESULT([no, Darwin support disabled]) |
| 193 | enable_darwin=no |
| 194 | fi |
| 195 | else |
| 196 | AC_MSG_RESULT([yes, Darwin support excluded]) |
| 197 | fi |
| 198 | |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 199 | AC_MSG_CHECKING(--with-mac-arch argument) |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 200 | AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 201 | MACARCH="$withval"; AC_MSG_RESULT($MACARCH), |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 202 | MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 203 | |
Bram Moolenaar | 595a7be | 2010-03-10 16:28:12 +0100 | [diff] [blame] | 204 | AC_MSG_CHECKING(--with-developer-dir argument) |
| 205 | AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], |
| 206 | DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), |
Bram Moolenaar | 32d03b3 | 2015-11-19 13:46:48 +0100 | [diff] [blame] | 207 | AC_MSG_RESULT(not present)) |
Bram Moolenaar | 595a7be | 2010-03-10 16:28:12 +0100 | [diff] [blame] | 208 | |
| 209 | if test "x$DEVELOPER_DIR" = "x"; then |
| 210 | AC_PATH_PROG(XCODE_SELECT, xcode-select) |
| 211 | if test "x$XCODE_SELECT" != "x"; then |
| 212 | AC_MSG_CHECKING(for developer dir using xcode-select) |
| 213 | DEVELOPER_DIR=`$XCODE_SELECT -print-path` |
| 214 | AC_MSG_RESULT([$DEVELOPER_DIR]) |
| 215 | else |
| 216 | DEVELOPER_DIR=/Developer |
| 217 | fi |
| 218 | fi |
| 219 | |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 220 | if test "x$MACARCH" = "xboth"; then |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 221 | AC_MSG_CHECKING(for 10.4 universal SDK) |
| 222 | dnl There is a terrible inconsistency (but we appear to get away with it): |
| 223 | dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS |
| 224 | dnl doesn't, because "gcc -E" doesn't grok it. That means the configure |
| 225 | dnl tests using the preprocessor are actually done with the wrong header |
| 226 | dnl files. $LDFLAGS is set at the end, because configure uses it together |
| 227 | dnl with $CFLAGS and we can only have one -sysroot argument. |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 228 | save_cppflags="$CPPFLAGS" |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 229 | save_cflags="$CFLAGS" |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 230 | save_ldflags="$LDFLAGS" |
Bram Moolenaar | 595a7be | 2010-03-10 16:28:12 +0100 | [diff] [blame] | 231 | CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 232 | AC_TRY_LINK([ ], [ ], |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 233 | AC_MSG_RESULT(found, will make universal binary), |
| 234 | |
| 235 | AC_MSG_RESULT(not found) |
Bram Moolenaar | 1f35bf9 | 2006-03-07 22:38:47 +0000 | [diff] [blame] | 236 | CFLAGS="$save_cflags" |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 237 | AC_MSG_CHECKING(if Intel architecture is supported) |
| 238 | CPPFLAGS="$CPPFLAGS -arch i386" |
| 239 | LDFLAGS="$save_ldflags -arch i386" |
| 240 | AC_TRY_LINK([ ], [ ], |
| 241 | AC_MSG_RESULT(yes); MACARCH="intel", |
| 242 | AC_MSG_RESULT(no, using PowerPC) |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 243 | MACARCH="ppc" |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 244 | CPPFLAGS="$save_cppflags -arch ppc" |
| 245 | LDFLAGS="$save_ldflags -arch ppc")) |
| 246 | elif test "x$MACARCH" = "xintel"; then |
| 247 | CPPFLAGS="$CPPFLAGS -arch intel" |
| 248 | LDFLAGS="$LDFLAGS -arch intel" |
Bram Moolenaar | e2f98b9 | 2006-03-29 21:18:24 +0000 | [diff] [blame] | 249 | elif test "x$MACARCH" = "xppc"; then |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 250 | CPPFLAGS="$CPPFLAGS -arch ppc" |
| 251 | LDFLAGS="$LDFLAGS -arch ppc" |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 252 | fi |
| 253 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 254 | if test "$enable_darwin" = "yes"; then |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 255 | MACOS_X_DARWIN=yes |
Bram Moolenaar | 164fca3 | 2010-07-14 13:58:07 +0200 | [diff] [blame] | 256 | OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; |
Bram Moolenaar | ab79bcb | 2004-07-18 21:34:53 +0000 | [diff] [blame] | 257 | OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" |
Bram Moolenaar | 32466aa | 2006-02-24 23:53:04 +0000 | [diff] [blame] | 258 | dnl TODO: use -arch i386 on Intel machines |
Bram Moolenaar | 0958e0f | 2013-11-04 04:57:50 +0100 | [diff] [blame] | 259 | dnl Removed -no-cpp-precomp, only for very old compilers. |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 260 | CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 261 | |
| 262 | dnl If Carbon is found, assume we don't want X11 |
| 263 | dnl unless it was specifically asked for (--with-x) |
Bram Moolenaar | ab79bcb | 2004-07-18 21:34:53 +0000 | [diff] [blame] | 264 | dnl or Motif, Athena or GTK GUI is used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 265 | AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) |
| 266 | if test "x$CARBON" = "xyes"; then |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 267 | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 268 | with_x=no |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 269 | fi |
| 270 | fi |
| 271 | fi |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 272 | |
Bram Moolenaar | db552d60 | 2006-03-23 22:59:57 +0000 | [diff] [blame] | 273 | dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 274 | dnl free. This happens in expand_filename(), because the optimizer swaps |
Bram Moolenaar | db552d60 | 2006-03-23 22:59:57 +0000 | [diff] [blame] | 275 | dnl two blocks of code, both using "repl", that can't be swapped. |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 276 | if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then |
| 277 | CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` |
| 278 | fi |
| 279 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 280 | else |
| 281 | AC_MSG_RESULT(no) |
| 282 | fi |
| 283 | |
Bram Moolenaar | 39766a7 | 2013-11-03 00:41:00 +0100 | [diff] [blame] | 284 | dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon |
| 285 | dnl so we need to include it to have access to version macros. |
Bram Moolenaar | 18e5469 | 2013-11-03 20:26:31 +0100 | [diff] [blame] | 286 | AC_CHECK_HEADERS(AvailabilityMacros.h) |
Bram Moolenaar | 39766a7 | 2013-11-03 00:41:00 +0100 | [diff] [blame] | 287 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 288 | AC_SUBST(OS_EXTRA_SRC) |
| 289 | AC_SUBST(OS_EXTRA_OBJ) |
| 290 | |
| 291 | dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS. |
| 292 | dnl Only when the directory exists and it wasn't there yet. |
| 293 | dnl For gcc don't do this when it is already in the default search path. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 294 | dnl Skip all of this when cross-compiling. |
| 295 | if test "$cross_compiling" = no; then |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 296 | AC_MSG_CHECKING(--with-local-dir argument) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 297 | have_local_include='' |
| 298 | have_local_lib='' |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 299 | AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries. |
| 300 | --without-local-dir do not search /usr/local for local libraries.], [ |
| 301 | local_dir="$withval" |
| 302 | case "$withval" in |
| 303 | */*) ;; |
| 304 | no) |
| 305 | # avoid adding local dir to LDFLAGS and CPPFLAGS |
Bram Moolenaar | e06c188 | 2010-07-21 22:05:20 +0200 | [diff] [blame] | 306 | have_local_include=yes |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 307 | have_local_lib=yes |
| 308 | ;; |
| 309 | *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;; |
| 310 | esac |
| 311 | AC_MSG_RESULT($local_dir) |
| 312 | ], [ |
| 313 | local_dir=/usr/local |
| 314 | AC_MSG_RESULT(Defaulting to $local_dir) |
| 315 | ]) |
| 316 | if test "$GCC" = yes -a "$local_dir" != no; then |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 317 | echo 'void f(){}' > conftest.c |
Bram Moolenaar | 0958e0f | 2013-11-04 04:57:50 +0100 | [diff] [blame] | 318 | dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler) |
| 319 | have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"` |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 320 | have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 321 | rm -f conftest.c conftest.o |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 322 | fi |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 323 | if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then |
| 324 | tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"` |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 325 | if test "$tt" = "$LDFLAGS"; then |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 326 | LDFLAGS="$LDFLAGS -L${local_dir}/lib" |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 327 | fi |
| 328 | fi |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 329 | if test -z "$have_local_include" -a -d "${local_dir}/include"; then |
| 330 | tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"` |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 331 | if test "$tt" = "$CPPFLAGS"; then |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 332 | CPPFLAGS="$CPPFLAGS -I${local_dir}/include" |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 333 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 334 | fi |
| 335 | fi |
| 336 | |
| 337 | AC_MSG_CHECKING(--with-vim-name argument) |
| 338 | AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable], |
| 339 | VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME), |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 340 | VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME)) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 341 | AC_SUBST(VIMNAME) |
| 342 | AC_MSG_CHECKING(--with-ex-name argument) |
| 343 | AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable], |
| 344 | EXNAME="$withval"; AC_MSG_RESULT($EXNAME), |
| 345 | EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex)) |
| 346 | AC_SUBST(EXNAME) |
| 347 | AC_MSG_CHECKING(--with-view-name argument) |
| 348 | AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable], |
| 349 | VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME), |
| 350 | VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view)) |
| 351 | AC_SUBST(VIEWNAME) |
| 352 | |
| 353 | AC_MSG_CHECKING(--with-global-runtime argument) |
Bram Moolenaar | 9d302ad | 2018-12-21 11:48:51 +0100 | [diff] [blame] | 354 | AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories], |
| 355 | RUNTIME_GLOBAL="$withval"; AC_MSG_RESULT($withval), |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 356 | AC_MSG_RESULT(no)) |
| 357 | |
Bram Moolenaar | 9d302ad | 2018-12-21 11:48:51 +0100 | [diff] [blame] | 358 | if test "X$RUNTIME_GLOBAL" != "X"; then |
| 359 | RUNTIME_GLOBAL_AFTER=$(printf -- "$RUNTIME_GLOBAL\\n" | $AWK -F, 'BEGIN { comma=0 } { for (i = NF; i > 0; i--) { if (comma) { printf ",%s/after", $i } else { printf "%s/after", $i; comma=1 } } } END { printf "\n" }') |
| 360 | AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$RUNTIME_GLOBAL") |
| 361 | AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL_AFTER, "$RUNTIME_GLOBAL_AFTER") |
| 362 | fi |
| 363 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 364 | AC_MSG_CHECKING(--with-modified-by argument) |
| 365 | AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version], |
| 366 | AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"), |
| 367 | AC_MSG_RESULT(no)) |
| 368 | |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 369 | dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 370 | AC_MSG_CHECKING(if character set is EBCDIC) |
| 371 | AC_TRY_COMPILE([ ], |
| 372 | [ /* TryCompile function for CharSet. |
| 373 | Treat any failure as ASCII for compatibility with existing art. |
| 374 | Use compile-time rather than run-time tests for cross-compiler |
| 375 | tolerance. */ |
| 376 | #if '0'!=240 |
| 377 | make an error "Character set is not EBCDIC" |
| 378 | #endif ], |
| 379 | [ # TryCompile action if true |
| 380 | cf_cv_ebcdic=yes ], |
| 381 | [ # TryCompile action if false |
| 382 | cf_cv_ebcdic=no]) |
| 383 | # end of TryCompile ]) |
| 384 | # end of CacheVal CvEbcdic |
| 385 | AC_MSG_RESULT($cf_cv_ebcdic) |
| 386 | case "$cf_cv_ebcdic" in #(vi |
| 387 | yes) AC_DEFINE(EBCDIC) |
| 388 | line_break='"\\n"' |
| 389 | ;; |
| 390 | *) line_break='"\\012"';; |
| 391 | esac |
| 392 | AC_SUBST(line_break) |
| 393 | |
| 394 | if test "$cf_cv_ebcdic" = "yes"; then |
Bram Moolenaar | 84a05ac | 2013-05-06 04:24:17 +0200 | [diff] [blame] | 395 | dnl If we have EBCDIC we most likely have z/OS Unix, let's test it! |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 396 | AC_MSG_CHECKING(for z/OS Unix) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 397 | case `uname` in |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 398 | OS/390) zOSUnix="yes"; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 399 | dnl If using cc the environment variable _CC_CCMODE must be |
| 400 | dnl set to "1", so that some compiler extensions are enabled. |
| 401 | dnl If using c89 the environment variable is named _CC_C89MODE. |
| 402 | dnl Note: compile with c89 never tested. |
| 403 | if test "$CC" = "cc"; then |
| 404 | ccm="$_CC_CCMODE" |
| 405 | ccn="CC" |
| 406 | else |
| 407 | if test "$CC" = "c89"; then |
| 408 | ccm="$_CC_C89MODE" |
| 409 | ccn="C89" |
| 410 | else |
| 411 | ccm=1 |
| 412 | fi |
| 413 | fi |
| 414 | if test "$ccm" != "1"; then |
| 415 | echo "" |
| 416 | echo "------------------------------------------" |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 417 | echo " On z/OS Unix, the environment variable" |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 418 | echo " _CC_${ccn}MODE must be set to \"1\"!" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 419 | echo " Do:" |
| 420 | echo " export _CC_${ccn}MODE=1" |
| 421 | echo " and then call configure again." |
| 422 | echo "------------------------------------------" |
| 423 | exit 1 |
| 424 | fi |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 425 | # Set CFLAGS for configure process. |
| 426 | # This will be reset later for config.mk. |
| 427 | # Use haltonmsg to force error for missing H files. |
| 428 | CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; |
| 429 | LDFLAGS="$LDFLAGS -Wl,EDIT=NO" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 430 | AC_MSG_RESULT(yes) |
| 431 | ;; |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 432 | *) zOSUnix="no"; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 433 | AC_MSG_RESULT(no) |
| 434 | ;; |
| 435 | esac |
| 436 | fi |
| 437 | |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 438 | dnl Set QUOTESED. Needs additional backslashes on zOS |
| 439 | if test "$zOSUnix" = "yes"; then |
| 440 | QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" |
| 441 | else |
| 442 | QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" |
| 443 | fi |
| 444 | AC_SUBST(QUOTESED) |
| 445 | |
| 446 | |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 447 | dnl Link with -lsmack for Smack stuff; if not found |
| 448 | AC_MSG_CHECKING(--disable-smack argument) |
| 449 | AC_ARG_ENABLE(smack, |
| 450 | [ --disable-smack Do not check for Smack support.], |
| 451 | , enable_smack="yes") |
| 452 | if test "$enable_smack" = "yes"; then |
Bram Moolenaar | 4ed89cd | 2014-04-05 12:02:25 +0200 | [diff] [blame] | 453 | AC_MSG_RESULT(no) |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 454 | AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no") |
Bram Moolenaar | 4ed89cd | 2014-04-05 12:02:25 +0200 | [diff] [blame] | 455 | else |
Bram Moolenaar | c09551a | 2014-04-10 11:09:17 +0200 | [diff] [blame] | 456 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 457 | fi |
| 458 | if test "$enable_smack" = "yes"; then |
Bram Moolenaar | c09551a | 2014-04-10 11:09:17 +0200 | [diff] [blame] | 459 | AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no") |
| 460 | fi |
| 461 | if test "$enable_smack" = "yes"; then |
| 462 | AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h) |
| 463 | AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>], |
| 464 | AC_MSG_RESULT(yes), |
Bram Moolenaar | e29b1fe | 2014-04-10 20:00:15 +0200 | [diff] [blame] | 465 | AC_MSG_RESULT(no); enable_smack="no") |
Bram Moolenaar | c09551a | 2014-04-10 11:09:17 +0200 | [diff] [blame] | 466 | fi |
| 467 | if test "$enable_smack" = "yes"; then |
| 468 | AC_CHECK_LIB(attr, setxattr, |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 469 | [LIBS="$LIBS -lattr" |
| 470 | found_smack="yes" |
| 471 | AC_DEFINE(HAVE_SMACK)]) |
Bram Moolenaar | 588ebeb | 2008-05-07 17:09:24 +0000 | [diff] [blame] | 472 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 473 | |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 474 | dnl When smack was found don't search for SELinux |
| 475 | if test "x$found_smack" = "x"; then |
| 476 | dnl Link with -lselinux for SELinux stuff; if not found |
| 477 | AC_MSG_CHECKING(--disable-selinux argument) |
| 478 | AC_ARG_ENABLE(selinux, |
| 479 | [ --disable-selinux Do not check for SELinux support.], |
| 480 | , enable_selinux="yes") |
| 481 | if test "$enable_selinux" = "yes"; then |
| 482 | AC_MSG_RESULT(no) |
| 483 | AC_CHECK_LIB(selinux, is_selinux_enabled, |
Bram Moolenaar | e4b78e2 | 2017-12-07 22:29:11 +0100 | [diff] [blame] | 484 | [AC_CHECK_HEADER(selinux/selinux.h, |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 485 | [LIBS="$LIBS -lselinux" |
Bram Moolenaar | e4b78e2 | 2017-12-07 22:29:11 +0100 | [diff] [blame] | 486 | AC_DEFINE(HAVE_SELINUX)])]) |
Bram Moolenaar | 5bd32f4 | 2014-04-02 14:05:38 +0200 | [diff] [blame] | 487 | else |
| 488 | AC_MSG_RESULT(yes) |
| 489 | fi |
| 490 | fi |
| 491 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 492 | dnl Check user requested features. |
| 493 | |
| 494 | AC_MSG_CHECKING(--with-features argument) |
Bram Moolenaar | eec2981 | 2016-07-26 21:27:36 +0200 | [diff] [blame] | 495 | AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: huge)], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 496 | features="$withval"; AC_MSG_RESULT($features), |
Bram Moolenaar | 23c4f71 | 2016-01-20 22:11:59 +0100 | [diff] [blame] | 497 | features="huge"; AC_MSG_RESULT(Defaulting to huge)) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 498 | |
| 499 | dovimdiff="" |
| 500 | dogvimdiff="" |
| 501 | case "$features" in |
| 502 | tiny) AC_DEFINE(FEAT_TINY) ;; |
| 503 | small) AC_DEFINE(FEAT_SMALL) ;; |
| 504 | normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff"; |
| 505 | dogvimdiff="installgvimdiff" ;; |
| 506 | big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff"; |
| 507 | dogvimdiff="installgvimdiff" ;; |
| 508 | huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff"; |
| 509 | dogvimdiff="installgvimdiff" ;; |
| 510 | *) AC_MSG_RESULT([Sorry, $features is not supported]) ;; |
| 511 | esac |
| 512 | |
| 513 | AC_SUBST(dovimdiff) |
| 514 | AC_SUBST(dogvimdiff) |
| 515 | |
| 516 | AC_MSG_CHECKING(--with-compiledby argument) |
| 517 | AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message], |
| 518 | compiledby="$withval"; AC_MSG_RESULT($withval), |
| 519 | compiledby=""; AC_MSG_RESULT(no)) |
| 520 | AC_SUBST(compiledby) |
| 521 | |
| 522 | AC_MSG_CHECKING(--disable-xsmp argument) |
| 523 | AC_ARG_ENABLE(xsmp, |
| 524 | [ --disable-xsmp Disable XSMP session management], |
| 525 | , enable_xsmp="yes") |
| 526 | |
| 527 | if test "$enable_xsmp" = "yes"; then |
| 528 | AC_MSG_RESULT(no) |
| 529 | AC_MSG_CHECKING(--disable-xsmp-interact argument) |
| 530 | AC_ARG_ENABLE(xsmp-interact, |
| 531 | [ --disable-xsmp-interact Disable XSMP interaction], |
| 532 | , enable_xsmp_interact="yes") |
| 533 | if test "$enable_xsmp_interact" = "yes"; then |
| 534 | AC_MSG_RESULT(no) |
| 535 | AC_DEFINE(USE_XSMP_INTERACT) |
| 536 | else |
| 537 | AC_MSG_RESULT(yes) |
| 538 | fi |
| 539 | else |
| 540 | AC_MSG_RESULT(yes) |
| 541 | fi |
| 542 | |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 543 | dnl Check for Lua feature. |
| 544 | AC_MSG_CHECKING(--enable-luainterp argument) |
| 545 | AC_ARG_ENABLE(luainterp, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 546 | [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 547 | [enable_luainterp="no"]) |
| 548 | AC_MSG_RESULT($enable_luainterp) |
| 549 | |
Bram Moolenaar | 2334b6d | 2010-07-22 21:32:16 +0200 | [diff] [blame] | 550 | if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then |
Bram Moolenaar | 3c124e3 | 2016-01-31 14:36:58 +0100 | [diff] [blame] | 551 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 552 | AC_MSG_ERROR([cannot use Lua with tiny or small features]) |
| 553 | fi |
| 554 | |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 555 | dnl -- find the lua executable |
| 556 | AC_SUBST(vi_cv_path_lua) |
| 557 | |
| 558 | AC_MSG_CHECKING(--with-lua-prefix argument) |
| 559 | AC_ARG_WITH(lua_prefix, |
| 560 | [ --with-lua-prefix=PFX Prefix where Lua is installed.], |
| 561 | with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix), |
Bram Moolenaar | 0d2e4fc | 2010-07-18 12:35:47 +0200 | [diff] [blame] | 562 | with_lua_prefix="";AC_MSG_RESULT(no)) |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 563 | |
| 564 | if test "X$with_lua_prefix" != "X"; then |
| 565 | vi_cv_path_lua_pfx="$with_lua_prefix" |
| 566 | else |
| 567 | AC_MSG_CHECKING(LUA_PREFIX environment var) |
| 568 | if test "X$LUA_PREFIX" != "X"; then |
| 569 | AC_MSG_RESULT("$LUA_PREFIX") |
| 570 | vi_cv_path_lua_pfx="$LUA_PREFIX" |
| 571 | else |
Bram Moolenaar | 0d2e4fc | 2010-07-18 12:35:47 +0200 | [diff] [blame] | 572 | AC_MSG_RESULT([not set, default to /usr]) |
| 573 | vi_cv_path_lua_pfx="/usr" |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 574 | fi |
| 575 | fi |
| 576 | |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 577 | AC_MSG_CHECKING(--with-luajit) |
| 578 | AC_ARG_WITH(luajit, |
| 579 | [ --with-luajit Link with LuaJIT instead of Lua.], |
| 580 | [vi_cv_with_luajit="$withval"], |
| 581 | [vi_cv_with_luajit="no"]) |
| 582 | AC_MSG_RESULT($vi_cv_with_luajit) |
| 583 | |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 584 | LUA_INC= |
| 585 | if test "X$vi_cv_path_lua_pfx" != "X"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 586 | if test "x$vi_cv_with_luajit" != "xno"; then |
| 587 | dnl -- try to find LuaJIT executable |
| 588 | AC_PATH_PROG(vi_cv_path_luajit, luajit) |
| 589 | if test "X$vi_cv_path_luajit" != "X"; then |
| 590 | dnl -- find LuaJIT version |
| 591 | AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit, |
Bram Moolenaar | 49b1027 | 2013-11-21 12:17:51 +0100 | [diff] [blame] | 592 | [ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-[[a-z0-9]]*\)* .*/\1/'` ]) |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 593 | AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit, |
| 594 | [ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ]) |
| 595 | vi_cv_path_lua="$vi_cv_path_luajit" |
| 596 | vi_cv_version_lua="$vi_cv_version_lua_luajit" |
| 597 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 598 | else |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 599 | dnl -- try to find Lua executable |
| 600 | AC_PATH_PROG(vi_cv_path_plain_lua, lua) |
| 601 | if test "X$vi_cv_path_plain_lua" != "X"; then |
| 602 | dnl -- find Lua version |
| 603 | AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua, |
| 604 | [ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ]) |
| 605 | fi |
| 606 | vi_cv_path_lua="$vi_cv_path_plain_lua" |
| 607 | vi_cv_version_lua="$vi_cv_version_plain_lua" |
| 608 | fi |
| 609 | if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then |
| 610 | AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 611 | if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 612 | AC_MSG_RESULT(yes) |
| 613 | LUA_INC=/luajit-$vi_cv_version_luajit |
| 614 | fi |
| 615 | fi |
| 616 | if test "X$LUA_INC" = "X"; then |
| 617 | AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 618 | if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 619 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 1e91f26 | 2012-10-03 14:48:08 +0200 | [diff] [blame] | 620 | else |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 621 | AC_MSG_RESULT(no) |
| 622 | AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 623 | if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 624 | AC_MSG_RESULT(yes) |
| 625 | LUA_INC=/lua$vi_cv_version_lua |
| 626 | else |
| 627 | AC_MSG_RESULT(no) |
Bram Moolenaar | f49e564 | 2020-04-19 17:46:53 +0200 | [diff] [blame] | 628 | |
| 629 | # Detect moonjit: |
| 630 | # https://groups.google.com/forum/#!topic/vim_use/O0vek60WuTk |
| 631 | lua_suf=/moonjit-2.3 |
| 632 | inc_path="$vi_cv_path_lua_pfx/include" |
| 633 | for dir in "$inc_path"/moonjit-[0-9]* ; do |
| 634 | if test -d "$dir" ; then |
| 635 | lua_suf=`basename '$dir'` |
| 636 | lua_suf="/$lua_suf" |
| 637 | break |
| 638 | fi |
| 639 | done |
| 640 | AC_MSG_CHECKING(if lua.h can be found in $inc_path$lua_suf) |
| 641 | if test -f "$inc_path$lua_suf/lua.h"; then |
| 642 | AC_MSG_RESULT(yes) |
| 643 | LUA_INC=$lua_suf |
| 644 | else |
| 645 | AC_MSG_RESULT(no) |
| 646 | vi_cv_path_lua_pfx= |
| 647 | fi |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 648 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 649 | fi |
| 650 | fi |
| 651 | fi |
| 652 | |
| 653 | if test "X$vi_cv_path_lua_pfx" != "X"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 654 | if test "x$vi_cv_with_luajit" != "xno"; then |
| 655 | multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` |
| 656 | if test "X$multiarch" != "X"; then |
| 657 | lib_multiarch="lib/${multiarch}" |
| 658 | else |
| 659 | lib_multiarch="lib" |
| 660 | fi |
| 661 | if test "X$vi_cv_version_lua" = "X"; then |
| 662 | LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit" |
| 663 | else |
| 664 | LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua" |
| 665 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 666 | else |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 667 | if test "X$LUA_INC" != "X"; then |
| 668 | dnl Test alternate location using version |
| 669 | LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua" |
| 670 | else |
| 671 | LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua" |
| 672 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 673 | fi |
Bram Moolenaar | 2334b6d | 2010-07-22 21:32:16 +0200 | [diff] [blame] | 674 | if test "$enable_luainterp" = "dynamic"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 675 | lua_ok="yes" |
| 676 | else |
| 677 | AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane]) |
| 678 | libs_save=$LIBS |
| 679 | LIBS="$LIBS $LUA_LIBS" |
| 680 | AC_TRY_LINK(,[ ], |
| 681 | AC_MSG_RESULT(yes); lua_ok="yes", |
| 682 | AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="") |
| 683 | LIBS=$libs_save |
| 684 | fi |
| 685 | if test "x$lua_ok" = "xyes"; then |
| 686 | LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}" |
| 687 | LUA_SRC="if_lua.c" |
| 688 | LUA_OBJ="objects/if_lua.o" |
| 689 | LUA_PRO="if_lua.pro" |
| 690 | AC_DEFINE(FEAT_LUA) |
| 691 | fi |
| 692 | if test "$enable_luainterp" = "dynamic"; then |
| 693 | if test "x$vi_cv_with_luajit" != "xno"; then |
| 694 | luajit="jit" |
| 695 | fi |
Bram Moolenaar | 1e91f26 | 2012-10-03 14:48:08 +0200 | [diff] [blame] | 696 | if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then |
| 697 | vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" |
| 698 | else |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 699 | if test "x$MACOS_X" = "xyes"; then |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 700 | ext="dylib" |
| 701 | indexes="" |
| 702 | else |
| 703 | ext="so" |
| 704 | indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9" |
| 705 | multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null` |
| 706 | if test "X$multiarch" != "X"; then |
| 707 | lib_multiarch="lib/${multiarch}" |
| 708 | fi |
Bram Moolenaar | 768baac | 2013-04-15 14:44:57 +0200 | [diff] [blame] | 709 | fi |
| 710 | dnl Determine the sover for the current version, but fallback to |
| 711 | dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found. |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 712 | AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx) |
Bram Moolenaar | 768baac | 2013-04-15 14:44:57 +0200 | [diff] [blame] | 713 | for subdir in "${lib_multiarch}" lib64 lib; do |
| 714 | if test -z "$subdir"; then |
| 715 | continue |
| 716 | fi |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 717 | for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \ |
| 718 | ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do |
| 719 | for i in $indexes ""; do |
| 720 | if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then |
Bram Moolenaar | 768baac | 2013-04-15 14:44:57 +0200 | [diff] [blame] | 721 | sover2="$i" |
| 722 | break 3 |
| 723 | fi |
| 724 | done |
Bram Moolenaar | 07e1da6 | 2013-02-06 19:49:43 +0100 | [diff] [blame] | 725 | done |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 726 | sover="" |
Bram Moolenaar | 1e91f26 | 2012-10-03 14:48:08 +0200 | [diff] [blame] | 727 | done |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 728 | if test "X$sover" = "X"; then |
| 729 | AC_MSG_RESULT(no) |
| 730 | lua_ok="no" |
| 731 | vi_cv_dll_name_lua="liblua${luajit}.${ext}" |
| 732 | else |
| 733 | AC_MSG_RESULT(yes) |
| 734 | lua_ok="yes" |
| 735 | vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2" |
| 736 | fi |
Bram Moolenaar | 1e91f26 | 2012-10-03 14:48:08 +0200 | [diff] [blame] | 737 | fi |
Bram Moolenaar | 2334b6d | 2010-07-22 21:32:16 +0200 | [diff] [blame] | 738 | AC_DEFINE(DYNAMIC_LUA) |
| 739 | LUA_LIBS="" |
Bram Moolenaar | 1e91f26 | 2012-10-03 14:48:08 +0200 | [diff] [blame] | 740 | LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" |
Bram Moolenaar | 2334b6d | 2010-07-22 21:32:16 +0200 | [diff] [blame] | 741 | fi |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 742 | if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 743 | test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 744 | test "`(uname -m) 2>/dev/null`" = "x86_64"; then |
| 745 | dnl OSX/x64 requires these flags. See http://luajit.org/install.html |
| 746 | LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" |
| 747 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 748 | fi |
Bram Moolenaar | e855ccf | 2013-07-28 13:32:15 +0200 | [diff] [blame] | 749 | if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 750 | AC_MSG_ERROR([could not configure lua]) |
| 751 | fi |
Bram Moolenaar | 0ba0429 | 2010-07-14 23:23:17 +0200 | [diff] [blame] | 752 | AC_SUBST(LUA_SRC) |
| 753 | AC_SUBST(LUA_OBJ) |
| 754 | AC_SUBST(LUA_PRO) |
| 755 | AC_SUBST(LUA_LIBS) |
| 756 | AC_SUBST(LUA_CFLAGS) |
| 757 | fi |
| 758 | |
| 759 | |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 760 | dnl Check for MzScheme feature. |
| 761 | AC_MSG_CHECKING(--enable-mzschemeinterp argument) |
| 762 | AC_ARG_ENABLE(mzschemeinterp, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 763 | [ --enable-mzschemeinterp Include MzScheme interpreter.], , |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 764 | [enable_mzschemeinterp="no"]) |
| 765 | AC_MSG_RESULT($enable_mzschemeinterp) |
| 766 | |
| 767 | if test "$enable_mzschemeinterp" = "yes"; then |
| 768 | dnl -- find the mzscheme executable |
| 769 | AC_SUBST(vi_cv_path_mzscheme) |
| 770 | |
| 771 | AC_MSG_CHECKING(--with-plthome argument) |
| 772 | AC_ARG_WITH(plthome, |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 773 | [ --with-plthome=PLTHOME Use PLTHOME.], |
| 774 | with_plthome="$withval"; AC_MSG_RESULT($with_plthome), |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 775 | with_plthome="";AC_MSG_RESULT("no")) |
| 776 | |
| 777 | if test "X$with_plthome" != "X"; then |
| 778 | vi_cv_path_mzscheme_pfx="$with_plthome" |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 779 | vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 780 | else |
| 781 | AC_MSG_CHECKING(PLTHOME environment var) |
| 782 | if test "X$PLTHOME" != "X"; then |
| 783 | AC_MSG_RESULT("$PLTHOME") |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 784 | vi_cv_path_mzscheme_pfx="$PLTHOME" |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 785 | vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme" |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 786 | else |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 787 | AC_MSG_RESULT(not set) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 788 | dnl -- try to find MzScheme executable |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 789 | AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 790 | |
| 791 | dnl resolve symbolic link, the executable is often elsewhere and there |
| 792 | dnl are no links for the include files. |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 793 | if test "X$vi_cv_path_mzscheme" != "X"; then |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 794 | lsout=`ls -l $vi_cv_path_mzscheme` |
| 795 | if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then |
| 796 | vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` |
| 797 | fi |
| 798 | fi |
| 799 | |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 800 | if test "X$vi_cv_path_mzscheme" != "X"; then |
| 801 | dnl -- find where MzScheme thinks it was installed |
| 802 | AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 803 | dnl different versions of MzScheme differ in command line processing |
| 804 | dnl use universal approach |
| 805 | echo "(display (simplify-path \ |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 806 | (build-path (call-with-values \ |
| 807 | (lambda () (split-path (find-system-path (quote exec-file)))) \ |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 808 | (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm |
| 809 | dnl Remove a trailing slash |
| 810 | [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ |
| 811 | sed -e 's+/$++'` ]) |
| 812 | rm -f mzdirs.scm |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 813 | fi |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 814 | fi |
| 815 | fi |
| 816 | |
| 817 | if test "X$vi_cv_path_mzscheme_pfx" != "X"; then |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 818 | AC_MSG_CHECKING(for racket include directory) |
| 819 | SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'` |
| 820 | if test "X$SCHEME_INC" != "X"; then |
| 821 | AC_MSG_RESULT(${SCHEME_INC}) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 822 | else |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 823 | AC_MSG_RESULT(not found) |
| 824 | AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include) |
| 825 | if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then |
| 826 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 827 | AC_MSG_RESULT(yes) |
Bram Moolenaar | d7afed3 | 2007-05-06 13:26:41 +0000 | [diff] [blame] | 828 | else |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 829 | AC_MSG_RESULT(no) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 830 | AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt) |
| 831 | if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 832 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 833 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 834 | else |
| 835 | AC_MSG_RESULT(no) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 836 | AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket) |
| 837 | if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 838 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 839 | SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 840 | else |
| 841 | AC_MSG_RESULT(no) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 842 | AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) |
| 843 | if test -f /usr/include/plt/scheme.h; then |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 844 | AC_MSG_RESULT(yes) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 845 | SCHEME_INC=/usr/include/plt |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 846 | else |
| 847 | AC_MSG_RESULT(no) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 848 | AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/) |
| 849 | if test -f /usr/include/racket/scheme.h; then |
| 850 | AC_MSG_RESULT(yes) |
| 851 | SCHEME_INC=/usr/include/racket |
| 852 | else |
| 853 | AC_MSG_RESULT(no) |
| 854 | vi_cv_path_mzscheme_pfx= |
| 855 | fi |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 856 | fi |
| 857 | fi |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 858 | fi |
Bram Moolenaar | d7afed3 | 2007-05-06 13:26:41 +0000 | [diff] [blame] | 859 | fi |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 860 | fi |
| 861 | fi |
| 862 | |
| 863 | if test "X$vi_cv_path_mzscheme_pfx" != "X"; then |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 864 | |
| 865 | AC_MSG_CHECKING(for racket lib directory) |
| 866 | SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'` |
| 867 | if test "X$SCHEME_LIB" != "X"; then |
| 868 | AC_MSG_RESULT(${SCHEME_LIB}) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 869 | else |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 870 | AC_MSG_RESULT(not found) |
| 871 | fi |
| 872 | |
| 873 | for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do |
| 874 | if test "X$path" != "X"; then |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 875 | if test "x$MACOS_X" = "xyes"; then |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 876 | MZSCHEME_LIBS="-framework Racket" |
| 877 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 878 | elif test -f "${path}/libmzscheme3m.a"; then |
| 879 | MZSCHEME_LIBS="${path}/libmzscheme3m.a" |
| 880 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 881 | elif test -f "${path}/libracket3m.a"; then |
| 882 | MZSCHEME_LIBS="${path}/libracket3m.a" |
| 883 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 884 | elif test -f "${path}/libracket.a"; then |
| 885 | MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a" |
| 886 | elif test -f "${path}/libmzscheme.a"; then |
| 887 | MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a" |
| 888 | else |
| 889 | dnl Using shared objects |
| 890 | if test -f "${path}/libmzscheme3m.so"; then |
| 891 | MZSCHEME_LIBS="-L${path} -lmzscheme3m" |
| 892 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 893 | elif test -f "${path}/libracket3m.so"; then |
| 894 | MZSCHEME_LIBS="-L${path} -lracket3m" |
| 895 | MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" |
| 896 | elif test -f "${path}/libracket.so"; then |
| 897 | MZSCHEME_LIBS="-L${path} -lracket -lmzgc" |
| 898 | else |
| 899 | dnl try next until last |
| 900 | if test "$path" != "$SCHEME_LIB"; then |
| 901 | continue |
| 902 | fi |
| 903 | MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc" |
| 904 | fi |
| 905 | if test "$GCC" = yes; then |
| 906 | dnl Make Vim remember the path to the library. For when it's not in |
| 907 | dnl $LD_LIBRARY_PATH. |
| 908 | MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}" |
| 909 | elif test "`(uname) 2>/dev/null`" = SunOS && |
| 910 | uname -r | grep '^5' >/dev/null; then |
| 911 | MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}" |
| 912 | fi |
| 913 | fi |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 914 | fi |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 915 | if test "X$MZSCHEME_LIBS" != "X"; then |
| 916 | break |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 917 | fi |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 918 | done |
| 919 | |
| 920 | AC_MSG_CHECKING([if racket requires -pthread]) |
| 921 | if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then |
| 922 | AC_MSG_RESULT(yes) |
| 923 | MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread" |
| 924 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread" |
| 925 | else |
| 926 | AC_MSG_RESULT(no) |
| 927 | fi |
| 928 | |
| 929 | AC_MSG_CHECKING(for racket config directory) |
| 930 | SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'` |
| 931 | if test "X$SCHEME_CONFIGDIR" != "X"; then |
| 932 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'" |
| 933 | AC_MSG_RESULT(${SCHEME_CONFIGDIR}) |
| 934 | else |
| 935 | AC_MSG_RESULT(not found) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 936 | fi |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 937 | |
| 938 | AC_MSG_CHECKING(for racket collects directory) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 939 | 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))))'` |
| 940 | if test "X$SCHEME_COLLECTS" = "X"; then |
| 941 | if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then |
| 942 | SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 943 | else |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 944 | if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then |
| 945 | SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ |
Bram Moolenaar | 7567646 | 2013-01-30 14:55:42 +0100 | [diff] [blame] | 946 | else |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 947 | if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then |
| 948 | SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ |
| 949 | else |
| 950 | if test -d "$vi_cv_path_mzscheme_pfx/collects"; then |
| 951 | SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/ |
| 952 | fi |
Bram Moolenaar | 7567646 | 2013-01-30 14:55:42 +0100 | [diff] [blame] | 953 | fi |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 954 | fi |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 955 | fi |
Bram Moolenaar | d7afed3 | 2007-05-06 13:26:41 +0000 | [diff] [blame] | 956 | fi |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 957 | if test "X$SCHEME_COLLECTS" != "X" ; then |
| 958 | AC_MSG_RESULT(${SCHEME_COLLECTS}) |
| 959 | else |
| 960 | AC_MSG_RESULT(not found) |
| 961 | fi |
| 962 | |
| 963 | AC_MSG_CHECKING(for mzscheme_base.c) |
| 964 | if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 965 | MZSCHEME_EXTRA="mzscheme_base.c" |
Bram Moolenaar | 45e2bcc | 2014-02-15 17:19:00 +0100 | [diff] [blame] | 966 | MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" |
| 967 | MZSCHEME_MOD="++lib scheme/base" |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 968 | else |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 969 | if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 970 | MZSCHEME_EXTRA="mzscheme_base.c" |
Bram Moolenaar | 45e2bcc | 2014-02-15 17:19:00 +0100 | [diff] [blame] | 971 | MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" |
| 972 | MZSCHEME_MOD="++lib scheme/base" |
| 973 | else |
| 974 | if test -f "${SCHEME_COLLECTS}collects/racket/base.rkt" ; then |
| 975 | MZSCHEME_EXTRA="mzscheme_base.c" |
| 976 | MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/raco ctool" |
| 977 | MZSCHEME_MOD="" |
| 978 | fi |
Bram Moolenaar | 2d0860d | 2010-11-03 21:59:30 +0100 | [diff] [blame] | 979 | fi |
| 980 | fi |
| 981 | if test "X$MZSCHEME_EXTRA" != "X" ; then |
| 982 | dnl need to generate bytecode for MzScheme base |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 983 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 984 | AC_MSG_RESULT(needed) |
| 985 | else |
| 986 | AC_MSG_RESULT(not needed) |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 987 | fi |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 988 | |
Bram Moolenaar | 9e90219 | 2013-07-17 18:58:11 +0200 | [diff] [blame] | 989 | dnl On Ubuntu this fixes "undefined reference to symbol 'ffi_type_void'". |
| 990 | AC_CHECK_LIB(ffi, ffi_type_void, [MZSCHEME_LIBS="$MZSCHEME_LIBS -lffi"]) |
| 991 | |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 992 | MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ |
Bram Moolenaar | fe9fb92 | 2012-11-23 21:54:48 +0100 | [diff] [blame] | 993 | -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" |
Bram Moolenaar | 9e90219 | 2013-07-17 18:58:11 +0200 | [diff] [blame] | 994 | |
| 995 | dnl Test that we can compile a simple program with these CFLAGS and LIBS. |
| 996 | AC_MSG_CHECKING([if compile and link flags for MzScheme are sane]) |
| 997 | cflags_save=$CFLAGS |
| 998 | libs_save=$LIBS |
| 999 | CFLAGS="$CFLAGS $MZSCHEME_CFLAGS" |
| 1000 | LIBS="$LIBS $MZSCHEME_LIBS" |
| 1001 | AC_TRY_LINK(,[ ], |
| 1002 | AC_MSG_RESULT(yes); mzs_ok=yes, |
| 1003 | AC_MSG_RESULT(no: MZSCHEME DISABLED); mzs_ok=no) |
| 1004 | CFLAGS=$cflags_save |
| 1005 | LIBS=$libs_save |
| 1006 | if test $mzs_ok = yes; then |
| 1007 | MZSCHEME_SRC="if_mzsch.c" |
| 1008 | MZSCHEME_OBJ="objects/if_mzsch.o" |
| 1009 | MZSCHEME_PRO="if_mzsch.pro" |
| 1010 | AC_DEFINE(FEAT_MZSCHEME) |
| 1011 | else |
| 1012 | MZSCHEME_CFLAGS= |
| 1013 | MZSCHEME_LIBS= |
| 1014 | MZSCHEME_EXTRA= |
| 1015 | MZSCHEME_MZC= |
| 1016 | fi |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 1017 | fi |
| 1018 | AC_SUBST(MZSCHEME_SRC) |
| 1019 | AC_SUBST(MZSCHEME_OBJ) |
| 1020 | AC_SUBST(MZSCHEME_PRO) |
| 1021 | AC_SUBST(MZSCHEME_LIBS) |
| 1022 | AC_SUBST(MZSCHEME_CFLAGS) |
Bram Moolenaar | 9e70cf1 | 2009-05-26 20:59:55 +0000 | [diff] [blame] | 1023 | AC_SUBST(MZSCHEME_EXTRA) |
| 1024 | AC_SUBST(MZSCHEME_MZC) |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 1025 | fi |
| 1026 | |
| 1027 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1028 | AC_MSG_CHECKING(--enable-perlinterp argument) |
| 1029 | AC_ARG_ENABLE(perlinterp, |
Bram Moolenaar | e06c188 | 2010-07-21 22:05:20 +0200 | [diff] [blame] | 1030 | [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1031 | [enable_perlinterp="no"]) |
| 1032 | AC_MSG_RESULT($enable_perlinterp) |
Bram Moolenaar | e06c188 | 2010-07-21 22:05:20 +0200 | [diff] [blame] | 1033 | if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then |
Bram Moolenaar | 3c124e3 | 2016-01-31 14:36:58 +0100 | [diff] [blame] | 1034 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 1035 | AC_MSG_ERROR([cannot use Perl with tiny or small features]) |
| 1036 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1037 | AC_SUBST(vi_cv_path_perl) |
| 1038 | AC_PATH_PROG(vi_cv_path_perl, perl) |
| 1039 | if test "X$vi_cv_path_perl" != "X"; then |
| 1040 | AC_MSG_CHECKING(Perl version) |
| 1041 | if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then |
| 1042 | eval `$vi_cv_path_perl -V:usethreads` |
Bram Moolenaar | e06c188 | 2010-07-21 22:05:20 +0200 | [diff] [blame] | 1043 | eval `$vi_cv_path_perl -V:libperl` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1044 | if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then |
| 1045 | badthreads=no |
| 1046 | else |
| 1047 | if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then |
| 1048 | eval `$vi_cv_path_perl -V:use5005threads` |
| 1049 | if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then |
| 1050 | badthreads=no |
| 1051 | else |
| 1052 | badthreads=yes |
| 1053 | AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<) |
| 1054 | fi |
| 1055 | else |
| 1056 | badthreads=yes |
| 1057 | AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<) |
| 1058 | fi |
| 1059 | fi |
| 1060 | if test $badthreads = no; then |
| 1061 | AC_MSG_RESULT(OK) |
| 1062 | eval `$vi_cv_path_perl -V:shrpenv` |
| 1063 | if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04 |
| 1064 | shrpenv="" |
| 1065 | fi |
| 1066 | vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'` |
| 1067 | AC_SUBST(vi_cv_perllib) |
Bram Moolenaar | d5f62b1 | 2014-08-17 17:05:44 +0200 | [diff] [blame] | 1068 | vi_cv_perl_extutils=unknown_perl_extutils_path |
| 1069 | for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do |
| 1070 | xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp" |
| 1071 | if test -f "$xsubpp_path"; then |
| 1072 | vi_cv_perl_xsubpp="$xsubpp_path" |
| 1073 | fi |
| 1074 | done |
| 1075 | AC_SUBST(vi_cv_perl_xsubpp) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1076 | dnl Remove "-fno-something", it breaks using cproto. |
Bram Moolenaar | 280a868 | 2015-06-21 13:41:08 +0200 | [diff] [blame] | 1077 | dnl Remove "-fdebug-prefix-map", it isn't supported by clang. |
Bram Moolenaar | e8ff56b | 2017-09-14 23:06:23 +0200 | [diff] [blame] | 1078 | dnl Remove "FORTIFY_SOURCE", it will be defined twice. |
Bram Moolenaar | 1ec96c9 | 2017-09-27 21:42:08 +0200 | [diff] [blame] | 1079 | dnl remove -pipe and -Wxxx, it confuses cproto |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1080 | perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ |
Bram Moolenaar | e8ff56b | 2017-09-14 23:06:23 +0200 | [diff] [blame] | 1081 | -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \ |
| 1082 | -e 's/-fdebug-prefix-map[[^ ]]*//g' \ |
Bram Moolenaar | 1ec96c9 | 2017-09-27 21:42:08 +0200 | [diff] [blame] | 1083 | -e 's/-pipe //' \ |
| 1084 | -e 's/-W[[^ ]]*//g' \ |
| 1085 | -e 's/-D_FORTIFY_SOURCE=.//g'` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1086 | dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". |
| 1087 | perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ |
| 1088 | sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ |
| 1089 | -e 's/-bE:perl.exp//' -e 's/-lc //'` |
| 1090 | dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH |
| 1091 | dnl a test in configure may fail because of that. |
| 1092 | perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ |
| 1093 | -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` |
| 1094 | |
| 1095 | dnl check that compiling a simple program still works with the flags |
| 1096 | dnl added for Perl. |
| 1097 | AC_MSG_CHECKING([if compile and link flags for Perl are sane]) |
| 1098 | cflags_save=$CFLAGS |
| 1099 | libs_save=$LIBS |
| 1100 | ldflags_save=$LDFLAGS |
| 1101 | CFLAGS="$CFLAGS $perlcppflags" |
| 1102 | LIBS="$LIBS $perllibs" |
Bram Moolenaar | a6cc031 | 2013-06-18 23:31:55 +0200 | [diff] [blame] | 1103 | perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1104 | LDFLAGS="$perlldflags $LDFLAGS" |
| 1105 | AC_TRY_LINK(,[ ], |
| 1106 | AC_MSG_RESULT(yes); perl_ok=yes, |
| 1107 | AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no) |
| 1108 | CFLAGS=$cflags_save |
| 1109 | LIBS=$libs_save |
| 1110 | LDFLAGS=$ldflags_save |
| 1111 | if test $perl_ok = yes; then |
| 1112 | if test "X$perlcppflags" != "X"; then |
Bram Moolenaar | 1ec96c9 | 2017-09-27 21:42:08 +0200 | [diff] [blame] | 1113 | PERL_CFLAGS=$perlcppflags |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1114 | fi |
| 1115 | if test "X$perlldflags" != "X"; then |
Bram Moolenaar | 2bcaec3 | 2014-03-27 18:51:11 +0100 | [diff] [blame] | 1116 | if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$perlldflags\"`" = "X"; then |
Bram Moolenaar | a6cc031 | 2013-06-18 23:31:55 +0200 | [diff] [blame] | 1117 | LDFLAGS="$perlldflags $LDFLAGS" |
| 1118 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1119 | fi |
| 1120 | PERL_LIBS=$perllibs |
| 1121 | PERL_SRC="auto/if_perl.c if_perlsfio.c" |
| 1122 | PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" |
| 1123 | PERL_PRO="if_perl.pro if_perlsfio.pro" |
| 1124 | AC_DEFINE(FEAT_PERL) |
| 1125 | fi |
| 1126 | fi |
| 1127 | else |
| 1128 | AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<) |
| 1129 | fi |
| 1130 | fi |
| 1131 | |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1132 | if test "x$MACOS_X" = "xyes"; then |
Bram Moolenaar | 9372a11 | 2005-12-06 19:59:18 +0000 | [diff] [blame] | 1133 | dnl Mac OS X 10.2 or later |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1134 | dir=/System/Library/Perl |
| 1135 | darwindir=$dir/darwin |
| 1136 | if test -d $darwindir; then |
| 1137 | PERL=/usr/bin/perl |
| 1138 | else |
| 1139 | dnl Mac OS X 10.3 |
| 1140 | dir=/System/Library/Perl/5.8.1 |
| 1141 | darwindir=$dir/darwin-thread-multi-2level |
| 1142 | if test -d $darwindir; then |
| 1143 | PERL=/usr/bin/perl |
| 1144 | fi |
| 1145 | fi |
| 1146 | if test -n "$PERL"; then |
| 1147 | PERL_DIR="$dir" |
| 1148 | PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE" |
| 1149 | PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a" |
| 1150 | PERL_LIBS="-L$darwindir/CORE -lperl" |
| 1151 | fi |
Bram Moolenaar | 5dff57d | 2010-07-24 16:19:44 +0200 | [diff] [blame] | 1152 | dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only |
| 1153 | dnl be included if requested by passing --with-mac-arch to |
| 1154 | dnl configure, so strip these flags first (if present) |
| 1155 | PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
| 1156 | PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1157 | fi |
Bram Moolenaar | e06c188 | 2010-07-21 22:05:20 +0200 | [diff] [blame] | 1158 | if test "$enable_perlinterp" = "dynamic"; then |
| 1159 | if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then |
| 1160 | AC_DEFINE(DYNAMIC_PERL) |
| 1161 | PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" |
| 1162 | fi |
| 1163 | fi |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 1164 | |
| 1165 | if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then |
| 1166 | AC_MSG_ERROR([could not configure perl]) |
| 1167 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1168 | fi |
| 1169 | AC_SUBST(shrpenv) |
| 1170 | AC_SUBST(PERL_SRC) |
| 1171 | AC_SUBST(PERL_OBJ) |
| 1172 | AC_SUBST(PERL_PRO) |
| 1173 | AC_SUBST(PERL_CFLAGS) |
| 1174 | AC_SUBST(PERL_LIBS) |
| 1175 | |
| 1176 | AC_MSG_CHECKING(--enable-pythoninterp argument) |
| 1177 | AC_ARG_ENABLE(pythoninterp, |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1178 | [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1179 | [enable_pythoninterp="no"]) |
| 1180 | AC_MSG_RESULT($enable_pythoninterp) |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1181 | if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then |
Bram Moolenaar | 0b10541 | 2014-11-30 13:34:23 +0100 | [diff] [blame] | 1182 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 1183 | AC_MSG_ERROR([cannot use Python with tiny or small features]) |
| 1184 | fi |
| 1185 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1186 | dnl -- find the python executable |
Bram Moolenaar | e1a3231 | 2018-04-15 16:03:25 +0200 | [diff] [blame] | 1187 | AC_MSG_CHECKING(--with-python-command argument) |
| 1188 | AC_SUBST(vi_cv_path_python) |
| 1189 | AC_ARG_WITH(python-command, [ --with-python-command=NAME name of the Python 2 command (default: python2 or python)], |
| 1190 | vi_cv_path_python="$withval"; AC_MSG_RESULT($vi_cv_path_python), |
| 1191 | AC_MSG_RESULT(no)) |
| 1192 | |
| 1193 | if test "X$vi_cv_path_python" = "X"; then |
| 1194 | AC_PATH_PROGS(vi_cv_path_python, python2 python) |
| 1195 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1196 | if test "X$vi_cv_path_python" != "X"; then |
| 1197 | |
| 1198 | dnl -- get its version number |
| 1199 | AC_CACHE_CHECK(Python version,vi_cv_var_python_version, |
| 1200 | [[vi_cv_var_python_version=` |
| 1201 | ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` |
| 1202 | ]]) |
| 1203 | |
Bram Moolenaar | c09a6d6 | 2013-06-10 21:27:29 +0200 | [diff] [blame] | 1204 | dnl -- it must be at least version 2.3 |
| 1205 | AC_MSG_CHECKING(Python is 2.3 or better) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1206 | if ${vi_cv_path_python} -c \ |
Bram Moolenaar | c09a6d6 | 2013-06-10 21:27:29 +0200 | [diff] [blame] | 1207 | "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1208 | then |
| 1209 | AC_MSG_RESULT(yep) |
| 1210 | |
| 1211 | dnl -- find where python thinks it was installed |
| 1212 | AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx, |
| 1213 | [ vi_cv_path_python_pfx=` |
| 1214 | ${vi_cv_path_python} -c \ |
| 1215 | "import sys; print sys.prefix"` ]) |
| 1216 | |
| 1217 | dnl -- and where it thinks it runs |
| 1218 | AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx, |
| 1219 | [ vi_cv_path_python_epfx=` |
| 1220 | ${vi_cv_path_python} -c \ |
| 1221 | "import sys; print sys.exec_prefix"` ]) |
| 1222 | |
| 1223 | dnl -- python's internal library path |
| 1224 | |
| 1225 | AC_CACHE_VAL(vi_cv_path_pythonpath, |
| 1226 | [ vi_cv_path_pythonpath=` |
| 1227 | unset PYTHONPATH; |
| 1228 | ${vi_cv_path_python} -c \ |
| 1229 | "import sys, string; print string.join(sys.path,':')"` ]) |
| 1230 | |
| 1231 | dnl -- where the Python implementation library archives are |
| 1232 | |
| 1233 | AC_ARG_WITH(python-config-dir, |
Bram Moolenaar | e1a3231 | 2018-04-15 16:03:25 +0200 | [diff] [blame] | 1234 | [ --with-python-config-dir=PATH Python's config directory (deprecated)], |
Bram Moolenaar | d088240 | 2018-04-10 18:13:05 +0200 | [diff] [blame] | 1235 | [ vi_cv_path_python_conf="${withval}"; have_python_config_dir=1 ] ) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1236 | |
| 1237 | AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf, |
| 1238 | [ |
| 1239 | vi_cv_path_python_conf= |
Bram Moolenaar | ac499e3 | 2013-06-02 19:14:17 +0200 | [diff] [blame] | 1240 | d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` |
| 1241 | if test -d "$d" && test -f "$d/config.c"; then |
| 1242 | vi_cv_path_python_conf="$d" |
| 1243 | else |
| 1244 | for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do |
| 1245 | for subdir in lib64 lib share; do |
| 1246 | d="${path}/${subdir}/python${vi_cv_var_python_version}/config" |
| 1247 | if test -d "$d" && test -f "$d/config.c"; then |
| 1248 | vi_cv_path_python_conf="$d" |
| 1249 | fi |
| 1250 | done |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1251 | done |
Bram Moolenaar | ac499e3 | 2013-06-02 19:14:17 +0200 | [diff] [blame] | 1252 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1253 | ]) |
| 1254 | |
| 1255 | PYTHON_CONFDIR="${vi_cv_path_python_conf}" |
| 1256 | |
| 1257 | if test "X$PYTHON_CONFDIR" = "X"; then |
| 1258 | AC_MSG_RESULT([can't find it!]) |
| 1259 | else |
| 1260 | |
| 1261 | dnl -- we need to examine Python's config/Makefile too |
| 1262 | dnl see what the interpreter is built from |
| 1263 | AC_CACHE_VAL(vi_cv_path_python_plibs, |
| 1264 | [ |
Bram Moolenaar | 01dd60c | 2008-07-24 14:24:48 +0000 | [diff] [blame] | 1265 | pwd=`pwd` |
| 1266 | tmp_mkf="$pwd/config-PyMake$$" |
| 1267 | cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1268 | __: |
Bram Moolenaar | 218116c | 2010-05-20 21:46:00 +0200 | [diff] [blame] | 1269 | @echo "python_BASEMODLIBS='$(BASEMODLIBS)'" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1270 | @echo "python_LIBS='$(LIBS)'" |
| 1271 | @echo "python_SYSLIBS='$(SYSLIBS)'" |
| 1272 | @echo "python_LINKFORSHARED='$(LINKFORSHARED)'" |
Bram Moolenaar | f94a13c | 2012-09-21 13:26:49 +0200 | [diff] [blame] | 1273 | @echo "python_DLLLIBRARY='$(DLLLIBRARY)'" |
Bram Moolenaar | 2a7e2a6 | 2010-07-24 15:19:11 +0200 | [diff] [blame] | 1274 | @echo "python_INSTSONAME='$(INSTSONAME)'" |
Bram Moolenaar | 6c92755 | 2015-03-24 12:21:33 +0100 | [diff] [blame] | 1275 | @echo "python_PYTHONFRAMEWORK='$(PYTHONFRAMEWORK)'" |
| 1276 | @echo "python_PYTHONFRAMEWORKPREFIX='$(PYTHONFRAMEWORKPREFIX)'" |
| 1277 | @echo "python_PYTHONFRAMEWORKINSTALLDIR='$(PYTHONFRAMEWORKINSTALLDIR)'" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1278 | eof |
| 1279 | dnl -- delete the lines from make about Entering/Leaving directory |
Bram Moolenaar | 01dd60c | 2008-07-24 14:24:48 +0000 | [diff] [blame] | 1280 | eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
| 1281 | rm -f -- "${tmp_mkf}" |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1282 | if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1283 | "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then |
| 1284 | vi_cv_path_python_plibs="-framework Python" |
Bram Moolenaar | 6c92755 | 2015-03-24 12:21:33 +0100 | [diff] [blame] | 1285 | if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then |
| 1286 | vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" |
| 1287 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1288 | else |
Bram Moolenaar | 9ce4213 | 2018-04-11 22:19:36 +0200 | [diff] [blame] | 1289 | vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}" |
Bram Moolenaar | 6c92755 | 2015-03-24 12:21:33 +0100 | [diff] [blame] | 1290 | dnl -- Check if the path contained in python_LINKFORSHARED is |
| 1291 | dnl usable for vim build. If not, make and try other |
| 1292 | dnl candidates. |
Bram Moolenaar | a161e26 | 2015-03-24 15:14:27 +0100 | [diff] [blame] | 1293 | if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then |
Bram Moolenaar | 6c92755 | 2015-03-24 12:21:33 +0100 | [diff] [blame] | 1294 | python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]].*/\1/'` |
| 1295 | python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([[^ \t]][[^ \t]]*[[ \t]][[ \t]]*[[^ \t]][[^ \t]]*\)[[ \t]][[ \t]]*\(.*\)/\2/'` |
| 1296 | if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then |
| 1297 | dnl -- The path looks relative. Guess the absolute one using |
| 1298 | dnl the prefix and try that. |
| 1299 | python_link_path="${python_PYTHONFRAMEWORKPREFIX}/${python_link_path}" |
| 1300 | if test -n "${python_link_path}" && ! test -x "${python_link_path}"; then |
| 1301 | dnl -- A last resort. |
| 1302 | python_link_path="${python_PYTHONFRAMEWORKINSTALLDIR}/Versions/${vi_cv_var_python_version}/${python_PYTHONFRAMEWORK}" |
| 1303 | dnl -- No check is done. The last word is left to the |
| 1304 | dnl "sanity" test on link flags that follows shortly. |
| 1305 | fi |
| 1306 | python_LINKFORSHARED="${python_link_symbol} ${python_link_path}" |
| 1307 | fi |
| 1308 | fi |
Bram Moolenaar | 218116c | 2010-05-20 21:46:00 +0200 | [diff] [blame] | 1309 | vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1310 | dnl remove -ltermcap, it can conflict with an earlier -lncurses |
| 1311 | vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` |
| 1312 | fi |
| 1313 | ]) |
Bram Moolenaar | ba59ddb | 2016-01-28 15:34:25 +0100 | [diff] [blame] | 1314 | AC_CACHE_CHECK(Python's dll name,vi_cv_dll_name_python, |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1315 | [ |
| 1316 | if test "X$python_DLLLIBRARY" != "X"; then |
| 1317 | vi_cv_dll_name_python="$python_DLLLIBRARY" |
| 1318 | else |
| 1319 | vi_cv_dll_name_python="$python_INSTSONAME" |
| 1320 | fi |
| 1321 | ]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1322 | |
| 1323 | PYTHON_LIBS="${vi_cv_path_python_plibs}" |
| 1324 | if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then |
Bram Moolenaar | 0424958 | 2018-04-10 13:29:34 +0200 | [diff] [blame] | 1325 | PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1326 | else |
Bram Moolenaar | 0424958 | 2018-04-10 13:29:34 +0200 | [diff] [blame] | 1327 | 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}" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1328 | fi |
Bram Moolenaar | 3a21d9c | 2018-04-10 20:26:20 +0200 | [diff] [blame] | 1329 | if test "X$have_python_config_dir" = "X1" -a "$enable_pythoninterp" = "dynamic"; then |
Bram Moolenaar | d088240 | 2018-04-10 18:13:05 +0200 | [diff] [blame] | 1330 | dnl Define PYTHON_HOME if --with-python-config-dir was used |
| 1331 | PYTHON_CFLAGS="${PYTHON_CFLAGS} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" |
| 1332 | |
| 1333 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1334 | PYTHON_SRC="if_python.c" |
Bram Moolenaar | 9bdb9a0 | 2012-07-25 16:32:08 +0200 | [diff] [blame] | 1335 | PYTHON_OBJ="objects/if_python.o" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1336 | |
| 1337 | dnl On FreeBSD linking with "-pthread" is required to use threads. |
| 1338 | dnl _THREAD_SAFE must be used for compiling then. |
| 1339 | dnl The "-pthread" is added to $LIBS, so that the following check for |
| 1340 | dnl sigaltstack() will look in libc_r (it's there in libc!). |
| 1341 | dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC |
| 1342 | dnl will then define target-specific defines, e.g., -D_REENTRANT. |
| 1343 | dnl Don't do this for Mac OSX, -pthread will generate a warning. |
| 1344 | AC_MSG_CHECKING([if -pthread should be used]) |
| 1345 | threadsafe_flag= |
| 1346 | thread_lib= |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1347 | dnl if test "x$MACOS_X" != "xyes"; then |
Bram Moolenaar | a1b5aa5 | 2006-10-10 09:41:28 +0000 | [diff] [blame] | 1348 | if test "`(uname) 2>/dev/null`" != Darwin; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1349 | test "$GCC" = yes && threadsafe_flag="-pthread" |
| 1350 | if test "`(uname) 2>/dev/null`" = FreeBSD; then |
| 1351 | threadsafe_flag="-D_THREAD_SAFE" |
| 1352 | thread_lib="-pthread" |
| 1353 | fi |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1354 | if test "`(uname) 2>/dev/null`" = SunOS; then |
| 1355 | threadsafe_flag="-pthreads" |
| 1356 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1357 | fi |
| 1358 | libs_save_old=$LIBS |
| 1359 | if test -n "$threadsafe_flag"; then |
| 1360 | cflags_save=$CFLAGS |
| 1361 | CFLAGS="$CFLAGS $threadsafe_flag" |
| 1362 | LIBS="$LIBS $thread_lib" |
| 1363 | AC_TRY_LINK(,[ ], |
Bram Moolenaar | 69f787a | 2010-07-11 20:52:58 +0200 | [diff] [blame] | 1364 | AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1365 | AC_MSG_RESULT(no); LIBS=$libs_save_old |
| 1366 | ) |
| 1367 | CFLAGS=$cflags_save |
| 1368 | else |
| 1369 | AC_MSG_RESULT(no) |
| 1370 | fi |
| 1371 | |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1372 | dnl Check that compiling a simple program still works with the flags |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1373 | dnl added for Python. |
| 1374 | AC_MSG_CHECKING([if compile and link flags for Python are sane]) |
| 1375 | cflags_save=$CFLAGS |
| 1376 | libs_save=$LIBS |
Bram Moolenaar | 69f787a | 2010-07-11 20:52:58 +0200 | [diff] [blame] | 1377 | CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1378 | LIBS="$LIBS $PYTHON_LIBS" |
| 1379 | AC_TRY_LINK(,[ ], |
| 1380 | AC_MSG_RESULT(yes); python_ok=yes, |
| 1381 | AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no) |
| 1382 | CFLAGS=$cflags_save |
| 1383 | LIBS=$libs_save |
| 1384 | if test $python_ok = yes; then |
| 1385 | AC_DEFINE(FEAT_PYTHON) |
| 1386 | else |
| 1387 | LIBS=$libs_save_old |
| 1388 | PYTHON_SRC= |
| 1389 | PYTHON_OBJ= |
| 1390 | PYTHON_LIBS= |
| 1391 | PYTHON_CFLAGS= |
| 1392 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1393 | fi |
| 1394 | else |
| 1395 | AC_MSG_RESULT(too old) |
| 1396 | fi |
| 1397 | fi |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 1398 | |
| 1399 | if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then |
| 1400 | AC_MSG_ERROR([could not configure python]) |
| 1401 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1402 | fi |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1403 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1404 | AC_SUBST(PYTHON_LIBS) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1405 | AC_SUBST(PYTHON_CFLAGS) |
| 1406 | AC_SUBST(PYTHON_SRC) |
| 1407 | AC_SUBST(PYTHON_OBJ) |
| 1408 | |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1409 | |
| 1410 | AC_MSG_CHECKING(--enable-python3interp argument) |
| 1411 | AC_ARG_ENABLE(python3interp, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 1412 | [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1413 | [enable_python3interp="no"]) |
| 1414 | AC_MSG_RESULT($enable_python3interp) |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1415 | if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then |
Bram Moolenaar | 0b10541 | 2014-11-30 13:34:23 +0100 | [diff] [blame] | 1416 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 1417 | AC_MSG_ERROR([cannot use Python with tiny or small features]) |
| 1418 | fi |
| 1419 | |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1420 | dnl -- find the python3 executable |
Bram Moolenaar | e1a3231 | 2018-04-15 16:03:25 +0200 | [diff] [blame] | 1421 | AC_MSG_CHECKING(--with-python3-command argument) |
| 1422 | AC_SUBST(vi_cv_path_python3) |
| 1423 | AC_ARG_WITH(python3-command, [ --with-python3-command=NAME name of the Python 3 command (default: python3 or python)], |
| 1424 | vi_cv_path_python3="$withval"; AC_MSG_RESULT($vi_cv_path_python3), |
| 1425 | AC_MSG_RESULT(no)) |
| 1426 | |
| 1427 | if test "X$vi_cv_path_python3" = "X"; then |
| 1428 | AC_PATH_PROGS(vi_cv_path_python3, python3 python) |
| 1429 | fi |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1430 | if test "X$vi_cv_path_python3" != "X"; then |
| 1431 | |
| 1432 | dnl -- get its version number |
| 1433 | AC_CACHE_CHECK(Python version,vi_cv_var_python3_version, |
| 1434 | [[vi_cv_var_python3_version=` |
Bram Moolenaar | 3804aeb | 2010-07-19 21:18:54 +0200 | [diff] [blame] | 1435 | ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1436 | ]]) |
| 1437 | |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1438 | dnl -- it must be at least version 3 |
| 1439 | AC_MSG_CHECKING(Python is 3.0 or better) |
| 1440 | if ${vi_cv_path_python3} -c \ |
| 1441 | "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" |
| 1442 | then |
| 1443 | AC_MSG_RESULT(yep) |
Bram Moolenaar | 456f2bb | 2011-06-12 21:37:13 +0200 | [diff] [blame] | 1444 | |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1445 | dnl -- get abiflags for python 3.2 or higher (PEP 3149) |
| 1446 | AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags, |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1447 | [ |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1448 | vi_cv_var_python3_abiflags= |
| 1449 | if ${vi_cv_path_python3} -c \ |
| 1450 | "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" |
| 1451 | then |
| 1452 | vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ |
| 1453 | "import sys; print(sys.abiflags)"` |
| 1454 | fi ]) |
| 1455 | |
| 1456 | dnl -- find where python3 thinks it was installed |
| 1457 | AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, |
| 1458 | [ vi_cv_path_python3_pfx=` |
| 1459 | ${vi_cv_path_python3} -c \ |
| 1460 | "import sys; print(sys.prefix)"` ]) |
| 1461 | |
| 1462 | dnl -- and where it thinks it runs |
| 1463 | AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, |
| 1464 | [ vi_cv_path_python3_epfx=` |
| 1465 | ${vi_cv_path_python3} -c \ |
| 1466 | "import sys; print(sys.exec_prefix)"` ]) |
| 1467 | |
| 1468 | dnl -- python3's internal library path |
| 1469 | |
| 1470 | AC_CACHE_VAL(vi_cv_path_python3path, |
| 1471 | [ vi_cv_path_python3path=` |
| 1472 | unset PYTHONPATH; |
| 1473 | ${vi_cv_path_python3} -c \ |
| 1474 | "import sys, string; print(':'.join(sys.path))"` ]) |
| 1475 | |
| 1476 | dnl -- where the Python implementation library archives are |
| 1477 | |
| 1478 | AC_ARG_WITH(python3-config-dir, |
Bram Moolenaar | e1a3231 | 2018-04-15 16:03:25 +0200 | [diff] [blame] | 1479 | [ --with-python3-config-dir=PATH Python's config directory (deprecated)], |
Bram Moolenaar | d088240 | 2018-04-10 18:13:05 +0200 | [diff] [blame] | 1480 | [ vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1 ] ) |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1481 | |
| 1482 | AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, |
| 1483 | [ |
| 1484 | vi_cv_path_python3_conf= |
Bram Moolenaar | fee496d | 2013-07-12 20:07:24 +0200 | [diff] [blame] | 1485 | config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1486 | d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` |
| 1487 | if test -d "$d" && test -f "$d/config.c"; then |
| 1488 | vi_cv_path_python3_conf="$d" |
| 1489 | else |
| 1490 | for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do |
| 1491 | for subdir in lib64 lib share; do |
| 1492 | d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" |
| 1493 | if test -d "$d" && test -f "$d/config.c"; then |
| 1494 | vi_cv_path_python3_conf="$d" |
| 1495 | fi |
| 1496 | done |
| 1497 | done |
| 1498 | fi |
| 1499 | ]) |
| 1500 | |
| 1501 | PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" |
| 1502 | |
| 1503 | if test "X$PYTHON3_CONFDIR" = "X"; then |
| 1504 | AC_MSG_RESULT([can't find it!]) |
| 1505 | else |
| 1506 | |
| 1507 | dnl -- we need to examine Python's config/Makefile too |
| 1508 | dnl see what the interpreter is built from |
| 1509 | AC_CACHE_VAL(vi_cv_path_python3_plibs, |
| 1510 | [ |
| 1511 | pwd=`pwd` |
| 1512 | tmp_mkf="$pwd/config-PyMake$$" |
| 1513 | cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1514 | __: |
Bram Moolenaar | 3804aeb | 2010-07-19 21:18:54 +0200 | [diff] [blame] | 1515 | @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1516 | @echo "python3_LIBS='$(LIBS)'" |
| 1517 | @echo "python3_SYSLIBS='$(SYSLIBS)'" |
Bram Moolenaar | f94a13c | 2012-09-21 13:26:49 +0200 | [diff] [blame] | 1518 | @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" |
Bram Moolenaar | 2a7e2a6 | 2010-07-24 15:19:11 +0200 | [diff] [blame] | 1519 | @echo "python3_INSTSONAME='$(INSTSONAME)'" |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1520 | eof |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1521 | dnl -- delete the lines from make about Entering/Leaving directory |
| 1522 | eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
| 1523 | rm -f -- "${tmp_mkf}" |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1524 | vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1525 | vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" |
| 1526 | dnl remove -ltermcap, it can conflict with an earlier -lncurses |
| 1527 | vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` |
| 1528 | vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` |
| 1529 | ]) |
Bram Moolenaar | ba59ddb | 2016-01-28 15:34:25 +0100 | [diff] [blame] | 1530 | AC_CACHE_CHECK(Python3's dll name,vi_cv_dll_name_python3, |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1531 | [ |
| 1532 | if test "X$python3_DLLLIBRARY" != "X"; then |
| 1533 | vi_cv_dll_name_python3="$python3_DLLLIBRARY" |
| 1534 | else |
| 1535 | vi_cv_dll_name_python3="$python3_INSTSONAME" |
| 1536 | fi |
| 1537 | ]) |
| 1538 | |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1539 | PYTHON3_LIBS="${vi_cv_path_python3_plibs}" |
| 1540 | if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then |
Bram Moolenaar | 0424958 | 2018-04-10 13:29:34 +0200 | [diff] [blame] | 1541 | PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1542 | else |
Bram Moolenaar | 0424958 | 2018-04-10 13:29:34 +0200 | [diff] [blame] | 1543 | 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}" |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1544 | fi |
Bram Moolenaar | 3a21d9c | 2018-04-10 20:26:20 +0200 | [diff] [blame] | 1545 | if test "X$have_python3_config_dir" = "X1" -a "$enable_python3interp" = "dynamic"; then |
Bram Moolenaar | d088240 | 2018-04-10 18:13:05 +0200 | [diff] [blame] | 1546 | dnl Define PYTHON3_HOME if --with-python-config-dir was used |
| 1547 | PYTHON3_CFLAGS="${PYTHON3_CFLAGS} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" |
| 1548 | fi |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1549 | PYTHON3_SRC="if_python3.c" |
| 1550 | PYTHON3_OBJ="objects/if_python3.o" |
| 1551 | |
| 1552 | dnl On FreeBSD linking with "-pthread" is required to use threads. |
| 1553 | dnl _THREAD_SAFE must be used for compiling then. |
| 1554 | dnl The "-pthread" is added to $LIBS, so that the following check for |
| 1555 | dnl sigaltstack() will look in libc_r (it's there in libc!). |
| 1556 | dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC |
| 1557 | dnl will then define target-specific defines, e.g., -D_REENTRANT. |
| 1558 | dnl Don't do this for Mac OSX, -pthread will generate a warning. |
| 1559 | AC_MSG_CHECKING([if -pthread should be used]) |
| 1560 | threadsafe_flag= |
| 1561 | thread_lib= |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1562 | dnl if test "x$MACOS_X" != "xyes"; then |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1563 | if test "`(uname) 2>/dev/null`" != Darwin; then |
| 1564 | test "$GCC" = yes && threadsafe_flag="-pthread" |
| 1565 | if test "`(uname) 2>/dev/null`" = FreeBSD; then |
| 1566 | threadsafe_flag="-D_THREAD_SAFE" |
| 1567 | thread_lib="-pthread" |
| 1568 | fi |
| 1569 | if test "`(uname) 2>/dev/null`" = SunOS; then |
| 1570 | threadsafe_flag="-pthreads" |
| 1571 | fi |
| 1572 | fi |
| 1573 | libs_save_old=$LIBS |
| 1574 | if test -n "$threadsafe_flag"; then |
| 1575 | cflags_save=$CFLAGS |
| 1576 | CFLAGS="$CFLAGS $threadsafe_flag" |
| 1577 | LIBS="$LIBS $thread_lib" |
| 1578 | AC_TRY_LINK(,[ ], |
| 1579 | AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", |
| 1580 | AC_MSG_RESULT(no); LIBS=$libs_save_old |
| 1581 | ) |
| 1582 | CFLAGS=$cflags_save |
| 1583 | else |
| 1584 | AC_MSG_RESULT(no) |
| 1585 | fi |
| 1586 | |
| 1587 | dnl check that compiling a simple program still works with the flags |
| 1588 | dnl added for Python. |
| 1589 | AC_MSG_CHECKING([if compile and link flags for Python 3 are sane]) |
| 1590 | cflags_save=$CFLAGS |
| 1591 | libs_save=$LIBS |
| 1592 | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
| 1593 | LIBS="$LIBS $PYTHON3_LIBS" |
| 1594 | AC_TRY_LINK(,[ ], |
| 1595 | AC_MSG_RESULT(yes); python3_ok=yes, |
| 1596 | AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) |
| 1597 | CFLAGS=$cflags_save |
| 1598 | LIBS=$libs_save |
| 1599 | if test "$python3_ok" = yes; then |
| 1600 | AC_DEFINE(FEAT_PYTHON3) |
| 1601 | else |
| 1602 | LIBS=$libs_save_old |
| 1603 | PYTHON3_SRC= |
| 1604 | PYTHON3_OBJ= |
| 1605 | PYTHON3_LIBS= |
| 1606 | PYTHON3_CFLAGS= |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1607 | fi |
| 1608 | fi |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 1609 | else |
| 1610 | AC_MSG_RESULT(too old) |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1611 | fi |
| 1612 | fi |
Bram Moolenaar | 1612b1a | 2013-06-14 21:22:39 +0200 | [diff] [blame] | 1613 | if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then |
| 1614 | AC_MSG_ERROR([could not configure python3]) |
| 1615 | fi |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1616 | fi |
| 1617 | |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1618 | AC_SUBST(PYTHON3_LIBS) |
| 1619 | AC_SUBST(PYTHON3_CFLAGS) |
| 1620 | AC_SUBST(PYTHON3_SRC) |
| 1621 | AC_SUBST(PYTHON3_OBJ) |
| 1622 | |
| 1623 | dnl if python2.x and python3.x are enabled one can only link in code |
| 1624 | dnl with dlopen(), dlsym(), dlclose() |
| 1625 | if test "$python_ok" = yes && test "$python3_ok" = yes; then |
| 1626 | AC_DEFINE(DYNAMIC_PYTHON) |
| 1627 | AC_DEFINE(DYNAMIC_PYTHON3) |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1628 | AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python) |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1629 | cflags_save=$CFLAGS |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1630 | CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1631 | libs_save=$LIBS |
Bram Moolenaar | 6fabcbe | 2011-09-02 12:27:25 +0200 | [diff] [blame] | 1632 | dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1633 | LIBS="-ldl $LIBS" |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 1634 | AC_RUN_IFELSE([AC_LANG_SOURCE([ |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1635 | #include <dlfcn.h> |
| 1636 | /* If this program fails, then RTLD_GLOBAL is needed. |
| 1637 | * RTLD_GLOBAL will be used and then it is not possible to |
| 1638 | * have both python versions enabled in the same vim instance. |
Bram Moolenaar | 84a05ac | 2013-05-06 04:24:17 +0200 | [diff] [blame] | 1639 | * Only the first python version used will be switched on. |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1640 | */ |
| 1641 | |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1642 | int no_rtl_global_needed_for(char *python_instsoname, char *prefix) |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1643 | { |
| 1644 | int needed = 0; |
Bram Moolenaar | ba59ddb | 2016-01-28 15:34:25 +0100 | [diff] [blame] | 1645 | void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1646 | if (pylib != 0) |
| 1647 | { |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1648 | void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome"); |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1649 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
| 1650 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
| 1651 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1652 | (*pfx)(prefix); |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1653 | (*init)(); |
| 1654 | needed = (*simple)("import termios") == -1; |
| 1655 | (*final)(); |
| 1656 | dlclose(pylib); |
| 1657 | } |
| 1658 | return !needed; |
| 1659 | } |
| 1660 | |
| 1661 | int main(int argc, char** argv) |
| 1662 | { |
| 1663 | int not_needed = 0; |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1664 | if (no_rtl_global_needed_for("${vi_cv_dll_name_python}", "${vi_cv_path_python_pfx}")) |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1665 | not_needed = 1; |
| 1666 | return !not_needed; |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 1667 | }])], |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1668 | [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1669 | |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1670 | CFLAGS=$cflags_save |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1671 | LIBS=$libs_save |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1672 | |
| 1673 | AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3) |
| 1674 | cflags_save=$CFLAGS |
| 1675 | CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1676 | libs_save=$LIBS |
Bram Moolenaar | 6fabcbe | 2011-09-02 12:27:25 +0200 | [diff] [blame] | 1677 | dnl -ldl must go first to make this work on Archlinux (Roland Puntaier) |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1678 | LIBS="-ldl $LIBS" |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 1679 | AC_RUN_IFELSE([AC_LANG_SOURCE([ |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1680 | #include <dlfcn.h> |
| 1681 | #include <wchar.h> |
| 1682 | /* If this program fails, then RTLD_GLOBAL is needed. |
| 1683 | * RTLD_GLOBAL will be used and then it is not possible to |
| 1684 | * have both python versions enabled in the same vim instance. |
Bram Moolenaar | 84a05ac | 2013-05-06 04:24:17 +0200 | [diff] [blame] | 1685 | * Only the first python version used will be switched on. |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1686 | */ |
| 1687 | |
| 1688 | int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) |
| 1689 | { |
| 1690 | int needed = 0; |
Bram Moolenaar | ba59ddb | 2016-01-28 15:34:25 +0100 | [diff] [blame] | 1691 | void* pylib = dlopen(python_instsoname, RTLD_LAZY|RTLD_LOCAL); |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1692 | if (pylib != 0) |
| 1693 | { |
| 1694 | void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome"); |
| 1695 | void (*init)(void) = dlsym(pylib, "Py_Initialize"); |
| 1696 | int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString"); |
| 1697 | void (*final)(void) = dlsym(pylib, "Py_Finalize"); |
| 1698 | (*pfx)(prefix); |
| 1699 | (*init)(); |
| 1700 | needed = (*simple)("import termios") == -1; |
| 1701 | (*final)(); |
| 1702 | dlclose(pylib); |
| 1703 | } |
| 1704 | return !needed; |
| 1705 | } |
| 1706 | |
| 1707 | int main(int argc, char** argv) |
| 1708 | { |
| 1709 | int not_needed = 0; |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1710 | if (no_rtl_global_needed_for("${vi_cv_dll_name_python3}", L"${vi_cv_path_python3_pfx}")) |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1711 | not_needed = 1; |
| 1712 | return !not_needed; |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 1713 | }])], |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1714 | [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) |
| 1715 | |
| 1716 | CFLAGS=$cflags_save |
Bram Moolenaar | 5d3fbf3 | 2015-03-05 16:47:20 +0100 | [diff] [blame] | 1717 | LIBS=$libs_save |
Bram Moolenaar | 644d37b | 2010-11-16 19:26:02 +0100 | [diff] [blame] | 1718 | |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1719 | PYTHON_SRC="if_python.c" |
| 1720 | PYTHON_OBJ="objects/if_python.o" |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1721 | PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1722 | PYTHON_LIBS= |
| 1723 | PYTHON3_SRC="if_python3.c" |
| 1724 | PYTHON3_OBJ="objects/if_python3.o" |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1725 | PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1726 | PYTHON3_LIBS= |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1727 | elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then |
| 1728 | AC_DEFINE(DYNAMIC_PYTHON) |
| 1729 | PYTHON_SRC="if_python.c" |
| 1730 | PYTHON_OBJ="objects/if_python.o" |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1731 | PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${vi_cv_dll_name_python}\\\"" |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1732 | PYTHON_LIBS= |
Bram Moolenaar | e741f27 | 2013-07-09 21:57:52 +0200 | [diff] [blame] | 1733 | elif test "$python_ok" = yes; then |
| 1734 | dnl Check that adding -fPIE works. It may be needed when using a static |
| 1735 | dnl Python library. |
| 1736 | AC_MSG_CHECKING([if -fPIE can be added for Python]) |
| 1737 | cflags_save=$CFLAGS |
| 1738 | libs_save=$LIBS |
| 1739 | CFLAGS="$CFLAGS $PYTHON_CFLAGS -fPIE" |
| 1740 | LIBS="$LIBS $PYTHON_LIBS" |
| 1741 | AC_TRY_LINK(,[ ], |
| 1742 | AC_MSG_RESULT(yes); fpie_ok=yes, |
| 1743 | AC_MSG_RESULT(no); fpie_ok=no) |
| 1744 | CFLAGS=$cflags_save |
| 1745 | LIBS=$libs_save |
| 1746 | if test $fpie_ok = yes; then |
| 1747 | PYTHON_CFLAGS="$PYTHON_CFLAGS -fPIE" |
| 1748 | fi |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1749 | elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then |
| 1750 | AC_DEFINE(DYNAMIC_PYTHON3) |
| 1751 | PYTHON3_SRC="if_python3.c" |
| 1752 | PYTHON3_OBJ="objects/if_python3.o" |
Bram Moolenaar | cf1b057 | 2014-05-22 14:44:22 +0200 | [diff] [blame] | 1753 | PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${vi_cv_dll_name_python3}\\\"" |
Bram Moolenaar | b744b2f | 2010-08-13 16:22:57 +0200 | [diff] [blame] | 1754 | PYTHON3_LIBS= |
Bram Moolenaar | e741f27 | 2013-07-09 21:57:52 +0200 | [diff] [blame] | 1755 | elif test "$python3_ok" = yes; then |
| 1756 | dnl Check that adding -fPIE works. It may be needed when using a static |
| 1757 | dnl Python library. |
| 1758 | AC_MSG_CHECKING([if -fPIE can be added for Python3]) |
| 1759 | cflags_save=$CFLAGS |
| 1760 | libs_save=$LIBS |
| 1761 | CFLAGS="$CFLAGS $PYTHON3_CFLAGS -fPIE" |
| 1762 | LIBS="$LIBS $PYTHON3_LIBS" |
| 1763 | AC_TRY_LINK(,[ ], |
| 1764 | AC_MSG_RESULT(yes); fpie_ok=yes, |
| 1765 | AC_MSG_RESULT(no); fpie_ok=no) |
| 1766 | CFLAGS=$cflags_save |
| 1767 | LIBS=$libs_save |
| 1768 | if test $fpie_ok = yes; then |
| 1769 | PYTHON3_CFLAGS="$PYTHON3_CFLAGS -fPIE" |
| 1770 | fi |
Bram Moolenaar | bd5e15f | 2010-07-17 21:19:38 +0200 | [diff] [blame] | 1771 | fi |
| 1772 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1773 | AC_MSG_CHECKING(--enable-tclinterp argument) |
| 1774 | AC_ARG_ENABLE(tclinterp, |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 1775 | [ --enable-tclinterp[=OPTS] Include Tcl interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1776 | [enable_tclinterp="no"]) |
| 1777 | AC_MSG_RESULT($enable_tclinterp) |
| 1778 | |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 1779 | if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1780 | |
Bram Moolenaar | 9b5d4dd | 2008-01-01 15:26:45 +0000 | [diff] [blame] | 1781 | dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1782 | AC_MSG_CHECKING(--with-tclsh argument) |
| 1783 | AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)], |
| 1784 | tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name), |
Bram Moolenaar | 9b5d4dd | 2008-01-01 15:26:45 +0000 | [diff] [blame] | 1785 | tclsh_name="tclsh8.5"; AC_MSG_RESULT(no)) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1786 | AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
| 1787 | AC_SUBST(vi_cv_path_tcl) |
| 1788 | |
Bram Moolenaar | 9b5d4dd | 2008-01-01 15:26:45 +0000 | [diff] [blame] | 1789 | dnl when no specific version specified, also try 8.4, 8.2 and 8.0 |
| 1790 | if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then |
| 1791 | tclsh_name="tclsh8.4" |
| 1792 | AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
| 1793 | fi |
Bram Moolenaar | df3267e | 2005-01-25 22:07:05 +0000 | [diff] [blame] | 1794 | if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1795 | tclsh_name="tclsh8.2" |
| 1796 | AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
| 1797 | fi |
Bram Moolenaar | df3267e | 2005-01-25 22:07:05 +0000 | [diff] [blame] | 1798 | if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then |
| 1799 | tclsh_name="tclsh8.0" |
| 1800 | AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
| 1801 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1802 | dnl still didn't find it, try without version number |
| 1803 | if test "X$vi_cv_path_tcl" = "X"; then |
| 1804 | tclsh_name="tclsh" |
| 1805 | AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
| 1806 | fi |
| 1807 | if test "X$vi_cv_path_tcl" != "X"; then |
| 1808 | AC_MSG_CHECKING(Tcl version) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 1809 | if echo 'exit [[expr [info tclversion] < 8.0]]' | "$vi_cv_path_tcl" - ; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1810 | tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -` |
| 1811 | AC_MSG_RESULT($tclver - OK); |
| 1812 | 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 -` |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 1813 | tcldll=`echo 'puts libtcl[[info tclversion]][[info sharedlibextension]]' | $vi_cv_path_tcl -` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1814 | |
| 1815 | AC_MSG_CHECKING(for location of Tcl include) |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1816 | if test "x$MACOS_X" != "xyes"; then |
Bram Moolenaar | 0ff8f60 | 2008-02-20 11:44:03 +0000 | [diff] [blame] | 1817 | tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1818 | else |
| 1819 | dnl For Mac OS X 10.3, use the OS-provided framework location |
| 1820 | tclinc="/System/Library/Frameworks/Tcl.framework/Headers" |
| 1821 | fi |
Bram Moolenaar | 0ff8f60 | 2008-02-20 11:44:03 +0000 | [diff] [blame] | 1822 | TCL_INC= |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1823 | for try in $tclinc; do |
| 1824 | if test -f "$try/tcl.h"; then |
| 1825 | AC_MSG_RESULT($try/tcl.h) |
| 1826 | TCL_INC=$try |
| 1827 | break |
| 1828 | fi |
| 1829 | done |
| 1830 | if test -z "$TCL_INC"; then |
| 1831 | AC_MSG_RESULT(<not found>) |
| 1832 | SKIP_TCL=YES |
| 1833 | fi |
| 1834 | if test -z "$SKIP_TCL"; then |
| 1835 | AC_MSG_CHECKING(for location of tclConfig.sh script) |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 1836 | if test "x$MACOS_X" != "xyes"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1837 | tclcnf=`echo $tclinc | sed s/include/lib/g` |
Bram Moolenaar | 9b5d4dd | 2008-01-01 15:26:45 +0000 | [diff] [blame] | 1838 | tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1839 | else |
| 1840 | dnl For Mac OS X 10.3, use the OS-provided framework location |
| 1841 | tclcnf="/System/Library/Frameworks/Tcl.framework" |
| 1842 | fi |
| 1843 | for try in $tclcnf; do |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 1844 | if test -f "$try/tclConfig.sh"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1845 | AC_MSG_RESULT($try/tclConfig.sh) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 1846 | . "$try/tclConfig.sh" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1847 | dnl use eval, because tcl 8.2 includes ${TCL_DBGX} |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 1848 | if test "$enable_tclinterp" = "dynamic"; then |
| 1849 | TCL_LIBS=`eval echo "$TCL_STUB_LIB_SPEC $TCL_LIBS"` |
| 1850 | else |
| 1851 | TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"` |
| 1852 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1853 | dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the |
Bram Moolenaar | df3267e | 2005-01-25 22:07:05 +0000 | [diff] [blame] | 1854 | dnl "-D_ABC" items. Watch out for -DFOO=long\ long. |
Bram Moolenaar | 4394bff | 2008-07-24 11:21:31 +0000 | [diff] [blame] | 1855 | 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'` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1856 | break |
| 1857 | fi |
| 1858 | done |
| 1859 | if test -z "$TCL_LIBS"; then |
| 1860 | AC_MSG_RESULT(<not found>) |
| 1861 | AC_MSG_CHECKING(for Tcl library by myself) |
| 1862 | tcllib=`echo $tclinc | sed s/include/lib/g` |
Bram Moolenaar | 9b5d4dd | 2008-01-01 15:26:45 +0000 | [diff] [blame] | 1863 | tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1864 | for ext in .so .a ; do |
| 1865 | for ver in "" $tclver ; do |
| 1866 | for try in $tcllib ; do |
| 1867 | trylib=tcl$ver$ext |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 1868 | if test -f "$try/lib$trylib" ; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1869 | AC_MSG_RESULT($try/lib$trylib) |
Bram Moolenaar | 49222be | 2015-12-11 18:11:30 +0100 | [diff] [blame] | 1870 | TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1871 | if test "`(uname) 2>/dev/null`" = SunOS && |
| 1872 | uname -r | grep '^5' >/dev/null; then |
| 1873 | TCL_LIBS="$TCL_LIBS -R $try" |
| 1874 | fi |
| 1875 | break 3 |
| 1876 | fi |
| 1877 | done |
| 1878 | done |
| 1879 | done |
| 1880 | if test -z "$TCL_LIBS"; then |
| 1881 | AC_MSG_RESULT(<not found>) |
| 1882 | SKIP_TCL=YES |
| 1883 | fi |
| 1884 | fi |
| 1885 | if test -z "$SKIP_TCL"; then |
| 1886 | AC_DEFINE(FEAT_TCL) |
| 1887 | TCL_SRC=if_tcl.c |
| 1888 | TCL_OBJ=objects/if_tcl.o |
| 1889 | TCL_PRO=if_tcl.pro |
| 1890 | TCL_CFLAGS="-I$TCL_INC $TCL_DEFS" |
| 1891 | fi |
| 1892 | fi |
| 1893 | else |
| 1894 | AC_MSG_RESULT(too old; need Tcl version 8.0 or later) |
| 1895 | fi |
| 1896 | fi |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 1897 | if test "$enable_tclinterp" = "dynamic"; then |
| 1898 | if test "X$TCL_SRC" != "X" -a "X$tcldll" != "X"; then |
| 1899 | AC_DEFINE(DYNAMIC_TCL) |
| 1900 | TCL_CFLAGS="-DDYNAMIC_TCL_DLL=\\\"$tcldll\\\" -DDYNAMIC_TCL_VER=\\\"$tclver\\\" $TCL_CFLAGS" |
| 1901 | fi |
| 1902 | fi |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 1903 | if test "$fail_if_missing" = "yes" -a -z "$TCL_SRC"; then |
| 1904 | AC_MSG_ERROR([could not configure Tcl]) |
| 1905 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1906 | fi |
| 1907 | AC_SUBST(TCL_SRC) |
| 1908 | AC_SUBST(TCL_OBJ) |
| 1909 | AC_SUBST(TCL_PRO) |
| 1910 | AC_SUBST(TCL_CFLAGS) |
| 1911 | AC_SUBST(TCL_LIBS) |
| 1912 | |
| 1913 | AC_MSG_CHECKING(--enable-rubyinterp argument) |
| 1914 | AC_ARG_ENABLE(rubyinterp, |
Bram Moolenaar | 3ca71f1 | 2010-10-27 16:49:47 +0200 | [diff] [blame] | 1915 | [ --enable-rubyinterp[=OPTS] Include Ruby interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1916 | [enable_rubyinterp="no"]) |
| 1917 | AC_MSG_RESULT($enable_rubyinterp) |
Bram Moolenaar | 3ca71f1 | 2010-10-27 16:49:47 +0200 | [diff] [blame] | 1918 | if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then |
Bram Moolenaar | 0b10541 | 2014-11-30 13:34:23 +0100 | [diff] [blame] | 1919 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 1920 | AC_MSG_ERROR([cannot use Ruby with tiny or small features]) |
| 1921 | fi |
| 1922 | |
Bram Moolenaar | 165641d | 2010-02-17 16:23:09 +0100 | [diff] [blame] | 1923 | AC_MSG_CHECKING(--with-ruby-command argument) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1924 | AC_SUBST(vi_cv_path_ruby) |
Bram Moolenaar | 948733a | 2011-05-05 18:10:16 +0200 | [diff] [blame] | 1925 | AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], |
| 1926 | RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD), |
| 1927 | RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) |
Bram Moolenaar | 165641d | 2010-02-17 16:23:09 +0100 | [diff] [blame] | 1928 | AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1929 | if test "X$vi_cv_path_ruby" != "X"; then |
| 1930 | AC_MSG_CHECKING(Ruby version) |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1931 | if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1932 | AC_MSG_RESULT(OK) |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1933 | AC_MSG_CHECKING(Ruby rbconfig) |
| 1934 | ruby_rbconfig="RbConfig" |
| 1935 | if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then |
| 1936 | ruby_rbconfig="Config" |
| 1937 | fi |
| 1938 | AC_MSG_RESULT($ruby_rbconfig) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1939 | AC_MSG_CHECKING(Ruby header files) |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1940 | rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1941 | if test "X$rubyhdrdir" != "X"; then |
| 1942 | AC_MSG_RESULT($rubyhdrdir) |
| 1943 | RUBY_CFLAGS="-I$rubyhdrdir" |
Bram Moolenaar | a6fd37b | 2014-03-27 17:19:09 +0100 | [diff] [blame] | 1944 | rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"` |
| 1945 | if test -d "$rubyarchdir"; then |
| 1946 | RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir" |
Bram Moolenaar | 165641d | 2010-02-17 16:23:09 +0100 | [diff] [blame] | 1947 | fi |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1948 | rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"` |
Bram Moolenaar | 026a445 | 2013-08-07 15:22:23 +0200 | [diff] [blame] | 1949 | if test "X$rubyversion" = "X"; then |
| 1950 | rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[[0,2]]"` |
| 1951 | fi |
Bram Moolenaar | 165641d | 2010-02-17 16:23:09 +0100 | [diff] [blame] | 1952 | RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1953 | rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1954 | if test "X$rubylibs" != "X"; then |
| 1955 | RUBY_LIBS="$rubylibs" |
| 1956 | fi |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1957 | librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` |
| 1958 | librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` |
Bram Moolenaar | ac499e3 | 2013-06-02 19:14:17 +0200 | [diff] [blame] | 1959 | rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` |
Bram Moolenaar | 948733a | 2011-05-05 18:10:16 +0200 | [diff] [blame] | 1960 | if test -f "$rubylibdir/$librubya"; then |
| 1961 | librubyarg="$librubyarg" |
Bram Moolenaar | ac499e3 | 2013-06-02 19:14:17 +0200 | [diff] [blame] | 1962 | RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" |
| 1963 | elif test "$librubyarg" = "libruby.a"; then |
| 1964 | dnl required on Mac OS 10.3 where libruby.a doesn't exist |
| 1965 | librubyarg="-lruby" |
| 1966 | RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1967 | fi |
| 1968 | |
| 1969 | if test "X$librubyarg" != "X"; then |
| 1970 | RUBY_LIBS="$librubyarg $RUBY_LIBS" |
| 1971 | fi |
Bram Moolenaar | 8139889 | 2012-10-03 21:09:35 +0200 | [diff] [blame] | 1972 | rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1973 | if test "X$rubyldflags" != "X"; then |
Bram Moolenaar | 996b6d8 | 2009-07-22 09:17:23 +0000 | [diff] [blame] | 1974 | dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only |
| 1975 | dnl be included if requested by passing --with-mac-arch to |
| 1976 | dnl configure, so strip these flags first (if present) |
Bram Moolenaar | 5dff57d | 2010-07-24 16:19:44 +0200 | [diff] [blame] | 1977 | rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` |
Bram Moolenaar | 996b6d8 | 2009-07-22 09:17:23 +0000 | [diff] [blame] | 1978 | if test "X$rubyldflags" != "X"; then |
Bram Moolenaar | 2bcaec3 | 2014-03-27 18:51:11 +0100 | [diff] [blame] | 1979 | if test "X`echo \"$LDFLAGS\" | $FGREP -e \"$rubyldflags\"`" = "X"; then |
Bram Moolenaar | a6cc031 | 2013-06-18 23:31:55 +0200 | [diff] [blame] | 1980 | LDFLAGS="$rubyldflags $LDFLAGS" |
| 1981 | fi |
Bram Moolenaar | 996b6d8 | 2009-07-22 09:17:23 +0000 | [diff] [blame] | 1982 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1983 | fi |
| 1984 | RUBY_SRC="if_ruby.c" |
| 1985 | RUBY_OBJ="objects/if_ruby.o" |
| 1986 | RUBY_PRO="if_ruby.pro" |
| 1987 | AC_DEFINE(FEAT_RUBY) |
Bram Moolenaar | 3ca71f1 | 2010-10-27 16:49:47 +0200 | [diff] [blame] | 1988 | if test "$enable_rubyinterp" = "dynamic"; then |
Bram Moolenaar | 9202162 | 2017-10-12 12:33:43 +0200 | [diff] [blame] | 1989 | libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_ALIASES']].split[[0]]"` |
Bram Moolenaar | 87ea64c | 2018-08-04 15:13:34 +0200 | [diff] [blame] | 1990 | if test -z "$libruby_soname"; then |
| 1991 | libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` |
| 1992 | fi |
Bram Moolenaar | 3ca71f1 | 2010-10-27 16:49:47 +0200 | [diff] [blame] | 1993 | AC_DEFINE(DYNAMIC_RUBY) |
Bram Moolenaar | 41a4141 | 2020-01-07 21:32:19 +0100 | [diff] [blame] | 1994 | RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" |
Bram Moolenaar | 3ca71f1 | 2010-10-27 16:49:47 +0200 | [diff] [blame] | 1995 | RUBY_LIBS= |
| 1996 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1997 | else |
Bram Moolenaar | 165641d | 2010-02-17 16:23:09 +0100 | [diff] [blame] | 1998 | AC_MSG_RESULT(not found; disabling Ruby) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1999 | fi |
| 2000 | else |
| 2001 | AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) |
| 2002 | fi |
| 2003 | fi |
Bram Moolenaar | f788a06 | 2011-12-14 20:51:25 +0100 | [diff] [blame] | 2004 | |
| 2005 | if test "$fail_if_missing" = "yes" -a -z "$RUBY_OBJ"; then |
| 2006 | AC_MSG_ERROR([could not configure Ruby]) |
| 2007 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2008 | fi |
| 2009 | AC_SUBST(RUBY_SRC) |
| 2010 | AC_SUBST(RUBY_OBJ) |
| 2011 | AC_SUBST(RUBY_PRO) |
| 2012 | AC_SUBST(RUBY_CFLAGS) |
| 2013 | AC_SUBST(RUBY_LIBS) |
| 2014 | |
| 2015 | AC_MSG_CHECKING(--enable-cscope argument) |
| 2016 | AC_ARG_ENABLE(cscope, |
| 2017 | [ --enable-cscope Include cscope interface.], , |
| 2018 | [enable_cscope="no"]) |
| 2019 | AC_MSG_RESULT($enable_cscope) |
| 2020 | if test "$enable_cscope" = "yes"; then |
| 2021 | AC_DEFINE(FEAT_CSCOPE) |
| 2022 | fi |
| 2023 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2024 | AC_MSG_CHECKING(--disable-netbeans argument) |
| 2025 | AC_ARG_ENABLE(netbeans, |
| 2026 | [ --disable-netbeans Disable NetBeans integration support.], |
| 2027 | , [enable_netbeans="yes"]) |
| 2028 | if test "$enable_netbeans" = "yes"; then |
Bram Moolenaar | 3c124e3 | 2016-01-31 14:36:58 +0100 | [diff] [blame] | 2029 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 2030 | AC_MSG_RESULT([cannot use NetBeans with tiny or small features]) |
| 2031 | enable_netbeans="no" |
| 2032 | else |
| 2033 | AC_MSG_RESULT(no) |
| 2034 | fi |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2035 | else |
| 2036 | AC_MSG_RESULT(yes) |
| 2037 | fi |
| 2038 | |
| 2039 | AC_MSG_CHECKING(--disable-channel argument) |
| 2040 | AC_ARG_ENABLE(channel, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 2041 | [ --disable-channel Disable process communication support.], |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2042 | , [enable_channel="yes"]) |
| 2043 | if test "$enable_channel" = "yes"; then |
Bram Moolenaar | 3c124e3 | 2016-01-31 14:36:58 +0100 | [diff] [blame] | 2044 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 2045 | AC_MSG_RESULT([cannot use channels with tiny or small features]) |
| 2046 | enable_channel="no" |
| 2047 | else |
| 2048 | AC_MSG_RESULT(no) |
| 2049 | fi |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2050 | else |
| 2051 | if test "$enable_netbeans" = "yes"; then |
Bram Moolenaar | 1643548 | 2016-01-24 21:31:54 +0100 | [diff] [blame] | 2052 | AC_MSG_RESULT([yes, netbeans also disabled]) |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2053 | enable_netbeans="no" |
| 2054 | else |
| 2055 | AC_MSG_RESULT(yes) |
| 2056 | fi |
| 2057 | fi |
| 2058 | |
Bram Moolenaar | 1643548 | 2016-01-24 21:31:54 +0100 | [diff] [blame] | 2059 | if test "$enable_channel" = "yes"; then |
Bram Moolenaar | bfe13cc | 2020-04-12 17:53:12 +0200 | [diff] [blame] | 2060 | dnl On Solaris we need the socket library, or on Haiku the network library. |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2061 | if test "x$HAIKU" = "xyes"; then |
| 2062 | AC_CHECK_LIB(network, socket) |
| 2063 | else |
| 2064 | AC_CHECK_LIB(socket, socket) |
| 2065 | fi |
| 2066 | |
Bram Moolenaar | bfe13cc | 2020-04-12 17:53:12 +0200 | [diff] [blame] | 2067 | AC_CACHE_CHECK([whether compiling with IPv6 networking is possible], [vim_cv_ipv6_networking], |
| 2068 | [AC_TRY_LINK([ |
| 2069 | #include <stdio.h> |
| 2070 | #include <stdlib.h> |
| 2071 | #include <stdarg.h> |
| 2072 | #include <fcntl.h> |
| 2073 | #include <netdb.h> |
| 2074 | #include <netinet/in.h> |
| 2075 | #include <errno.h> |
| 2076 | #include <sys/types.h> |
| 2077 | #include <sys/socket.h> |
| 2078 | /* Check bitfields */ |
| 2079 | struct nbbuf { |
| 2080 | unsigned int initDone:1; |
| 2081 | unsigned short signmaplen; |
| 2082 | }; |
| 2083 | ], [ |
| 2084 | /* Check creating a socket. */ |
| 2085 | struct sockaddr_in server; |
| 2086 | struct addrinfo *res; |
| 2087 | (void)socket(AF_INET, SOCK_STREAM, 0); |
| 2088 | (void)htons(100); |
| 2089 | (void)getaddrinfo("microsoft.com", NULL, NULL, &res); |
| 2090 | if (errno == ECONNREFUSED) |
| 2091 | (void)connect(1, (struct sockaddr *)&server, sizeof(server)); |
| 2092 | (void)freeaddrinfo(res); |
| 2093 | ], |
| 2094 | [vim_cv_ipv6_networking="yes"], |
| 2095 | [vim_cv_ipv6_networking="no"])]) |
| 2096 | |
| 2097 | if test "x$vim_cv_ipv6_networking" = "xyes"; then |
| 2098 | AC_DEFINE(FEAT_IPV6) |
Bram Moolenaar | b6fb051 | 2020-04-18 18:24:18 +0200 | [diff] [blame] | 2099 | AC_CHECK_FUNCS(inet_ntop) |
Bram Moolenaar | bfe13cc | 2020-04-12 17:53:12 +0200 | [diff] [blame] | 2100 | else |
| 2101 | dnl On Solaris we need the nsl library. |
| 2102 | AC_CHECK_LIB(nsl, gethostbyname) |
| 2103 | AC_CACHE_CHECK([whether compiling with IPv4 networking is possible], [vim_cv_ipv4_networking], |
| 2104 | [AC_TRY_LINK([ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2105 | #include <stdio.h> |
| 2106 | #include <stdlib.h> |
| 2107 | #include <stdarg.h> |
| 2108 | #include <fcntl.h> |
| 2109 | #include <netdb.h> |
| 2110 | #include <netinet/in.h> |
| 2111 | #include <errno.h> |
| 2112 | #include <sys/types.h> |
| 2113 | #include <sys/socket.h> |
| 2114 | /* Check bitfields */ |
| 2115 | struct nbbuf { |
| 2116 | unsigned int initDone:1; |
Bram Moolenaar | 63de19e | 2016-12-09 20:11:26 +0100 | [diff] [blame] | 2117 | unsigned short signmaplen; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2118 | }; |
| 2119 | ], [ |
| 2120 | /* Check creating a socket. */ |
| 2121 | struct sockaddr_in server; |
| 2122 | (void)socket(AF_INET, SOCK_STREAM, 0); |
| 2123 | (void)htons(100); |
| 2124 | (void)gethostbyname("microsoft.com"); |
| 2125 | if (errno == ECONNREFUSED) |
| 2126 | (void)connect(1, (struct sockaddr *)&server, sizeof(server)); |
| 2127 | ], |
Bram Moolenaar | bfe13cc | 2020-04-12 17:53:12 +0200 | [diff] [blame] | 2128 | [vim_cv_ipv4_networking="yes"], |
| 2129 | [vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no"])]) |
| 2130 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2131 | fi |
| 2132 | if test "$enable_netbeans" = "yes"; then |
| 2133 | AC_DEFINE(FEAT_NETBEANS_INTG) |
| 2134 | NETBEANS_SRC="netbeans.c" |
| 2135 | AC_SUBST(NETBEANS_SRC) |
| 2136 | NETBEANS_OBJ="objects/netbeans.o" |
| 2137 | AC_SUBST(NETBEANS_OBJ) |
| 2138 | fi |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2139 | if test "$enable_channel" = "yes"; then |
Bram Moolenaar | 509ce2a | 2016-03-11 22:52:15 +0100 | [diff] [blame] | 2140 | AC_DEFINE(FEAT_JOB_CHANNEL) |
Bram Moolenaar | e0874f8 | 2016-01-24 20:36:41 +0100 | [diff] [blame] | 2141 | CHANNEL_SRC="channel.c" |
| 2142 | AC_SUBST(CHANNEL_SRC) |
| 2143 | CHANNEL_OBJ="objects/channel.o" |
| 2144 | AC_SUBST(CHANNEL_OBJ) |
| 2145 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2146 | |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2147 | AC_MSG_CHECKING(--enable-terminal argument) |
| 2148 | AC_ARG_ENABLE(terminal, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 2149 | [ --enable-terminal Enable terminal emulation support.], |
Bram Moolenaar | ef83956 | 2017-10-28 20:28:23 +0200 | [diff] [blame] | 2150 | , [enable_terminal="auto"]) |
Bram Moolenaar | 595a402 | 2017-09-03 19:15:57 +0200 | [diff] [blame] | 2151 | if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2152 | if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then |
| 2153 | AC_MSG_RESULT([cannot use terminal emulator with tiny or small features]) |
| 2154 | enable_terminal="no" |
| 2155 | else |
Bram Moolenaar | 595a402 | 2017-09-03 19:15:57 +0200 | [diff] [blame] | 2156 | if test "$enable_terminal" = "auto"; then |
| 2157 | enable_terminal="yes" |
| 2158 | AC_MSG_RESULT(defaulting to yes) |
| 2159 | else |
| 2160 | AC_MSG_RESULT(yes) |
| 2161 | fi |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2162 | fi |
| 2163 | else |
Bram Moolenaar | 595a402 | 2017-09-03 19:15:57 +0200 | [diff] [blame] | 2164 | if test "$enable_terminal" = "auto"; then |
| 2165 | enable_terminal="no" |
| 2166 | AC_MSG_RESULT(defaulting to no) |
| 2167 | else |
| 2168 | AC_MSG_RESULT(no) |
| 2169 | fi |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2170 | fi |
Bram Moolenaar | 8b42328 | 2017-12-16 14:37:06 +0100 | [diff] [blame] | 2171 | if test "$enable_terminal" = "yes" -a "$enable_channel" = "yes"; then |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2172 | AC_DEFINE(FEAT_TERMINAL) |
Bram Moolenaar | 9326805 | 2019-10-10 13:22:54 +0200 | [diff] [blame] | 2173 | TERM_SRC="libvterm/src/encoding.c libvterm/src/keyboard.c libvterm/src/mouse.c libvterm/src/parser.c libvterm/src/pen.c libvterm/src/creen.c libvterm/src/state.c libvterm/src/unicode.c libvterm/src/vterm.c" |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2174 | AC_SUBST(TERM_SRC) |
Bram Moolenaar | 9326805 | 2019-10-10 13:22:54 +0200 | [diff] [blame] | 2175 | TERM_OBJ="objects/vterm_encoding.o objects/vterm_keyboard.o objects/vterm_mouse.o objects/vterm_parser.o objects/vterm_pen.o objects/vterm_screen.o objects/vterm_state.o objects/vterm_unicode.o objects/vterm_vterm.o" |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2176 | AC_SUBST(TERM_OBJ) |
Bram Moolenaar | 823edd1 | 2019-10-23 22:35:36 +0200 | [diff] [blame] | 2177 | TERM_TEST="test_libvterm" |
| 2178 | AC_SUBST(TERM_TEST) |
Bram Moolenaar | e4f25e4 | 2017-07-07 11:54:15 +0200 | [diff] [blame] | 2179 | fi |
| 2180 | |
Bram Moolenaar | e42a6d2 | 2017-11-12 19:21:51 +0100 | [diff] [blame] | 2181 | AC_MSG_CHECKING(--enable-autoservername argument) |
| 2182 | AC_ARG_ENABLE(autoservername, |
| 2183 | [ --enable-autoservername Automatically define servername at vim startup.], , |
| 2184 | [enable_autoservername="no"]) |
| 2185 | AC_MSG_RESULT($enable_autoservername) |
| 2186 | if test "$enable_autoservername" = "yes"; then |
| 2187 | AC_DEFINE(FEAT_AUTOSERVERNAME) |
| 2188 | fi |
| 2189 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2190 | AC_MSG_CHECKING(--enable-multibyte argument) |
| 2191 | AC_ARG_ENABLE(multibyte, |
| 2192 | [ --enable-multibyte Include multibyte editing support.], , |
Bram Moolenaar | 2be7cb7 | 2019-01-12 16:10:51 +0100 | [diff] [blame] | 2193 | [enable_multibyte="yes"]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2194 | AC_MSG_RESULT($enable_multibyte) |
Bram Moolenaar | 30276f2 | 2019-01-24 17:59:39 +0100 | [diff] [blame] | 2195 | if test "$enable_multibyte" != "yes"; then |
Bram Moolenaar | 2be7cb7 | 2019-01-12 16:10:51 +0100 | [diff] [blame] | 2196 | AC_MSG_ERROR([The multi-byte feature can no longer be disabled. If you have |
| 2197 | a problem with this, discuss on the Vim mailing list.]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2198 | fi |
| 2199 | |
Bram Moolenaar | 5c5697f | 2018-12-12 20:34:09 +0100 | [diff] [blame] | 2200 | dnl Right-to-Left language support for Vim will be included with big features, |
| 2201 | dnl unless ENABLE_RIGHTLEFT is undefined. |
| 2202 | AC_MSG_CHECKING(--disable-rightleft argument) |
| 2203 | AC_ARG_ENABLE(rightleft, |
| 2204 | [ --disable-rightleft Do not include Right-to-Left language support.], |
| 2205 | , [enable_rightleft="yes"]) |
| 2206 | if test "$enable_rightleft" = "yes"; then |
| 2207 | AC_MSG_RESULT(no) |
| 2208 | else |
| 2209 | AC_MSG_RESULT(yes) |
| 2210 | AC_DEFINE(DISABLE_RIGHTLEFT) |
| 2211 | fi |
| 2212 | |
| 2213 | dnl Arabic language support for Vim will be included with big features, |
| 2214 | dnl unless ENABLE_ARABIC is undefined. |
| 2215 | AC_MSG_CHECKING(--disable-arabic argument) |
| 2216 | AC_ARG_ENABLE(arabic, |
| 2217 | [ --disable-arabic Do not include Arabic language support.], |
| 2218 | , [enable_arabic="yes"]) |
| 2219 | if test "$enable_arabic" = "yes"; then |
| 2220 | AC_MSG_RESULT(no) |
| 2221 | else |
| 2222 | AC_MSG_RESULT(yes) |
| 2223 | AC_DEFINE(DISABLE_ARABIC) |
| 2224 | fi |
| 2225 | |
Bram Moolenaar | 14184a3 | 2019-02-16 15:10:30 +0100 | [diff] [blame] | 2226 | dnl Farsi language support has been removed, ignore --disable-farsi |
Bram Moolenaar | 5c5697f | 2018-12-12 20:34:09 +0100 | [diff] [blame] | 2227 | AC_ARG_ENABLE(farsi, |
Bram Moolenaar | 14184a3 | 2019-02-16 15:10:30 +0100 | [diff] [blame] | 2228 | [ --disable-farsi Deprecated.],,) |
Bram Moolenaar | 5c5697f | 2018-12-12 20:34:09 +0100 | [diff] [blame] | 2229 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2230 | AC_MSG_CHECKING(--enable-xim argument) |
| 2231 | AC_ARG_ENABLE(xim, |
| 2232 | [ --enable-xim Include XIM input support.], |
| 2233 | AC_MSG_RESULT($enable_xim), |
| 2234 | [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2235 | |
| 2236 | AC_MSG_CHECKING(--enable-fontset argument) |
| 2237 | AC_ARG_ENABLE(fontset, |
| 2238 | [ --enable-fontset Include X fontset output support.], , |
| 2239 | [enable_fontset="no"]) |
| 2240 | AC_MSG_RESULT($enable_fontset) |
| 2241 | dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI |
| 2242 | |
| 2243 | test -z "$with_x" && with_x=yes |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 2244 | test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2245 | if test "$with_x" = no; then |
| 2246 | AC_MSG_RESULT(defaulting to: don't HAVE_X11) |
| 2247 | else |
| 2248 | dnl Do this check early, so that its failure can override user requests. |
| 2249 | |
| 2250 | AC_PATH_PROG(xmkmfpath, xmkmf) |
| 2251 | |
| 2252 | AC_PATH_XTRA |
| 2253 | |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 2254 | dnl On z/OS Unix the X libraries are DLLs. To use them the code must |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2255 | dnl be compiled with a special option. |
| 2256 | dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS. |
Bram Moolenaar | 2c704a7 | 2010-06-03 21:17:25 +0200 | [diff] [blame] | 2257 | if test "$zOSUnix" = "yes"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2258 | CFLAGS="$CFLAGS -W c,dll" |
| 2259 | LDFLAGS="$LDFLAGS -W l,dll" |
| 2260 | X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu" |
| 2261 | fi |
| 2262 | |
| 2263 | dnl On my HPUX system the X include dir is found, but the lib dir not. |
Bram Moolenaar | 7077892 | 2020-02-05 20:44:24 +0100 | [diff] [blame] | 2264 | dnl This is a desperate try to fix this. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2265 | |
| 2266 | if test -d "$x_includes" && test ! -d "$x_libraries"; then |
| 2267 | x_libraries=`echo "$x_includes" | sed s/include/lib/` |
| 2268 | AC_MSG_RESULT(Corrected X libraries to $x_libraries) |
| 2269 | X_LIBS="$X_LIBS -L$x_libraries" |
| 2270 | if test "`(uname) 2>/dev/null`" = SunOS && |
| 2271 | uname -r | grep '^5' >/dev/null; then |
| 2272 | X_LIBS="$X_LIBS -R $x_libraries" |
| 2273 | fi |
| 2274 | fi |
| 2275 | |
| 2276 | if test -d "$x_libraries" && test ! -d "$x_includes"; then |
| 2277 | x_includes=`echo "$x_libraries" | sed s/lib/include/` |
| 2278 | AC_MSG_RESULT(Corrected X includes to $x_includes) |
| 2279 | X_CFLAGS="$X_CFLAGS -I$x_includes" |
| 2280 | fi |
| 2281 | |
| 2282 | dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed. |
| 2283 | X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`" |
| 2284 | dnl Remove "-L/usr/lib " from X_LIBS, should not be needed. |
| 2285 | X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`" |
| 2286 | dnl Same for "-R/usr/lib ". |
| 2287 | X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`" |
| 2288 | |
| 2289 | |
| 2290 | dnl Check if the X11 header files are correctly installed. On some systems |
Bram Moolenaar | 00ca284 | 2008-06-26 20:14:00 +0000 | [diff] [blame] | 2291 | dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h |
| 2292 | dnl is missing. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2293 | AC_MSG_CHECKING(if X11 header files can be found) |
| 2294 | cflags_save=$CFLAGS |
| 2295 | CFLAGS="$CFLAGS $X_CFLAGS" |
Bram Moolenaar | 00ca284 | 2008-06-26 20:14:00 +0000 | [diff] [blame] | 2296 | AC_TRY_COMPILE([#include <X11/Xlib.h> |
| 2297 | #include <X11/Intrinsic.h>], , |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2298 | AC_MSG_RESULT(yes), |
| 2299 | AC_MSG_RESULT(no); no_x=yes) |
| 2300 | CFLAGS=$cflags_save |
| 2301 | |
| 2302 | if test "${no_x-no}" = yes; then |
| 2303 | with_x=no |
| 2304 | else |
| 2305 | AC_DEFINE(HAVE_X11) |
| 2306 | X_LIB="-lXt -lX11"; |
| 2307 | AC_SUBST(X_LIB) |
| 2308 | |
| 2309 | ac_save_LDFLAGS="$LDFLAGS" |
| 2310 | LDFLAGS="-L$x_libraries $LDFLAGS" |
| 2311 | |
| 2312 | dnl Check for -lXdmcp (needed on SunOS 4.1.4) |
| 2313 | dnl For HP-UX 10.20 it must be before -lSM -lICE |
| 2314 | AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],, |
| 2315 | [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp]) |
| 2316 | |
| 2317 | dnl Some systems need -lnsl -lsocket when testing for ICE. |
| 2318 | dnl The check above doesn't do this, try here (again). Also needed to get |
| 2319 | dnl them after Xdmcp. link.sh will remove them when not needed. |
| 2320 | dnl Check for other function than above to avoid the cached value |
| 2321 | AC_CHECK_LIB(ICE, IceOpenConnection, |
| 2322 | [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS]) |
| 2323 | |
| 2324 | dnl Check for -lXpm (needed for some versions of Motif) |
| 2325 | LDFLAGS="$X_LIBS $ac_save_LDFLAGS" |
| 2326 | AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],, |
| 2327 | [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS]) |
| 2328 | |
| 2329 | dnl Check that the X11 header files don't use implicit declarations |
| 2330 | AC_MSG_CHECKING(if X11 header files implicitly declare return values) |
| 2331 | cflags_save=$CFLAGS |
Bram Moolenaar | d186459 | 2013-05-04 04:40:15 +0200 | [diff] [blame] | 2332 | dnl -Werror is GCC only, others like Solaris Studio might not like it |
| 2333 | if test "$GCC" = yes; then |
| 2334 | CFLAGS="$CFLAGS $X_CFLAGS -Werror" |
| 2335 | else |
| 2336 | CFLAGS="$CFLAGS $X_CFLAGS" |
| 2337 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2338 | AC_TRY_COMPILE([#include <X11/Xlib.h>], , |
| 2339 | AC_MSG_RESULT(no), |
| 2340 | CFLAGS="$CFLAGS -Wno-implicit-int" |
| 2341 | AC_TRY_COMPILE([#include <X11/Xlib.h>], , |
| 2342 | AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int", |
| 2343 | AC_MSG_RESULT(test failed) |
| 2344 | ) |
| 2345 | ) |
| 2346 | CFLAGS=$cflags_save |
| 2347 | |
| 2348 | LDFLAGS="$ac_save_LDFLAGS" |
| 2349 | |
Bram Moolenaar | 4bdbbf7 | 2009-05-21 21:27:43 +0000 | [diff] [blame] | 2350 | AC_MSG_CHECKING(size of wchar_t is 2 bytes) |
| 2351 | AC_CACHE_VAL(ac_cv_small_wchar_t, |
| 2352 | [AC_TRY_RUN([ |
| 2353 | #include <X11/Xlib.h> |
| 2354 | #if STDC_HEADERS |
| 2355 | # include <stdlib.h> |
| 2356 | # include <stddef.h> |
| 2357 | #endif |
| 2358 | main() |
| 2359 | { |
| 2360 | if (sizeof(wchar_t) <= 2) |
| 2361 | exit(1); |
| 2362 | exit(0); |
| 2363 | }], |
| 2364 | ac_cv_small_wchar_t="no", |
| 2365 | ac_cv_small_wchar_t="yes", |
| 2366 | AC_MSG_ERROR(failed to compile test program))]) |
| 2367 | AC_MSG_RESULT($ac_cv_small_wchar_t) |
| 2368 | if test "x$ac_cv_small_wchar_t" = "xyes" ; then |
| 2369 | AC_DEFINE(SMALL_WCHAR_T) |
| 2370 | fi |
| 2371 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2372 | fi |
| 2373 | fi |
| 2374 | |
Bram Moolenaar | d2a0549 | 2018-07-27 22:35:15 +0200 | [diff] [blame] | 2375 | dnl Check if --with-x was given but it doesn't work. |
| 2376 | if test "x$with_x" = xno -a "x$with_x_arg" = xyes; then |
| 2377 | AC_MSG_ERROR([could not configure X]) |
| 2378 | fi |
| 2379 | |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2380 | test "x$with_x" = xno -a "x$HAIKU" != "xyes" -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2381 | |
| 2382 | AC_MSG_CHECKING(--enable-gui argument) |
| 2383 | AC_ARG_ENABLE(gui, |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2384 | [ --enable-gui[=OPTS] X11 GUI. [default=auto] [OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/haiku/photon/carbon]], , enable_gui="auto") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2385 | |
| 2386 | dnl Canonicalize the --enable-gui= argument so that it can be easily compared. |
| 2387 | dnl Do not use character classes for portability with old tools. |
| 2388 | enable_gui_canon=`echo "_$enable_gui" | \ |
| 2389 | sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
| 2390 | |
| 2391 | dnl Skip everything by default. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2392 | SKIP_GTK2=YES |
Bram Moolenaar | 1858a84 | 2016-02-23 22:30:31 +0100 | [diff] [blame] | 2393 | SKIP_GTK3=YES |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2394 | SKIP_GNOME=YES |
| 2395 | SKIP_MOTIF=YES |
| 2396 | SKIP_ATHENA=YES |
| 2397 | SKIP_NEXTAW=YES |
| 2398 | SKIP_PHOTON=YES |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2399 | SKIP_HAIKU=YES |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2400 | SKIP_CARBON=YES |
| 2401 | GUITYPE=NONE |
| 2402 | |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2403 | if test "x$HAIKU" = "xyes"; then |
| 2404 | SKIP_HAIKU= |
| 2405 | case "$enable_gui_canon" in |
| 2406 | no) AC_MSG_RESULT(no GUI support) |
| 2407 | SKIP_HAIKU=YES ;; |
| 2408 | yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; |
| 2409 | auto) AC_MSG_RESULT(auto - automatic GUI support) ;; |
| 2410 | haiku) AC_MSG_RESULT(Haiku GUI support) ;; |
| 2411 | *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) |
| 2412 | SKIP_HAIKU=YES ;; |
| 2413 | esac |
| 2414 | elif test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2415 | SKIP_PHOTON= |
| 2416 | case "$enable_gui_canon" in |
| 2417 | no) AC_MSG_RESULT(no GUI support) |
| 2418 | SKIP_PHOTON=YES ;; |
Bram Moolenaar | af0839a | 2018-12-30 22:55:47 +0100 | [diff] [blame] | 2419 | yes|""|auto) AC_MSG_RESULT(automatic GUI support) |
| 2420 | gui_auto=yes ;; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2421 | photon) AC_MSG_RESULT(Photon GUI support) ;; |
| 2422 | *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) |
| 2423 | SKIP_PHOTON=YES ;; |
| 2424 | esac |
| 2425 | |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 2426 | elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2427 | SKIP_CARBON= |
| 2428 | case "$enable_gui_canon" in |
| 2429 | no) AC_MSG_RESULT(no GUI support) |
| 2430 | SKIP_CARBON=YES ;; |
Bram Moolenaar | af0839a | 2018-12-30 22:55:47 +0100 | [diff] [blame] | 2431 | yes|"") AC_MSG_RESULT(yes - automatic GUI support) |
| 2432 | gui_auto=yes ;; |
Bram Moolenaar | 164fca3 | 2010-07-14 13:58:07 +0200 | [diff] [blame] | 2433 | auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support) |
| 2434 | SKIP_CARBON=YES ;; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2435 | carbon) AC_MSG_RESULT(Carbon GUI support) ;; |
| 2436 | *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) |
| 2437 | SKIP_CARBON=YES ;; |
| 2438 | esac |
| 2439 | |
| 2440 | else |
| 2441 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2442 | case "$enable_gui_canon" in |
| 2443 | no|none) AC_MSG_RESULT(no GUI support) ;; |
| 2444 | yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support) |
Bram Moolenaar | af0839a | 2018-12-30 22:55:47 +0100 | [diff] [blame] | 2445 | gui_auto=yes |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2446 | SKIP_GTK2= |
| 2447 | SKIP_GNOME= |
| 2448 | SKIP_MOTIF= |
| 2449 | SKIP_ATHENA= |
| 2450 | SKIP_NEXTAW= |
| 2451 | SKIP_CARBON=;; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2452 | gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2453 | SKIP_GTK2=;; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2454 | gnome2) AC_MSG_RESULT(GNOME 2.x GUI support) |
| 2455 | SKIP_GNOME= |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2456 | SKIP_GTK2=;; |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2457 | gtk3) AC_MSG_RESULT(GTK+ 3.x GUI support) |
| 2458 | SKIP_GTK3=;; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2459 | motif) AC_MSG_RESULT(Motif GUI support) |
| 2460 | SKIP_MOTIF=;; |
| 2461 | athena) AC_MSG_RESULT(Athena GUI support) |
| 2462 | SKIP_ATHENA=;; |
| 2463 | nextaw) AC_MSG_RESULT(neXtaw GUI support) |
| 2464 | SKIP_NEXTAW=;; |
| 2465 | *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;; |
| 2466 | esac |
| 2467 | |
| 2468 | fi |
| 2469 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2470 | if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \ |
| 2471 | -a "$enable_gui_canon" != "gnome2"; then |
| 2472 | AC_MSG_CHECKING(whether or not to look for GTK+ 2) |
| 2473 | AC_ARG_ENABLE(gtk2-check, |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2474 | [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2475 | , enable_gtk2_check="yes") |
| 2476 | AC_MSG_RESULT($enable_gtk2_check) |
| 2477 | if test "x$enable_gtk2_check" = "xno"; then |
| 2478 | SKIP_GTK2=YES |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2479 | SKIP_GNOME=YES |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2480 | fi |
| 2481 | fi |
| 2482 | |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2483 | if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2484 | AC_MSG_CHECKING(whether or not to look for GNOME) |
| 2485 | AC_ARG_ENABLE(gnome-check, |
| 2486 | [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]], |
| 2487 | , enable_gnome_check="no") |
| 2488 | AC_MSG_RESULT($enable_gnome_check) |
| 2489 | if test "x$enable_gnome_check" = "xno"; then |
| 2490 | SKIP_GNOME=YES |
| 2491 | fi |
| 2492 | fi |
| 2493 | |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2494 | if test "x$SKIP_GTK3" != "xYES" -a "$enable_gui_canon" != "gtk3"; then |
| 2495 | AC_MSG_CHECKING(whether or not to look for GTK+ 3) |
| 2496 | AC_ARG_ENABLE(gtk3-check, |
| 2497 | [ --enable-gtk3-check If auto-select GUI, check for GTK+ 3 [default=yes]], |
| 2498 | , enable_gtk3_check="yes") |
| 2499 | AC_MSG_RESULT($enable_gtk3_check) |
| 2500 | if test "x$enable_gtk3_check" = "xno"; then |
| 2501 | SKIP_GTK3=YES |
| 2502 | fi |
| 2503 | fi |
| 2504 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2505 | if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then |
| 2506 | AC_MSG_CHECKING(whether or not to look for Motif) |
| 2507 | AC_ARG_ENABLE(motif-check, |
| 2508 | [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]], |
| 2509 | , enable_motif_check="yes") |
| 2510 | AC_MSG_RESULT($enable_motif_check) |
| 2511 | if test "x$enable_motif_check" = "xno"; then |
| 2512 | SKIP_MOTIF=YES |
| 2513 | fi |
| 2514 | fi |
| 2515 | |
| 2516 | if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then |
| 2517 | AC_MSG_CHECKING(whether or not to look for Athena) |
| 2518 | AC_ARG_ENABLE(athena-check, |
| 2519 | [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]], |
| 2520 | , enable_athena_check="yes") |
| 2521 | AC_MSG_RESULT($enable_athena_check) |
| 2522 | if test "x$enable_athena_check" = "xno"; then |
| 2523 | SKIP_ATHENA=YES |
| 2524 | fi |
| 2525 | fi |
| 2526 | |
| 2527 | if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then |
| 2528 | AC_MSG_CHECKING(whether or not to look for neXtaw) |
| 2529 | AC_ARG_ENABLE(nextaw-check, |
| 2530 | [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]], |
| 2531 | , enable_nextaw_check="yes") |
| 2532 | AC_MSG_RESULT($enable_nextaw_check); |
| 2533 | if test "x$enable_nextaw_check" = "xno"; then |
| 2534 | SKIP_NEXTAW=YES |
| 2535 | fi |
| 2536 | fi |
| 2537 | |
| 2538 | if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then |
| 2539 | AC_MSG_CHECKING(whether or not to look for Carbon) |
| 2540 | AC_ARG_ENABLE(carbon-check, |
| 2541 | [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]], |
| 2542 | , enable_carbon_check="yes") |
| 2543 | AC_MSG_RESULT($enable_carbon_check); |
| 2544 | if test "x$enable_carbon_check" = "xno"; then |
| 2545 | SKIP_CARBON=YES |
| 2546 | fi |
| 2547 | fi |
| 2548 | |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 2549 | |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 2550 | if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2551 | AC_MSG_CHECKING(for Carbon GUI) |
Bram Moolenaar | 1471681 | 2006-05-04 21:54:08 +0000 | [diff] [blame] | 2552 | dnl already did the check, just give the message |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2553 | AC_MSG_RESULT(yes); |
| 2554 | GUITYPE=CARBONGUI |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 2555 | if test "$VIMNAME" = "vim"; then |
| 2556 | VIMNAME=Vim |
| 2557 | fi |
Bram Moolenaar | 1471681 | 2006-05-04 21:54:08 +0000 | [diff] [blame] | 2558 | |
Bram Moolenaar | 164fca3 | 2010-07-14 13:58:07 +0200 | [diff] [blame] | 2559 | if test "x$MACARCH" = "xboth"; then |
| 2560 | CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" |
| 2561 | else |
| 2562 | CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" |
| 2563 | fi |
| 2564 | |
Bram Moolenaar | 1471681 | 2006-05-04 21:54:08 +0000 | [diff] [blame] | 2565 | dnl Default install directory is not /usr/local |
| 2566 | if test x$prefix = xNONE; then |
| 2567 | prefix=/Applications |
| 2568 | fi |
| 2569 | |
| 2570 | dnl Sorry for the hard coded default |
| 2571 | datadir='${prefix}/Vim.app/Contents/Resources' |
| 2572 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2573 | dnl skip everything else |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2574 | SKIP_GTK2=YES; |
| 2575 | SKIP_GNOME=YES; |
| 2576 | SKIP_MOTIF=YES; |
| 2577 | SKIP_ATHENA=YES; |
| 2578 | SKIP_NEXTAW=YES; |
| 2579 | SKIP_PHOTON=YES; |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 2580 | SKIP_HAIKU=YES; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2581 | SKIP_CARBON=YES |
| 2582 | fi |
| 2583 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2584 | dnl define an autoconf function to check for a specified version of GTK, and |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2585 | dnl try to compile/link a GTK program. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2586 | dnl |
| 2587 | dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
Bram Moolenaar | 7b0294c | 2004-10-11 10:16:09 +0000 | [diff] [blame] | 2588 | dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2589 | dnl |
| 2590 | AC_DEFUN(AM_PATH_GTK, |
| 2591 | [ |
| 2592 | if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then |
| 2593 | { |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2594 | no_gtk="" |
| 2595 | if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ |
| 2596 | && $PKG_CONFIG --exists gtk+-2.0; then |
| 2597 | { |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2598 | min_gtk_version=ifelse([$1], ,2.2.0,$1) |
| 2599 | AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2600 | dnl We should be using PKG_CHECK_MODULES() instead of this hack. |
| 2601 | dnl But I guess the dependency on pkgconfig.m4 is not wanted or |
| 2602 | dnl something like that. |
| 2603 | GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` |
Bram Moolenaar | 7b0294c | 2004-10-11 10:16:09 +0000 | [diff] [blame] | 2604 | GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2605 | GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
| 2606 | gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
| 2607 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
| 2608 | gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
| 2609 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
| 2610 | gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
| 2611 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
| 2612 | } |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2613 | elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ |
| 2614 | && $PKG_CONFIG --exists gtk+-3.0; then |
| 2615 | { |
| 2616 | min_gtk_version=ifelse([$1], ,3.0.0,$1) |
| 2617 | AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
| 2618 | |
| 2619 | GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` |
| 2620 | GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` |
| 2621 | GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` |
| 2622 | gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ |
| 2623 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
| 2624 | gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ |
| 2625 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
| 2626 | gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ |
| 2627 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
| 2628 | } |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2629 | else |
| 2630 | no_gtk=yes |
| 2631 | fi |
| 2632 | |
| 2633 | if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then |
| 2634 | { |
| 2635 | ac_save_CFLAGS="$CFLAGS" |
| 2636 | ac_save_LIBS="$LIBS" |
| 2637 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 2638 | LIBS="$LIBS $GTK_LIBS" |
| 2639 | |
| 2640 | dnl |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2641 | dnl Now check if the installed GTK is sufficiently new. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2642 | dnl |
| 2643 | rm -f conf.gtktest |
| 2644 | AC_TRY_RUN([ |
| 2645 | #include <gtk/gtk.h> |
| 2646 | #include <stdio.h> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2647 | #if STDC_HEADERS |
| 2648 | # include <stdlib.h> |
| 2649 | # include <stddef.h> |
| 2650 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2651 | |
| 2652 | int |
| 2653 | main () |
| 2654 | { |
| 2655 | int major, minor, micro; |
| 2656 | char *tmp_version; |
| 2657 | |
| 2658 | system ("touch conf.gtktest"); |
| 2659 | |
| 2660 | /* HP/UX 9 (%@#!) writes to sscanf strings */ |
| 2661 | tmp_version = g_strdup("$min_gtk_version"); |
| 2662 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
| 2663 | printf("%s, bad version string\n", "$min_gtk_version"); |
| 2664 | exit(1); |
| 2665 | } |
| 2666 | |
| 2667 | if ((gtk_major_version > major) || |
| 2668 | ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
| 2669 | ((gtk_major_version == major) && (gtk_minor_version == minor) && |
| 2670 | (gtk_micro_version >= micro))) |
| 2671 | { |
| 2672 | return 0; |
| 2673 | } |
| 2674 | return 1; |
| 2675 | } |
| 2676 | ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
| 2677 | CFLAGS="$ac_save_CFLAGS" |
| 2678 | LIBS="$ac_save_LIBS" |
| 2679 | } |
| 2680 | fi |
| 2681 | if test "x$no_gtk" = x ; then |
| 2682 | if test "x$enable_gtktest" = "xyes"; then |
| 2683 | AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) |
| 2684 | else |
| 2685 | AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) |
| 2686 | fi |
| 2687 | ifelse([$2], , :, [$2]) |
| 2688 | else |
| 2689 | { |
| 2690 | AC_MSG_RESULT(no) |
| 2691 | GTK_CFLAGS="" |
| 2692 | GTK_LIBS="" |
| 2693 | ifelse([$3], , :, [$3]) |
Bram Moolenaar | af0839a | 2018-12-30 22:55:47 +0100 | [diff] [blame] | 2694 | if test "$fail_if_missing" = "yes" -a "X$gui_auto" != "Xyes"; then |
| 2695 | AC_MSG_ERROR([could not configure GTK]) |
| 2696 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2697 | } |
| 2698 | fi |
| 2699 | } |
| 2700 | else |
| 2701 | GTK_CFLAGS="" |
| 2702 | GTK_LIBS="" |
| 2703 | ifelse([$3], , :, [$3]) |
| 2704 | fi |
| 2705 | AC_SUBST(GTK_CFLAGS) |
| 2706 | AC_SUBST(GTK_LIBS) |
| 2707 | rm -f conf.gtktest |
| 2708 | ]) |
| 2709 | |
| 2710 | dnl --------------------------------------------------------------------------- |
| 2711 | dnl gnome |
| 2712 | dnl --------------------------------------------------------------------------- |
| 2713 | AC_DEFUN([GNOME_INIT_HOOK], |
| 2714 | [ |
| 2715 | AC_SUBST(GNOME_LIBS) |
| 2716 | AC_SUBST(GNOME_LIBDIR) |
| 2717 | AC_SUBST(GNOME_INCLUDEDIR) |
| 2718 | |
| 2719 | AC_ARG_WITH(gnome-includes, |
| 2720 | [ --with-gnome-includes=DIR Specify location of GNOME headers], |
| 2721 | [CFLAGS="$CFLAGS -I$withval"] |
| 2722 | ) |
| 2723 | |
| 2724 | AC_ARG_WITH(gnome-libs, |
| 2725 | [ --with-gnome-libs=DIR Specify location of GNOME libs], |
| 2726 | [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval] |
| 2727 | ) |
| 2728 | |
| 2729 | AC_ARG_WITH(gnome, |
| 2730 | [ --with-gnome Specify prefix for GNOME files], |
| 2731 | if test x$withval = xyes; then |
| 2732 | want_gnome=yes |
| 2733 | ifelse([$1], [], :, [$1]) |
| 2734 | else |
| 2735 | if test "x$withval" = xno; then |
| 2736 | want_gnome=no |
| 2737 | else |
| 2738 | want_gnome=yes |
| 2739 | LDFLAGS="$LDFLAGS -L$withval/lib" |
| 2740 | CFLAGS="$CFLAGS -I$withval/include" |
| 2741 | gnome_prefix=$withval/lib |
| 2742 | fi |
| 2743 | fi, |
| 2744 | want_gnome=yes) |
| 2745 | |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2746 | if test "x$want_gnome" = xyes; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2747 | { |
| 2748 | AC_MSG_CHECKING(for libgnomeui-2.0) |
| 2749 | if $PKG_CONFIG --exists libgnomeui-2.0; then |
| 2750 | AC_MSG_RESULT(yes) |
| 2751 | GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0` |
| 2752 | GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0` |
| 2753 | GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0` |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 2754 | |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 2755 | dnl On FreeBSD we need -pthread but pkg-config doesn't include it. |
| 2756 | dnl This might not be the right way but it works for me... |
| 2757 | AC_MSG_CHECKING(for FreeBSD) |
| 2758 | if test "`(uname) 2>/dev/null`" = FreeBSD; then |
| 2759 | AC_MSG_RESULT(yes, adding -pthread) |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 2760 | GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 2761 | GNOME_LIBS="$GNOME_LIBS -pthread" |
| 2762 | else |
| 2763 | AC_MSG_RESULT(no) |
| 2764 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2765 | $1 |
| 2766 | else |
| 2767 | AC_MSG_RESULT(not found) |
| 2768 | if test "x$2" = xfail; then |
| 2769 | AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config) |
| 2770 | fi |
| 2771 | fi |
| 2772 | } |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2773 | fi |
| 2774 | ]) |
| 2775 | |
| 2776 | AC_DEFUN([GNOME_INIT],[ |
| 2777 | GNOME_INIT_HOOK([],fail) |
| 2778 | ]) |
| 2779 | |
Bram Moolenaar | 427f5b6 | 2019-06-09 13:43:51 +0200 | [diff] [blame] | 2780 | if test "X$PKG_CONFIG" = "X"; then |
| 2781 | AC_PATH_TOOL(PKG_CONFIG, pkg-config, no) |
| 2782 | fi |
| 2783 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2784 | |
| 2785 | dnl --------------------------------------------------------------------------- |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2786 | dnl Check for GTK2. If it fails, then continue on for Motif as before... |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2787 | dnl --------------------------------------------------------------------------- |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2788 | if test -z "$SKIP_GTK2"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2789 | |
| 2790 | AC_MSG_CHECKING(--disable-gtktest argument) |
| 2791 | AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
| 2792 | , enable_gtktest=yes) |
| 2793 | if test "x$enable_gtktest" = "xyes" ; then |
| 2794 | AC_MSG_RESULT(gtk test enabled) |
| 2795 | else |
| 2796 | AC_MSG_RESULT(gtk test disabled) |
| 2797 | fi |
| 2798 | |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2799 | if test "x$PKG_CONFIG" != "xno"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2800 | dnl First try finding version 2.2.0 or later. The 2.0.x series has |
| 2801 | dnl problems (bold fonts, --remote doesn't work). |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2802 | AM_PATH_GTK(2.2.0, |
| 2803 | [GUI_LIB_LOC="$GTK_LIBDIR" |
| 2804 | GTK_LIBNAME="$GTK_LIBS" |
| 2805 | GUI_INC_LOC="$GTK_CFLAGS"], ) |
| 2806 | if test "x$GTK_CFLAGS" != "x"; then |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2807 | SKIP_GTK3=YES |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2808 | SKIP_ATHENA=YES |
| 2809 | SKIP_NEXTAW=YES |
| 2810 | SKIP_MOTIF=YES |
| 2811 | GUITYPE=GTK |
| 2812 | AC_SUBST(GTK_LIBNAME) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2813 | fi |
| 2814 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2815 | if test "x$GUITYPE" = "xGTK"; then |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2816 | dnl |
| 2817 | dnl if GTK exists, then check for GNOME. |
| 2818 | dnl |
| 2819 | if test -z "$SKIP_GNOME"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2820 | { |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 2821 | GNOME_INIT_HOOK([have_gnome=yes]) |
| 2822 | if test "x$have_gnome" = xyes ; then |
| 2823 | AC_DEFINE(FEAT_GUI_GNOME) |
| 2824 | GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR" |
| 2825 | GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2826 | fi |
| 2827 | } |
| 2828 | fi |
| 2829 | fi |
| 2830 | fi |
| 2831 | |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2832 | |
| 2833 | dnl --------------------------------------------------------------------------- |
| 2834 | dnl Check for GTK3. |
| 2835 | dnl --------------------------------------------------------------------------- |
| 2836 | if test -z "$SKIP_GTK3"; then |
| 2837 | |
| 2838 | AC_MSG_CHECKING(--disable-gtktest argument) |
| 2839 | AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
| 2840 | , enable_gtktest=yes) |
| 2841 | if test "x$enable_gtktest" = "xyes" ; then |
| 2842 | AC_MSG_RESULT(gtk test enabled) |
| 2843 | else |
| 2844 | AC_MSG_RESULT(gtk test disabled) |
| 2845 | fi |
| 2846 | |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2847 | if test "x$PKG_CONFIG" != "xno"; then |
| 2848 | AM_PATH_GTK(3.0.0, |
| 2849 | [GUI_LIB_LOC="$GTK_LIBDIR" |
| 2850 | GTK_LIBNAME="$GTK_LIBS" |
| 2851 | GUI_INC_LOC="$GTK_CFLAGS"], ) |
| 2852 | if test "x$GTK_CFLAGS" != "x"; then |
| 2853 | SKIP_GTK2=YES |
| 2854 | SKIP_GNOME=YES |
| 2855 | SKIP_ATHENA=YES |
| 2856 | SKIP_NEXTAW=YES |
| 2857 | SKIP_MOTIF=YES |
| 2858 | GUITYPE=GTK |
| 2859 | AC_SUBST(GTK_LIBNAME) |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 2860 | AC_DEFINE(USE_GTK3) |
| 2861 | fi |
| 2862 | fi |
| 2863 | fi |
| 2864 | |
Bram Moolenaar | d2e03f0 | 2016-01-02 22:46:36 +0100 | [diff] [blame] | 2865 | dnl Check the version of Gdk-Pixbuf. If the version is 2.31 or later and |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2866 | dnl glib-compile-resources is found in PATH, use GResource. |
| 2867 | if test "x$GUITYPE" = "xGTK"; then |
| 2868 | AC_MSG_CHECKING([version of Gdk-Pixbuf]) |
| 2869 | gdk_pixbuf_version=`$PKG_CONFIG --modversion gdk-pixbuf-2.0` |
| 2870 | if test "x$gdk_pixbuf_version" != x ; then |
| 2871 | gdk_pixbuf_version_minor=`echo $gdk_pixbuf_version | \ |
| 2872 | sed -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/'` |
| 2873 | if test "x$gdk_pixbuf_version_minor" != x -a \ |
Bram Moolenaar | 33c31d5 | 2016-02-22 21:07:06 +0100 | [diff] [blame] | 2874 | $gdk_pixbuf_version_minor -ge 31 ; then |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2875 | AC_MSG_RESULT([OK.]) |
| 2876 | AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no) |
| 2877 | AC_MSG_CHECKING([glib-compile-resources]) |
| 2878 | if test "x$GLIB_COMPILE_RESOURCES" = xno ; then |
Bram Moolenaar | 33c31d5 | 2016-02-22 21:07:06 +0100 | [diff] [blame] | 2879 | GLIB_COMPILE_RESOURCES="" |
| 2880 | AC_MSG_RESULT([cannot be found in PATH.]) |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2881 | else |
| 2882 | AC_MSG_RESULT([usable.]) |
Bram Moolenaar | 33c31d5 | 2016-02-22 21:07:06 +0100 | [diff] [blame] | 2883 | AC_DEFINE(USE_GRESOURCE) |
| 2884 | GRESOURCE_SRC="auto/gui_gtk_gresources.c" |
| 2885 | GRESOURCE_OBJ="objects/gui_gtk_gresources.o" |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2886 | fi |
| 2887 | else |
| 2888 | AC_MSG_RESULT([not usable.]) |
| 2889 | fi |
| 2890 | else |
| 2891 | AC_MSG_RESULT([cannot obtain from pkg_config.]) |
| 2892 | fi |
Bram Moolenaar | 4adfaab | 2016-04-21 18:20:11 +0200 | [diff] [blame] | 2893 | |
| 2894 | AC_MSG_CHECKING([--disable-icon-cache-update argument]) |
| 2895 | AC_ARG_ENABLE(icon_cache_update, |
| 2896 | [ --disable-icon-cache-update update disabled], |
| 2897 | [], |
| 2898 | [enable_icon_cache_update="yes"]) |
| 2899 | if test "$enable_icon_cache_update" = "yes"; then |
| 2900 | AC_MSG_RESULT([not set]) |
| 2901 | AC_PATH_PROG(GTK_UPDATE_ICON_CACHE,[gtk-update-icon-cache],no) |
| 2902 | if test "x$GTK_UPDATE_ICON_CACHE" = "xno" ; then |
| 2903 | AC_MSG_RESULT([not found in PATH.]) |
| 2904 | fi |
| 2905 | else |
| 2906 | AC_MSG_RESULT([update disabled]) |
| 2907 | fi |
| 2908 | |
| 2909 | AC_MSG_CHECKING([--disable-desktop-database-update argument]) |
| 2910 | AC_ARG_ENABLE(desktop_database_update, |
| 2911 | [ --disable-desktop-database-update update disabled], |
| 2912 | [], |
| 2913 | [enable_desktop_database_update="yes"]) |
| 2914 | if test "$enable_desktop_database_update" = "yes"; then |
| 2915 | AC_MSG_RESULT([not set]) |
| 2916 | AC_PATH_PROG(UPDATE_DESKTOP_DATABASE,[update-desktop-database],no) |
| 2917 | if test "x$UPDATE_DESKTOP_DATABASE" = "xno" ; then |
| 2918 | AC_MSG_RESULT([not found in PATH.]) |
| 2919 | fi |
| 2920 | else |
| 2921 | AC_MSG_RESULT([update disabled]) |
| 2922 | fi |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2923 | fi |
| 2924 | AC_SUBST(GLIB_COMPILE_RESOURCES) |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2925 | AC_SUBST(GRESOURCE_SRC) |
| 2926 | AC_SUBST(GRESOURCE_OBJ) |
Bram Moolenaar | 4adfaab | 2016-04-21 18:20:11 +0200 | [diff] [blame] | 2927 | AC_SUBST(GTK_UPDATE_ICON_CACHE) |
| 2928 | AC_SUBST(UPDATE_DESKTOP_DATABASE) |
Bram Moolenaar | 36e294c | 2015-12-29 18:55:46 +0100 | [diff] [blame] | 2929 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2930 | dnl Check for Motif include files location. |
| 2931 | dnl The LAST one found is used, this makes the highest version to be used, |
| 2932 | dnl e.g. when Motif1.2 and Motif2.0 are both present. |
| 2933 | |
| 2934 | if test -z "$SKIP_MOTIF"; then |
| 2935 | 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" |
| 2936 | dnl Remove "-I" from before $GUI_INC_LOC if it's there |
| 2937 | GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`" |
| 2938 | |
| 2939 | AC_MSG_CHECKING(for location of Motif GUI includes) |
| 2940 | gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC" |
| 2941 | GUI_INC_LOC= |
| 2942 | for try in $gui_includes; do |
| 2943 | if test -f "$try/Xm/Xm.h"; then |
| 2944 | GUI_INC_LOC=$try |
| 2945 | fi |
| 2946 | done |
| 2947 | if test -n "$GUI_INC_LOC"; then |
| 2948 | if test "$GUI_INC_LOC" = /usr/include; then |
| 2949 | GUI_INC_LOC= |
| 2950 | AC_MSG_RESULT(in default path) |
| 2951 | else |
| 2952 | AC_MSG_RESULT($GUI_INC_LOC) |
| 2953 | fi |
| 2954 | else |
| 2955 | AC_MSG_RESULT(<not found>) |
| 2956 | SKIP_MOTIF=YES |
| 2957 | fi |
| 2958 | fi |
| 2959 | |
| 2960 | dnl Check for Motif library files location. In the same order as the include |
| 2961 | dnl files, to avoid a mixup if several versions are present |
| 2962 | |
| 2963 | if test -z "$SKIP_MOTIF"; then |
| 2964 | AC_MSG_CHECKING(--with-motif-lib argument) |
| 2965 | AC_ARG_WITH(motif-lib, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 2966 | [ --with-motif-lib=STRING Library for Motif ], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2967 | [ MOTIF_LIBNAME="${withval}" ] ) |
| 2968 | |
| 2969 | if test -n "$MOTIF_LIBNAME"; then |
| 2970 | AC_MSG_RESULT($MOTIF_LIBNAME) |
| 2971 | GUI_LIB_LOC= |
| 2972 | else |
| 2973 | AC_MSG_RESULT(no) |
| 2974 | |
| 2975 | dnl Remove "-L" from before $GUI_LIB_LOC if it's there |
| 2976 | GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" |
| 2977 | |
Bram Moolenaar | 6324c3b | 2013-06-17 20:27:18 +0200 | [diff] [blame] | 2978 | dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The |
| 2979 | dnl linker will figure out which one to use, we only check if one exists. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2980 | AC_MSG_CHECKING(for location of Motif GUI libs) |
Bram Moolenaar | 6324c3b | 2013-06-17 20:27:18 +0200 | [diff] [blame] | 2981 | 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" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2982 | GUI_LIB_LOC= |
| 2983 | for try in $gui_libs; do |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 2984 | for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2985 | if test -f "$libtry"; then |
| 2986 | GUI_LIB_LOC=$try |
| 2987 | fi |
| 2988 | done |
| 2989 | done |
| 2990 | if test -n "$GUI_LIB_LOC"; then |
| 2991 | dnl Remove /usr/lib, it causes trouble on some systems |
Bram Moolenaar | 6324c3b | 2013-06-17 20:27:18 +0200 | [diff] [blame] | 2992 | if test "$GUI_LIB_LOC" = /usr/lib \ |
| 2993 | -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ |
| 2994 | -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2995 | GUI_LIB_LOC= |
| 2996 | AC_MSG_RESULT(in default path) |
| 2997 | else |
| 2998 | if test -n "$GUI_LIB_LOC"; then |
| 2999 | AC_MSG_RESULT($GUI_LIB_LOC) |
| 3000 | if test "`(uname) 2>/dev/null`" = SunOS && |
| 3001 | uname -r | grep '^5' >/dev/null; then |
| 3002 | GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC" |
| 3003 | fi |
| 3004 | fi |
| 3005 | fi |
| 3006 | MOTIF_LIBNAME=-lXm |
| 3007 | else |
| 3008 | AC_MSG_RESULT(<not found>) |
| 3009 | SKIP_MOTIF=YES |
| 3010 | fi |
| 3011 | fi |
| 3012 | fi |
| 3013 | |
| 3014 | if test -z "$SKIP_MOTIF"; then |
| 3015 | SKIP_ATHENA=YES |
| 3016 | SKIP_NEXTAW=YES |
| 3017 | GUITYPE=MOTIF |
| 3018 | AC_SUBST(MOTIF_LIBNAME) |
| 3019 | fi |
| 3020 | |
| 3021 | dnl Check if the Athena files can be found |
| 3022 | |
| 3023 | GUI_X_LIBS= |
| 3024 | |
| 3025 | if test -z "$SKIP_ATHENA"; then |
| 3026 | AC_MSG_CHECKING(if Athena header files can be found) |
| 3027 | cflags_save=$CFLAGS |
| 3028 | CFLAGS="$CFLAGS $X_CFLAGS" |
| 3029 | AC_TRY_COMPILE([ |
| 3030 | #include <X11/Intrinsic.h> |
| 3031 | #include <X11/Xaw/Paned.h>], , |
| 3032 | AC_MSG_RESULT(yes), |
| 3033 | AC_MSG_RESULT(no); SKIP_ATHENA=YES ) |
| 3034 | CFLAGS=$cflags_save |
| 3035 | fi |
| 3036 | |
| 3037 | if test -z "$SKIP_ATHENA"; then |
| 3038 | GUITYPE=ATHENA |
| 3039 | fi |
| 3040 | |
| 3041 | if test -z "$SKIP_NEXTAW"; then |
| 3042 | AC_MSG_CHECKING(if neXtaw header files can be found) |
| 3043 | cflags_save=$CFLAGS |
| 3044 | CFLAGS="$CFLAGS $X_CFLAGS" |
| 3045 | AC_TRY_COMPILE([ |
| 3046 | #include <X11/Intrinsic.h> |
| 3047 | #include <X11/neXtaw/Paned.h>], , |
| 3048 | AC_MSG_RESULT(yes), |
| 3049 | AC_MSG_RESULT(no); SKIP_NEXTAW=YES ) |
| 3050 | CFLAGS=$cflags_save |
| 3051 | fi |
| 3052 | |
| 3053 | if test -z "$SKIP_NEXTAW"; then |
| 3054 | GUITYPE=NEXTAW |
| 3055 | fi |
| 3056 | |
| 3057 | if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then |
| 3058 | dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty |
| 3059 | dnl Avoid adding it when it twice |
| 3060 | if test -n "$GUI_INC_LOC"; then |
| 3061 | GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`" |
| 3062 | fi |
| 3063 | if test -n "$GUI_LIB_LOC"; then |
| 3064 | GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`" |
| 3065 | fi |
| 3066 | |
| 3067 | dnl Check for -lXext and then for -lXmu |
| 3068 | ldflags_save=$LDFLAGS |
| 3069 | LDFLAGS="$X_LIBS $LDFLAGS" |
| 3070 | AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],, |
| 3071 | [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) |
| 3072 | dnl For Solaris we need -lw and -ldl before linking with -lXmu works. |
| 3073 | AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],, |
| 3074 | [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) |
| 3075 | AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],, |
| 3076 | [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) |
| 3077 | AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],, |
| 3078 | [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) |
| 3079 | if test -z "$SKIP_MOTIF"; then |
| 3080 | AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],, |
| 3081 | [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) |
| 3082 | fi |
| 3083 | LDFLAGS=$ldflags_save |
| 3084 | |
| 3085 | dnl Execute xmkmf to figure out if -DNARROWPROTO is needed. |
| 3086 | AC_MSG_CHECKING(for extra X11 defines) |
| 3087 | NARROW_PROTO= |
| 3088 | rm -fr conftestdir |
| 3089 | if mkdir conftestdir; then |
| 3090 | cd conftestdir |
| 3091 | cat > Imakefile <<'EOF' |
| 3092 | acfindx: |
| 3093 | @echo 'NARROW_PROTO="${PROTO_DEFINES}"' |
| 3094 | EOF |
| 3095 | if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then |
| 3096 | eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` |
| 3097 | fi |
| 3098 | cd .. |
| 3099 | rm -fr conftestdir |
| 3100 | fi |
| 3101 | if test -z "$NARROW_PROTO"; then |
| 3102 | AC_MSG_RESULT(no) |
| 3103 | else |
| 3104 | AC_MSG_RESULT($NARROW_PROTO) |
| 3105 | fi |
| 3106 | AC_SUBST(NARROW_PROTO) |
| 3107 | fi |
| 3108 | |
| 3109 | dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs |
| 3110 | dnl use the X11 include path |
| 3111 | if test "$enable_xsmp" = "yes"; then |
| 3112 | cppflags_save=$CPPFLAGS |
| 3113 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
| 3114 | AC_CHECK_HEADERS(X11/SM/SMlib.h) |
| 3115 | CPPFLAGS=$cppflags_save |
| 3116 | fi |
| 3117 | |
| 3118 | |
Bram Moolenaar | 9892189 | 2016-02-23 17:14:37 +0100 | [diff] [blame] | 3119 | if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2" -o -z "$SKIP_GTK3"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3120 | dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path |
| 3121 | cppflags_save=$CPPFLAGS |
| 3122 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
| 3123 | AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h) |
| 3124 | |
| 3125 | dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h |
| 3126 | if test ! "$enable_xim" = "no"; then |
| 3127 | AC_MSG_CHECKING(for XIMText in X11/Xlib.h) |
| 3128 | AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>], |
| 3129 | AC_MSG_RESULT(yes), |
Bram Moolenaar | e29b1fe | 2014-04-10 20:00:15 +0200 | [diff] [blame] | 3130 | AC_MSG_RESULT(no; xim has been disabled); enable_xim="no") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3131 | fi |
| 3132 | CPPFLAGS=$cppflags_save |
| 3133 | |
Bram Moolenaar | 5461258 | 2019-11-21 17:13:31 +0100 | [diff] [blame] | 3134 | dnl automatically enable XIM in the GUI |
| 3135 | if test "$enable_xim" = "auto" -a "x$GUITYPE" != "xNONE" ; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3136 | AC_MSG_RESULT(X GUI selected; xim has been enabled) |
| 3137 | enable_xim="yes" |
| 3138 | fi |
| 3139 | fi |
| 3140 | |
| 3141 | if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then |
| 3142 | cppflags_save=$CPPFLAGS |
| 3143 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
Bram Moolenaar | 2ce06f6 | 2005-01-31 19:19:04 +0000 | [diff] [blame] | 3144 | dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h |
| 3145 | AC_MSG_CHECKING([for X11/Xmu/Editres.h]) |
| 3146 | AC_TRY_COMPILE([ |
| 3147 | #include <X11/Intrinsic.h> |
| 3148 | #include <X11/Xmu/Editres.h>], |
| 3149 | [int i; i = 0;], |
| 3150 | AC_MSG_RESULT(yes) |
| 3151 | AC_DEFINE(HAVE_X11_XMU_EDITRES_H), |
| 3152 | AC_MSG_RESULT(no)) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3153 | CPPFLAGS=$cppflags_save |
| 3154 | fi |
| 3155 | |
| 3156 | dnl Only use the Xm directory when compiling Motif, don't use it for Athena |
| 3157 | if test -z "$SKIP_MOTIF"; then |
| 3158 | cppflags_save=$CPPFLAGS |
| 3159 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 3160 | if test "$zOSUnix" = "yes"; then |
| 3161 | xmheader="Xm/Xm.h" |
| 3162 | else |
| 3163 | xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 3164 | Xm/UnhighlightT.h Xm/Notebook.h" |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 3165 | fi |
| 3166 | AC_CHECK_HEADERS($xmheader) |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 3167 | |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 3168 | if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 3169 | dnl Solaris uses XpmAttributes_21, very annoying. |
| 3170 | AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) |
| 3171 | AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;], |
| 3172 | AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21), |
| 3173 | AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) |
| 3174 | ) |
| 3175 | else |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 3176 | AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 3177 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3178 | CPPFLAGS=$cppflags_save |
| 3179 | fi |
| 3180 | |
| 3181 | if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then |
| 3182 | AC_MSG_RESULT(no GUI selected; xim has been disabled) |
| 3183 | enable_xim="no" |
| 3184 | fi |
| 3185 | if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then |
| 3186 | AC_MSG_RESULT(no GUI selected; fontset has been disabled) |
| 3187 | enable_fontset="no" |
| 3188 | fi |
Bram Moolenaar | 182c5be | 2010-06-25 05:37:59 +0200 | [diff] [blame] | 3189 | if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3190 | AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled) |
| 3191 | enable_fontset="no" |
| 3192 | fi |
| 3193 | |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 3194 | dnl There is no test for the Haiku GUI, if it's selected it's used |
| 3195 | if test -z "$SKIP_HAIKU"; then |
| 3196 | GUITYPE=HAIKUGUI |
| 3197 | fi |
| 3198 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3199 | if test -z "$SKIP_PHOTON"; then |
| 3200 | GUITYPE=PHOTONGUI |
| 3201 | fi |
| 3202 | |
| 3203 | AC_SUBST(GUI_INC_LOC) |
| 3204 | AC_SUBST(GUI_LIB_LOC) |
| 3205 | AC_SUBST(GUITYPE) |
| 3206 | AC_SUBST(GUI_X_LIBS) |
| 3207 | |
| 3208 | if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then |
| 3209 | AC_MSG_ERROR([cannot use workshop without Motif]) |
| 3210 | fi |
| 3211 | |
| 3212 | dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled |
| 3213 | if test "$enable_xim" = "yes"; then |
| 3214 | AC_DEFINE(FEAT_XIM) |
| 3215 | fi |
| 3216 | if test "$enable_fontset" = "yes"; then |
| 3217 | AC_DEFINE(FEAT_XFONTSET) |
| 3218 | fi |
| 3219 | |
| 3220 | |
| 3221 | dnl --------------------------------------------------------------------------- |
| 3222 | dnl end of GUI-checking |
| 3223 | dnl --------------------------------------------------------------------------- |
| 3224 | |
Bram Moolenaar | f3757f0 | 2017-03-16 15:13:45 +0100 | [diff] [blame] | 3225 | AC_MSG_CHECKING([for /proc link to executable]) |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 3226 | if test -L "/proc/self/exe"; then |
Bram Moolenaar | f3757f0 | 2017-03-16 15:13:45 +0100 | [diff] [blame] | 3227 | dnl Linux |
| 3228 | AC_MSG_RESULT([/proc/self/exe]) |
| 3229 | AC_DEFINE(PROC_EXE_LINK, "/proc/self/exe") |
| 3230 | elif test -L "/proc/self/path/a.out"; then |
| 3231 | dnl Solaris |
| 3232 | AC_MSG_RESULT([/proc/self/path/a.out]) |
| 3233 | AC_DEFINE(PROC_EXE_LINK, "/proc/self/path/a.out") |
| 3234 | elif test -L "/proc/curproc/file"; then |
| 3235 | dnl FreeBSD |
| 3236 | AC_MSG_RESULT([/proc/curproc/file]) |
| 3237 | AC_DEFINE(PROC_EXE_LINK, "/proc/curproc/file") |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 3238 | else |
Bram Moolenaar | f3757f0 | 2017-03-16 15:13:45 +0100 | [diff] [blame] | 3239 | AC_MSG_RESULT(no) |
Bram Moolenaar | 5f69fee | 2017-03-09 11:58:40 +0100 | [diff] [blame] | 3240 | fi |
| 3241 | |
Bram Moolenaar | 693e40c | 2013-02-26 14:56:42 +0100 | [diff] [blame] | 3242 | dnl Check for Cygwin, which needs an extra source file if not using X11 |
Bram Moolenaar | 8def26a | 2015-12-17 15:34:53 +0100 | [diff] [blame] | 3243 | AC_MSG_CHECKING(for CYGWIN or MSYS environment) |
Bram Moolenaar | 693e40c | 2013-02-26 14:56:42 +0100 | [diff] [blame] | 3244 | case `uname` in |
Bram Moolenaar | 8def26a | 2015-12-17 15:34:53 +0100 | [diff] [blame] | 3245 | CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes) |
Bram Moolenaar | 693e40c | 2013-02-26 14:56:42 +0100 | [diff] [blame] | 3246 | AC_MSG_CHECKING(for CYGWIN clipboard support) |
| 3247 | if test "x$with_x" = "xno" ; then |
| 3248 | OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o |
| 3249 | AC_MSG_RESULT(yes) |
| 3250 | AC_DEFINE(FEAT_CYGWIN_WIN32_CLIPBOARD) |
| 3251 | else |
| 3252 | AC_MSG_RESULT(no - using X11) |
| 3253 | fi ;; |
| 3254 | |
| 3255 | *) CYGWIN=no; AC_MSG_RESULT(no);; |
| 3256 | esac |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3257 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3258 | dnl Checks for libraries and include files. |
| 3259 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3260 | AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], |
| 3261 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3262 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3263 | #include "confdefs.h" |
| 3264 | #include <ctype.h> |
| 3265 | #if STDC_HEADERS |
| 3266 | # include <stdlib.h> |
| 3267 | # include <stddef.h> |
| 3268 | #endif |
| 3269 | main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3270 | ]])],[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3271 | vim_cv_toupper_broken=yes |
| 3272 | ],[ |
| 3273 | vim_cv_toupper_broken=no |
| 3274 | ],[ |
| 3275 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken') |
| 3276 | ])]) |
| 3277 | |
| 3278 | if test "x$vim_cv_toupper_broken" = "xyes" ; then |
| 3279 | AC_DEFINE(BROKEN_TOUPPER) |
| 3280 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3281 | |
| 3282 | AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3283 | AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3284 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME), |
| 3285 | AC_MSG_RESULT(no)) |
| 3286 | |
Bram Moolenaar | 0c094b9 | 2009-05-14 20:20:33 +0000 | [diff] [blame] | 3287 | AC_MSG_CHECKING(whether __attribute__((unused)) is allowed) |
| 3288 | AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));], |
| 3289 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED), |
| 3290 | AC_MSG_RESULT(no)) |
| 3291 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3292 | dnl Checks for header files. |
| 3293 | AC_CHECK_HEADER(elf.h, HAS_ELF=1) |
| 3294 | dnl AC_CHECK_HEADER(dwarf.h, SVR4=1) |
| 3295 | if test "$HAS_ELF" = 1; then |
| 3296 | AC_CHECK_LIB(elf, main) |
| 3297 | fi |
| 3298 | |
| 3299 | AC_HEADER_DIRENT |
| 3300 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3301 | dnl If sys/wait.h is not found it might still exist but not be POSIX |
| 3302 | dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT) |
| 3303 | if test $ac_cv_header_sys_wait_h = no; then |
| 3304 | AC_MSG_CHECKING([for sys/wait.h that defines union wait]) |
| 3305 | AC_TRY_COMPILE([#include <sys/wait.h>], |
| 3306 | [union wait xx, yy; xx = yy], |
| 3307 | AC_MSG_RESULT(yes) |
| 3308 | AC_DEFINE(HAVE_SYS_WAIT_H) |
| 3309 | AC_DEFINE(HAVE_UNION_WAIT), |
| 3310 | AC_MSG_RESULT(no)) |
| 3311 | fi |
| 3312 | |
Bram Moolenaar | 779a775 | 2016-01-30 23:26:34 +0100 | [diff] [blame] | 3313 | AC_CHECK_HEADERS(stdint.h stdlib.h string.h \ |
Bram Moolenaar | fa7584c | 2010-05-19 21:57:45 +0200 | [diff] [blame] | 3314 | sys/select.h sys/utsname.h termcap.h fcntl.h \ |
| 3315 | sgtty.h sys/ioctl.h sys/time.h sys/types.h \ |
| 3316 | termio.h iconv.h inttypes.h langinfo.h math.h \ |
| 3317 | unistd.h stropts.h errno.h sys/resource.h \ |
| 3318 | sys/systeminfo.h locale.h sys/stream.h termios.h \ |
| 3319 | libc.h sys/statfs.h poll.h sys/poll.h pwd.h \ |
Bram Moolenaar | 1ecc5e4 | 2019-01-26 15:12:55 +0100 | [diff] [blame] | 3320 | utime.h sys/param.h sys/ptms.h libintl.h libgen.h \ |
Bram Moolenaar | fa7584c | 2010-05-19 21:57:45 +0200 | [diff] [blame] | 3321 | util/debug.h util/msg18n.h frame.h sys/acl.h \ |
| 3322 | sys/access.h sys/sysinfo.h wchar.h wctype.h) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3323 | |
Bram Moolenaar | 00ca284 | 2008-06-26 20:14:00 +0000 | [diff] [blame] | 3324 | dnl sys/ptem.h depends on sys/stream.h on Solaris |
| 3325 | AC_CHECK_HEADERS(sys/ptem.h, [], [], |
| 3326 | [#if defined HAVE_SYS_STREAM_H |
| 3327 | # include <sys/stream.h> |
| 3328 | #endif]) |
| 3329 | |
Bram Moolenaar | 32f31b1 | 2009-05-21 13:20:59 +0000 | [diff] [blame] | 3330 | dnl sys/sysctl.h depends on sys/param.h on OpenBSD |
| 3331 | AC_CHECK_HEADERS(sys/sysctl.h, [], [], |
| 3332 | [#if defined HAVE_SYS_PARAM_H |
| 3333 | # include <sys/param.h> |
| 3334 | #endif]) |
| 3335 | |
Bram Moolenaar | 00ca284 | 2008-06-26 20:14:00 +0000 | [diff] [blame] | 3336 | |
Bram Moolenaar | df3267e | 2005-01-25 22:07:05 +0000 | [diff] [blame] | 3337 | dnl pthread_np.h may exist but can only be used after including pthread.h |
| 3338 | AC_MSG_CHECKING([for pthread_np.h]) |
| 3339 | AC_TRY_COMPILE([ |
| 3340 | #include <pthread.h> |
| 3341 | #include <pthread_np.h>], |
| 3342 | [int i; i = 0;], |
| 3343 | AC_MSG_RESULT(yes) |
| 3344 | AC_DEFINE(HAVE_PTHREAD_NP_H), |
| 3345 | AC_MSG_RESULT(no)) |
| 3346 | |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 3347 | AC_CHECK_HEADERS(strings.h) |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 3348 | if test "x$MACOS_X" = "xyes"; then |
Bram Moolenaar | 9372a11 | 2005-12-06 19:59:18 +0000 | [diff] [blame] | 3349 | dnl The strings.h file on OS/X contains a warning and nothing useful. |
| 3350 | AC_DEFINE(NO_STRINGS_WITH_STRING_H) |
| 3351 | else |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3352 | |
| 3353 | dnl Check if strings.h and string.h can both be included when defined. |
| 3354 | AC_MSG_CHECKING([if strings.h can be included after string.h]) |
| 3355 | cppflags_save=$CPPFLAGS |
| 3356 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
| 3357 | AC_TRY_COMPILE([ |
| 3358 | #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO) |
| 3359 | # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */ |
| 3360 | /* but don't do it on AIX 5.1 (Uribarri) */ |
| 3361 | #endif |
| 3362 | #ifdef HAVE_XM_XM_H |
| 3363 | # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */ |
| 3364 | #endif |
| 3365 | #ifdef HAVE_STRING_H |
| 3366 | # include <string.h> |
| 3367 | #endif |
| 3368 | #if defined(HAVE_STRINGS_H) |
| 3369 | # include <strings.h> |
| 3370 | #endif |
| 3371 | ], [int i; i = 0;], |
| 3372 | AC_MSG_RESULT(yes), |
| 3373 | AC_DEFINE(NO_STRINGS_WITH_STRING_H) |
| 3374 | AC_MSG_RESULT(no)) |
| 3375 | CPPFLAGS=$cppflags_save |
Bram Moolenaar | 9372a11 | 2005-12-06 19:59:18 +0000 | [diff] [blame] | 3376 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3377 | |
| 3378 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 3379 | AC_PROG_GCC_TRADITIONAL |
| 3380 | AC_C_CONST |
Bram Moolenaar | 76243bd | 2009-03-02 01:47:02 +0000 | [diff] [blame] | 3381 | AC_C_VOLATILE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3382 | AC_TYPE_MODE_T |
| 3383 | AC_TYPE_OFF_T |
| 3384 | AC_TYPE_PID_T |
| 3385 | AC_TYPE_SIZE_T |
| 3386 | AC_TYPE_UID_T |
Bram Moolenaar | 0bbabe8 | 2010-05-17 20:32:55 +0200 | [diff] [blame] | 3387 | AC_TYPE_UINT32_T |
Bram Moolenaar | fa7584c | 2010-05-19 21:57:45 +0200 | [diff] [blame] | 3388 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3389 | AC_HEADER_TIME |
| 3390 | AC_CHECK_TYPE(ino_t, long) |
| 3391 | AC_CHECK_TYPE(dev_t, unsigned) |
Bram Moolenaar | 0bbabe8 | 2010-05-17 20:32:55 +0200 | [diff] [blame] | 3392 | AC_C_BIGENDIAN(,,,) |
Bram Moolenaar | 136f29a | 2016-02-27 20:14:15 +0100 | [diff] [blame] | 3393 | AC_C_INLINE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3394 | |
| 3395 | AC_MSG_CHECKING(for rlim_t) |
| 3396 | if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then |
| 3397 | AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t]) |
| 3398 | else |
| 3399 | AC_EGREP_CPP(dnl |
| 3400 | changequote(<<,>>)dnl |
| 3401 | <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl |
| 3402 | changequote([,]), |
| 3403 | [ |
| 3404 | #include <sys/types.h> |
| 3405 | #if STDC_HEADERS |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3406 | # include <stdlib.h> |
| 3407 | # include <stddef.h> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3408 | #endif |
| 3409 | #ifdef HAVE_SYS_RESOURCE_H |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3410 | # include <sys/resource.h> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3411 | #endif |
| 3412 | ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no) |
| 3413 | AC_MSG_RESULT($ac_cv_type_rlim_t) |
| 3414 | fi |
| 3415 | if test $ac_cv_type_rlim_t = no; then |
| 3416 | cat >> confdefs.h <<\EOF |
| 3417 | #define rlim_t unsigned long |
| 3418 | EOF |
| 3419 | fi |
| 3420 | |
| 3421 | AC_MSG_CHECKING(for stack_t) |
| 3422 | if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then |
| 3423 | AC_MSG_RESULT([(cached) $ac_cv_type_stack_t]) |
| 3424 | else |
| 3425 | AC_EGREP_CPP(stack_t, |
| 3426 | [ |
| 3427 | #include <sys/types.h> |
| 3428 | #if STDC_HEADERS |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3429 | # include <stdlib.h> |
| 3430 | # include <stddef.h> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3431 | #endif |
| 3432 | #include <signal.h> |
| 3433 | ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no) |
| 3434 | AC_MSG_RESULT($ac_cv_type_stack_t) |
| 3435 | fi |
| 3436 | if test $ac_cv_type_stack_t = no; then |
| 3437 | cat >> confdefs.h <<\EOF |
| 3438 | #define stack_t struct sigaltstack |
| 3439 | EOF |
| 3440 | fi |
| 3441 | |
| 3442 | dnl BSDI uses ss_base while others use ss_sp for the stack pointer. |
| 3443 | AC_MSG_CHECKING(whether stack_t has an ss_base field) |
| 3444 | AC_TRY_COMPILE([ |
| 3445 | #include <sys/types.h> |
| 3446 | #if STDC_HEADERS |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3447 | # include <stdlib.h> |
| 3448 | # include <stddef.h> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3449 | #endif |
| 3450 | #include <signal.h> |
| 3451 | #include "confdefs.h" |
| 3452 | ], [stack_t sigstk; sigstk.ss_base = 0; ], |
| 3453 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE), |
| 3454 | AC_MSG_RESULT(no)) |
| 3455 | |
| 3456 | olibs="$LIBS" |
| 3457 | AC_MSG_CHECKING(--with-tlib argument) |
| 3458 | AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],) |
| 3459 | if test -n "$with_tlib"; then |
| 3460 | AC_MSG_RESULT($with_tlib) |
| 3461 | LIBS="$LIBS -l$with_tlib" |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3462 | AC_MSG_CHECKING(for linking with $with_tlib library) |
| 3463 | AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) |
| 3464 | dnl Need to check for tgetent() below. |
| 3465 | olibs="$LIBS" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3466 | else |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3467 | AC_MSG_RESULT([empty: automatic terminal library selection]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3468 | dnl On HP-UX 10.10 termcap or termlib should be used instead of |
| 3469 | dnl curses, because curses is much slower. |
Bram Moolenaar | 4e509b6 | 2011-02-09 17:42:57 +0100 | [diff] [blame] | 3470 | dnl Newer versions of ncurses are preferred over anything, except |
Bram Moolenaar | 8f4ba69 | 2011-05-05 17:24:27 +0200 | [diff] [blame] | 3471 | dnl when tinfo has been split off, it contains all we need. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3472 | dnl Older versions of ncurses have bugs, get a new one! |
| 3473 | dnl Digital Unix (OSF1) should use curses (Ronald Schild). |
Bram Moolenaar | a1b5aa5 | 2006-10-10 09:41:28 +0000 | [diff] [blame] | 3474 | dnl On SCO Openserver should prefer termlib (Roger Cornelius). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3475 | case "`uname -s 2>/dev/null`" in |
Bram Moolenaar | 4e509b6 | 2011-02-09 17:42:57 +0100 | [diff] [blame] | 3476 | OSF1|SCO_SV) tlibs="tinfo ncurses curses termlib termcap";; |
| 3477 | *) tlibs="tinfo ncurses termlib termcap curses";; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3478 | esac |
| 3479 | for libname in $tlibs; do |
| 3480 | AC_CHECK_LIB(${libname}, tgetent,,) |
| 3481 | if test "x$olibs" != "x$LIBS"; then |
| 3482 | dnl It's possible that a library is found but it doesn't work |
| 3483 | dnl e.g., shared library that cannot be found |
| 3484 | dnl compile and run a test program to be sure |
| 3485 | AC_TRY_RUN([ |
| 3486 | #ifdef HAVE_TERMCAP_H |
| 3487 | # include <termcap.h> |
| 3488 | #endif |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3489 | #if STDC_HEADERS |
| 3490 | # include <stdlib.h> |
| 3491 | # include <stddef.h> |
| 3492 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3493 | main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], |
| 3494 | res="OK", res="FAIL", res="FAIL") |
| 3495 | if test "$res" = "OK"; then |
| 3496 | break |
| 3497 | fi |
| 3498 | AC_MSG_RESULT($libname library is not usable) |
| 3499 | LIBS="$olibs" |
| 3500 | fi |
| 3501 | done |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3502 | if test "x$olibs" = "x$LIBS"; then |
| 3503 | AC_MSG_RESULT(no terminal library found) |
| 3504 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3505 | fi |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3506 | |
| 3507 | if test "x$olibs" = "x$LIBS"; then |
| 3508 | AC_MSG_CHECKING([for tgetent()]) |
Bram Moolenaar | 2389c3c | 2005-05-22 22:07:59 +0000 | [diff] [blame] | 3509 | AC_TRY_LINK([], |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3510 | [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");], |
| 3511 | AC_MSG_RESULT(yes), |
| 3512 | AC_MSG_ERROR([NOT FOUND! |
| 3513 | You need to install a terminal library; for example ncurses. |
| 3514 | Or specify the name of the library with --with-tlib.])) |
| 3515 | fi |
| 3516 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3517 | AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], |
| 3518 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3519 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3520 | #include "confdefs.h" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3521 | #ifdef HAVE_TERMCAP_H |
| 3522 | # include <termcap.h> |
| 3523 | #endif |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3524 | #ifdef HAVE_STRING_H |
| 3525 | # include <string.h> |
| 3526 | #endif |
| 3527 | #if STDC_HEADERS |
| 3528 | # include <stdlib.h> |
| 3529 | # include <stddef.h> |
| 3530 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3531 | main() |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3532 | {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3533 | ]])],[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3534 | vim_cv_terminfo=no |
| 3535 | ],[ |
| 3536 | vim_cv_terminfo=yes |
| 3537 | ],[ |
| 3538 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo') |
| 3539 | ]) |
| 3540 | ]) |
| 3541 | |
| 3542 | if test "x$vim_cv_terminfo" = "xyes" ; then |
| 3543 | AC_DEFINE(TERMINFO) |
| 3544 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3545 | |
Bram Moolenaar | a88254f | 2017-11-02 23:04:14 +0100 | [diff] [blame] | 3546 | AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgetent], |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3547 | [ |
| 3548 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3549 | #include "confdefs.h" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3550 | #ifdef HAVE_TERMCAP_H |
| 3551 | # include <termcap.h> |
| 3552 | #endif |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3553 | #if STDC_HEADERS |
| 3554 | # include <stdlib.h> |
| 3555 | # include <stddef.h> |
| 3556 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3557 | main() |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3558 | {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3559 | ]])],[ |
Bram Moolenaar | a88254f | 2017-11-02 23:04:14 +0100 | [diff] [blame] | 3560 | vim_cv_tgetent=zero |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3561 | ],[ |
Bram Moolenaar | a88254f | 2017-11-02 23:04:14 +0100 | [diff] [blame] | 3562 | vim_cv_tgetent=non-zero |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3563 | ],[ |
| 3564 | AC_MSG_ERROR(failed to compile test program.) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3565 | ]) |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3566 | ]) |
| 3567 | |
Bram Moolenaar | a88254f | 2017-11-02 23:04:14 +0100 | [diff] [blame] | 3568 | if test "x$vim_cv_tgetent" = "xzero" ; then |
Bram Moolenaar | 696cbd2 | 2017-04-28 15:45:46 +0200 | [diff] [blame] | 3569 | AC_DEFINE(TGETENT_ZERO_ERR, 0) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3570 | fi |
| 3571 | |
| 3572 | AC_MSG_CHECKING(whether termcap.h contains ospeed) |
| 3573 | AC_TRY_LINK([ |
| 3574 | #ifdef HAVE_TERMCAP_H |
| 3575 | # include <termcap.h> |
| 3576 | #endif |
| 3577 | ], [ospeed = 20000], |
| 3578 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED), |
| 3579 | [AC_MSG_RESULT(no) |
| 3580 | AC_MSG_CHECKING(whether ospeed can be extern) |
| 3581 | AC_TRY_LINK([ |
| 3582 | #ifdef HAVE_TERMCAP_H |
| 3583 | # include <termcap.h> |
| 3584 | #endif |
| 3585 | extern short ospeed; |
| 3586 | ], [ospeed = 20000], |
| 3587 | AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN), |
| 3588 | AC_MSG_RESULT(no))] |
| 3589 | ) |
| 3590 | |
| 3591 | AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC]) |
| 3592 | AC_TRY_LINK([ |
| 3593 | #ifdef HAVE_TERMCAP_H |
| 3594 | # include <termcap.h> |
| 3595 | #endif |
| 3596 | ], [if (UP == 0 && BC == 0) PC = 1], |
| 3597 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC), |
| 3598 | [AC_MSG_RESULT(no) |
| 3599 | AC_MSG_CHECKING([whether UP, BC and PC can be extern]) |
| 3600 | AC_TRY_LINK([ |
| 3601 | #ifdef HAVE_TERMCAP_H |
| 3602 | # include <termcap.h> |
| 3603 | #endif |
| 3604 | extern char *UP, *BC, PC; |
| 3605 | ], [if (UP == 0 && BC == 0) PC = 1], |
| 3606 | AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN), |
| 3607 | AC_MSG_RESULT(no))] |
| 3608 | ) |
| 3609 | |
| 3610 | AC_MSG_CHECKING(whether tputs() uses outfuntype) |
| 3611 | AC_TRY_COMPILE([ |
| 3612 | #ifdef HAVE_TERMCAP_H |
| 3613 | # include <termcap.h> |
| 3614 | #endif |
| 3615 | ], [extern int xx(); tputs("test", 1, (outfuntype)xx)], |
| 3616 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE), |
| 3617 | AC_MSG_RESULT(no)) |
| 3618 | |
| 3619 | dnl On some SCO machines sys/select redefines struct timeval |
| 3620 | AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included]) |
| 3621 | AC_TRY_COMPILE([ |
| 3622 | #include <sys/types.h> |
| 3623 | #include <sys/time.h> |
| 3624 | #include <sys/select.h>], , |
| 3625 | AC_MSG_RESULT(yes) |
| 3626 | AC_DEFINE(SYS_SELECT_WITH_SYS_TIME), |
| 3627 | AC_MSG_RESULT(no)) |
| 3628 | |
| 3629 | dnl AC_DECL_SYS_SIGLIST |
| 3630 | |
| 3631 | dnl Checks for pty.c (copied from screen) ========================== |
| 3632 | AC_MSG_CHECKING(for /dev/ptc) |
| 3633 | if test -r /dev/ptc; then |
| 3634 | AC_DEFINE(HAVE_DEV_PTC) |
| 3635 | AC_MSG_RESULT(yes) |
| 3636 | else |
| 3637 | AC_MSG_RESULT(no) |
| 3638 | fi |
| 3639 | |
| 3640 | AC_MSG_CHECKING(for SVR4 ptys) |
| 3641 | if test -c /dev/ptmx ; then |
| 3642 | AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);], |
| 3643 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS), |
| 3644 | AC_MSG_RESULT(no)) |
| 3645 | else |
| 3646 | AC_MSG_RESULT(no) |
| 3647 | fi |
| 3648 | |
| 3649 | AC_MSG_CHECKING(for ptyranges) |
| 3650 | if test -d /dev/ptym ; then |
| 3651 | pdir='/dev/ptym' |
| 3652 | else |
| 3653 | pdir='/dev' |
| 3654 | fi |
| 3655 | dnl SCO uses ptyp%d |
| 3656 | AC_EGREP_CPP(yes, |
| 3657 | [#ifdef M_UNIX |
| 3658 | yes; |
| 3659 | #endif |
| 3660 | ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`) |
| 3661 | dnl if test -c /dev/ptyp19; then |
| 3662 | dnl ptys=`echo /dev/ptyp??` |
| 3663 | dnl else |
| 3664 | dnl ptys=`echo $pdir/pty??` |
| 3665 | dnl fi |
| 3666 | if test "$ptys" != "$pdir/pty??" ; then |
| 3667 | p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` |
| 3668 | p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` |
| 3669 | AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") |
| 3670 | AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") |
| 3671 | AC_MSG_RESULT([$p0 / $p1]) |
| 3672 | else |
| 3673 | AC_MSG_RESULT([don't know]) |
| 3674 | fi |
| 3675 | |
| 3676 | dnl **** pty mode/group handling **** |
| 3677 | dnl |
| 3678 | dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3679 | rm -f conftest_grp |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3680 | AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], |
| 3681 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3682 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3683 | #include "confdefs.h" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3684 | #include <sys/types.h> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3685 | #if STDC_HEADERS |
| 3686 | # include <stdlib.h> |
| 3687 | # include <stddef.h> |
| 3688 | #endif |
| 3689 | #ifdef HAVE_UNISTD_H |
| 3690 | #include <unistd.h> |
| 3691 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3692 | #include <sys/stat.h> |
| 3693 | #include <stdio.h> |
| 3694 | main() |
| 3695 | { |
| 3696 | struct stat sb; |
| 3697 | char *x,*ttyname(); |
| 3698 | int om, m; |
| 3699 | FILE *fp; |
| 3700 | |
| 3701 | if (!(x = ttyname(0))) exit(1); |
| 3702 | if (stat(x, &sb)) exit(1); |
| 3703 | om = sb.st_mode; |
| 3704 | if (om & 002) exit(0); |
| 3705 | m = system("mesg y"); |
| 3706 | if (m == -1 || m == 127) exit(1); |
| 3707 | if (stat(x, &sb)) exit(1); |
| 3708 | m = sb.st_mode; |
| 3709 | if (chmod(x, om)) exit(1); |
| 3710 | if (m & 002) exit(0); |
| 3711 | if (sb.st_gid == getgid()) exit(1); |
| 3712 | if (!(fp=fopen("conftest_grp", "w"))) |
| 3713 | exit(1); |
| 3714 | fprintf(fp, "%d\n", sb.st_gid); |
| 3715 | fclose(fp); |
| 3716 | exit(0); |
| 3717 | } |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3718 | ]])],[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3719 | if test -f conftest_grp; then |
| 3720 | vim_cv_tty_group=`cat conftest_grp` |
| 3721 | if test "x$vim_cv_tty_mode" = "x" ; then |
| 3722 | vim_cv_tty_mode=0620 |
| 3723 | fi |
| 3724 | AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) |
| 3725 | else |
| 3726 | vim_cv_tty_group=world |
Bram Moolenaar | 7295107 | 2009-12-02 16:58:33 +0000 | [diff] [blame] | 3727 | AC_MSG_RESULT([ptys are world accessible]) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3728 | fi |
| 3729 | ],[ |
| 3730 | vim_cv_tty_group=world |
Bram Moolenaar | 7295107 | 2009-12-02 16:58:33 +0000 | [diff] [blame] | 3731 | AC_MSG_RESULT([can't determine - assume ptys are world accessible]) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3732 | ],[ |
| 3733 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') |
| 3734 | ]) |
| 3735 | ]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3736 | rm -f conftest_grp |
| 3737 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3738 | if test "x$vim_cv_tty_group" != "xworld" ; then |
| 3739 | AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) |
| 3740 | if test "x$vim_cv_tty_mode" = "x" ; then |
Bram Moolenaar | 84a05ac | 2013-05-06 04:24:17 +0200 | [diff] [blame] | 3741 | 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)]) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3742 | else |
| 3743 | AC_DEFINE(PTYMODE, 0620) |
| 3744 | fi |
| 3745 | fi |
| 3746 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3747 | dnl Checks for library functions. =================================== |
| 3748 | |
| 3749 | AC_TYPE_SIGNAL |
| 3750 | |
| 3751 | dnl find out what to use at the end of a signal function |
| 3752 | if test $ac_cv_type_signal = void; then |
| 3753 | AC_DEFINE(SIGRETURN, [return]) |
| 3754 | else |
| 3755 | AC_DEFINE(SIGRETURN, [return 0]) |
| 3756 | fi |
| 3757 | |
| 3758 | dnl check if struct sigcontext is defined (used for SGI only) |
| 3759 | AC_MSG_CHECKING(for struct sigcontext) |
| 3760 | AC_TRY_COMPILE([ |
| 3761 | #include <signal.h> |
| 3762 | test_sig() |
| 3763 | { |
| 3764 | struct sigcontext *scont; |
| 3765 | scont = (struct sigcontext *)0; |
| 3766 | return 1; |
| 3767 | } ], , |
| 3768 | AC_MSG_RESULT(yes) |
| 3769 | AC_DEFINE(HAVE_SIGCONTEXT), |
| 3770 | AC_MSG_RESULT(no)) |
| 3771 | |
| 3772 | dnl tricky stuff: try to find out if getcwd() is implemented with |
| 3773 | dnl system("sh -c pwd") |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3774 | AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], |
| 3775 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3776 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3777 | #include "confdefs.h" |
| 3778 | #ifdef HAVE_UNISTD_H |
| 3779 | #include <unistd.h> |
| 3780 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3781 | char *dagger[] = { "IFS=pwd", 0 }; |
| 3782 | main() |
| 3783 | { |
| 3784 | char buffer[500]; |
| 3785 | extern char **environ; |
| 3786 | environ = dagger; |
| 3787 | return getcwd(buffer, 500) ? 0 : 1; |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3788 | } |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3789 | ]])],[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3790 | vim_cv_getcwd_broken=no |
| 3791 | ],[ |
| 3792 | vim_cv_getcwd_broken=yes |
| 3793 | ],[ |
| 3794 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken') |
| 3795 | ]) |
| 3796 | ]) |
| 3797 | |
| 3798 | if test "x$vim_cv_getcwd_broken" = "xyes" ; then |
| 3799 | AC_DEFINE(BAD_GETCWD) |
Bram Moolenaar | 63d2555 | 2019-05-10 21:28:38 +0200 | [diff] [blame] | 3800 | AC_CHECK_FUNCS(getwd) |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3801 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3802 | |
Bram Moolenaar | 25153e1 | 2010-02-24 14:47:08 +0100 | [diff] [blame] | 3803 | dnl Check for functions in one big call, to reduce the size of configure. |
| 3804 | dnl Can only be used for functions that do not require any include. |
Bram Moolenaar | cd142e3 | 2017-11-16 17:03:45 +0100 | [diff] [blame] | 3805 | AC_CHECK_FUNCS(fchdir fchown fchmod fsync getcwd getpseudotty \ |
Bram Moolenaar | 63d2555 | 2019-05-10 21:28:38 +0200 | [diff] [blame] | 3806 | getpwent getpwnam getpwuid getrlimit gettimeofday localtime_r lstat \ |
Bram Moolenaar | eaf0339 | 2009-11-17 11:08:52 +0000 | [diff] [blame] | 3807 | memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ |
Bram Moolenaar | 2fcf668 | 2017-03-11 20:03:42 +0100 | [diff] [blame] | 3808 | getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ |
Bram Moolenaar | bb09ceb | 2016-10-18 16:27:23 +0200 | [diff] [blame] | 3809 | sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ |
Bram Moolenaar | 10455d4 | 2019-11-21 15:36:18 +0100 | [diff] [blame] | 3810 | strnicmp strpbrk strptime strtol tgetent towlower towupper iswupper \ |
| 3811 | tzset usleep utime utimes mblen ftruncate unsetenv posix_openpt) |
Bram Moolenaar | 643b614 | 2018-09-12 20:29:09 +0200 | [diff] [blame] | 3812 | AC_FUNC_SELECT_ARGTYPES |
Bram Moolenaar | 25153e1 | 2010-02-24 14:47:08 +0100 | [diff] [blame] | 3813 | AC_FUNC_FSEEKO |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3814 | |
Bram Moolenaar | 317fd3a | 2010-05-07 16:05:55 +0200 | [diff] [blame] | 3815 | dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when |
| 3816 | dnl appropriate, so that off_t is 64 bits when needed. |
| 3817 | AC_SYS_LARGEFILE |
| 3818 | |
Bram Moolenaar | 2160667 | 2019-06-14 20:40:58 +0200 | [diff] [blame] | 3819 | AC_MSG_CHECKING(--enable-canberra argument) |
| 3820 | AC_ARG_ENABLE(canberra, |
| 3821 | [ --disable-canberra Do not use libcanberra.], |
| 3822 | , [enable_canberra="maybe"]) |
Bram Moolenaar | 427f5b6 | 2019-06-09 13:43:51 +0200 | [diff] [blame] | 3823 | |
Bram Moolenaar | 2160667 | 2019-06-14 20:40:58 +0200 | [diff] [blame] | 3824 | if test "$enable_canberra" = "maybe"; then |
| 3825 | if test "$features" = "big" -o "$features" = "huge"; then |
| 3826 | AC_MSG_RESULT(Defaulting to yes) |
| 3827 | enable_canberra="yes" |
| 3828 | else |
| 3829 | AC_MSG_RESULT(Defaulting to no) |
| 3830 | enable_canberra="no" |
| 3831 | fi |
| 3832 | else |
| 3833 | AC_MSG_RESULT($enable_canberra) |
Bram Moolenaar | 427f5b6 | 2019-06-09 13:43:51 +0200 | [diff] [blame] | 3834 | fi |
Bram Moolenaar | 2160667 | 2019-06-14 20:40:58 +0200 | [diff] [blame] | 3835 | if test "$enable_canberra" = "yes"; then |
| 3836 | if test "x$PKG_CONFIG" != "xno"; then |
| 3837 | canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null` |
| 3838 | canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null` |
| 3839 | fi |
| 3840 | if test "x$canberra_lib" = "x"; then |
| 3841 | canberra_lib=-lcanberra |
| 3842 | canberra_cflags=-D_REENTRANT |
| 3843 | fi |
| 3844 | AC_MSG_CHECKING(for libcanberra) |
| 3845 | ac_save_CFLAGS="$CFLAGS" |
| 3846 | ac_save_LIBS="$LIBS" |
| 3847 | CFLAGS="$CFLAGS $canberra_cflags" |
| 3848 | LIBS="$LIBS $canberra_lib" |
| 3849 | AC_TRY_LINK([ |
| 3850 | # include <canberra.h> |
| 3851 | ], [ |
| 3852 | ca_context *hello; |
| 3853 | ca_context_create(&hello);], |
| 3854 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA), |
Bram Moolenaar | 91b992c | 2019-11-17 19:07:42 +0100 | [diff] [blame] | 3855 | AC_MSG_RESULT(no; try installing libcanberra-dev); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS") |
Bram Moolenaar | 427f5b6 | 2019-06-09 13:43:51 +0200 | [diff] [blame] | 3856 | fi |
Bram Moolenaar | 427f5b6 | 2019-06-09 13:43:51 +0200 | [diff] [blame] | 3857 | |
| 3858 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3859 | dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible |
| 3860 | AC_MSG_CHECKING(for st_blksize) |
| 3861 | AC_TRY_COMPILE( |
| 3862 | [#include <sys/types.h> |
| 3863 | #include <sys/stat.h>], |
| 3864 | [ struct stat st; |
| 3865 | int n; |
| 3866 | |
| 3867 | stat("/", &st); |
| 3868 | n = (int)st.st_blksize;], |
| 3869 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE), |
| 3870 | AC_MSG_RESULT(no)) |
| 3871 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3872 | AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], |
| 3873 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3874 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3875 | #include "confdefs.h" |
| 3876 | #if STDC_HEADERS |
| 3877 | # include <stdlib.h> |
| 3878 | # include <stddef.h> |
| 3879 | #endif |
| 3880 | #include <sys/types.h> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3881 | #include <sys/stat.h> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3882 | main() {struct stat st; exit(stat("configure/", &st) != 0); } |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 3883 | ]])],[ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3884 | vim_cv_stat_ignores_slash=yes |
| 3885 | ],[ |
| 3886 | vim_cv_stat_ignores_slash=no |
| 3887 | ],[ |
| 3888 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash') |
| 3889 | ]) |
| 3890 | ]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3891 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3892 | if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then |
| 3893 | AC_DEFINE(STAT_IGNORES_SLASH) |
| 3894 | fi |
| 3895 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3896 | dnl Link with iconv for charset translation, if not found without library. |
| 3897 | dnl check for iconv() requires including iconv.h |
| 3898 | dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it |
| 3899 | dnl has been installed. |
| 3900 | AC_MSG_CHECKING(for iconv_open()) |
| 3901 | save_LIBS="$LIBS" |
| 3902 | LIBS="$LIBS -liconv" |
| 3903 | AC_TRY_LINK([ |
| 3904 | #ifdef HAVE_ICONV_H |
| 3905 | # include <iconv.h> |
| 3906 | #endif |
| 3907 | ], [iconv_open("fr", "to");], |
| 3908 | AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV), |
| 3909 | LIBS="$save_LIBS" |
| 3910 | AC_TRY_LINK([ |
| 3911 | #ifdef HAVE_ICONV_H |
| 3912 | # include <iconv.h> |
| 3913 | #endif |
| 3914 | ], [iconv_open("fr", "to");], |
| 3915 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV), |
| 3916 | AC_MSG_RESULT(no))) |
| 3917 | |
| 3918 | |
| 3919 | AC_MSG_CHECKING(for nl_langinfo(CODESET)) |
| 3920 | AC_TRY_LINK([ |
| 3921 | #ifdef HAVE_LANGINFO_H |
| 3922 | # include <langinfo.h> |
| 3923 | #endif |
| 3924 | ], [char *cs = nl_langinfo(CODESET);], |
| 3925 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET), |
| 3926 | AC_MSG_RESULT(no)) |
| 3927 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3928 | dnl Need various functions for floating point support. Only enable |
| 3929 | dnl floating point when they are all present. |
| 3930 | AC_CHECK_LIB(m, strtod) |
| 3931 | AC_MSG_CHECKING([for strtod() and other floating point functions]) |
| 3932 | AC_TRY_LINK([ |
| 3933 | #ifdef HAVE_MATH_H |
| 3934 | # include <math.h> |
| 3935 | #endif |
| 3936 | #if STDC_HEADERS |
| 3937 | # include <stdlib.h> |
| 3938 | # include <stddef.h> |
| 3939 | #endif |
| 3940 | ], [char *s; double d; |
| 3941 | d = strtod("1.1", &s); |
| 3942 | d = fabs(1.11); |
| 3943 | d = ceil(1.11); |
| 3944 | d = floor(1.11); |
| 3945 | d = log10(1.11); |
| 3946 | d = pow(1.11, 2.22); |
| 3947 | d = sqrt(1.11); |
| 3948 | d = sin(1.11); |
| 3949 | d = cos(1.11); |
| 3950 | d = atan(1.11); |
| 3951 | ], |
| 3952 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS), |
| 3953 | AC_MSG_RESULT(no)) |
| 3954 | |
Bram Moolenaar | a6b8976 | 2016-02-29 21:38:26 +0100 | [diff] [blame] | 3955 | dnl isinf() and isnan() need to include header files and may need -lm. |
| 3956 | AC_MSG_CHECKING([for isinf()]) |
| 3957 | AC_TRY_LINK([ |
| 3958 | #ifdef HAVE_MATH_H |
| 3959 | # include <math.h> |
| 3960 | #endif |
| 3961 | #if STDC_HEADERS |
| 3962 | # include <stdlib.h> |
| 3963 | # include <stddef.h> |
| 3964 | #endif |
| 3965 | ], [int r = isinf(1.11); ], |
| 3966 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF), |
| 3967 | AC_MSG_RESULT(no)) |
| 3968 | |
| 3969 | AC_MSG_CHECKING([for isnan()]) |
| 3970 | AC_TRY_LINK([ |
| 3971 | #ifdef HAVE_MATH_H |
| 3972 | # include <math.h> |
| 3973 | #endif |
| 3974 | #if STDC_HEADERS |
| 3975 | # include <stdlib.h> |
| 3976 | # include <stddef.h> |
| 3977 | #endif |
| 3978 | ], [int r = isnan(1.11); ], |
| 3979 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN), |
| 3980 | AC_MSG_RESULT(no)) |
| 3981 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3982 | dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI |
| 3983 | dnl when -lacl works, also try to use -lattr (required for Debian). |
Bram Moolenaar | 8d462f9 | 2012-02-05 22:51:33 +0100 | [diff] [blame] | 3984 | dnl On Solaris, use the acl_get/set functions in libsec, if present. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3985 | AC_MSG_CHECKING(--disable-acl argument) |
| 3986 | AC_ARG_ENABLE(acl, |
Bram Moolenaar | d6d3042 | 2018-01-28 22:48:55 +0100 | [diff] [blame] | 3987 | [ --disable-acl No check for ACL support.], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3988 | , [enable_acl="yes"]) |
| 3989 | if test "$enable_acl" = "yes"; then |
Bram Moolenaar | d6d3042 | 2018-01-28 22:48:55 +0100 | [diff] [blame] | 3990 | AC_MSG_RESULT(no) |
| 3991 | AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"], |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3992 | AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl" |
| 3993 | AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),) |
| 3994 | |
Bram Moolenaar | d6d3042 | 2018-01-28 22:48:55 +0100 | [diff] [blame] | 3995 | AC_MSG_CHECKING(for POSIX ACL support) |
| 3996 | AC_TRY_LINK([ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3997 | #include <sys/types.h> |
| 3998 | #ifdef HAVE_SYS_ACL_H |
| 3999 | # include <sys/acl.h> |
| 4000 | #endif |
| 4001 | acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS); |
| 4002 | acl_set_file("foo", ACL_TYPE_ACCESS, acl); |
| 4003 | acl_free(acl);], |
| 4004 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), |
| 4005 | AC_MSG_RESULT(no)) |
| 4006 | |
Bram Moolenaar | d6d3042 | 2018-01-28 22:48:55 +0100 | [diff] [blame] | 4007 | AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)], |
| 4008 | AC_MSG_CHECKING(for Solaris ACL support) |
| 4009 | AC_TRY_LINK([ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4010 | #ifdef HAVE_SYS_ACL_H |
| 4011 | # include <sys/acl.h> |
| 4012 | #endif], [acl("foo", GETACLCNT, 0, NULL); |
| 4013 | ], |
| 4014 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL), |
Bram Moolenaar | 8d462f9 | 2012-02-05 22:51:33 +0100 | [diff] [blame] | 4015 | AC_MSG_RESULT(no))) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4016 | |
Bram Moolenaar | d6d3042 | 2018-01-28 22:48:55 +0100 | [diff] [blame] | 4017 | AC_MSG_CHECKING(for AIX ACL support) |
| 4018 | AC_TRY_LINK([ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4019 | #if STDC_HEADERS |
| 4020 | # include <stdlib.h> |
| 4021 | # include <stddef.h> |
| 4022 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4023 | #ifdef HAVE_SYS_ACL_H |
| 4024 | # include <sys/acl.h> |
| 4025 | #endif |
| 4026 | #ifdef HAVE_SYS_ACCESS_H |
| 4027 | # include <sys/access.h> |
| 4028 | #endif |
| 4029 | #define _ALL_SOURCE |
| 4030 | |
| 4031 | #include <sys/stat.h> |
| 4032 | |
| 4033 | int aclsize; |
| 4034 | struct acl *aclent;], [aclsize = sizeof(struct acl); |
| 4035 | aclent = (void *)malloc(aclsize); |
| 4036 | statacl("foo", STX_NORMAL, aclent, aclsize); |
| 4037 | ], |
| 4038 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL), |
| 4039 | AC_MSG_RESULT(no)) |
| 4040 | else |
| 4041 | AC_MSG_RESULT(yes) |
| 4042 | fi |
| 4043 | |
Bram Moolenaar | 3cbe0c0 | 2015-09-08 20:00:22 +0200 | [diff] [blame] | 4044 | if test "x$GTK_CFLAGS" != "x"; then |
| 4045 | dnl pango_shape_full() is new, fall back to pango_shape(). |
| 4046 | AC_MSG_CHECKING(for pango_shape_full) |
| 4047 | ac_save_CFLAGS="$CFLAGS" |
| 4048 | ac_save_LIBS="$LIBS" |
| 4049 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
| 4050 | LIBS="$LIBS $GTK_LIBS" |
Bram Moolenaar | 5325b9b | 2015-09-09 20:27:02 +0200 | [diff] [blame] | 4051 | AC_TRY_LINK( |
Bram Moolenaar | 3cbe0c0 | 2015-09-08 20:00:22 +0200 | [diff] [blame] | 4052 | [#include <gtk/gtk.h>], |
| 4053 | [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ], |
| 4054 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL), |
| 4055 | AC_MSG_RESULT(no)) |
| 4056 | CFLAGS="$ac_save_CFLAGS" |
| 4057 | LIBS="$ac_save_LIBS" |
| 4058 | fi |
| 4059 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4060 | AC_MSG_CHECKING(--disable-gpm argument) |
| 4061 | AC_ARG_ENABLE(gpm, |
| 4062 | [ --disable-gpm Don't use gpm (Linux mouse daemon).], , |
| 4063 | [enable_gpm="yes"]) |
| 4064 | |
| 4065 | if test "$enable_gpm" = "yes"; then |
| 4066 | AC_MSG_RESULT(no) |
| 4067 | dnl Checking if gpm support can be compiled |
| 4068 | AC_CACHE_CHECK([for gpm], vi_cv_have_gpm, |
| 4069 | [olibs="$LIBS" ; LIBS="-lgpm"] |
| 4070 | AC_TRY_LINK( |
| 4071 | [#include <gpm.h> |
| 4072 | #include <linux/keyboard.h>], |
| 4073 | [Gpm_GetLibVersion(NULL);], |
| 4074 | dnl Configure defines HAVE_GPM, if it is defined feature.h defines |
| 4075 | dnl FEAT_MOUSE_GPM if mouse support is included |
| 4076 | [vi_cv_have_gpm=yes], |
| 4077 | [vi_cv_have_gpm=no]) |
| 4078 | [LIBS="$olibs"] |
| 4079 | ) |
| 4080 | if test $vi_cv_have_gpm = yes; then |
| 4081 | LIBS="$LIBS -lgpm" |
| 4082 | AC_DEFINE(HAVE_GPM) |
| 4083 | fi |
| 4084 | else |
| 4085 | AC_MSG_RESULT(yes) |
| 4086 | fi |
| 4087 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4088 | AC_MSG_CHECKING(--disable-sysmouse argument) |
| 4089 | AC_ARG_ENABLE(sysmouse, |
Bram Moolenaar | 8008b63 | 2017-07-18 21:33:20 +0200 | [diff] [blame] | 4090 | [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], , |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4091 | [enable_sysmouse="yes"]) |
| 4092 | |
| 4093 | if test "$enable_sysmouse" = "yes"; then |
| 4094 | AC_MSG_RESULT(no) |
| 4095 | dnl Checking if sysmouse support can be compiled |
| 4096 | dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h |
| 4097 | dnl defines FEAT_SYSMOUSE if mouse support is included |
| 4098 | AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse, |
| 4099 | AC_TRY_LINK( |
| 4100 | [#include <sys/consio.h> |
| 4101 | #include <signal.h> |
| 4102 | #include <sys/fbio.h>], |
| 4103 | [struct mouse_info mouse; |
| 4104 | mouse.operation = MOUSE_MODE; |
| 4105 | mouse.operation = MOUSE_SHOW; |
| 4106 | mouse.u.mode.mode = 0; |
| 4107 | mouse.u.mode.signal = SIGUSR2;], |
| 4108 | [vi_cv_have_sysmouse=yes], |
| 4109 | [vi_cv_have_sysmouse=no]) |
| 4110 | ) |
| 4111 | if test $vi_cv_have_sysmouse = yes; then |
| 4112 | AC_DEFINE(HAVE_SYSMOUSE) |
| 4113 | fi |
| 4114 | else |
| 4115 | AC_MSG_RESULT(yes) |
| 4116 | fi |
| 4117 | |
Bram Moolenaar | f05da21 | 2009-11-17 16:13:15 +0000 | [diff] [blame] | 4118 | dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known |
| 4119 | AC_MSG_CHECKING(for FD_CLOEXEC) |
| 4120 | AC_TRY_COMPILE( |
| 4121 | [#if HAVE_FCNTL_H |
| 4122 | # include <fcntl.h> |
| 4123 | #endif], |
| 4124 | [ int flag = FD_CLOEXEC;], |
| 4125 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), |
| 4126 | AC_MSG_RESULT(not usable)) |
| 4127 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4128 | dnl rename needs to be checked separately to work on Nextstep with cc |
| 4129 | AC_MSG_CHECKING(for rename) |
| 4130 | AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")], |
| 4131 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), |
| 4132 | AC_MSG_RESULT(no)) |
| 4133 | |
| 4134 | dnl sysctl() may exist but not the arguments we use |
| 4135 | AC_MSG_CHECKING(for sysctl) |
| 4136 | AC_TRY_COMPILE( |
| 4137 | [#include <sys/types.h> |
| 4138 | #include <sys/sysctl.h>], |
| 4139 | [ int mib[2], r; |
| 4140 | size_t len; |
| 4141 | |
| 4142 | mib[0] = CTL_HW; |
| 4143 | mib[1] = HW_USERMEM; |
| 4144 | len = sizeof(r); |
| 4145 | (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0); |
| 4146 | ], |
| 4147 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), |
| 4148 | AC_MSG_RESULT(not usable)) |
| 4149 | |
| 4150 | dnl sysinfo() may exist but not be Linux compatible |
| 4151 | AC_MSG_CHECKING(for sysinfo) |
| 4152 | AC_TRY_COMPILE( |
| 4153 | [#include <sys/types.h> |
| 4154 | #include <sys/sysinfo.h>], |
| 4155 | [ struct sysinfo sinfo; |
| 4156 | int t; |
| 4157 | |
| 4158 | (void)sysinfo(&sinfo); |
| 4159 | t = sinfo.totalram; |
| 4160 | ], |
| 4161 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO), |
| 4162 | AC_MSG_RESULT(not usable)) |
| 4163 | |
Bram Moolenaar | 914572a | 2007-05-01 11:37:47 +0000 | [diff] [blame] | 4164 | dnl struct sysinfo may have the mem_unit field or not |
| 4165 | AC_MSG_CHECKING(for sysinfo.mem_unit) |
| 4166 | AC_TRY_COMPILE( |
| 4167 | [#include <sys/types.h> |
| 4168 | #include <sys/sysinfo.h>], |
| 4169 | [ struct sysinfo sinfo; |
Bram Moolenaar | 3c7ad01 | 2013-06-11 19:53:45 +0200 | [diff] [blame] | 4170 | sinfo.mem_unit = 1; |
Bram Moolenaar | 914572a | 2007-05-01 11:37:47 +0000 | [diff] [blame] | 4171 | ], |
| 4172 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), |
| 4173 | AC_MSG_RESULT(no)) |
| 4174 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4175 | dnl sysconf() may exist but not support what we want to use |
| 4176 | AC_MSG_CHECKING(for sysconf) |
| 4177 | AC_TRY_COMPILE( |
| 4178 | [#include <unistd.h>], |
| 4179 | [ (void)sysconf(_SC_PAGESIZE); |
| 4180 | (void)sysconf(_SC_PHYS_PAGES); |
| 4181 | ], |
| 4182 | AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), |
| 4183 | AC_MSG_RESULT(not usable)) |
| 4184 | |
Bram Moolenaar | 914703b | 2010-05-31 21:59:46 +0200 | [diff] [blame] | 4185 | AC_CHECK_SIZEOF([int]) |
| 4186 | AC_CHECK_SIZEOF([long]) |
| 4187 | AC_CHECK_SIZEOF([time_t]) |
| 4188 | AC_CHECK_SIZEOF([off_t]) |
Bram Moolenaar | 644fdff | 2010-05-30 13:26:21 +0200 | [diff] [blame] | 4189 | |
Bram Moolenaar | a2aa31a | 2014-02-23 22:52:40 +0100 | [diff] [blame] | 4190 | dnl Use different names to avoid clashing with other header files. |
| 4191 | AC_DEFINE_UNQUOTED(VIM_SIZEOF_INT, [$ac_cv_sizeof_int]) |
| 4192 | AC_DEFINE_UNQUOTED(VIM_SIZEOF_LONG, [$ac_cv_sizeof_long]) |
| 4193 | |
Bram Moolenaar | fa7584c | 2010-05-19 21:57:45 +0200 | [diff] [blame] | 4194 | dnl Make sure that uint32_t is really 32 bits unsigned. |
| 4195 | AC_MSG_CHECKING([uint32_t is 32 bits]) |
| 4196 | AC_TRY_RUN([ |
| 4197 | #ifdef HAVE_STDINT_H |
| 4198 | # include <stdint.h> |
| 4199 | #endif |
| 4200 | #ifdef HAVE_INTTYPES_H |
| 4201 | # include <inttypes.h> |
| 4202 | #endif |
| 4203 | main() { |
| 4204 | uint32_t nr1 = (uint32_t)-1; |
| 4205 | uint32_t nr2 = (uint32_t)0xffffffffUL; |
| 4206 | if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); |
| 4207 | exit(0); |
| 4208 | }], |
| 4209 | AC_MSG_RESULT(ok), |
| 4210 | AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]), |
Bram Moolenaar | 323cb95 | 2011-12-14 19:22:34 +0100 | [diff] [blame] | 4211 | AC_MSG_WARN([cannot check uint32_t when cross-compiling.])) |
Bram Moolenaar | fa7584c | 2010-05-19 21:57:45 +0200 | [diff] [blame] | 4212 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4213 | dnl Check for memmove() before bcopy(), makes memmove() be used when both are |
| 4214 | dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. |
| 4215 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4216 | [bcopy_test_prog=' |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4217 | #include "confdefs.h" |
| 4218 | #ifdef HAVE_STRING_H |
| 4219 | # include <string.h> |
| 4220 | #endif |
| 4221 | #if STDC_HEADERS |
| 4222 | # include <stdlib.h> |
| 4223 | # include <stddef.h> |
| 4224 | #endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4225 | main() { |
| 4226 | char buf[10]; |
| 4227 | strcpy(buf, "abcdefghi"); |
| 4228 | mch_memmove(buf, buf + 2, 3); |
| 4229 | if (strncmp(buf, "ababcf", 6)) |
| 4230 | exit(1); |
| 4231 | strcpy(buf, "abcdefghi"); |
| 4232 | mch_memmove(buf + 2, buf, 3); |
| 4233 | if (strncmp(buf, "cdedef", 6)) |
| 4234 | exit(1); |
| 4235 | exit(0); /* libc version works properly. */ |
| 4236 | }'] |
| 4237 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4238 | AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap], |
| 4239 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 4240 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]])], |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4241 | [ |
| 4242 | vim_cv_memmove_handles_overlap=yes |
| 4243 | ],[ |
| 4244 | vim_cv_memmove_handles_overlap=no |
| 4245 | ],[ |
| 4246 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap') |
| 4247 | ]) |
| 4248 | ]) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4249 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4250 | if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then |
| 4251 | AC_DEFINE(USEMEMMOVE) |
| 4252 | else |
| 4253 | AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap], |
| 4254 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 4255 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]])], |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4256 | [ |
| 4257 | vim_cv_bcopy_handles_overlap=yes |
| 4258 | ],[ |
| 4259 | vim_cv_bcopy_handles_overlap=no |
| 4260 | ],[ |
| 4261 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap') |
| 4262 | ]) |
| 4263 | ]) |
| 4264 | |
| 4265 | if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then |
| 4266 | AC_DEFINE(USEBCOPY) |
| 4267 | else |
| 4268 | AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap], |
| 4269 | [ |
Bram Moolenaar | 7db7784 | 2014-03-27 17:40:59 +0100 | [diff] [blame] | 4270 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]])], |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4271 | [ |
| 4272 | vim_cv_memcpy_handles_overlap=yes |
| 4273 | ],[ |
| 4274 | vim_cv_memcpy_handles_overlap=no |
| 4275 | ],[ |
| 4276 | AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap') |
| 4277 | ]) |
| 4278 | ]) |
| 4279 | |
| 4280 | if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then |
| 4281 | AC_DEFINE(USEMEMCPY) |
| 4282 | fi |
| 4283 | fi |
| 4284 | fi |
| 4285 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4286 | |
| 4287 | dnl Check for multibyte locale functions |
| 4288 | dnl Find out if _Xsetlocale() is supported by libX11. |
| 4289 | dnl Check if X_LOCALE should be defined. |
Bram Moolenaar | cbc246a | 2014-10-11 14:47:26 +0200 | [diff] [blame] | 4290 | if test "x$with_x" = "xyes"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4291 | cflags_save=$CFLAGS |
Bram Moolenaar | cbc246a | 2014-10-11 14:47:26 +0200 | [diff] [blame] | 4292 | libs_save=$LIBS |
| 4293 | LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS" |
| 4294 | CFLAGS="$CFLAGS $X_CFLAGS" |
| 4295 | |
| 4296 | AC_MSG_CHECKING(whether X_LOCALE needed) |
| 4297 | AC_TRY_COMPILE([#include <X11/Xlocale.h>],, |
| 4298 | AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes) |
| 4299 | AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)), |
| 4300 | AC_MSG_RESULT(no)) |
| 4301 | |
| 4302 | AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used) |
| 4303 | AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes) |
| 4304 | AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no)) |
| 4305 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4306 | CFLAGS=$cflags_save |
Bram Moolenaar | cbc246a | 2014-10-11 14:47:26 +0200 | [diff] [blame] | 4307 | LIBS=$libs_save |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4308 | fi |
| 4309 | |
| 4310 | dnl Link with xpg4, it is said to make Korean locale working |
| 4311 | AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,) |
| 4312 | |
Bram Moolenaar | 0c7ce77 | 2009-05-13 12:49:39 +0000 | [diff] [blame] | 4313 | dnl Check how we can run ctags. Default to "ctags" when nothing works. |
Bram Moolenaar | 8f4ba69 | 2011-05-05 17:24:27 +0200 | [diff] [blame] | 4314 | dnl Use --version to detect Exuberant ctags (preferred) |
Bram Moolenaar | b21e584 | 2006-04-16 18:30:08 +0000 | [diff] [blame] | 4315 | dnl Add --fields=+S to get function signatures for omni completion. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4316 | dnl -t for typedefs (many ctags have this) |
| 4317 | dnl -s for static functions (Elvis ctags only?) |
| 4318 | dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'. |
| 4319 | dnl -i+m to test for older Exuberant ctags |
| 4320 | AC_MSG_CHECKING(how to create tags) |
| 4321 | test -f tags && mv tags tags.save |
Bram Moolenaar | 5897e0c | 2011-05-10 15:42:03 +0200 | [diff] [blame] | 4322 | if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then |
Bram Moolenaar | 509ff06 | 2020-01-02 22:38:49 +0100 | [diff] [blame] | 4323 | TAGPRG="ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" |
Bram Moolenaar | 5897e0c | 2011-05-10 15:42:03 +0200 | [diff] [blame] | 4324 | elif (eval exctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then |
Bram Moolenaar | 509ff06 | 2020-01-02 22:38:49 +0100 | [diff] [blame] | 4325 | TAGPRG="exctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" |
Bram Moolenaar | 5897e0c | 2011-05-10 15:42:03 +0200 | [diff] [blame] | 4326 | elif (eval exuberant-ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then |
Bram Moolenaar | 509ff06 | 2020-01-02 22:38:49 +0100 | [diff] [blame] | 4327 | TAGPRG="exuberant-ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4328 | else |
Bram Moolenaar | 0c7ce77 | 2009-05-13 12:49:39 +0000 | [diff] [blame] | 4329 | TAGPRG="ctags" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4330 | (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags" |
| 4331 | (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c" |
| 4332 | (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags" |
| 4333 | (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t" |
| 4334 | (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts" |
| 4335 | (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs" |
| 4336 | (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m" |
| 4337 | fi |
| 4338 | test -f tags.save && mv tags.save tags |
| 4339 | AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG) |
| 4340 | |
| 4341 | dnl Check how we can run man with a section number |
| 4342 | AC_MSG_CHECKING(how to run man with a section nr) |
| 4343 | MANDEF="man" |
Bram Moolenaar | 8b13150 | 2008-02-13 09:28:19 +0000 | [diff] [blame] | 4344 | (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4345 | AC_MSG_RESULT($MANDEF) |
| 4346 | if test "$MANDEF" = "man -s"; then |
| 4347 | AC_DEFINE(USEMAN_S) |
| 4348 | fi |
| 4349 | |
| 4350 | dnl Check if gettext() is working and if it needs -lintl |
Bram Moolenaar | 49b6a57 | 2013-11-17 20:32:54 +0100 | [diff] [blame] | 4351 | dnl We take care to base this on an empty LIBS: on some systems libelf would be |
| 4352 | dnl in LIBS and implicitly take along libintl. The final LIBS would then not |
| 4353 | dnl contain libintl, and the link step would fail due to -Wl,--as-needed. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4354 | AC_MSG_CHECKING(--disable-nls argument) |
| 4355 | AC_ARG_ENABLE(nls, |
| 4356 | [ --disable-nls Don't support NLS (gettext()).], , |
| 4357 | [enable_nls="yes"]) |
| 4358 | |
| 4359 | if test "$enable_nls" = "yes"; then |
| 4360 | AC_MSG_RESULT(no) |
Bram Moolenaar | 2389c3c | 2005-05-22 22:07:59 +0000 | [diff] [blame] | 4361 | |
| 4362 | INSTALL_LANGS=install-languages |
| 4363 | AC_SUBST(INSTALL_LANGS) |
| 4364 | INSTALL_TOOL_LANGS=install-tool-languages |
| 4365 | AC_SUBST(INSTALL_TOOL_LANGS) |
| 4366 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4367 | AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, ) |
| 4368 | AC_MSG_CHECKING([for NLS]) |
| 4369 | if test -f po/Makefile; then |
| 4370 | have_gettext="no" |
| 4371 | if test -n "$MSGFMT"; then |
Bram Moolenaar | 49b6a57 | 2013-11-17 20:32:54 +0100 | [diff] [blame] | 4372 | olibs=$LIBS |
| 4373 | LIBS="" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4374 | AC_TRY_LINK( |
| 4375 | [#include <libintl.h>], |
| 4376 | [gettext("Test");], |
Bram Moolenaar | 49b6a57 | 2013-11-17 20:32:54 +0100 | [diff] [blame] | 4377 | AC_MSG_RESULT([gettext() works]); have_gettext="yes"; LIBS=$olibs, |
| 4378 | LIBS="-lintl" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4379 | AC_TRY_LINK( |
| 4380 | [#include <libintl.h>], |
| 4381 | [gettext("Test");], |
Bram Moolenaar | 49b6a57 | 2013-11-17 20:32:54 +0100 | [diff] [blame] | 4382 | AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes"; |
| 4383 | LIBS="$olibs -lintl", |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4384 | AC_MSG_RESULT([gettext() doesn't work]); |
| 4385 | LIBS=$olibs)) |
| 4386 | else |
| 4387 | AC_MSG_RESULT([msgfmt not found - disabled]); |
| 4388 | fi |
Bram Moolenaar | 278eb58 | 2014-07-30 13:22:52 +0200 | [diff] [blame] | 4389 | if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4390 | AC_DEFINE(HAVE_GETTEXT) |
| 4391 | MAKEMO=yes |
| 4392 | AC_SUBST(MAKEMO) |
| 4393 | dnl this was added in GNU gettext 0.10.36 |
| 4394 | AC_CHECK_FUNCS(bind_textdomain_codeset) |
| 4395 | dnl _nl_msg_cat_cntr is required for GNU gettext |
| 4396 | AC_MSG_CHECKING([for _nl_msg_cat_cntr]) |
| 4397 | AC_TRY_LINK( |
| 4398 | [#include <libintl.h> |
| 4399 | extern int _nl_msg_cat_cntr;], |
| 4400 | [++_nl_msg_cat_cntr;], |
| 4401 | AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR), |
| 4402 | AC_MSG_RESULT([no])) |
Bram Moolenaar | 26096cc | 2019-04-11 15:25:40 +0200 | [diff] [blame] | 4403 | AC_MSG_CHECKING([if msgfmt supports --desktop]) |
| 4404 | MSGFMT_DESKTOP= |
| 4405 | if "$MSGFMT" --help | grep -e '--desktop' >/dev/null; then |
Bram Moolenaar | 62a88f4 | 2019-06-07 20:44:40 +0200 | [diff] [blame] | 4406 | if "$MSGFMT" --version | grep '0.19.[[3-7]]$' >/dev/null; then |
| 4407 | dnl GNU gettext 0.19.7's --desktop is broken. We assume back to |
| 4408 | dnl 0.19.3 is also broken. |
| 4409 | AC_MSG_RESULT([broken]) |
| 4410 | else |
| 4411 | AC_MSG_RESULT([yes]) |
| 4412 | MSGFMT_DESKTOP="gvim.desktop vim.desktop" |
| 4413 | fi |
Bram Moolenaar | 26096cc | 2019-04-11 15:25:40 +0200 | [diff] [blame] | 4414 | else |
| 4415 | AC_MSG_RESULT([no]) |
| 4416 | fi |
| 4417 | AC_SUBST(MSGFMT_DESKTOP) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4418 | fi |
| 4419 | else |
| 4420 | AC_MSG_RESULT([no "po/Makefile" - disabled]); |
| 4421 | fi |
| 4422 | else |
| 4423 | AC_MSG_RESULT(yes) |
| 4424 | fi |
| 4425 | |
| 4426 | dnl Check for dynamic linking loader |
| 4427 | AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)]) |
| 4428 | if test x${DLL} = xdlfcn.h; then |
| 4429 | AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ]) |
| 4430 | AC_MSG_CHECKING([for dlopen()]) |
| 4431 | AC_TRY_LINK(,[ |
| 4432 | extern void* dlopen(); |
| 4433 | dlopen(); |
| 4434 | ], |
| 4435 | AC_MSG_RESULT(yes); |
| 4436 | AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), |
| 4437 | AC_MSG_RESULT(no); |
| 4438 | AC_MSG_CHECKING([for dlopen() in -ldl]) |
| 4439 | olibs=$LIBS |
| 4440 | LIBS="$LIBS -ldl" |
| 4441 | AC_TRY_LINK(,[ |
| 4442 | extern void* dlopen(); |
| 4443 | dlopen(); |
| 4444 | ], |
| 4445 | AC_MSG_RESULT(yes); |
| 4446 | AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), |
| 4447 | AC_MSG_RESULT(no); |
| 4448 | LIBS=$olibs)) |
| 4449 | dnl ReliantUNIX has dlopen() in libc but everything else in libdl |
| 4450 | dnl ick :-) |
| 4451 | AC_MSG_CHECKING([for dlsym()]) |
| 4452 | AC_TRY_LINK(,[ |
| 4453 | extern void* dlsym(); |
| 4454 | dlsym(); |
| 4455 | ], |
| 4456 | AC_MSG_RESULT(yes); |
| 4457 | AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), |
| 4458 | AC_MSG_RESULT(no); |
| 4459 | AC_MSG_CHECKING([for dlsym() in -ldl]) |
| 4460 | olibs=$LIBS |
| 4461 | LIBS="$LIBS -ldl" |
| 4462 | AC_TRY_LINK(,[ |
| 4463 | extern void* dlsym(); |
| 4464 | dlsym(); |
| 4465 | ], |
| 4466 | AC_MSG_RESULT(yes); |
| 4467 | AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), |
| 4468 | AC_MSG_RESULT(no); |
| 4469 | LIBS=$olibs)) |
| 4470 | elif test x${DLL} = xdl.h; then |
| 4471 | AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ]) |
| 4472 | AC_MSG_CHECKING([for shl_load()]) |
| 4473 | AC_TRY_LINK(,[ |
| 4474 | extern void* shl_load(); |
| 4475 | shl_load(); |
| 4476 | ], |
| 4477 | AC_MSG_RESULT(yes); |
| 4478 | AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), |
| 4479 | AC_MSG_RESULT(no); |
| 4480 | AC_MSG_CHECKING([for shl_load() in -ldld]) |
| 4481 | olibs=$LIBS |
| 4482 | LIBS="$LIBS -ldld" |
| 4483 | AC_TRY_LINK(,[ |
| 4484 | extern void* shl_load(); |
| 4485 | shl_load(); |
| 4486 | ], |
| 4487 | AC_MSG_RESULT(yes); |
| 4488 | AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), |
| 4489 | AC_MSG_RESULT(no); |
| 4490 | LIBS=$olibs)) |
| 4491 | fi |
| 4492 | AC_CHECK_HEADERS(setjmp.h) |
| 4493 | |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 4494 | if test "x$MACOS_X" = "xyes" -a -n "$PERL"; then |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4495 | dnl -ldl must come after DynaLoader.a |
| 4496 | if echo $LIBS | grep -e '-ldl' >/dev/null; then |
| 4497 | LIBS=`echo $LIBS | sed s/-ldl//` |
| 4498 | PERL_LIBS="$PERL_LIBS -ldl" |
| 4499 | fi |
| 4500 | fi |
| 4501 | |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 4502 | if test "$MACOS_X" = "yes"; then |
| 4503 | AC_MSG_CHECKING([whether we need macOS frameworks]) |
| 4504 | if test "$GUITYPE" = "CARBONGUI"; then |
| 4505 | AC_MSG_RESULT([yes, we need Carbon]) |
| 4506 | LIBS="$LIBS -framework Carbon" |
| 4507 | elif test "$MACOS_X_DARWIN" = "yes"; then |
| 4508 | if test "$features" = "tiny"; then |
| 4509 | dnl Since no FEAT_CLIPBOARD, no longer need for os_macosx.m. |
| 4510 | OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` |
| 4511 | OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` |
Bram Moolenaar | 2be7cb7 | 2019-01-12 16:10:51 +0100 | [diff] [blame] | 4512 | AC_MSG_RESULT([yes, we need CoreServices]) |
| 4513 | LIBS="$LIBS -framework CoreServices" |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 4514 | else |
| 4515 | AC_MSG_RESULT([yes, we need AppKit]) |
| 4516 | LIBS="$LIBS -framework AppKit" |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 4517 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4518 | else |
Bram Moolenaar | d057301 | 2017-10-28 21:11:06 +0200 | [diff] [blame] | 4519 | AC_MSG_RESULT([no]) |
Bram Moolenaar | 3437b91 | 2013-07-03 19:52:53 +0200 | [diff] [blame] | 4520 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4521 | fi |
Bram Moolenaar | 164fca3 | 2010-07-14 13:58:07 +0200 | [diff] [blame] | 4522 | if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then |
Bram Moolenaar | 595a7be | 2010-03-10 16:28:12 +0100 | [diff] [blame] | 4523 | LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 4524 | fi |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4525 | |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 4526 | dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to |
| 4527 | dnl use "-isystem" instead of "-I" for all non-Vim include dirs. |
| 4528 | dnl But only when making dependencies, cproto and lint don't take "-isystem". |
Bram Moolenaar | 32466aa | 2006-02-24 23:53:04 +0000 | [diff] [blame] | 4529 | dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow |
| 4530 | dnl the number before the version number. |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 4531 | DEPEND_CFLAGS_FILTER= |
| 4532 | if test "$GCC" = yes; then |
Bram Moolenaar | 0cd4930 | 2008-11-20 09:37:01 +0000 | [diff] [blame] | 4533 | AC_MSG_CHECKING(for GCC 3 or later) |
Bram Moolenaar | 348808f | 2020-02-07 20:50:07 +0100 | [diff] [blame] | 4534 | gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]][[0-9]]*\)\..*$/\1/g'` |
Bram Moolenaar | f740b29 | 2006-02-16 22:11:02 +0000 | [diff] [blame] | 4535 | if test "$gccmajor" -gt "2"; then |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 4536 | DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" |
Bram Moolenaar | 0cd4930 | 2008-11-20 09:37:01 +0000 | [diff] [blame] | 4537 | AC_MSG_RESULT(yes) |
| 4538 | else |
| 4539 | AC_MSG_RESULT(no) |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 4540 | fi |
Bram Moolenaar | 0cd4930 | 2008-11-20 09:37:01 +0000 | [diff] [blame] | 4541 | dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is |
| 4542 | dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. |
Bram Moolenaar | 56d1db3 | 2009-12-16 16:14:51 +0000 | [diff] [blame] | 4543 | dnl Also remove duplicate _FORTIFY_SOURCE arguments. |
Bram Moolenaar | aeabe05 | 2011-12-08 15:17:34 +0100 | [diff] [blame] | 4544 | dnl And undefine it first to avoid a warning. |
Bram Moolenaar | 0cd4930 | 2008-11-20 09:37:01 +0000 | [diff] [blame] | 4545 | AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) |
| 4546 | if test "$gccmajor" -gt "3"; then |
Bram Moolenaar | a6cc031 | 2013-06-18 23:31:55 +0200 | [diff] [blame] | 4547 | 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/'` |
Bram Moolenaar | 91b992c | 2019-11-17 19:07:42 +0100 | [diff] [blame] | 4548 | CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g'` |
Bram Moolenaar | 0cd4930 | 2008-11-20 09:37:01 +0000 | [diff] [blame] | 4549 | AC_MSG_RESULT(yes) |
| 4550 | else |
| 4551 | AC_MSG_RESULT(no) |
| 4552 | fi |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 4553 | fi |
Bram Moolenaar | d5cdbeb | 2005-10-10 20:59:28 +0000 | [diff] [blame] | 4554 | AC_SUBST(DEPEND_CFLAGS_FILTER) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4555 | |
Bram Moolenaar | ec0557f | 2018-01-31 14:41:37 +0100 | [diff] [blame] | 4556 | dnl On some systems AC_SYS_LARGEFILE determines that -D_FILE_OFFSET_BITS=64 |
| 4557 | dnl isn't required, but the CFLAGS for some of the libraries we're using |
| 4558 | dnl include the define. Since the define changes the size of some datatypes |
| 4559 | dnl (e.g. ino_t and off_t), all of Vim's modules must be compiled with a |
| 4560 | dnl consistent value. It's therefore safest to force the use of the define |
| 4561 | dnl if it's present in any of the *_CFLAGS variables. |
| 4562 | AC_MSG_CHECKING(whether we need to force -D_FILE_OFFSET_BITS=64) |
Bram Moolenaar | 9ce4213 | 2018-04-11 22:19:36 +0200 | [diff] [blame] | 4563 | if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then |
Bram Moolenaar | ec0557f | 2018-01-31 14:41:37 +0100 | [diff] [blame] | 4564 | AC_MSG_RESULT(yes) |
| 4565 | AC_DEFINE(_FILE_OFFSET_BITS, 64) |
| 4566 | else |
| 4567 | AC_MSG_RESULT(no) |
| 4568 | fi |
| 4569 | |
Bram Moolenaar | 22e193d | 2010-11-03 22:32:24 +0100 | [diff] [blame] | 4570 | dnl link.sh tries to avoid overlinking in a hackish way. |
| 4571 | dnl At least GNU ld supports --as-needed which provides the same functionality |
| 4572 | dnl at linker level. Let's use it. |
| 4573 | AC_MSG_CHECKING(linker --as-needed support) |
| 4574 | LINK_AS_NEEDED= |
| 4575 | # Check if linker supports --as-needed and --no-as-needed options |
| 4576 | if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then |
Bram Moolenaar | a6cc031 | 2013-06-18 23:31:55 +0200 | [diff] [blame] | 4577 | LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` |
Bram Moolenaar | 22e193d | 2010-11-03 22:32:24 +0100 | [diff] [blame] | 4578 | LINK_AS_NEEDED=yes |
| 4579 | fi |
| 4580 | if test "$LINK_AS_NEEDED" = yes; then |
| 4581 | AC_MSG_RESULT(yes) |
| 4582 | else |
| 4583 | AC_MSG_RESULT(no) |
| 4584 | fi |
| 4585 | AC_SUBST(LINK_AS_NEEDED) |
| 4586 | |
Bram Moolenaar | 77c1935 | 2012-06-13 19:19:41 +0200 | [diff] [blame] | 4587 | # IBM z/OS reset CFLAGS for config.mk |
| 4588 | if test "$zOSUnix" = "yes"; then |
| 4589 | CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" |
| 4590 | fi |
| 4591 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4592 | dnl write output files |
| 4593 | AC_OUTPUT(auto/config.mk:config.mk.in) |
| 4594 | |
| 4595 | dnl vim: set sw=2 tw=78 fo+=l: |