Mercurial > vim
annotate src/configure.in @ 2388:06d77ed24f33 vim73
Find python3 also in lib64 directory. (Ben Boeckel)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 24 Jul 2010 16:11:21 +0200 |
parents | 410d7b5916f9 |
children | d680c97481c1 |
rev | line source |
---|---|
7 | 1 dnl configure.in: autoconf script for Vim |
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. | |
14 AC_PROG_CC dnl required by almost everything | |
15 AC_PROG_CPP dnl required by header file checks | |
16 AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP | |
17 AC_ISC_POSIX dnl required by AC_C_CROSS | |
18 AC_PROG_AWK dnl required for "make html" in ../doc | |
19 | |
20 dnl Don't strip if we don't have it | |
21 AC_CHECK_PROG(STRIP, strip, strip, :) | |
22 | |
14 | 23 dnl Check for extension of executables |
7 | 24 AC_EXEEXT |
25 | |
1621 | 26 dnl Check for standard headers. We don't use this in Vim but other stuff |
27 dnl in autoconf needs it, where it uses STDC_HEADERS. | |
28 AC_HEADER_STDC | |
29 AC_HEADER_SYS_WAIT | |
30 | |
7 | 31 dnl Set default value for CFLAGS if none is defined or it's empty |
32 if test -z "$CFLAGS"; then | |
33 CFLAGS="-O" | |
34 test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" | |
35 fi | |
36 if test "$GCC" = yes; then | |
819 | 37 dnl method that should work for nearly all versions |
38 gccversion=`"$CC" -dumpversion` | |
39 if test "x$gccversion" = "x"; then | |
40 dnl old method; fall-back for when -dumpversion doesn't work | |
41 gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` | |
42 fi | |
557 | 43 dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki |
44 if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then | |
697 | 45 echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"' |
7 | 46 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'` |
47 else | |
48 if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then | |
49 echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"' | |
50 CFLAGS="$CFLAGS -fno-strength-reduce" | |
51 fi | |
52 fi | |
53 fi | |
54 | |
1621 | 55 dnl If configure thinks we are cross compiling, there might be something |
56 dnl wrong with the CC or CFLAGS settings, give a useful warning message | |
7 | 57 if test "$cross_compiling" = yes; then |
1621 | 58 AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS]) |
7 | 59 fi |
60 | |
548 | 61 dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies. |
62 dnl But gcc 3.1 changed the meaning! See near the end. | |
7 | 63 test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM) |
64 | |
65 if test -f ./toolcheck; then | |
66 AC_CHECKING(for buggy tools) | |
67 sh ./toolcheck 1>&AC_FD_MSG | |
68 fi | |
69 | |
70 OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" | |
71 | |
72 dnl Check for BeOS, which needs an extra source file | |
73 AC_MSG_CHECKING(for BeOS) | |
74 case `uname` in | |
75 BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o | |
76 BEOS=yes; AC_MSG_RESULT(yes);; | |
77 *) BEOS=no; AC_MSG_RESULT(no);; | |
78 esac | |
79 | |
80 dnl If QNX is found, assume we don't want to use Xphoton | |
81 dnl unless it was specifically asked for (--with-x) | |
82 AC_MSG_CHECKING(for QNX) | |
83 case `uname` in | |
84 QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o | |
85 test -z "$with_x" && with_x=no | |
86 QNX=yes; AC_MSG_RESULT(yes);; | |
87 *) QNX=no; AC_MSG_RESULT(no);; | |
88 esac | |
89 | |
90 dnl Check for Darwin and MacOS X | |
91 dnl We do a check for MacOS X in the very beginning because there | |
92 dnl are a lot of other things we need to change besides GUI stuff | |
93 AC_MSG_CHECKING([for Darwin (Mac OS X)]) | |
94 if test "`(uname) 2>/dev/null`" = Darwin; then | |
95 AC_MSG_RESULT(yes) | |
96 | |
97 AC_MSG_CHECKING(--disable-darwin argument) | |
98 AC_ARG_ENABLE(darwin, | |
99 [ --disable-darwin Disable Darwin (Mac OS X) support.], | |
100 , [enable_darwin="yes"]) | |
101 if test "$enable_darwin" = "yes"; then | |
102 AC_MSG_RESULT(no) | |
103 AC_MSG_CHECKING(if Darwin files are there) | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
104 if test -f os_macosx.m; then |
7 | 105 AC_MSG_RESULT(yes) |
106 else | |
107 AC_MSG_RESULT([no, Darwin support disabled]) | |
108 enable_darwin=no | |
109 fi | |
110 else | |
111 AC_MSG_RESULT([yes, Darwin support excluded]) | |
112 fi | |
113 | |
692 | 114 AC_MSG_CHECKING(--with-mac-arch argument) |
809 | 115 AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], |
692 | 116 MACARCH="$withval"; AC_MSG_RESULT($MACARCH), |
809 | 117 MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) |
692 | 118 |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
119 AC_MSG_CHECKING(--with-developer-dir argument) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
120 AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools], |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
121 DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR), |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
122 DEVELOPER_DIR=""; AC_MSG_RESULT(not present)) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
123 |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
124 if test "x$DEVELOPER_DIR" = "x"; then |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
125 AC_PATH_PROG(XCODE_SELECT, xcode-select) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
126 if test "x$XCODE_SELECT" != "x"; then |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
127 AC_MSG_CHECKING(for developer dir using xcode-select) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
128 DEVELOPER_DIR=`$XCODE_SELECT -print-path` |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
129 AC_MSG_RESULT([$DEVELOPER_DIR]) |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
130 else |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
131 DEVELOPER_DIR=/Developer |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
132 fi |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
133 fi |
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
134 |
692 | 135 if test "x$MACARCH" = "xboth"; then |
697 | 136 AC_MSG_CHECKING(for 10.4 universal SDK) |
137 dnl There is a terrible inconsistency (but we appear to get away with it): | |
138 dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS | |
139 dnl doesn't, because "gcc -E" doesn't grok it. That means the configure | |
140 dnl tests using the preprocessor are actually done with the wrong header | |
141 dnl files. $LDFLAGS is set at the end, because configure uses it together | |
142 dnl with $CFLAGS and we can only have one -sysroot argument. | |
692 | 143 save_cppflags="$CPPFLAGS" |
697 | 144 save_cflags="$CFLAGS" |
692 | 145 save_ldflags="$LDFLAGS" |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
146 CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
692 | 147 AC_TRY_LINK([ ], [ ], |
697 | 148 AC_MSG_RESULT(found, will make universal binary), |
692 | 149 |
697 | 150 AC_MSG_RESULT(not found) |
716 | 151 CFLAGS="$save_cflags" |
697 | 152 AC_MSG_CHECKING(if Intel architecture is supported) |
153 CPPFLAGS="$CPPFLAGS -arch i386" | |
154 LDFLAGS="$save_ldflags -arch i386" | |
155 AC_TRY_LINK([ ], [ ], | |
156 AC_MSG_RESULT(yes); MACARCH="intel", | |
157 AC_MSG_RESULT(no, using PowerPC) | |
856 | 158 MACARCH="ppc" |
697 | 159 CPPFLAGS="$save_cppflags -arch ppc" |
160 LDFLAGS="$save_ldflags -arch ppc")) | |
161 elif test "x$MACARCH" = "xintel"; then | |
162 CPPFLAGS="$CPPFLAGS -arch intel" | |
163 LDFLAGS="$LDFLAGS -arch intel" | |
818 | 164 elif test "x$MACARCH" = "xppc"; then |
697 | 165 CPPFLAGS="$CPPFLAGS -arch ppc" |
166 LDFLAGS="$LDFLAGS -arch ppc" | |
692 | 167 fi |
168 | |
7 | 169 if test "$enable_darwin" = "yes"; then |
170 MACOSX=yes | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
171 OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; |
18 | 172 OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" |
685 | 173 dnl TODO: use -arch i386 on Intel machines |
697 | 174 CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp" |
7 | 175 |
176 dnl If Carbon is found, assume we don't want X11 | |
177 dnl unless it was specifically asked for (--with-x) | |
18 | 178 dnl or Motif, Athena or GTK GUI is used. |
7 | 179 AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) |
180 if test "x$CARBON" = "xyes"; then | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
181 if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then |
7 | 182 with_x=no |
183 fi | |
184 fi | |
185 fi | |
692 | 186 |
798 | 187 dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double |
699 | 188 dnl free. This happens in expand_filename(), because the optimizer swaps |
798 | 189 dnl two blocks of code, both using "repl", that can't be swapped. |
697 | 190 if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then |
191 CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` | |
192 fi | |
193 | |
7 | 194 else |
195 AC_MSG_RESULT(no) | |
196 fi | |
197 | |
198 AC_SUBST(OS_EXTRA_SRC) | |
199 AC_SUBST(OS_EXTRA_OBJ) | |
200 | |
201 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS. | |
202 dnl Only when the directory exists and it wasn't there yet. | |
203 dnl For gcc don't do this when it is already in the default search path. | |
1621 | 204 dnl Skip all of this when cross-compiling. |
205 if test "$cross_compiling" = no; then | |
1668 | 206 AC_MSG_CHECKING(--with-local-dir argument) |
1621 | 207 have_local_include='' |
208 have_local_lib='' | |
1668 | 209 AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries. |
210 --without-local-dir do not search /usr/local for local libraries.], [ | |
211 local_dir="$withval" | |
212 case "$withval" in | |
213 */*) ;; | |
214 no) | |
215 # avoid adding local dir to LDFLAGS and CPPFLAGS | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
216 have_local_include=yes |
1668 | 217 have_local_lib=yes |
218 ;; | |
219 *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;; | |
220 esac | |
221 AC_MSG_RESULT($local_dir) | |
222 ], [ | |
223 local_dir=/usr/local | |
224 AC_MSG_RESULT(Defaulting to $local_dir) | |
225 ]) | |
226 if test "$GCC" = yes -a "$local_dir" != no; then | |
1621 | 227 echo 'void f(){}' > conftest.c |
228 dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler) | |
1668 | 229 have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"` |
230 have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"` | |
1621 | 231 rm -f conftest.c conftest.o |
7 | 232 fi |
1668 | 233 if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then |
234 tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"` | |
1621 | 235 if test "$tt" = "$LDFLAGS"; then |
1668 | 236 LDFLAGS="$LDFLAGS -L${local_dir}/lib" |
1621 | 237 fi |
238 fi | |
1668 | 239 if test -z "$have_local_include" -a -d "${local_dir}/include"; then |
240 tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"` | |
1621 | 241 if test "$tt" = "$CPPFLAGS"; then |
1668 | 242 CPPFLAGS="$CPPFLAGS -I${local_dir}/include" |
1621 | 243 fi |
7 | 244 fi |
245 fi | |
246 | |
247 AC_MSG_CHECKING(--with-vim-name argument) | |
248 AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable], | |
249 VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME), | |
502 | 250 VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME)) |
7 | 251 AC_SUBST(VIMNAME) |
252 AC_MSG_CHECKING(--with-ex-name argument) | |
253 AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable], | |
254 EXNAME="$withval"; AC_MSG_RESULT($EXNAME), | |
255 EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex)) | |
256 AC_SUBST(EXNAME) | |
257 AC_MSG_CHECKING(--with-view-name argument) | |
258 AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable], | |
259 VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME), | |
260 VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view)) | |
261 AC_SUBST(VIEWNAME) | |
262 | |
263 AC_MSG_CHECKING(--with-global-runtime argument) | |
264 AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'], | |
265 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"), | |
266 AC_MSG_RESULT(no)) | |
267 | |
268 AC_MSG_CHECKING(--with-modified-by argument) | |
269 AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version], | |
270 AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"), | |
271 AC_MSG_RESULT(no)) | |
272 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
273 dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix |
7 | 274 AC_MSG_CHECKING(if character set is EBCDIC) |
275 AC_TRY_COMPILE([ ], | |
276 [ /* TryCompile function for CharSet. | |
277 Treat any failure as ASCII for compatibility with existing art. | |
278 Use compile-time rather than run-time tests for cross-compiler | |
279 tolerance. */ | |
280 #if '0'!=240 | |
281 make an error "Character set is not EBCDIC" | |
282 #endif ], | |
283 [ # TryCompile action if true | |
284 cf_cv_ebcdic=yes ], | |
285 [ # TryCompile action if false | |
286 cf_cv_ebcdic=no]) | |
287 # end of TryCompile ]) | |
288 # end of CacheVal CvEbcdic | |
289 AC_MSG_RESULT($cf_cv_ebcdic) | |
290 case "$cf_cv_ebcdic" in #(vi | |
291 yes) AC_DEFINE(EBCDIC) | |
292 line_break='"\\n"' | |
293 ;; | |
294 *) line_break='"\\012"';; | |
295 esac | |
296 AC_SUBST(line_break) | |
297 | |
298 if test "$cf_cv_ebcdic" = "yes"; then | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
299 dnl If we have EBCDIC we most likley have z/OS Unix, let's test it! |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
300 AC_MSG_CHECKING(for z/OS Unix) |
7 | 301 case `uname` in |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
302 OS/390) zOSUnix="yes"; |
7 | 303 dnl If using cc the environment variable _CC_CCMODE must be |
304 dnl set to "1", so that some compiler extensions are enabled. | |
305 dnl If using c89 the environment variable is named _CC_C89MODE. | |
306 dnl Note: compile with c89 never tested. | |
307 if test "$CC" = "cc"; then | |
308 ccm="$_CC_CCMODE" | |
309 ccn="CC" | |
310 else | |
311 if test "$CC" = "c89"; then | |
312 ccm="$_CC_C89MODE" | |
313 ccn="C89" | |
314 else | |
315 ccm=1 | |
316 fi | |
317 fi | |
318 if test "$ccm" != "1"; then | |
319 echo "" | |
320 echo "------------------------------------------" | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
321 echo " On z/OS Unix, the environment variable" |
7 | 322 echo " __CC_${ccn}MODE must be set to \"1\"!" |
323 echo " Do:" | |
324 echo " export _CC_${ccn}MODE=1" | |
325 echo " and then call configure again." | |
326 echo "------------------------------------------" | |
327 exit 1 | |
328 fi | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
329 CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)"; |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
330 LDFLAGS="$LDFLAGS -Wl,EDIT=NO" |
7 | 331 AC_MSG_RESULT(yes) |
332 ;; | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
333 *) zOSUnix="no"; |
7 | 334 AC_MSG_RESULT(no) |
335 ;; | |
336 esac | |
337 fi | |
338 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
339 dnl Set QUOTESED. Needs additional backslashes on zOS |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
340 if test "$zOSUnix" = "yes"; then |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
341 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'" |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
342 else |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
343 QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'" |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
344 fi |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
345 AC_SUBST(QUOTESED) |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
346 |
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
347 |
1583 | 348 dnl Link with -lselinux for SELinux stuff; if not found |
349 AC_MSG_CHECKING(--disable-selinux argument) | |
350 AC_ARG_ENABLE(selinux, | |
351 [ --disable-selinux Don't check for SELinux support.], | |
352 , enable_selinux="yes") | |
353 if test "$enable_selinux" = "yes"; then | |
354 AC_MSG_RESULT(no) | |
355 AC_CHECK_LIB(selinux, is_selinux_enabled, | |
356 [LIBS="$LIBS -lselinux" | |
357 AC_DEFINE(HAVE_SELINUX)]) | |
358 else | |
359 AC_MSG_RESULT(yes) | |
360 fi | |
7 | 361 |
362 dnl Check user requested features. | |
363 | |
364 AC_MSG_CHECKING(--with-features argument) | |
365 AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)], | |
366 features="$withval"; AC_MSG_RESULT($features), | |
367 features="normal"; AC_MSG_RESULT(Defaulting to normal)) | |
368 | |
369 dovimdiff="" | |
370 dogvimdiff="" | |
371 case "$features" in | |
372 tiny) AC_DEFINE(FEAT_TINY) ;; | |
373 small) AC_DEFINE(FEAT_SMALL) ;; | |
374 normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff"; | |
375 dogvimdiff="installgvimdiff" ;; | |
376 big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff"; | |
377 dogvimdiff="installgvimdiff" ;; | |
378 huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff"; | |
379 dogvimdiff="installgvimdiff" ;; | |
380 *) AC_MSG_RESULT([Sorry, $features is not supported]) ;; | |
381 esac | |
382 | |
383 AC_SUBST(dovimdiff) | |
384 AC_SUBST(dogvimdiff) | |
385 | |
386 AC_MSG_CHECKING(--with-compiledby argument) | |
387 AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message], | |
388 compiledby="$withval"; AC_MSG_RESULT($withval), | |
389 compiledby=""; AC_MSG_RESULT(no)) | |
390 AC_SUBST(compiledby) | |
391 | |
392 AC_MSG_CHECKING(--disable-xsmp argument) | |
393 AC_ARG_ENABLE(xsmp, | |
394 [ --disable-xsmp Disable XSMP session management], | |
395 , enable_xsmp="yes") | |
396 | |
397 if test "$enable_xsmp" = "yes"; then | |
398 AC_MSG_RESULT(no) | |
399 AC_MSG_CHECKING(--disable-xsmp-interact argument) | |
400 AC_ARG_ENABLE(xsmp-interact, | |
401 [ --disable-xsmp-interact Disable XSMP interaction], | |
402 , enable_xsmp_interact="yes") | |
403 if test "$enable_xsmp_interact" = "yes"; then | |
404 AC_MSG_RESULT(no) | |
405 AC_DEFINE(USE_XSMP_INTERACT) | |
406 else | |
407 AC_MSG_RESULT(yes) | |
408 fi | |
409 else | |
410 AC_MSG_RESULT(yes) | |
411 fi | |
412 | |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
413 dnl Check for Lua feature. |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
414 AC_MSG_CHECKING(--enable-luainterp argument) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
415 AC_ARG_ENABLE(luainterp, |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
416 [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
417 [enable_luainterp="no"]) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
418 AC_MSG_RESULT($enable_luainterp) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
419 |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
420 if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
421 dnl -- find the lua executable |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
422 AC_SUBST(vi_cv_path_lua) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
423 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
424 AC_MSG_CHECKING(--with-lua-prefix argument) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
425 AC_ARG_WITH(lua_prefix, |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
426 [ --with-lua-prefix=PFX Prefix where Lua is installed.], |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
427 with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix), |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
428 with_lua_prefix="";AC_MSG_RESULT(no)) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
429 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
430 if test "X$with_lua_prefix" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
431 vi_cv_path_lua_pfx="$with_lua_prefix" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
432 else |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
433 AC_MSG_CHECKING(LUA_PREFIX environment var) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
434 if test "X$LUA_PREFIX" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
435 AC_MSG_RESULT("$LUA_PREFIX") |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
436 vi_cv_path_lua_pfx="$LUA_PREFIX" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
437 else |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
438 AC_MSG_RESULT([not set, default to /usr]) |
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
439 vi_cv_path_lua_pfx="/usr" |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
440 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
441 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
442 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
443 LUA_INC= |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
444 if test "X$vi_cv_path_lua_pfx" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
445 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
446 if test -f $vi_cv_path_lua_pfx/include/lua.h; then |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
447 AC_MSG_RESULT(yes) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
448 else |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
449 AC_MSG_RESULT(no) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
450 dnl -- try to find Lua executable |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
451 AC_PATH_PROG(vi_cv_path_lua, lua) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
452 if test "X$vi_cv_path_lua" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
453 dnl -- find Lua version |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
454 AC_CACHE_CHECK(Lua version, vi_cv_version_lua, |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
455 [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION:sub(5,7))"` ]) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
456 AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
457 if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
458 AC_MSG_RESULT(yes) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
459 LUA_INC=/lua$vi_cv_version_lua |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
460 else |
2331
3840b7508835
Make it easier to build with Lua. Remove compiler warnings.
Bram Moolenaar <bram@vim.org>
parents:
2329
diff
changeset
|
461 AC_MSG_RESULT(no) |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
462 vi_cv_path_lua_pfx= |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
463 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
464 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
465 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
466 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
467 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
468 if test "X$vi_cv_path_lua_pfx" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
469 if test "X$vi_cv_version_lua" != "X"; then |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
470 dnl Test alternate location using version |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
471 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
472 else |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
473 LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
474 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
475 LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
476 LUA_SRC="if_lua.c" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
477 LUA_OBJ="objects/if_lua.o" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
478 LUA_PRO="if_lua.pro" |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
479 AC_DEFINE(FEAT_LUA) |
2373
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
480 if test "$enable_luainterp" = "dynamic"; then |
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
481 AC_DEFINE(DYNAMIC_LUA) |
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
482 LUA_LIBS="" |
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
483 LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so\\\" $LUA_CFLAGS" |
f149bb1cf5be
Make it possible to load Lua dynamically on Unix. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2370
diff
changeset
|
484 fi |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
485 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
486 AC_SUBST(LUA_SRC) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
487 AC_SUBST(LUA_OBJ) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
488 AC_SUBST(LUA_PRO) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
489 AC_SUBST(LUA_LIBS) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
490 AC_SUBST(LUA_CFLAGS) |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
491 fi |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
492 |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2309
diff
changeset
|
493 |
14 | 494 dnl Check for MzScheme feature. |
495 AC_MSG_CHECKING(--enable-mzschemeinterp argument) | |
496 AC_ARG_ENABLE(mzschemeinterp, | |
497 [ --enable-mzschemeinterp Include MzScheme interpreter.], , | |
498 [enable_mzschemeinterp="no"]) | |
499 AC_MSG_RESULT($enable_mzschemeinterp) | |
500 | |
501 if test "$enable_mzschemeinterp" = "yes"; then | |
502 dnl -- find the mzscheme executable | |
503 AC_SUBST(vi_cv_path_mzscheme) | |
504 | |
505 AC_MSG_CHECKING(--with-plthome argument) | |
506 AC_ARG_WITH(plthome, | |
856 | 507 [ --with-plthome=PLTHOME Use PLTHOME.], |
508 with_plthome="$withval"; AC_MSG_RESULT($with_plthome), | |
14 | 509 with_plthome="";AC_MSG_RESULT("no")) |
510 | |
511 if test "X$with_plthome" != "X"; then | |
512 vi_cv_path_mzscheme_pfx="$with_plthome" | |
513 else | |
514 AC_MSG_CHECKING(PLTHOME environment var) | |
515 if test "X$PLTHOME" != "X"; then | |
516 AC_MSG_RESULT("$PLTHOME") | |
856 | 517 vi_cv_path_mzscheme_pfx="$PLTHOME" |
14 | 518 else |
1894 | 519 AC_MSG_RESULT(not set) |
14 | 520 dnl -- try to find MzScheme executable |
856 | 521 AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) |
14 | 522 |
523 dnl resolve symbolic link, the executable is often elsewhere and there | |
524 dnl are no links for the include files. | |
856 | 525 if test "X$vi_cv_path_mzscheme" != "X"; then |
14 | 526 lsout=`ls -l $vi_cv_path_mzscheme` |
527 if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then | |
528 vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` | |
529 fi | |
530 fi | |
531 | |
856 | 532 if test "X$vi_cv_path_mzscheme" != "X"; then |
533 dnl -- find where MzScheme thinks it was installed | |
534 AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, | |
1894 | 535 dnl different versions of MzScheme differ in command line processing |
536 dnl use universal approach | |
537 echo "(display (simplify-path \ | |
856 | 538 (build-path (call-with-values \ |
539 (lambda () (split-path (find-system-path (quote exec-file)))) \ | |
1894 | 540 (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm |
541 dnl Remove a trailing slash | |
542 [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ | |
543 sed -e 's+/$++'` ]) | |
544 rm -f mzdirs.scm | |
856 | 545 fi |
14 | 546 fi |
547 fi | |
548 | |
1154 | 549 SCHEME_INC= |
14 | 550 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then |
551 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include) | |
552 if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then | |
1894 | 553 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include |
554 AC_MSG_RESULT(yes) | |
14 | 555 else |
1894 | 556 AC_MSG_RESULT(no) |
557 AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt) | |
1154 | 558 if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then |
1894 | 559 AC_MSG_RESULT(yes) |
560 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt | |
1154 | 561 else |
1894 | 562 AC_MSG_RESULT(no) |
563 AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/) | |
564 if test -f /usr/include/plt/scheme.h; then | |
565 AC_MSG_RESULT(yes) | |
566 SCHEME_INC=/usr/include/plt | |
567 else | |
568 AC_MSG_RESULT(no) | |
569 vi_cv_path_mzscheme_pfx= | |
570 fi | |
1154 | 571 fi |
14 | 572 fi |
573 fi | |
574 | |
575 if test "X$vi_cv_path_mzscheme_pfx" != "X"; then | |
1301 | 576 if test "x$MACOSX" = "xyes"; then |
577 MZSCHEME_LIBS="-framework PLT_MzScheme" | |
1894 | 578 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then |
579 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" | |
580 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
1301 | 581 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then |
1264 | 582 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a" |
14 | 583 else |
1894 | 584 dnl Using shared objects |
585 if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then | |
586 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m" | |
587 MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" | |
588 else | |
589 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" | |
590 fi | |
16 | 591 if test "$GCC" = yes; then |
592 dnl Make Vim remember the path to the library. For when it's not in | |
593 dnl $LD_LIBRARY_PATH. | |
1894 | 594 MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" |
17 | 595 elif test "`(uname) 2>/dev/null`" = SunOS && |
596 uname -r | grep '^5' >/dev/null; then | |
1894 | 597 MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib" |
16 | 598 fi |
14 | 599 fi |
1154 | 600 if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then |
601 SCHEME_COLLECTS=lib/plt/ | |
602 fi | |
1894 | 603 if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then |
604 dnl need to generate bytecode for MzScheme base | |
605 MZSCHEME_EXTRA="mzscheme_base.c" | |
606 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" | |
607 MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" | |
608 fi | |
609 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ | |
1154 | 610 -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'" |
14 | 611 MZSCHEME_SRC="if_mzsch.c" |
612 MZSCHEME_OBJ="objects/if_mzsch.o" | |
613 MZSCHEME_PRO="if_mzsch.pro" | |
614 AC_DEFINE(FEAT_MZSCHEME) | |
615 fi | |
616 AC_SUBST(MZSCHEME_SRC) | |
617 AC_SUBST(MZSCHEME_OBJ) | |
618 AC_SUBST(MZSCHEME_PRO) | |
619 AC_SUBST(MZSCHEME_LIBS) | |
620 AC_SUBST(MZSCHEME_CFLAGS) | |
1894 | 621 AC_SUBST(MZSCHEME_EXTRA) |
622 AC_SUBST(MZSCHEME_MZC) | |
14 | 623 fi |
624 | |
625 | |
7 | 626 AC_MSG_CHECKING(--enable-perlinterp argument) |
627 AC_ARG_ENABLE(perlinterp, | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
628 [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], , |
7 | 629 [enable_perlinterp="no"]) |
630 AC_MSG_RESULT($enable_perlinterp) | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
631 if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then |
7 | 632 AC_SUBST(vi_cv_path_perl) |
633 AC_PATH_PROG(vi_cv_path_perl, perl) | |
634 if test "X$vi_cv_path_perl" != "X"; then | |
635 AC_MSG_CHECKING(Perl version) | |
636 if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then | |
637 eval `$vi_cv_path_perl -V:usethreads` | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
638 eval `$vi_cv_path_perl -V:libperl` |
7 | 639 if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then |
640 badthreads=no | |
641 else | |
642 if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then | |
643 eval `$vi_cv_path_perl -V:use5005threads` | |
644 if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then | |
645 badthreads=no | |
646 else | |
647 badthreads=yes | |
648 AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<) | |
649 fi | |
650 else | |
651 badthreads=yes | |
652 AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<) | |
653 fi | |
654 fi | |
655 if test $badthreads = no; then | |
656 AC_MSG_RESULT(OK) | |
657 eval `$vi_cv_path_perl -V:shrpenv` | |
658 if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04 | |
659 shrpenv="" | |
660 fi | |
661 vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'` | |
662 AC_SUBST(vi_cv_perllib) | |
663 dnl Remove "-fno-something", it breaks using cproto. | |
664 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ | |
665 -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'` | |
666 dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". | |
667 perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ | |
668 sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ | |
669 -e 's/-bE:perl.exp//' -e 's/-lc //'` | |
670 dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH | |
671 dnl a test in configure may fail because of that. | |
672 perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \ | |
673 -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'` | |
674 | |
675 dnl check that compiling a simple program still works with the flags | |
676 dnl added for Perl. | |
677 AC_MSG_CHECKING([if compile and link flags for Perl are sane]) | |
678 cflags_save=$CFLAGS | |
679 libs_save=$LIBS | |
680 ldflags_save=$LDFLAGS | |
681 CFLAGS="$CFLAGS $perlcppflags" | |
682 LIBS="$LIBS $perllibs" | |
683 LDFLAGS="$perlldflags $LDFLAGS" | |
684 AC_TRY_LINK(,[ ], | |
685 AC_MSG_RESULT(yes); perl_ok=yes, | |
686 AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no) | |
687 CFLAGS=$cflags_save | |
688 LIBS=$libs_save | |
689 LDFLAGS=$ldflags_save | |
690 if test $perl_ok = yes; then | |
691 if test "X$perlcppflags" != "X"; then | |
1154 | 692 dnl remove -pipe and -Wxxx, it confuses cproto |
693 PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'` | |
7 | 694 fi |
695 if test "X$perlldflags" != "X"; then | |
696 LDFLAGS="$perlldflags $LDFLAGS" | |
697 fi | |
698 PERL_LIBS=$perllibs | |
699 PERL_SRC="auto/if_perl.c if_perlsfio.c" | |
700 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o" | |
701 PERL_PRO="if_perl.pro if_perlsfio.pro" | |
702 AC_DEFINE(FEAT_PERL) | |
703 fi | |
704 fi | |
705 else | |
706 AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<) | |
707 fi | |
708 fi | |
709 | |
710 if test "x$MACOSX" = "xyes"; then | |
574 | 711 dnl Mac OS X 10.2 or later |
7 | 712 dir=/System/Library/Perl |
713 darwindir=$dir/darwin | |
714 if test -d $darwindir; then | |
715 PERL=/usr/bin/perl | |
716 else | |
717 dnl Mac OS X 10.3 | |
718 dir=/System/Library/Perl/5.8.1 | |
719 darwindir=$dir/darwin-thread-multi-2level | |
720 if test -d $darwindir; then | |
721 PERL=/usr/bin/perl | |
722 fi | |
723 fi | |
724 if test -n "$PERL"; then | |
725 PERL_DIR="$dir" | |
726 PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE" | |
727 PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a" | |
728 PERL_LIBS="-L$darwindir/CORE -lperl" | |
729 fi | |
730 fi | |
2370
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
731 if test "$enable_perlinterp" = "dynamic"; then |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
732 if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
733 AC_DEFINE(DYNAMIC_PERL) |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
734 PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
735 fi |
454f314d0e61
Make it possible to load Perl dynamically on Unix. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2351
diff
changeset
|
736 fi |
7 | 737 fi |
738 AC_SUBST(shrpenv) | |
739 AC_SUBST(PERL_SRC) | |
740 AC_SUBST(PERL_OBJ) | |
741 AC_SUBST(PERL_PRO) | |
742 AC_SUBST(PERL_CFLAGS) | |
743 AC_SUBST(PERL_LIBS) | |
744 | |
745 AC_MSG_CHECKING(--enable-pythoninterp argument) | |
746 AC_ARG_ENABLE(pythoninterp, | |
747 [ --enable-pythoninterp Include Python interpreter.], , | |
748 [enable_pythoninterp="no"]) | |
749 AC_MSG_RESULT($enable_pythoninterp) | |
750 if test "$enable_pythoninterp" = "yes"; then | |
751 dnl -- find the python executable | |
752 AC_PATH_PROG(vi_cv_path_python, python) | |
753 if test "X$vi_cv_path_python" != "X"; then | |
754 | |
755 dnl -- get its version number | |
756 AC_CACHE_CHECK(Python version,vi_cv_var_python_version, | |
757 [[vi_cv_var_python_version=` | |
758 ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` | |
759 ]]) | |
760 | |
761 dnl -- it must be at least version 1.4 | |
762 AC_MSG_CHECKING(Python is 1.4 or better) | |
763 if ${vi_cv_path_python} -c \ | |
764 "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)" | |
765 then | |
766 AC_MSG_RESULT(yep) | |
767 | |
768 dnl -- find where python thinks it was installed | |
769 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx, | |
770 [ vi_cv_path_python_pfx=` | |
771 ${vi_cv_path_python} -c \ | |
772 "import sys; print sys.prefix"` ]) | |
773 | |
774 dnl -- and where it thinks it runs | |
775 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx, | |
776 [ vi_cv_path_python_epfx=` | |
777 ${vi_cv_path_python} -c \ | |
778 "import sys; print sys.exec_prefix"` ]) | |
779 | |
780 dnl -- python's internal library path | |
781 | |
782 AC_CACHE_VAL(vi_cv_path_pythonpath, | |
783 [ vi_cv_path_pythonpath=` | |
784 unset PYTHONPATH; | |
785 ${vi_cv_path_python} -c \ | |
786 "import sys, string; print string.join(sys.path,':')"` ]) | |
787 | |
788 dnl -- where the Python implementation library archives are | |
789 | |
790 AC_ARG_WITH(python-config-dir, | |
791 [ --with-python-config-dir=PATH Python's config directory], | |
792 [ vi_cv_path_python_conf="${withval}" ] ) | |
793 | |
794 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf, | |
795 [ | |
796 vi_cv_path_python_conf= | |
797 for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do | |
2018 | 798 for subdir in lib64 lib share; do |
7 | 799 d="${path}/${subdir}/python${vi_cv_var_python_version}/config" |
800 if test -d "$d" && test -f "$d/config.c"; then | |
801 vi_cv_path_python_conf="$d" | |
802 fi | |
803 done | |
804 done | |
805 ]) | |
806 | |
807 PYTHON_CONFDIR="${vi_cv_path_python_conf}" | |
808 | |
809 if test "X$PYTHON_CONFDIR" = "X"; then | |
810 AC_MSG_RESULT([can't find it!]) | |
811 else | |
812 | |
813 dnl -- we need to examine Python's config/Makefile too | |
814 dnl see what the interpreter is built from | |
815 AC_CACHE_VAL(vi_cv_path_python_plibs, | |
816 [ | |
1681 | 817 pwd=`pwd` |
818 tmp_mkf="$pwd/config-PyMake$$" | |
819 cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" | |
7 | 820 __: |
2200
99ba9a30755a
Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents:
2199
diff
changeset
|
821 @echo "python_BASEMODLIBS='$(BASEMODLIBS)'" |
7 | 822 @echo "python_LIBS='$(LIBS)'" |
823 @echo "python_SYSLIBS='$(SYSLIBS)'" | |
824 @echo "python_LINKFORSHARED='$(LINKFORSHARED)'" | |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
825 @echo "python_INSTSONAME='$(INSTSONAME)'" |
7 | 826 eof |
827 dnl -- delete the lines from make about Entering/Leaving directory | |
1681 | 828 eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
829 rm -f -- "${tmp_mkf}" | |
7 | 830 if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \ |
831 "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then | |
832 vi_cv_path_python_plibs="-framework Python" | |
833 else | |
834 if test "${vi_cv_var_python_version}" = "1.4"; then | |
835 vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a" | |
836 else | |
837 vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}" | |
838 fi | |
2200
99ba9a30755a
Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents:
2199
diff
changeset
|
839 vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" |
7 | 840 dnl remove -ltermcap, it can conflict with an earlier -lncurses |
841 vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` | |
842 fi | |
843 ]) | |
844 | |
845 PYTHON_LIBS="${vi_cv_path_python_plibs}" | |
846 if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then | |
847 PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}" | |
848 else | |
849 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}" | |
850 fi | |
851 PYTHON_SRC="if_python.c" | |
852 dnl For Mac OSX 10.2 config.o is included in the Python library. | |
853 if test "x$MACOSX" = "xyes"; then | |
854 PYTHON_OBJ="objects/if_python.o" | |
855 else | |
856 PYTHON_OBJ="objects/if_python.o objects/py_config.o" | |
857 fi | |
858 if test "${vi_cv_var_python_version}" = "1.4"; then | |
859 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" | |
860 fi | |
861 PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'" | |
862 | |
863 dnl On FreeBSD linking with "-pthread" is required to use threads. | |
864 dnl _THREAD_SAFE must be used for compiling then. | |
865 dnl The "-pthread" is added to $LIBS, so that the following check for | |
866 dnl sigaltstack() will look in libc_r (it's there in libc!). | |
867 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC | |
868 dnl will then define target-specific defines, e.g., -D_REENTRANT. | |
869 dnl Don't do this for Mac OSX, -pthread will generate a warning. | |
870 AC_MSG_CHECKING([if -pthread should be used]) | |
871 threadsafe_flag= | |
872 thread_lib= | |
997 | 873 dnl if test "x$MACOSX" != "xyes"; then |
874 if test "`(uname) 2>/dev/null`" != Darwin; then | |
7 | 875 test "$GCC" = yes && threadsafe_flag="-pthread" |
876 if test "`(uname) 2>/dev/null`" = FreeBSD; then | |
877 threadsafe_flag="-D_THREAD_SAFE" | |
878 thread_lib="-pthread" | |
879 fi | |
880 fi | |
881 libs_save_old=$LIBS | |
882 if test -n "$threadsafe_flag"; then | |
883 cflags_save=$CFLAGS | |
884 CFLAGS="$CFLAGS $threadsafe_flag" | |
885 LIBS="$LIBS $thread_lib" | |
886 AC_TRY_LINK(,[ ], | |
2303
6ebb886efe3c
Filter out -pthread for cproto.
Bram Moolenaar <bram@vim.org>
parents:
2285
diff
changeset
|
887 AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag", |
7 | 888 AC_MSG_RESULT(no); LIBS=$libs_save_old |
889 ) | |
890 CFLAGS=$cflags_save | |
891 else | |
892 AC_MSG_RESULT(no) | |
893 fi | |
894 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
895 dnl Check that compiling a simple program still works with the flags |
7 | 896 dnl added for Python. |
897 AC_MSG_CHECKING([if compile and link flags for Python are sane]) | |
898 cflags_save=$CFLAGS | |
899 libs_save=$LIBS | |
2303
6ebb886efe3c
Filter out -pthread for cproto.
Bram Moolenaar <bram@vim.org>
parents:
2285
diff
changeset
|
900 CFLAGS="$CFLAGS $PYTHON_CFLAGS" |
7 | 901 LIBS="$LIBS $PYTHON_LIBS" |
902 AC_TRY_LINK(,[ ], | |
903 AC_MSG_RESULT(yes); python_ok=yes, | |
904 AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no) | |
905 CFLAGS=$cflags_save | |
906 LIBS=$libs_save | |
907 if test $python_ok = yes; then | |
908 AC_DEFINE(FEAT_PYTHON) | |
909 else | |
910 LIBS=$libs_save_old | |
911 PYTHON_SRC= | |
912 PYTHON_OBJ= | |
913 PYTHON_LIBS= | |
914 PYTHON_CFLAGS= | |
915 fi | |
916 | |
917 fi | |
918 else | |
919 AC_MSG_RESULT(too old) | |
920 fi | |
921 fi | |
922 fi | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
923 |
7 | 924 AC_SUBST(PYTHON_CONFDIR) |
925 AC_SUBST(PYTHON_LIBS) | |
926 AC_SUBST(PYTHON_GETPATH_CFLAGS) | |
927 AC_SUBST(PYTHON_CFLAGS) | |
928 AC_SUBST(PYTHON_SRC) | |
929 AC_SUBST(PYTHON_OBJ) | |
930 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
931 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
932 AC_MSG_CHECKING(--enable-python3interp argument) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
933 AC_ARG_ENABLE(python3interp, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
934 [ --enable-python3interp Include Python3 interpreter.], , |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
935 [enable_python3interp="no"]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
936 AC_MSG_RESULT($enable_python3interp) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
937 if test "$enable_python3interp" = "yes"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
938 dnl -- find the python3 executable |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
939 AC_PATH_PROG(vi_cv_path_python3, python3) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
940 if test "X$vi_cv_path_python3" != "X"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
941 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
942 dnl -- get its version number |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
943 AC_CACHE_CHECK(Python version,vi_cv_var_python3_version, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
944 [[vi_cv_var_python3_version=` |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
945 ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
946 ]]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
947 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
948 dnl -- find where python3 thinks it was installed |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
949 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
950 [ vi_cv_path_python3_pfx=` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
951 ${vi_cv_path_python3} -c \ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
952 "import sys; print(sys.prefix)"` ]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
953 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
954 dnl -- and where it thinks it runs |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
955 AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
956 [ vi_cv_path_python3_epfx=` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
957 ${vi_cv_path_python3} -c \ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
958 "import sys; print(sys.exec_prefix)"` ]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
959 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
960 dnl -- python3's internal library path |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
961 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
962 AC_CACHE_VAL(vi_cv_path_python3path, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
963 [ vi_cv_path_python3path=` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
964 unset PYTHONPATH; |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
965 ${vi_cv_path_python3} -c \ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
966 "import sys, string; print(':'.join(sys.path))"` ]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
967 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
968 dnl -- where the Python implementation library archives are |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
969 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
970 AC_ARG_WITH(python3-config-dir, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
971 [ --with-python3-config-dir=PATH Python's config directory], |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
972 [ vi_cv_path_python3_conf="${withval}" ] ) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
973 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
974 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
975 [ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
976 vi_cv_path_python3_conf= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
977 for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do |
2388
06d77ed24f33
Find python3 also in lib64 directory. (Ben Boeckel)
Bram Moolenaar <bram@vim.org>
parents:
2383
diff
changeset
|
978 for subdir in lib64 lib share; do |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
979 d="${path}/${subdir}/python${vi_cv_var_python3_version}/config" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
980 if test -d "$d" && test -f "$d/config.c"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
981 vi_cv_path_python3_conf="$d" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
982 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
983 done |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
984 done |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
985 ]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
986 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
987 PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
988 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
989 if test "X$PYTHON3_CONFDIR" = "X"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
990 AC_MSG_RESULT([can't find it!]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
991 else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
992 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
993 dnl -- we need to examine Python's config/Makefile too |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
994 dnl see what the interpreter is built from |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
995 AC_CACHE_VAL(vi_cv_path_python3_plibs, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
996 [ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
997 pwd=`pwd` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
998 tmp_mkf="$pwd/config-PyMake$$" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
999 cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1000 __: |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1001 @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1002 @echo "python3_LIBS='$(LIBS)'" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1003 @echo "python3_SYSLIBS='$(SYSLIBS)'" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1004 @echo "python3_LINKFORSHARED='$(LINKFORSHARED)'" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1005 @echo "python3_INSTSONAME='$(INSTSONAME)'" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1006 eof |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1007 dnl -- delete the lines from make about Entering/Leaving directory |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1008 eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1009 rm -f -- "${tmp_mkf}" |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1010 vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}" |
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1011 vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS} ${python3_LINKFORSHARED}" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1012 dnl remove -ltermcap, it can conflict with an earlier -lncurses |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1013 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1014 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1015 ]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1016 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1017 PYTHON3_LIBS="${vi_cv_path_python3_plibs}" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1018 if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1019 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1020 else |
2351
df5fc287a891
Fix configure for Python3 libs and version number. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2331
diff
changeset
|
1021 PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1022 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1023 PYTHON3_SRC="if_python3.c" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1024 dnl For Mac OSX 10.2 config.o is included in the Python library. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1025 if test "x$MACOSX" = "xyes"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1026 PYTHON3_OBJ="objects/if_python3.o" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1027 else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1028 PYTHON3_OBJ="objects/if_python3.o objects/py3_config.o" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1029 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1030 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1031 dnl On FreeBSD linking with "-pthread" is required to use threads. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1032 dnl _THREAD_SAFE must be used for compiling then. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1033 dnl The "-pthread" is added to $LIBS, so that the following check for |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1034 dnl sigaltstack() will look in libc_r (it's there in libc!). |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1035 dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1036 dnl will then define target-specific defines, e.g., -D_REENTRANT. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1037 dnl Don't do this for Mac OSX, -pthread will generate a warning. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1038 AC_MSG_CHECKING([if -pthread should be used]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1039 threadsafe_flag= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1040 thread_lib= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1041 dnl if test "x$MACOSX" != "xyes"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1042 if test "`(uname) 2>/dev/null`" != Darwin; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1043 test "$GCC" = yes && threadsafe_flag="-pthread" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1044 if test "`(uname) 2>/dev/null`" = FreeBSD; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1045 threadsafe_flag="-D_THREAD_SAFE" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1046 thread_lib="-pthread" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1047 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1048 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1049 libs_save_old=$LIBS |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1050 if test -n "$threadsafe_flag"; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1051 cflags_save=$CFLAGS |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1052 CFLAGS="$CFLAGS $threadsafe_flag" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1053 LIBS="$LIBS $thread_lib" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1054 AC_TRY_LINK(,[ ], |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1055 AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1056 AC_MSG_RESULT(no); LIBS=$libs_save_old |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1057 ) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1058 CFLAGS=$cflags_save |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1059 else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1060 AC_MSG_RESULT(no) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1061 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1062 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1063 dnl check that compiling a simple program still works with the flags |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1064 dnl added for Python. |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1065 AC_MSG_CHECKING([if compile and link flags for Python are sane]) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1066 cflags_save=$CFLAGS |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1067 libs_save=$LIBS |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1068 CFLAGS="$CFLAGS $PYTHON3_CFLAGS" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1069 LIBS="$LIBS $PYTHON3_LIBS" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1070 AC_TRY_LINK(,[ ], |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1071 AC_MSG_RESULT(yes); python3_ok=yes, |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1072 AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1073 CFLAGS=$cflags_save |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1074 LIBS=$libs_save |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1075 if test "$python3_ok" = yes; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1076 AC_DEFINE(FEAT_PYTHON3) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1077 else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1078 LIBS=$libs_save_old |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1079 PYTHON3_SRC= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1080 PYTHON3_OBJ= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1081 PYTHON3_LIBS= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1082 PYTHON3_CFLAGS= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1083 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1084 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1085 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1086 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1087 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1088 AC_SUBST(PYTHON3_CONFDIR) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1089 AC_SUBST(PYTHON3_LIBS) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1090 AC_SUBST(PYTHON3_CFLAGS) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1091 AC_SUBST(PYTHON3_SRC) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1092 AC_SUBST(PYTHON3_OBJ) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1093 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1094 dnl if python2.x and python3.x are enabled one can only link in code |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1095 dnl with dlopen(), dlsym(), dlclose() |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1096 if test "$python_ok" = yes && test "$python3_ok" = yes; then |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1097 AC_DEFINE(DYNAMIC_PYTHON) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1098 AC_DEFINE(DYNAMIC_PYTHON3) |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1099 PYTHON_SRC="if_python.c" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1100 PYTHON_OBJ="objects/if_python.o" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1101 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1102 PYTHON_LIBS= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1103 PYTHON3_SRC="if_python3.c" |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1104 PYTHON3_OBJ="objects/if_python3.o" |
2383
410d7b5916f9
Specify library to load for Python more precisely. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2373
diff
changeset
|
1105 PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\"" |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1106 PYTHON3_LIBS= |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1107 fi |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
1108 |
7 | 1109 AC_MSG_CHECKING(--enable-tclinterp argument) |
1110 AC_ARG_ENABLE(tclinterp, | |
1111 [ --enable-tclinterp Include Tcl interpreter.], , | |
1112 [enable_tclinterp="no"]) | |
1113 AC_MSG_RESULT($enable_tclinterp) | |
1114 | |
1115 if test "$enable_tclinterp" = "yes"; then | |
1116 | |
1464 | 1117 dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420] |
7 | 1118 AC_MSG_CHECKING(--with-tclsh argument) |
1119 AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)], | |
1120 tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name), | |
1464 | 1121 tclsh_name="tclsh8.5"; AC_MSG_RESULT(no)) |
7 | 1122 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) |
1123 AC_SUBST(vi_cv_path_tcl) | |
1124 | |
1464 | 1125 dnl when no specific version specified, also try 8.4, 8.2 and 8.0 |
1126 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then | |
1127 tclsh_name="tclsh8.4" | |
1128 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1129 fi | |
132 | 1130 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then |
7 | 1131 tclsh_name="tclsh8.2" |
1132 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1133 fi | |
132 | 1134 if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then |
1135 tclsh_name="tclsh8.0" | |
1136 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1137 fi | |
7 | 1138 dnl still didn't find it, try without version number |
1139 if test "X$vi_cv_path_tcl" = "X"; then | |
1140 tclsh_name="tclsh" | |
1141 AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name) | |
1142 fi | |
1143 if test "X$vi_cv_path_tcl" != "X"; then | |
1144 AC_MSG_CHECKING(Tcl version) | |
1145 if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then | |
1146 tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -` | |
1147 AC_MSG_RESULT($tclver - OK); | |
1148 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 -` | |
1149 | |
1150 AC_MSG_CHECKING(for location of Tcl include) | |
1151 if test "x$MACOSX" != "xyes"; then | |
1542 | 1152 tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" |
7 | 1153 else |
1154 dnl For Mac OS X 10.3, use the OS-provided framework location | |
1155 tclinc="/System/Library/Frameworks/Tcl.framework/Headers" | |
1156 fi | |
1542 | 1157 TCL_INC= |
7 | 1158 for try in $tclinc; do |
1159 if test -f "$try/tcl.h"; then | |
1160 AC_MSG_RESULT($try/tcl.h) | |
1161 TCL_INC=$try | |
1162 break | |
1163 fi | |
1164 done | |
1165 if test -z "$TCL_INC"; then | |
1166 AC_MSG_RESULT(<not found>) | |
1167 SKIP_TCL=YES | |
1168 fi | |
1169 if test -z "$SKIP_TCL"; then | |
1170 AC_MSG_CHECKING(for location of tclConfig.sh script) | |
1171 if test "x$MACOSX" != "xyes"; then | |
1172 tclcnf=`echo $tclinc | sed s/include/lib/g` | |
1464 | 1173 tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" |
7 | 1174 else |
1175 dnl For Mac OS X 10.3, use the OS-provided framework location | |
1176 tclcnf="/System/Library/Frameworks/Tcl.framework" | |
1177 fi | |
1178 for try in $tclcnf; do | |
1179 if test -f $try/tclConfig.sh; then | |
1180 AC_MSG_RESULT($try/tclConfig.sh) | |
1181 . $try/tclConfig.sh | |
1182 dnl use eval, because tcl 8.2 includes ${TCL_DBGX} | |
1183 TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"` | |
1184 dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the | |
132 | 1185 dnl "-D_ABC" items. Watch out for -DFOO=long\ long. |
1679 | 1186 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'` |
7 | 1187 break |
1188 fi | |
1189 done | |
1190 if test -z "$TCL_LIBS"; then | |
1191 AC_MSG_RESULT(<not found>) | |
1192 AC_MSG_CHECKING(for Tcl library by myself) | |
1193 tcllib=`echo $tclinc | sed s/include/lib/g` | |
1464 | 1194 tcllib="$tcllib `echo $tclinc | sed s/include/lib64/g`" |
7 | 1195 for ext in .so .a ; do |
1196 for ver in "" $tclver ; do | |
1197 for try in $tcllib ; do | |
1198 trylib=tcl$ver$ext | |
1199 if test -f $try/lib$trylib ; then | |
1200 AC_MSG_RESULT($try/lib$trylib) | |
1201 TCL_LIBS="-L$try -ltcl$ver -ldl -lm" | |
1202 if test "`(uname) 2>/dev/null`" = SunOS && | |
1203 uname -r | grep '^5' >/dev/null; then | |
1204 TCL_LIBS="$TCL_LIBS -R $try" | |
1205 fi | |
1206 break 3 | |
1207 fi | |
1208 done | |
1209 done | |
1210 done | |
1211 if test -z "$TCL_LIBS"; then | |
1212 AC_MSG_RESULT(<not found>) | |
1213 SKIP_TCL=YES | |
1214 fi | |
1215 fi | |
1216 if test -z "$SKIP_TCL"; then | |
1217 AC_DEFINE(FEAT_TCL) | |
1218 TCL_SRC=if_tcl.c | |
1219 TCL_OBJ=objects/if_tcl.o | |
1220 TCL_PRO=if_tcl.pro | |
1221 TCL_CFLAGS="-I$TCL_INC $TCL_DEFS" | |
1222 fi | |
1223 fi | |
1224 else | |
1225 AC_MSG_RESULT(too old; need Tcl version 8.0 or later) | |
1226 fi | |
1227 fi | |
1228 fi | |
1229 AC_SUBST(TCL_SRC) | |
1230 AC_SUBST(TCL_OBJ) | |
1231 AC_SUBST(TCL_PRO) | |
1232 AC_SUBST(TCL_CFLAGS) | |
1233 AC_SUBST(TCL_LIBS) | |
1234 | |
1235 AC_MSG_CHECKING(--enable-rubyinterp argument) | |
1236 AC_ARG_ENABLE(rubyinterp, | |
1237 [ --enable-rubyinterp Include Ruby interpreter.], , | |
1238 [enable_rubyinterp="no"]) | |
1239 AC_MSG_RESULT($enable_rubyinterp) | |
1240 if test "$enable_rubyinterp" = "yes"; then | |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1241 AC_MSG_CHECKING(--with-ruby-command argument) |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1242 AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)], |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1243 RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD), |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1244 RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD)) |
7 | 1245 AC_SUBST(vi_cv_path_ruby) |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1246 AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD) |
7 | 1247 if test "X$vi_cv_path_ruby" != "X"; then |
1248 AC_MSG_CHECKING(Ruby version) | |
189 | 1249 if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then |
7 | 1250 AC_MSG_RESULT(OK) |
1251 AC_MSG_CHECKING(Ruby header files) | |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1252 rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null` |
7 | 1253 if test "X$rubyhdrdir" != "X"; then |
1254 AC_MSG_RESULT($rubyhdrdir) | |
1255 RUBY_CFLAGS="-I$rubyhdrdir" | |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1256 rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'` |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1257 if test -d "$rubyhdrdir/$rubyarch"; then |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1258 RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch" |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1259 fi |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1260 rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'` |
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1261 RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" |
7 | 1262 rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'` |
1263 if test "X$rubylibs" != "X"; then | |
1264 RUBY_LIBS="$rubylibs" | |
1265 fi | |
1266 librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'` | |
1267 if test -f "$rubyhdrdir/$librubyarg"; then | |
1268 librubyarg="$rubyhdrdir/$librubyarg" | |
1269 else | |
1270 rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'` | |
1271 if test -f "$rubylibdir/$librubyarg"; then | |
1272 librubyarg="$rubylibdir/$librubyarg" | |
1273 elif test "$librubyarg" = "libruby.a"; then | |
1274 dnl required on Mac OS 10.3 where libruby.a doesn't exist | |
1275 librubyarg="-lruby" | |
1276 else | |
1277 librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"` | |
1278 fi | |
1279 fi | |
1280 | |
1281 if test "X$librubyarg" != "X"; then | |
1282 RUBY_LIBS="$librubyarg $RUBY_LIBS" | |
1283 fi | |
1284 rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'` | |
1285 if test "X$rubyldflags" != "X"; then | |
1939 | 1286 dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only |
1287 dnl be included if requested by passing --with-mac-arch to | |
1288 dnl configure, so strip these flags first (if present) | |
1289 rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'` | |
1290 if test "X$rubyldflags" != "X"; then | |
1291 LDFLAGS="$rubyldflags $LDFLAGS" | |
1292 fi | |
7 | 1293 fi |
1294 RUBY_SRC="if_ruby.c" | |
1295 RUBY_OBJ="objects/if_ruby.o" | |
1296 RUBY_PRO="if_ruby.pro" | |
1297 AC_DEFINE(FEAT_RUBY) | |
1298 else | |
2077
d8983769c9dd
updated for version 7.2.361
Bram Moolenaar <bram@zimbu.org>
parents:
2019
diff
changeset
|
1299 AC_MSG_RESULT(not found; disabling Ruby) |
7 | 1300 fi |
1301 else | |
1302 AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) | |
1303 fi | |
1304 fi | |
1305 fi | |
1306 AC_SUBST(RUBY_SRC) | |
1307 AC_SUBST(RUBY_OBJ) | |
1308 AC_SUBST(RUBY_PRO) | |
1309 AC_SUBST(RUBY_CFLAGS) | |
1310 AC_SUBST(RUBY_LIBS) | |
1311 | |
1312 AC_MSG_CHECKING(--enable-cscope argument) | |
1313 AC_ARG_ENABLE(cscope, | |
1314 [ --enable-cscope Include cscope interface.], , | |
1315 [enable_cscope="no"]) | |
1316 AC_MSG_RESULT($enable_cscope) | |
1317 if test "$enable_cscope" = "yes"; then | |
1318 AC_DEFINE(FEAT_CSCOPE) | |
1319 fi | |
1320 | |
1321 AC_MSG_CHECKING(--enable-workshop argument) | |
1322 AC_ARG_ENABLE(workshop, | |
1323 [ --enable-workshop Include Sun Visual Workshop support.], , | |
1324 [enable_workshop="no"]) | |
1325 AC_MSG_RESULT($enable_workshop) | |
1326 if test "$enable_workshop" = "yes"; then | |
1327 AC_DEFINE(FEAT_SUN_WORKSHOP) | |
1328 WORKSHOP_SRC="workshop.c integration.c" | |
1329 AC_SUBST(WORKSHOP_SRC) | |
1330 WORKSHOP_OBJ="objects/workshop.o objects/integration.o" | |
1331 AC_SUBST(WORKSHOP_OBJ) | |
1332 if test "${enable_gui-xxx}" = xxx; then | |
1333 enable_gui=motif | |
1334 fi | |
1335 fi | |
1336 | |
1337 AC_MSG_CHECKING(--disable-netbeans argument) | |
1338 AC_ARG_ENABLE(netbeans, | |
1339 [ --disable-netbeans Disable NetBeans integration support.], | |
1340 , [enable_netbeans="yes"]) | |
1341 if test "$enable_netbeans" = "yes"; then | |
1342 AC_MSG_RESULT(no) | |
1343 dnl On Solaris we need the socket and nsl library. | |
1344 AC_CHECK_LIB(socket, socket) | |
1345 AC_CHECK_LIB(nsl, gethostbyname) | |
1346 AC_MSG_CHECKING(whether compiling netbeans integration is possible) | |
1347 AC_TRY_LINK([ | |
1348 #include <stdio.h> | |
1349 #include <stdlib.h> | |
1350 #include <stdarg.h> | |
1351 #include <fcntl.h> | |
1352 #include <netdb.h> | |
1353 #include <netinet/in.h> | |
1354 #include <errno.h> | |
1355 #include <sys/types.h> | |
1356 #include <sys/socket.h> | |
1357 /* Check bitfields */ | |
1358 struct nbbuf { | |
1359 unsigned int initDone:1; | |
1360 ushort signmaplen; | |
1361 }; | |
1362 ], [ | |
1363 /* Check creating a socket. */ | |
1364 struct sockaddr_in server; | |
1365 (void)socket(AF_INET, SOCK_STREAM, 0); | |
1366 (void)htons(100); | |
1367 (void)gethostbyname("microsoft.com"); | |
1368 if (errno == ECONNREFUSED) | |
1369 (void)connect(1, (struct sockaddr *)&server, sizeof(server)); | |
1370 ], | |
1371 AC_MSG_RESULT(yes), | |
1372 AC_MSG_RESULT(no); enable_netbeans="no") | |
1373 else | |
1374 AC_MSG_RESULT(yes) | |
1375 fi | |
1376 if test "$enable_netbeans" = "yes"; then | |
1377 AC_DEFINE(FEAT_NETBEANS_INTG) | |
1378 NETBEANS_SRC="netbeans.c" | |
1379 AC_SUBST(NETBEANS_SRC) | |
1380 NETBEANS_OBJ="objects/netbeans.o" | |
1381 AC_SUBST(NETBEANS_OBJ) | |
1382 fi | |
1383 | |
1384 AC_MSG_CHECKING(--enable-sniff argument) | |
1385 AC_ARG_ENABLE(sniff, | |
1386 [ --enable-sniff Include Sniff interface.], , | |
1387 [enable_sniff="no"]) | |
1388 AC_MSG_RESULT($enable_sniff) | |
1389 if test "$enable_sniff" = "yes"; then | |
1390 AC_DEFINE(FEAT_SNIFF) | |
1391 SNIFF_SRC="if_sniff.c" | |
1392 AC_SUBST(SNIFF_SRC) | |
1393 SNIFF_OBJ="objects/if_sniff.o" | |
1394 AC_SUBST(SNIFF_OBJ) | |
1395 fi | |
1396 | |
1397 AC_MSG_CHECKING(--enable-multibyte argument) | |
1398 AC_ARG_ENABLE(multibyte, | |
1399 [ --enable-multibyte Include multibyte editing support.], , | |
1400 [enable_multibyte="no"]) | |
1401 AC_MSG_RESULT($enable_multibyte) | |
1402 if test "$enable_multibyte" = "yes"; then | |
1403 AC_DEFINE(FEAT_MBYTE) | |
1404 fi | |
1405 | |
1406 AC_MSG_CHECKING(--enable-hangulinput argument) | |
1407 AC_ARG_ENABLE(hangulinput, | |
1408 [ --enable-hangulinput Include Hangul input support.], , | |
1409 [enable_hangulinput="no"]) | |
1410 AC_MSG_RESULT($enable_hangulinput) | |
1411 | |
1412 AC_MSG_CHECKING(--enable-xim argument) | |
1413 AC_ARG_ENABLE(xim, | |
1414 [ --enable-xim Include XIM input support.], | |
1415 AC_MSG_RESULT($enable_xim), | |
1416 [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)]) | |
1417 | |
1418 AC_MSG_CHECKING(--enable-fontset argument) | |
1419 AC_ARG_ENABLE(fontset, | |
1420 [ --enable-fontset Include X fontset output support.], , | |
1421 [enable_fontset="no"]) | |
1422 AC_MSG_RESULT($enable_fontset) | |
1423 dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI | |
1424 | |
1425 test -z "$with_x" && with_x=yes | |
1426 test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes | |
1427 if test "$with_x" = no; then | |
1428 AC_MSG_RESULT(defaulting to: don't HAVE_X11) | |
1429 else | |
1430 dnl Do this check early, so that its failure can override user requests. | |
1431 | |
1432 AC_PATH_PROG(xmkmfpath, xmkmf) | |
1433 | |
1434 AC_PATH_XTRA | |
1435 | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
1436 dnl On z/OS Unix the X libraries are DLLs. To use them the code must |
7 | 1437 dnl be compiled with a special option. |
1438 dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS. | |
2247
c40cd9aad546
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
1439 if test "$zOSUnix" = "yes"; then |
7 | 1440 CFLAGS="$CFLAGS -W c,dll" |
1441 LDFLAGS="$LDFLAGS -W l,dll" | |
1442 X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu" | |
1443 fi | |
1444 | |
1445 dnl On my HPUX system the X include dir is found, but the lib dir not. | |
1446 dnl This is a desparate try to fix this. | |
1447 | |
1448 if test -d "$x_includes" && test ! -d "$x_libraries"; then | |
1449 x_libraries=`echo "$x_includes" | sed s/include/lib/` | |
1450 AC_MSG_RESULT(Corrected X libraries to $x_libraries) | |
1451 X_LIBS="$X_LIBS -L$x_libraries" | |
1452 if test "`(uname) 2>/dev/null`" = SunOS && | |
1453 uname -r | grep '^5' >/dev/null; then | |
1454 X_LIBS="$X_LIBS -R $x_libraries" | |
1455 fi | |
1456 fi | |
1457 | |
1458 if test -d "$x_libraries" && test ! -d "$x_includes"; then | |
1459 x_includes=`echo "$x_libraries" | sed s/lib/include/` | |
1460 AC_MSG_RESULT(Corrected X includes to $x_includes) | |
1461 X_CFLAGS="$X_CFLAGS -I$x_includes" | |
1462 fi | |
1463 | |
1464 dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed. | |
1465 X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`" | |
1466 dnl Remove "-L/usr/lib " from X_LIBS, should not be needed. | |
1467 X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`" | |
1468 dnl Same for "-R/usr/lib ". | |
1469 X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`" | |
1470 | |
1471 | |
1472 dnl Check if the X11 header files are correctly installed. On some systems | |
1649 | 1473 dnl Xlib.h includes files that don't exist. On some systems X11/Intrinsic.h |
1474 dnl is missing. | |
7 | 1475 AC_MSG_CHECKING(if X11 header files can be found) |
1476 cflags_save=$CFLAGS | |
1477 CFLAGS="$CFLAGS $X_CFLAGS" | |
1649 | 1478 AC_TRY_COMPILE([#include <X11/Xlib.h> |
1479 #include <X11/Intrinsic.h>], , | |
7 | 1480 AC_MSG_RESULT(yes), |
1481 AC_MSG_RESULT(no); no_x=yes) | |
1482 CFLAGS=$cflags_save | |
1483 | |
1484 if test "${no_x-no}" = yes; then | |
1485 with_x=no | |
1486 else | |
1487 AC_DEFINE(HAVE_X11) | |
1488 X_LIB="-lXt -lX11"; | |
1489 AC_SUBST(X_LIB) | |
1490 | |
1491 ac_save_LDFLAGS="$LDFLAGS" | |
1492 LDFLAGS="-L$x_libraries $LDFLAGS" | |
1493 | |
1494 dnl Check for -lXdmcp (needed on SunOS 4.1.4) | |
1495 dnl For HP-UX 10.20 it must be before -lSM -lICE | |
1496 AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],, | |
1497 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp]) | |
1498 | |
1499 dnl Some systems need -lnsl -lsocket when testing for ICE. | |
1500 dnl The check above doesn't do this, try here (again). Also needed to get | |
1501 dnl them after Xdmcp. link.sh will remove them when not needed. | |
1502 dnl Check for other function than above to avoid the cached value | |
1503 AC_CHECK_LIB(ICE, IceOpenConnection, | |
1504 [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS]) | |
1505 | |
1506 dnl Check for -lXpm (needed for some versions of Motif) | |
1507 LDFLAGS="$X_LIBS $ac_save_LDFLAGS" | |
1508 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],, | |
1509 [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS]) | |
1510 | |
1511 dnl Check that the X11 header files don't use implicit declarations | |
1512 AC_MSG_CHECKING(if X11 header files implicitly declare return values) | |
1513 cflags_save=$CFLAGS | |
1514 CFLAGS="$CFLAGS $X_CFLAGS -Werror" | |
1515 AC_TRY_COMPILE([#include <X11/Xlib.h>], , | |
1516 AC_MSG_RESULT(no), | |
1517 CFLAGS="$CFLAGS -Wno-implicit-int" | |
1518 AC_TRY_COMPILE([#include <X11/Xlib.h>], , | |
1519 AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int", | |
1520 AC_MSG_RESULT(test failed) | |
1521 ) | |
1522 ) | |
1523 CFLAGS=$cflags_save | |
1524 | |
1525 LDFLAGS="$ac_save_LDFLAGS" | |
1526 | |
1887 | 1527 AC_MSG_CHECKING(size of wchar_t is 2 bytes) |
1528 AC_CACHE_VAL(ac_cv_small_wchar_t, | |
1529 [AC_TRY_RUN([ | |
1530 #include <X11/Xlib.h> | |
1531 #if STDC_HEADERS | |
1532 # include <stdlib.h> | |
1533 # include <stddef.h> | |
1534 #endif | |
1535 main() | |
1536 { | |
1537 if (sizeof(wchar_t) <= 2) | |
1538 exit(1); | |
1539 exit(0); | |
1540 }], | |
1541 ac_cv_small_wchar_t="no", | |
1542 ac_cv_small_wchar_t="yes", | |
1543 AC_MSG_ERROR(failed to compile test program))]) | |
1544 AC_MSG_RESULT($ac_cv_small_wchar_t) | |
1545 if test "x$ac_cv_small_wchar_t" = "xyes" ; then | |
1546 AC_DEFINE(SMALL_WCHAR_T) | |
1547 fi | |
1548 | |
7 | 1549 fi |
1550 fi | |
1551 | |
270 | 1552 test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no |
7 | 1553 |
1554 AC_MSG_CHECKING(--enable-gui argument) | |
1555 AC_ARG_ENABLE(gui, | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1556 [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto") |
7 | 1557 |
1558 dnl Canonicalize the --enable-gui= argument so that it can be easily compared. | |
1559 dnl Do not use character classes for portability with old tools. | |
1560 enable_gui_canon=`echo "_$enable_gui" | \ | |
1561 sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | |
1562 | |
1563 dnl Skip everything by default. | |
1564 SKIP_GTK2=YES | |
1565 SKIP_GNOME=YES | |
1566 SKIP_MOTIF=YES | |
1567 SKIP_ATHENA=YES | |
1568 SKIP_NEXTAW=YES | |
1569 SKIP_PHOTON=YES | |
1570 SKIP_CARBON=YES | |
1571 GUITYPE=NONE | |
1572 | |
67 | 1573 if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then |
7 | 1574 SKIP_PHOTON= |
1575 case "$enable_gui_canon" in | |
1576 no) AC_MSG_RESULT(no GUI support) | |
1577 SKIP_PHOTON=YES ;; | |
1578 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; | |
1579 auto) AC_MSG_RESULT(auto - automatic GUI support) ;; | |
1580 photon) AC_MSG_RESULT(Photon GUI support) ;; | |
1581 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) | |
1582 SKIP_PHOTON=YES ;; | |
1583 esac | |
1584 | |
1585 elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then | |
1586 SKIP_CARBON= | |
1587 case "$enable_gui_canon" in | |
1588 no) AC_MSG_RESULT(no GUI support) | |
1589 SKIP_CARBON=YES ;; | |
1590 yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;; | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1591 auto) AC_MSG_RESULT(auto - Carbon GUI is outdated - disable GUI support) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1592 SKIP_CARBON=YES ;; |
7 | 1593 carbon) AC_MSG_RESULT(Carbon GUI support) ;; |
1594 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) | |
1595 SKIP_CARBON=YES ;; | |
1596 esac | |
1597 | |
1598 else | |
1599 | |
1600 case "$enable_gui_canon" in | |
1601 no|none) AC_MSG_RESULT(no GUI support) ;; | |
1602 yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support) | |
1603 SKIP_GTK2= | |
1604 SKIP_GNOME= | |
1605 SKIP_MOTIF= | |
1606 SKIP_ATHENA= | |
1607 SKIP_NEXTAW= | |
1608 SKIP_CARBON=;; | |
1609 gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support) | |
1610 SKIP_GTK2=;; | |
1611 gnome2) AC_MSG_RESULT(GNOME 2.x GUI support) | |
1612 SKIP_GNOME= | |
1613 SKIP_GTK2=;; | |
1614 motif) AC_MSG_RESULT(Motif GUI support) | |
1615 SKIP_MOTIF=;; | |
1616 athena) AC_MSG_RESULT(Athena GUI support) | |
1617 SKIP_ATHENA=;; | |
1618 nextaw) AC_MSG_RESULT(neXtaw GUI support) | |
1619 SKIP_NEXTAW=;; | |
1620 *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;; | |
1621 esac | |
1622 | |
1623 fi | |
1624 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1625 if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \ |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1626 -a "$enable_gui_canon" != "gnome2"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1627 AC_MSG_CHECKING(whether or not to look for GTK+ 2) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1628 AC_ARG_ENABLE(gtk2-check, |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1629 [ --enable-gtk2-check If auto-select GUI, check for GTK+ 2 [default=yes]], |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1630 , enable_gtk2_check="yes") |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1631 AC_MSG_RESULT($enable_gtk2_check) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1632 if test "x$enable_gtk2_check" = "xno"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1633 SKIP_GTK2=YES |
7 | 1634 SKIP_GNOME=YES |
1635 fi | |
1636 fi | |
1637 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1638 if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome2"; then |
7 | 1639 AC_MSG_CHECKING(whether or not to look for GNOME) |
1640 AC_ARG_ENABLE(gnome-check, | |
1641 [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]], | |
1642 , enable_gnome_check="no") | |
1643 AC_MSG_RESULT($enable_gnome_check) | |
1644 if test "x$enable_gnome_check" = "xno"; then | |
1645 SKIP_GNOME=YES | |
1646 fi | |
1647 fi | |
1648 | |
1649 if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then | |
1650 AC_MSG_CHECKING(whether or not to look for Motif) | |
1651 AC_ARG_ENABLE(motif-check, | |
1652 [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]], | |
1653 , enable_motif_check="yes") | |
1654 AC_MSG_RESULT($enable_motif_check) | |
1655 if test "x$enable_motif_check" = "xno"; then | |
1656 SKIP_MOTIF=YES | |
1657 fi | |
1658 fi | |
1659 | |
1660 if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then | |
1661 AC_MSG_CHECKING(whether or not to look for Athena) | |
1662 AC_ARG_ENABLE(athena-check, | |
1663 [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]], | |
1664 , enable_athena_check="yes") | |
1665 AC_MSG_RESULT($enable_athena_check) | |
1666 if test "x$enable_athena_check" = "xno"; then | |
1667 SKIP_ATHENA=YES | |
1668 fi | |
1669 fi | |
1670 | |
1671 if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then | |
1672 AC_MSG_CHECKING(whether or not to look for neXtaw) | |
1673 AC_ARG_ENABLE(nextaw-check, | |
1674 [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]], | |
1675 , enable_nextaw_check="yes") | |
1676 AC_MSG_RESULT($enable_nextaw_check); | |
1677 if test "x$enable_nextaw_check" = "xno"; then | |
1678 SKIP_NEXTAW=YES | |
1679 fi | |
1680 fi | |
1681 | |
1682 if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then | |
1683 AC_MSG_CHECKING(whether or not to look for Carbon) | |
1684 AC_ARG_ENABLE(carbon-check, | |
1685 [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]], | |
1686 , enable_carbon_check="yes") | |
1687 AC_MSG_RESULT($enable_carbon_check); | |
1688 if test "x$enable_carbon_check" = "xno"; then | |
1689 SKIP_CARBON=YES | |
1690 fi | |
1691 fi | |
1692 | |
11 | 1693 |
7 | 1694 if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then |
1695 AC_MSG_CHECKING(for Carbon GUI) | |
864 | 1696 dnl already did the check, just give the message |
7 | 1697 AC_MSG_RESULT(yes); |
1698 GUITYPE=CARBONGUI | |
502 | 1699 if test "$VIMNAME" = "vim"; then |
1700 VIMNAME=Vim | |
1701 fi | |
864 | 1702 |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1703 if test "x$MACARCH" = "xboth"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1704 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1705 else |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1706 CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon" |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1707 fi |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
1708 |
864 | 1709 dnl Default install directory is not /usr/local |
1710 if test x$prefix = xNONE; then | |
1711 prefix=/Applications | |
1712 fi | |
1713 | |
1714 dnl Sorry for the hard coded default | |
1715 datadir='${prefix}/Vim.app/Contents/Resources' | |
1716 | |
7 | 1717 dnl skip everything else |
1718 SKIP_GTK2=YES; | |
1719 SKIP_GNOME=YES; | |
1720 SKIP_MOTIF=YES; | |
1721 SKIP_ATHENA=YES; | |
1722 SKIP_NEXTAW=YES; | |
1723 SKIP_PHOTON=YES; | |
1724 SKIP_CARBON=YES | |
1725 fi | |
1726 | |
1727 dnl define an autoconf function to check for a specified version of GTK, and | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1728 dnl try to compile/link a GTK program. |
7 | 1729 dnl |
1730 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
29 | 1731 dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS |
7 | 1732 dnl |
1733 AC_DEFUN(AM_PATH_GTK, | |
1734 [ | |
1735 if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then | |
1736 { | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1737 min_gtk_version=ifelse([$1], ,2.2.0,$1) |
7 | 1738 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
1739 no_gtk="" | |
1740 if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ | |
1741 && $PKG_CONFIG --exists gtk+-2.0; then | |
1742 { | |
1743 dnl We should be using PKG_CHECK_MODULES() instead of this hack. | |
1744 dnl But I guess the dependency on pkgconfig.m4 is not wanted or | |
1745 dnl something like that. | |
1746 GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` | |
29 | 1747 GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` |
7 | 1748 GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
1749 gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
1750 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` | |
1751 gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
1752 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | |
1753 gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | |
1754 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | |
1755 } | |
1756 else | |
1757 no_gtk=yes | |
1758 fi | |
1759 | |
1760 if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then | |
1761 { | |
1762 ac_save_CFLAGS="$CFLAGS" | |
1763 ac_save_LIBS="$LIBS" | |
1764 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
1765 LIBS="$LIBS $GTK_LIBS" | |
1766 | |
1767 dnl | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1768 dnl Now check if the installed GTK is sufficiently new. |
7 | 1769 dnl |
1770 rm -f conf.gtktest | |
1771 AC_TRY_RUN([ | |
1772 #include <gtk/gtk.h> | |
1773 #include <stdio.h> | |
1621 | 1774 #if STDC_HEADERS |
1775 # include <stdlib.h> | |
1776 # include <stddef.h> | |
1777 #endif | |
7 | 1778 |
1779 int | |
1780 main () | |
1781 { | |
1782 int major, minor, micro; | |
1783 char *tmp_version; | |
1784 | |
1785 system ("touch conf.gtktest"); | |
1786 | |
1787 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
1788 tmp_version = g_strdup("$min_gtk_version"); | |
1789 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
1790 printf("%s, bad version string\n", "$min_gtk_version"); | |
1791 exit(1); | |
1792 } | |
1793 | |
1794 if ((gtk_major_version > major) || | |
1795 ((gtk_major_version == major) && (gtk_minor_version > minor)) || | |
1796 ((gtk_major_version == major) && (gtk_minor_version == minor) && | |
1797 (gtk_micro_version >= micro))) | |
1798 { | |
1799 return 0; | |
1800 } | |
1801 return 1; | |
1802 } | |
1803 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
1804 CFLAGS="$ac_save_CFLAGS" | |
1805 LIBS="$ac_save_LIBS" | |
1806 } | |
1807 fi | |
1808 if test "x$no_gtk" = x ; then | |
1809 if test "x$enable_gtktest" = "xyes"; then | |
1810 AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) | |
1811 else | |
1812 AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) | |
1813 fi | |
1814 ifelse([$2], , :, [$2]) | |
1815 else | |
1816 { | |
1817 AC_MSG_RESULT(no) | |
1818 GTK_CFLAGS="" | |
1819 GTK_LIBS="" | |
1820 ifelse([$3], , :, [$3]) | |
1821 } | |
1822 fi | |
1823 } | |
1824 else | |
1825 GTK_CFLAGS="" | |
1826 GTK_LIBS="" | |
1827 ifelse([$3], , :, [$3]) | |
1828 fi | |
1829 AC_SUBST(GTK_CFLAGS) | |
1830 AC_SUBST(GTK_LIBS) | |
1831 rm -f conf.gtktest | |
1832 ]) | |
1833 | |
1834 dnl --------------------------------------------------------------------------- | |
1835 dnl gnome | |
1836 dnl --------------------------------------------------------------------------- | |
1837 AC_DEFUN([GNOME_INIT_HOOK], | |
1838 [ | |
1839 AC_SUBST(GNOME_LIBS) | |
1840 AC_SUBST(GNOME_LIBDIR) | |
1841 AC_SUBST(GNOME_INCLUDEDIR) | |
1842 | |
1843 AC_ARG_WITH(gnome-includes, | |
1844 [ --with-gnome-includes=DIR Specify location of GNOME headers], | |
1845 [CFLAGS="$CFLAGS -I$withval"] | |
1846 ) | |
1847 | |
1848 AC_ARG_WITH(gnome-libs, | |
1849 [ --with-gnome-libs=DIR Specify location of GNOME libs], | |
1850 [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval] | |
1851 ) | |
1852 | |
1853 AC_ARG_WITH(gnome, | |
1854 [ --with-gnome Specify prefix for GNOME files], | |
1855 if test x$withval = xyes; then | |
1856 want_gnome=yes | |
1857 ifelse([$1], [], :, [$1]) | |
1858 else | |
1859 if test "x$withval" = xno; then | |
1860 want_gnome=no | |
1861 else | |
1862 want_gnome=yes | |
1863 LDFLAGS="$LDFLAGS -L$withval/lib" | |
1864 CFLAGS="$CFLAGS -I$withval/include" | |
1865 gnome_prefix=$withval/lib | |
1866 fi | |
1867 fi, | |
1868 want_gnome=yes) | |
1869 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1870 if test "x$want_gnome" = xyes; then |
7 | 1871 { |
1872 AC_MSG_CHECKING(for libgnomeui-2.0) | |
1873 if $PKG_CONFIG --exists libgnomeui-2.0; then | |
1874 AC_MSG_RESULT(yes) | |
1875 GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0` | |
1876 GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0` | |
1877 GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0` | |
856 | 1878 |
782 | 1879 dnl On FreeBSD we need -pthread but pkg-config doesn't include it. |
1880 dnl This might not be the right way but it works for me... | |
1881 AC_MSG_CHECKING(for FreeBSD) | |
1882 if test "`(uname) 2>/dev/null`" = FreeBSD; then | |
1883 AC_MSG_RESULT(yes, adding -pthread) | |
856 | 1884 GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" |
782 | 1885 GNOME_LIBS="$GNOME_LIBS -pthread" |
1886 else | |
1887 AC_MSG_RESULT(no) | |
1888 fi | |
7 | 1889 $1 |
1890 else | |
1891 AC_MSG_RESULT(not found) | |
1892 if test "x$2" = xfail; then | |
1893 AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config) | |
1894 fi | |
1895 fi | |
1896 } | |
1897 fi | |
1898 ]) | |
1899 | |
1900 AC_DEFUN([GNOME_INIT],[ | |
1901 GNOME_INIT_HOOK([],fail) | |
1902 ]) | |
1903 | |
1904 | |
1905 dnl --------------------------------------------------------------------------- | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1906 dnl Check for GTK2. If it fails, then continue on for Motif as before... |
7 | 1907 dnl --------------------------------------------------------------------------- |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1908 if test -z "$SKIP_GTK2"; then |
7 | 1909 |
1910 AC_MSG_CHECKING(--disable-gtktest argument) | |
1911 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], | |
1912 , enable_gtktest=yes) | |
1913 if test "x$enable_gtktest" = "xyes" ; then | |
1914 AC_MSG_RESULT(gtk test enabled) | |
1915 else | |
1916 AC_MSG_RESULT(gtk test disabled) | |
1917 fi | |
1918 | |
1919 if test "X$PKG_CONFIG" = "X"; then | |
1920 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | |
1921 fi | |
1922 | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1923 if test "x$PKG_CONFIG" != "xno"; then |
7 | 1924 dnl First try finding version 2.2.0 or later. The 2.0.x series has |
1925 dnl problems (bold fonts, --remote doesn't work). | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1926 AM_PATH_GTK(2.2.0, |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1927 [GUI_LIB_LOC="$GTK_LIBDIR" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1928 GTK_LIBNAME="$GTK_LIBS" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1929 GUI_INC_LOC="$GTK_CFLAGS"], ) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1930 if test "x$GTK_CFLAGS" != "x"; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1931 SKIP_ATHENA=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1932 SKIP_NEXTAW=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1933 SKIP_MOTIF=YES |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1934 GUITYPE=GTK |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1935 AC_SUBST(GTK_LIBNAME) |
7 | 1936 fi |
1937 fi | |
1938 if test "x$GUITYPE" = "xGTK"; then | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1939 if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \ |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1940 || test "0$gtk_minor_version" -ge 2; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1941 AC_DEFINE(HAVE_GTK_MULTIHEAD) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1942 fi |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1943 dnl |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1944 dnl if GTK exists, then check for GNOME. |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1945 dnl |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1946 if test -z "$SKIP_GNOME"; then |
7 | 1947 { |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1948 GNOME_INIT_HOOK([have_gnome=yes]) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1949 if test "x$have_gnome" = xyes ; then |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1950 AC_DEFINE(FEAT_GUI_GNOME) |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1951 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR" |
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
1952 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS" |
7 | 1953 fi |
1954 } | |
1955 fi | |
1956 fi | |
1957 fi | |
1958 | |
1959 dnl Check for Motif include files location. | |
1960 dnl The LAST one found is used, this makes the highest version to be used, | |
1961 dnl e.g. when Motif1.2 and Motif2.0 are both present. | |
1962 | |
1963 if test -z "$SKIP_MOTIF"; then | |
1964 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" | |
1965 dnl Remove "-I" from before $GUI_INC_LOC if it's there | |
1966 GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`" | |
1967 | |
1968 AC_MSG_CHECKING(for location of Motif GUI includes) | |
1969 gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC" | |
1970 GUI_INC_LOC= | |
1971 for try in $gui_includes; do | |
1972 if test -f "$try/Xm/Xm.h"; then | |
1973 GUI_INC_LOC=$try | |
1974 fi | |
1975 done | |
1976 if test -n "$GUI_INC_LOC"; then | |
1977 if test "$GUI_INC_LOC" = /usr/include; then | |
1978 GUI_INC_LOC= | |
1979 AC_MSG_RESULT(in default path) | |
1980 else | |
1981 AC_MSG_RESULT($GUI_INC_LOC) | |
1982 fi | |
1983 else | |
1984 AC_MSG_RESULT(<not found>) | |
1985 SKIP_MOTIF=YES | |
1986 fi | |
1987 fi | |
1988 | |
1989 dnl Check for Motif library files location. In the same order as the include | |
1990 dnl files, to avoid a mixup if several versions are present | |
1991 | |
1992 if test -z "$SKIP_MOTIF"; then | |
1993 AC_MSG_CHECKING(--with-motif-lib argument) | |
1994 AC_ARG_WITH(motif-lib, | |
1995 [ --with-motif-lib=STRING Library for Motif ], | |
1996 [ MOTIF_LIBNAME="${withval}" ] ) | |
1997 | |
1998 if test -n "$MOTIF_LIBNAME"; then | |
1999 AC_MSG_RESULT($MOTIF_LIBNAME) | |
2000 GUI_LIB_LOC= | |
2001 else | |
2002 AC_MSG_RESULT(no) | |
2003 | |
2004 dnl Remove "-L" from before $GUI_LIB_LOC if it's there | |
2005 GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" | |
2006 | |
2007 AC_MSG_CHECKING(for location of Motif GUI libs) | |
2008 gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" | |
2009 GUI_LIB_LOC= | |
2010 for try in $gui_libs; do | |
14 | 2011 for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do |
7 | 2012 if test -f "$libtry"; then |
2013 GUI_LIB_LOC=$try | |
2014 fi | |
2015 done | |
2016 done | |
2017 if test -n "$GUI_LIB_LOC"; then | |
2018 dnl Remove /usr/lib, it causes trouble on some systems | |
2019 if test "$GUI_LIB_LOC" = /usr/lib; then | |
2020 GUI_LIB_LOC= | |
2021 AC_MSG_RESULT(in default path) | |
2022 else | |
2023 if test -n "$GUI_LIB_LOC"; then | |
2024 AC_MSG_RESULT($GUI_LIB_LOC) | |
2025 if test "`(uname) 2>/dev/null`" = SunOS && | |
2026 uname -r | grep '^5' >/dev/null; then | |
2027 GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC" | |
2028 fi | |
2029 fi | |
2030 fi | |
2031 MOTIF_LIBNAME=-lXm | |
2032 else | |
2033 AC_MSG_RESULT(<not found>) | |
2034 SKIP_MOTIF=YES | |
2035 fi | |
2036 fi | |
2037 fi | |
2038 | |
2039 if test -z "$SKIP_MOTIF"; then | |
2040 SKIP_ATHENA=YES | |
2041 SKIP_NEXTAW=YES | |
2042 GUITYPE=MOTIF | |
2043 AC_SUBST(MOTIF_LIBNAME) | |
2044 fi | |
2045 | |
2046 dnl Check if the Athena files can be found | |
2047 | |
2048 GUI_X_LIBS= | |
2049 | |
2050 if test -z "$SKIP_ATHENA"; then | |
2051 AC_MSG_CHECKING(if Athena header files can be found) | |
2052 cflags_save=$CFLAGS | |
2053 CFLAGS="$CFLAGS $X_CFLAGS" | |
2054 AC_TRY_COMPILE([ | |
2055 #include <X11/Intrinsic.h> | |
2056 #include <X11/Xaw/Paned.h>], , | |
2057 AC_MSG_RESULT(yes), | |
2058 AC_MSG_RESULT(no); SKIP_ATHENA=YES ) | |
2059 CFLAGS=$cflags_save | |
2060 fi | |
2061 | |
2062 if test -z "$SKIP_ATHENA"; then | |
2063 GUITYPE=ATHENA | |
2064 fi | |
2065 | |
2066 if test -z "$SKIP_NEXTAW"; then | |
2067 AC_MSG_CHECKING(if neXtaw header files can be found) | |
2068 cflags_save=$CFLAGS | |
2069 CFLAGS="$CFLAGS $X_CFLAGS" | |
2070 AC_TRY_COMPILE([ | |
2071 #include <X11/Intrinsic.h> | |
2072 #include <X11/neXtaw/Paned.h>], , | |
2073 AC_MSG_RESULT(yes), | |
2074 AC_MSG_RESULT(no); SKIP_NEXTAW=YES ) | |
2075 CFLAGS=$cflags_save | |
2076 fi | |
2077 | |
2078 if test -z "$SKIP_NEXTAW"; then | |
2079 GUITYPE=NEXTAW | |
2080 fi | |
2081 | |
2082 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then | |
2083 dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty | |
2084 dnl Avoid adding it when it twice | |
2085 if test -n "$GUI_INC_LOC"; then | |
2086 GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`" | |
2087 fi | |
2088 if test -n "$GUI_LIB_LOC"; then | |
2089 GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`" | |
2090 fi | |
2091 | |
2092 dnl Check for -lXext and then for -lXmu | |
2093 ldflags_save=$LDFLAGS | |
2094 LDFLAGS="$X_LIBS $LDFLAGS" | |
2095 AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],, | |
2096 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2097 dnl For Solaris we need -lw and -ldl before linking with -lXmu works. | |
2098 AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],, | |
2099 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2100 AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],, | |
2101 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2102 AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],, | |
2103 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2104 if test -z "$SKIP_MOTIF"; then | |
2105 AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],, | |
2106 [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) | |
2107 fi | |
2108 LDFLAGS=$ldflags_save | |
2109 | |
2110 dnl Execute xmkmf to figure out if -DNARROWPROTO is needed. | |
2111 AC_MSG_CHECKING(for extra X11 defines) | |
2112 NARROW_PROTO= | |
2113 rm -fr conftestdir | |
2114 if mkdir conftestdir; then | |
2115 cd conftestdir | |
2116 cat > Imakefile <<'EOF' | |
2117 acfindx: | |
2118 @echo 'NARROW_PROTO="${PROTO_DEFINES}"' | |
2119 EOF | |
2120 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then | |
2121 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` | |
2122 fi | |
2123 cd .. | |
2124 rm -fr conftestdir | |
2125 fi | |
2126 if test -z "$NARROW_PROTO"; then | |
2127 AC_MSG_RESULT(no) | |
2128 else | |
2129 AC_MSG_RESULT($NARROW_PROTO) | |
2130 fi | |
2131 AC_SUBST(NARROW_PROTO) | |
2132 fi | |
2133 | |
2134 dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs | |
2135 dnl use the X11 include path | |
2136 if test "$enable_xsmp" = "yes"; then | |
2137 cppflags_save=$CPPFLAGS | |
2138 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2139 AC_CHECK_HEADERS(X11/SM/SMlib.h) | |
2140 CPPFLAGS=$cppflags_save | |
2141 fi | |
2142 | |
2143 | |
2285
69064995302a
Change SKIP_GTK to SKIP_GTK2 in configure.
Bram Moolenaar <bram@vim.org>
parents:
2277
diff
changeset
|
2144 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK2"; then |
7 | 2145 dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path |
2146 cppflags_save=$CPPFLAGS | |
2147 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2148 AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h) | |
2149 | |
2150 dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h | |
2151 if test ! "$enable_xim" = "no"; then | |
2152 AC_MSG_CHECKING(for XIMText in X11/Xlib.h) | |
2153 AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>], | |
2154 AC_MSG_RESULT(yes), | |
2155 AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no") | |
2156 fi | |
2157 CPPFLAGS=$cppflags_save | |
2158 | |
2159 dnl automatically enable XIM when hangul input isn't enabled | |
2160 if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \ | |
2161 -a "x$GUITYPE" != "xNONE" ; then | |
2162 AC_MSG_RESULT(X GUI selected; xim has been enabled) | |
2163 enable_xim="yes" | |
2164 fi | |
2165 fi | |
2166 | |
2167 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then | |
2168 cppflags_save=$CPPFLAGS | |
2169 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
148 | 2170 dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h |
2171 AC_MSG_CHECKING([for X11/Xmu/Editres.h]) | |
2172 AC_TRY_COMPILE([ | |
2173 #include <X11/Intrinsic.h> | |
2174 #include <X11/Xmu/Editres.h>], | |
2175 [int i; i = 0;], | |
2176 AC_MSG_RESULT(yes) | |
2177 AC_DEFINE(HAVE_X11_XMU_EDITRES_H), | |
2178 AC_MSG_RESULT(no)) | |
7 | 2179 CPPFLAGS=$cppflags_save |
2180 fi | |
2181 | |
2182 dnl Only use the Xm directory when compiling Motif, don't use it for Athena | |
2183 if test -z "$SKIP_MOTIF"; then | |
2184 cppflags_save=$CPPFLAGS | |
2185 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
148 | 2186 AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \ |
838 | 2187 Xm/UnhighlightT.h Xm/Notebook.h) |
819 | 2188 |
2189 if test $ac_cv_header_Xm_XpmP_h = yes; then | |
2190 dnl Solaris uses XpmAttributes_21, very annoying. | |
2191 AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) | |
2192 AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;], | |
2193 AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21), | |
2194 AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) | |
2195 ) | |
2196 else | |
839 | 2197 AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes) |
819 | 2198 fi |
7 | 2199 CPPFLAGS=$cppflags_save |
2200 fi | |
2201 | |
2202 if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then | |
2203 AC_MSG_RESULT(no GUI selected; xim has been disabled) | |
2204 enable_xim="no" | |
2205 fi | |
2206 if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then | |
2207 AC_MSG_RESULT(no GUI selected; fontset has been disabled) | |
2208 enable_fontset="no" | |
2209 fi | |
2275
e4d849f4df03
Remove the old and not well supported GTK 1 code. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2247
diff
changeset
|
2210 if test "x$GUITYPE:$enable_fontset" = "xGTK:yes"; then |
7 | 2211 AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled) |
2212 enable_fontset="no" | |
2213 fi | |
2214 | |
2215 if test -z "$SKIP_PHOTON"; then | |
2216 GUITYPE=PHOTONGUI | |
2217 fi | |
2218 | |
2219 AC_SUBST(GUI_INC_LOC) | |
2220 AC_SUBST(GUI_LIB_LOC) | |
2221 AC_SUBST(GUITYPE) | |
2222 AC_SUBST(GUI_X_LIBS) | |
2223 | |
2224 if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then | |
2225 AC_MSG_ERROR([cannot use workshop without Motif]) | |
2226 fi | |
2227 | |
2228 dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled | |
2229 if test "$enable_xim" = "yes"; then | |
2230 AC_DEFINE(FEAT_XIM) | |
2231 fi | |
2232 if test "$enable_fontset" = "yes"; then | |
2233 AC_DEFINE(FEAT_XFONTSET) | |
2234 fi | |
2235 | |
2236 | |
2237 dnl --------------------------------------------------------------------------- | |
2238 dnl end of GUI-checking | |
2239 dnl --------------------------------------------------------------------------- | |
2240 | |
2241 | |
2242 dnl Only really enable hangul input when GUI and XFONTSET are available | |
2243 if test "$enable_hangulinput" = "yes"; then | |
2244 if test "x$GUITYPE" = "xNONE"; then | |
2245 AC_MSG_RESULT(no GUI selected; hangul input has been disabled) | |
2246 enable_hangulinput=no | |
2247 else | |
2248 AC_DEFINE(FEAT_HANGULIN) | |
2249 HANGULIN_SRC=hangulin.c | |
2250 AC_SUBST(HANGULIN_SRC) | |
2251 HANGULIN_OBJ=objects/hangulin.o | |
2252 AC_SUBST(HANGULIN_OBJ) | |
2253 fi | |
2254 fi | |
2255 | |
2256 dnl Checks for libraries and include files. | |
2257 | |
1621 | 2258 AC_CACHE_CHECK([whether toupper is broken], [vim_cv_toupper_broken], |
2259 [ | |
2260 AC_RUN_IFELSE([[ | |
2261 #include "confdefs.h" | |
2262 #include <ctype.h> | |
2263 #if STDC_HEADERS | |
2264 # include <stdlib.h> | |
2265 # include <stddef.h> | |
2266 #endif | |
2267 main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } | |
2268 ]],[ | |
2269 vim_cv_toupper_broken=yes | |
2270 ],[ | |
2271 vim_cv_toupper_broken=no | |
2272 ],[ | |
2273 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken') | |
2274 ])]) | |
2275 | |
2276 if test "x$vim_cv_toupper_broken" = "xyes" ; then | |
2277 AC_DEFINE(BROKEN_TOUPPER) | |
2278 fi | |
7 | 2279 |
2280 AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) | |
1621 | 2281 AC_TRY_COMPILE([#include <stdio.h>], [printf("(" __DATE__ " " __TIME__ ")");], |
7 | 2282 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME), |
2283 AC_MSG_RESULT(no)) | |
2284 | |
1876 | 2285 AC_MSG_CHECKING(whether __attribute__((unused)) is allowed) |
2286 AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));], | |
2287 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED), | |
2288 AC_MSG_RESULT(no)) | |
2289 | |
7 | 2290 dnl Checks for header files. |
2291 AC_CHECK_HEADER(elf.h, HAS_ELF=1) | |
2292 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1) | |
2293 if test "$HAS_ELF" = 1; then | |
2294 AC_CHECK_LIB(elf, main) | |
2295 fi | |
2296 | |
2297 AC_HEADER_DIRENT | |
2298 | |
2299 dnl If sys/wait.h is not found it might still exist but not be POSIX | |
2300 dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT) | |
2301 if test $ac_cv_header_sys_wait_h = no; then | |
2302 AC_MSG_CHECKING([for sys/wait.h that defines union wait]) | |
2303 AC_TRY_COMPILE([#include <sys/wait.h>], | |
2304 [union wait xx, yy; xx = yy], | |
2305 AC_MSG_RESULT(yes) | |
2306 AC_DEFINE(HAVE_SYS_WAIT_H) | |
2307 AC_DEFINE(HAVE_UNION_WAIT), | |
2308 AC_MSG_RESULT(no)) | |
2309 fi | |
2310 | |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2311 AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2312 sys/select.h sys/utsname.h termcap.h fcntl.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2313 sgtty.h sys/ioctl.h sys/time.h sys/types.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2314 termio.h iconv.h inttypes.h langinfo.h math.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2315 unistd.h stropts.h errno.h sys/resource.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2316 sys/systeminfo.h locale.h sys/stream.h termios.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2317 libc.h sys/statfs.h poll.h sys/poll.h pwd.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2318 utime.h sys/param.h libintl.h libgen.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2319 util/debug.h util/msg18n.h frame.h sys/acl.h \ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2320 sys/access.h sys/sysinfo.h wchar.h wctype.h) |
7 | 2321 |
1649 | 2322 dnl sys/ptem.h depends on sys/stream.h on Solaris |
2323 AC_CHECK_HEADERS(sys/ptem.h, [], [], | |
2324 [#if defined HAVE_SYS_STREAM_H | |
2325 # include <sys/stream.h> | |
2326 #endif]) | |
2327 | |
1886 | 2328 dnl sys/sysctl.h depends on sys/param.h on OpenBSD |
2329 AC_CHECK_HEADERS(sys/sysctl.h, [], [], | |
2330 [#if defined HAVE_SYS_PARAM_H | |
2331 # include <sys/param.h> | |
2332 #endif]) | |
2333 | |
1649 | 2334 |
132 | 2335 dnl pthread_np.h may exist but can only be used after including pthread.h |
2336 AC_MSG_CHECKING([for pthread_np.h]) | |
2337 AC_TRY_COMPILE([ | |
2338 #include <pthread.h> | |
2339 #include <pthread_np.h>], | |
2340 [int i; i = 0;], | |
2341 AC_MSG_RESULT(yes) | |
2342 AC_DEFINE(HAVE_PTHREAD_NP_H), | |
2343 AC_MSG_RESULT(no)) | |
2344 | |
502 | 2345 AC_CHECK_HEADERS(strings.h) |
574 | 2346 if test "x$MACOSX" = "xyes"; then |
2347 dnl The strings.h file on OS/X contains a warning and nothing useful. | |
2348 AC_DEFINE(NO_STRINGS_WITH_STRING_H) | |
2349 else | |
7 | 2350 |
2351 dnl Check if strings.h and string.h can both be included when defined. | |
2352 AC_MSG_CHECKING([if strings.h can be included after string.h]) | |
2353 cppflags_save=$CPPFLAGS | |
2354 CPPFLAGS="$CPPFLAGS $X_CFLAGS" | |
2355 AC_TRY_COMPILE([ | |
2356 #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO) | |
2357 # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */ | |
2358 /* but don't do it on AIX 5.1 (Uribarri) */ | |
2359 #endif | |
2360 #ifdef HAVE_XM_XM_H | |
2361 # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */ | |
2362 #endif | |
2363 #ifdef HAVE_STRING_H | |
2364 # include <string.h> | |
2365 #endif | |
2366 #if defined(HAVE_STRINGS_H) | |
2367 # include <strings.h> | |
2368 #endif | |
2369 ], [int i; i = 0;], | |
2370 AC_MSG_RESULT(yes), | |
2371 AC_DEFINE(NO_STRINGS_WITH_STRING_H) | |
2372 AC_MSG_RESULT(no)) | |
2373 CPPFLAGS=$cppflags_save | |
574 | 2374 fi |
7 | 2375 |
2376 dnl Checks for typedefs, structures, and compiler characteristics. | |
2377 AC_PROG_GCC_TRADITIONAL | |
2378 AC_C_CONST | |
1832 | 2379 AC_C_VOLATILE |
7 | 2380 AC_TYPE_MODE_T |
2381 AC_TYPE_OFF_T | |
2382 AC_TYPE_PID_T | |
2383 AC_TYPE_SIZE_T | |
2384 AC_TYPE_UID_T | |
2184
5028c4d6d825
Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents:
2131
diff
changeset
|
2385 AC_TYPE_UINT32_T |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2386 |
7 | 2387 AC_HEADER_TIME |
2388 AC_CHECK_TYPE(ino_t, long) | |
2389 AC_CHECK_TYPE(dev_t, unsigned) | |
2184
5028c4d6d825
Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents:
2131
diff
changeset
|
2390 AC_C_BIGENDIAN(,,,) |
7 | 2391 |
2392 AC_MSG_CHECKING(for rlim_t) | |
2393 if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then | |
2394 AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t]) | |
2395 else | |
2396 AC_EGREP_CPP(dnl | |
2397 changequote(<<,>>)dnl | |
2398 <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl | |
2399 changequote([,]), | |
2400 [ | |
2401 #include <sys/types.h> | |
2402 #if STDC_HEADERS | |
1621 | 2403 # include <stdlib.h> |
2404 # include <stddef.h> | |
7 | 2405 #endif |
2406 #ifdef HAVE_SYS_RESOURCE_H | |
1621 | 2407 # include <sys/resource.h> |
7 | 2408 #endif |
2409 ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no) | |
2410 AC_MSG_RESULT($ac_cv_type_rlim_t) | |
2411 fi | |
2412 if test $ac_cv_type_rlim_t = no; then | |
2413 cat >> confdefs.h <<\EOF | |
2414 #define rlim_t unsigned long | |
2415 EOF | |
2416 fi | |
2417 | |
2418 AC_MSG_CHECKING(for stack_t) | |
2419 if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then | |
2420 AC_MSG_RESULT([(cached) $ac_cv_type_stack_t]) | |
2421 else | |
2422 AC_EGREP_CPP(stack_t, | |
2423 [ | |
2424 #include <sys/types.h> | |
2425 #if STDC_HEADERS | |
1621 | 2426 # include <stdlib.h> |
2427 # include <stddef.h> | |
7 | 2428 #endif |
2429 #include <signal.h> | |
2430 ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no) | |
2431 AC_MSG_RESULT($ac_cv_type_stack_t) | |
2432 fi | |
2433 if test $ac_cv_type_stack_t = no; then | |
2434 cat >> confdefs.h <<\EOF | |
2435 #define stack_t struct sigaltstack | |
2436 EOF | |
2437 fi | |
2438 | |
2439 dnl BSDI uses ss_base while others use ss_sp for the stack pointer. | |
2440 AC_MSG_CHECKING(whether stack_t has an ss_base field) | |
2441 AC_TRY_COMPILE([ | |
2442 #include <sys/types.h> | |
2443 #if STDC_HEADERS | |
1621 | 2444 # include <stdlib.h> |
2445 # include <stddef.h> | |
7 | 2446 #endif |
2447 #include <signal.h> | |
2448 #include "confdefs.h" | |
2449 ], [stack_t sigstk; sigstk.ss_base = 0; ], | |
2450 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE), | |
2451 AC_MSG_RESULT(no)) | |
2452 | |
2453 olibs="$LIBS" | |
2454 AC_MSG_CHECKING(--with-tlib argument) | |
2455 AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],) | |
2456 if test -n "$with_tlib"; then | |
2457 AC_MSG_RESULT($with_tlib) | |
2458 LIBS="$LIBS -l$with_tlib" | |
39 | 2459 AC_MSG_CHECKING(for linking with $with_tlib library) |
2460 AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED)) | |
2461 dnl Need to check for tgetent() below. | |
2462 olibs="$LIBS" | |
7 | 2463 else |
39 | 2464 AC_MSG_RESULT([empty: automatic terminal library selection]) |
7 | 2465 dnl On HP-UX 10.10 termcap or termlib should be used instead of |
2466 dnl curses, because curses is much slower. | |
2467 dnl Newer versions of ncurses are preferred over anything. | |
2468 dnl Older versions of ncurses have bugs, get a new one! | |
2469 dnl Digital Unix (OSF1) should use curses (Ronald Schild). | |
997 | 2470 dnl On SCO Openserver should prefer termlib (Roger Cornelius). |
7 | 2471 case "`uname -s 2>/dev/null`" in |
997 | 2472 OSF1|SCO_SV) tlibs="ncurses curses termlib termcap";; |
7 | 2473 *) tlibs="ncurses termlib termcap curses";; |
2474 esac | |
2475 for libname in $tlibs; do | |
2476 AC_CHECK_LIB(${libname}, tgetent,,) | |
2477 if test "x$olibs" != "x$LIBS"; then | |
2478 dnl It's possible that a library is found but it doesn't work | |
2479 dnl e.g., shared library that cannot be found | |
2480 dnl compile and run a test program to be sure | |
2481 AC_TRY_RUN([ | |
2482 #ifdef HAVE_TERMCAP_H | |
2483 # include <termcap.h> | |
2484 #endif | |
1621 | 2485 #if STDC_HEADERS |
2486 # include <stdlib.h> | |
2487 # include <stddef.h> | |
2488 #endif | |
7 | 2489 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], |
2490 res="OK", res="FAIL", res="FAIL") | |
2491 if test "$res" = "OK"; then | |
2492 break | |
2493 fi | |
2494 AC_MSG_RESULT($libname library is not usable) | |
2495 LIBS="$olibs" | |
2496 fi | |
2497 done | |
39 | 2498 if test "x$olibs" = "x$LIBS"; then |
2499 AC_MSG_RESULT(no terminal library found) | |
2500 fi | |
7 | 2501 fi |
39 | 2502 |
2503 if test "x$olibs" = "x$LIBS"; then | |
2504 AC_MSG_CHECKING([for tgetent()]) | |
282 | 2505 AC_TRY_LINK([], |
39 | 2506 [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");], |
2507 AC_MSG_RESULT(yes), | |
2508 AC_MSG_ERROR([NOT FOUND! | |
2509 You need to install a terminal library; for example ncurses. | |
2510 Or specify the name of the library with --with-tlib.])) | |
2511 fi | |
2512 | |
1621 | 2513 AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], |
2514 [ | |
2515 AC_RUN_IFELSE([[ | |
2516 #include "confdefs.h" | |
7 | 2517 #ifdef HAVE_TERMCAP_H |
2518 # include <termcap.h> | |
2519 #endif | |
1621 | 2520 #ifdef HAVE_STRING_H |
2521 # include <string.h> | |
2522 #endif | |
2523 #if STDC_HEADERS | |
2524 # include <stdlib.h> | |
2525 # include <stddef.h> | |
2526 #endif | |
7 | 2527 main() |
1621 | 2528 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } |
2529 ]],[ | |
2530 vim_cv_terminfo=no | |
2531 ],[ | |
2532 vim_cv_terminfo=yes | |
2533 ],[ | |
2534 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo') | |
2535 ]) | |
2536 ]) | |
2537 | |
2538 if test "x$vim_cv_terminfo" = "xyes" ; then | |
2539 AC_DEFINE(TERMINFO) | |
2540 fi | |
7 | 2541 |
2542 if test "x$olibs" != "x$LIBS"; then | |
1621 | 2543 AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent], |
2544 [ | |
2545 AC_RUN_IFELSE([[ | |
2546 #include "confdefs.h" | |
7 | 2547 #ifdef HAVE_TERMCAP_H |
2548 # include <termcap.h> | |
2549 #endif | |
1621 | 2550 #if STDC_HEADERS |
2551 # include <stdlib.h> | |
2552 # include <stddef.h> | |
2553 #endif | |
7 | 2554 main() |
1621 | 2555 {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } |
2556 ]],[ | |
2557 vim_cv_tgent=zero | |
2558 ],[ | |
2559 vim_cv_tgent=non-zero | |
2560 ],[ | |
2561 AC_MSG_ERROR(failed to compile test program.) | |
2562 ]) | |
2563 ]) | |
2564 | |
2565 if test "x$vim_cv_tgent" = "xzero" ; then | |
2566 AC_DEFINE(TGETENT_ZERO_ERR, 0) | |
2567 fi | |
7 | 2568 fi |
2569 | |
2570 AC_MSG_CHECKING(whether termcap.h contains ospeed) | |
2571 AC_TRY_LINK([ | |
2572 #ifdef HAVE_TERMCAP_H | |
2573 # include <termcap.h> | |
2574 #endif | |
2575 ], [ospeed = 20000], | |
2576 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED), | |
2577 [AC_MSG_RESULT(no) | |
2578 AC_MSG_CHECKING(whether ospeed can be extern) | |
2579 AC_TRY_LINK([ | |
2580 #ifdef HAVE_TERMCAP_H | |
2581 # include <termcap.h> | |
2582 #endif | |
2583 extern short ospeed; | |
2584 ], [ospeed = 20000], | |
2585 AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN), | |
2586 AC_MSG_RESULT(no))] | |
2587 ) | |
2588 | |
2589 AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC]) | |
2590 AC_TRY_LINK([ | |
2591 #ifdef HAVE_TERMCAP_H | |
2592 # include <termcap.h> | |
2593 #endif | |
2594 ], [if (UP == 0 && BC == 0) PC = 1], | |
2595 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC), | |
2596 [AC_MSG_RESULT(no) | |
2597 AC_MSG_CHECKING([whether UP, BC and PC can be extern]) | |
2598 AC_TRY_LINK([ | |
2599 #ifdef HAVE_TERMCAP_H | |
2600 # include <termcap.h> | |
2601 #endif | |
2602 extern char *UP, *BC, PC; | |
2603 ], [if (UP == 0 && BC == 0) PC = 1], | |
2604 AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN), | |
2605 AC_MSG_RESULT(no))] | |
2606 ) | |
2607 | |
2608 AC_MSG_CHECKING(whether tputs() uses outfuntype) | |
2609 AC_TRY_COMPILE([ | |
2610 #ifdef HAVE_TERMCAP_H | |
2611 # include <termcap.h> | |
2612 #endif | |
2613 ], [extern int xx(); tputs("test", 1, (outfuntype)xx)], | |
2614 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE), | |
2615 AC_MSG_RESULT(no)) | |
2616 | |
2617 dnl On some SCO machines sys/select redefines struct timeval | |
2618 AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included]) | |
2619 AC_TRY_COMPILE([ | |
2620 #include <sys/types.h> | |
2621 #include <sys/time.h> | |
2622 #include <sys/select.h>], , | |
2623 AC_MSG_RESULT(yes) | |
2624 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME), | |
2625 AC_MSG_RESULT(no)) | |
2626 | |
2627 dnl AC_DECL_SYS_SIGLIST | |
2628 | |
2629 dnl Checks for pty.c (copied from screen) ========================== | |
2630 AC_MSG_CHECKING(for /dev/ptc) | |
2631 if test -r /dev/ptc; then | |
2632 AC_DEFINE(HAVE_DEV_PTC) | |
2633 AC_MSG_RESULT(yes) | |
2634 else | |
2635 AC_MSG_RESULT(no) | |
2636 fi | |
2637 | |
2638 AC_MSG_CHECKING(for SVR4 ptys) | |
2639 if test -c /dev/ptmx ; then | |
2640 AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);], | |
2641 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS), | |
2642 AC_MSG_RESULT(no)) | |
2643 else | |
2644 AC_MSG_RESULT(no) | |
2645 fi | |
2646 | |
2647 AC_MSG_CHECKING(for ptyranges) | |
2648 if test -d /dev/ptym ; then | |
2649 pdir='/dev/ptym' | |
2650 else | |
2651 pdir='/dev' | |
2652 fi | |
2653 dnl SCO uses ptyp%d | |
2654 AC_EGREP_CPP(yes, | |
2655 [#ifdef M_UNIX | |
2656 yes; | |
2657 #endif | |
2658 ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`) | |
2659 dnl if test -c /dev/ptyp19; then | |
2660 dnl ptys=`echo /dev/ptyp??` | |
2661 dnl else | |
2662 dnl ptys=`echo $pdir/pty??` | |
2663 dnl fi | |
2664 if test "$ptys" != "$pdir/pty??" ; then | |
2665 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` | |
2666 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` | |
2667 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") | |
2668 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") | |
2669 AC_MSG_RESULT([$p0 / $p1]) | |
2670 else | |
2671 AC_MSG_RESULT([don't know]) | |
2672 fi | |
2673 | |
2674 dnl **** pty mode/group handling **** | |
2675 dnl | |
2676 dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222 | |
2677 rm -f conftest_grp | |
1621 | 2678 AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], |
2679 [ | |
2680 AC_RUN_IFELSE([[ | |
2681 #include "confdefs.h" | |
7 | 2682 #include <sys/types.h> |
1621 | 2683 #if STDC_HEADERS |
2684 # include <stdlib.h> | |
2685 # include <stddef.h> | |
2686 #endif | |
2687 #ifdef HAVE_UNISTD_H | |
2688 #include <unistd.h> | |
2689 #endif | |
7 | 2690 #include <sys/stat.h> |
2691 #include <stdio.h> | |
2692 main() | |
2693 { | |
2694 struct stat sb; | |
2695 char *x,*ttyname(); | |
2696 int om, m; | |
2697 FILE *fp; | |
2698 | |
2699 if (!(x = ttyname(0))) exit(1); | |
2700 if (stat(x, &sb)) exit(1); | |
2701 om = sb.st_mode; | |
2702 if (om & 002) exit(0); | |
2703 m = system("mesg y"); | |
2704 if (m == -1 || m == 127) exit(1); | |
2705 if (stat(x, &sb)) exit(1); | |
2706 m = sb.st_mode; | |
2707 if (chmod(x, om)) exit(1); | |
2708 if (m & 002) exit(0); | |
2709 if (sb.st_gid == getgid()) exit(1); | |
2710 if (!(fp=fopen("conftest_grp", "w"))) | |
2711 exit(1); | |
2712 fprintf(fp, "%d\n", sb.st_gid); | |
2713 fclose(fp); | |
2714 exit(0); | |
2715 } | |
1621 | 2716 ]],[ |
2717 if test -f conftest_grp; then | |
2718 vim_cv_tty_group=`cat conftest_grp` | |
2719 if test "x$vim_cv_tty_mode" = "x" ; then | |
2720 vim_cv_tty_mode=0620 | |
2721 fi | |
2722 AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) | |
2723 else | |
2724 vim_cv_tty_group=world | |
2018 | 2725 AC_MSG_RESULT([ptys are world accessible]) |
1621 | 2726 fi |
2727 ],[ | |
2728 vim_cv_tty_group=world | |
2018 | 2729 AC_MSG_RESULT([can't determine - assume ptys are world accessible]) |
1621 | 2730 ],[ |
2731 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') | |
2732 ]) | |
2733 ]) | |
7 | 2734 rm -f conftest_grp |
2735 | |
1621 | 2736 if test "x$vim_cv_tty_group" != "xworld" ; then |
2737 AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) | |
2738 if test "x$vim_cv_tty_mode" = "x" ; then | |
2739 AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (propably 0620)]) | |
2740 else | |
2741 AC_DEFINE(PTYMODE, 0620) | |
2742 fi | |
2743 fi | |
2744 | |
7 | 2745 dnl Checks for library functions. =================================== |
2746 | |
2747 AC_TYPE_SIGNAL | |
2748 | |
2749 dnl find out what to use at the end of a signal function | |
2750 if test $ac_cv_type_signal = void; then | |
2751 AC_DEFINE(SIGRETURN, [return]) | |
2752 else | |
2753 AC_DEFINE(SIGRETURN, [return 0]) | |
2754 fi | |
2755 | |
2756 dnl check if struct sigcontext is defined (used for SGI only) | |
2757 AC_MSG_CHECKING(for struct sigcontext) | |
2758 AC_TRY_COMPILE([ | |
2759 #include <signal.h> | |
2760 test_sig() | |
2761 { | |
2762 struct sigcontext *scont; | |
2763 scont = (struct sigcontext *)0; | |
2764 return 1; | |
2765 } ], , | |
2766 AC_MSG_RESULT(yes) | |
2767 AC_DEFINE(HAVE_SIGCONTEXT), | |
2768 AC_MSG_RESULT(no)) | |
2769 | |
2770 dnl tricky stuff: try to find out if getcwd() is implemented with | |
2771 dnl system("sh -c pwd") | |
1621 | 2772 AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], |
2773 [ | |
2774 AC_RUN_IFELSE([[ | |
2775 #include "confdefs.h" | |
2776 #ifdef HAVE_UNISTD_H | |
2777 #include <unistd.h> | |
2778 #endif | |
7 | 2779 char *dagger[] = { "IFS=pwd", 0 }; |
2780 main() | |
2781 { | |
2782 char buffer[500]; | |
2783 extern char **environ; | |
2784 environ = dagger; | |
2785 return getcwd(buffer, 500) ? 0 : 1; | |
1621 | 2786 } |
2787 ]],[ | |
2788 vim_cv_getcwd_broken=no | |
2789 ],[ | |
2790 vim_cv_getcwd_broken=yes | |
2791 ],[ | |
2792 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken') | |
2793 ]) | |
2794 ]) | |
2795 | |
2796 if test "x$vim_cv_getcwd_broken" = "xyes" ; then | |
2797 AC_DEFINE(BAD_GETCWD) | |
2798 fi | |
7 | 2799 |
2087
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
2800 dnl Check for functions in one big call, to reduce the size of configure. |
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
2801 dnl Can only be used for functions that do not require any include. |
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
2802 AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ |
7 | 2803 getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ |
1997 | 2804 memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ |
7 | 2805 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ |
273 | 2806 sigvec strcasecmp strerror strftime stricmp strncasecmp \ |
258 | 2807 strnicmp strpbrk strtol tgetent towlower towupper iswupper \ |
2808 usleep utime utimes) | |
2087
3112fcc89238
updated for version 7.2.371
Bram Moolenaar <bram@zimbu.org>
parents:
2077
diff
changeset
|
2809 AC_FUNC_FSEEKO |
7 | 2810 |
2131
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
2811 dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
2812 dnl appropriate, so that off_t is 64 bits when needed. |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
2813 AC_SYS_LARGEFILE |
8ef9da918a98
updated for version 7.2.413
Bram Moolenaar <bram@zimbu.org>
parents:
2110
diff
changeset
|
2814 |
7 | 2815 dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible |
2816 AC_MSG_CHECKING(for st_blksize) | |
2817 AC_TRY_COMPILE( | |
2818 [#include <sys/types.h> | |
2819 #include <sys/stat.h>], | |
2820 [ struct stat st; | |
2821 int n; | |
2822 | |
2823 stat("/", &st); | |
2824 n = (int)st.st_blksize;], | |
2825 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE), | |
2826 AC_MSG_RESULT(no)) | |
2827 | |
1621 | 2828 AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], |
2829 [ | |
2830 AC_RUN_IFELSE([[ | |
2831 #include "confdefs.h" | |
2832 #if STDC_HEADERS | |
2833 # include <stdlib.h> | |
2834 # include <stddef.h> | |
2835 #endif | |
2836 #include <sys/types.h> | |
7 | 2837 #include <sys/stat.h> |
1621 | 2838 main() {struct stat st; exit(stat("configure/", &st) != 0); } |
2839 ]],[ | |
2840 vim_cv_stat_ignores_slash=yes | |
2841 ],[ | |
2842 vim_cv_stat_ignores_slash=no | |
2843 ],[ | |
2844 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash') | |
2845 ]) | |
2846 ]) | |
7 | 2847 |
1621 | 2848 if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then |
2849 AC_DEFINE(STAT_IGNORES_SLASH) | |
2850 fi | |
2851 | |
7 | 2852 dnl Link with iconv for charset translation, if not found without library. |
2853 dnl check for iconv() requires including iconv.h | |
2854 dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it | |
2855 dnl has been installed. | |
2856 AC_MSG_CHECKING(for iconv_open()) | |
2857 save_LIBS="$LIBS" | |
2858 LIBS="$LIBS -liconv" | |
2859 AC_TRY_LINK([ | |
2860 #ifdef HAVE_ICONV_H | |
2861 # include <iconv.h> | |
2862 #endif | |
2863 ], [iconv_open("fr", "to");], | |
2864 AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV), | |
2865 LIBS="$save_LIBS" | |
2866 AC_TRY_LINK([ | |
2867 #ifdef HAVE_ICONV_H | |
2868 # include <iconv.h> | |
2869 #endif | |
2870 ], [iconv_open("fr", "to");], | |
2871 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV), | |
2872 AC_MSG_RESULT(no))) | |
2873 | |
2874 | |
2875 AC_MSG_CHECKING(for nl_langinfo(CODESET)) | |
2876 AC_TRY_LINK([ | |
2877 #ifdef HAVE_LANGINFO_H | |
2878 # include <langinfo.h> | |
2879 #endif | |
2880 ], [char *cs = nl_langinfo(CODESET);], | |
2881 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET), | |
2882 AC_MSG_RESULT(no)) | |
2883 | |
1621 | 2884 dnl Need various functions for floating point support. Only enable |
2885 dnl floating point when they are all present. | |
2886 AC_CHECK_LIB(m, strtod) | |
2887 AC_MSG_CHECKING([for strtod() and other floating point functions]) | |
2888 AC_TRY_LINK([ | |
2889 #ifdef HAVE_MATH_H | |
2890 # include <math.h> | |
2891 #endif | |
2892 #if STDC_HEADERS | |
2893 # include <stdlib.h> | |
2894 # include <stddef.h> | |
2895 #endif | |
2896 ], [char *s; double d; | |
2897 d = strtod("1.1", &s); | |
2898 d = fabs(1.11); | |
2899 d = ceil(1.11); | |
2900 d = floor(1.11); | |
2901 d = log10(1.11); | |
2902 d = pow(1.11, 2.22); | |
2903 d = sqrt(1.11); | |
2904 d = sin(1.11); | |
2905 d = cos(1.11); | |
2906 d = atan(1.11); | |
2907 ], | |
2908 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS), | |
2909 AC_MSG_RESULT(no)) | |
2910 | |
7 | 2911 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI |
2912 dnl when -lacl works, also try to use -lattr (required for Debian). | |
2913 AC_MSG_CHECKING(--disable-acl argument) | |
2914 AC_ARG_ENABLE(acl, | |
2915 [ --disable-acl Don't check for ACL support.], | |
2916 , [enable_acl="yes"]) | |
2917 if test "$enable_acl" = "yes"; then | |
2918 AC_MSG_RESULT(no) | |
2919 AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"], | |
2920 AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl" | |
2921 AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),) | |
2922 | |
2923 AC_MSG_CHECKING(for POSIX ACL support) | |
2924 AC_TRY_LINK([ | |
2925 #include <sys/types.h> | |
2926 #ifdef HAVE_SYS_ACL_H | |
2927 # include <sys/acl.h> | |
2928 #endif | |
2929 acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS); | |
2930 acl_set_file("foo", ACL_TYPE_ACCESS, acl); | |
2931 acl_free(acl);], | |
2932 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), | |
2933 AC_MSG_RESULT(no)) | |
2934 | |
2935 AC_MSG_CHECKING(for Solaris ACL support) | |
2936 AC_TRY_LINK([ | |
2937 #ifdef HAVE_SYS_ACL_H | |
2938 # include <sys/acl.h> | |
2939 #endif], [acl("foo", GETACLCNT, 0, NULL); | |
2940 ], | |
2941 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL), | |
2942 AC_MSG_RESULT(no)) | |
2943 | |
2944 AC_MSG_CHECKING(for AIX ACL support) | |
2945 AC_TRY_LINK([ | |
1621 | 2946 #if STDC_HEADERS |
2947 # include <stdlib.h> | |
2948 # include <stddef.h> | |
2949 #endif | |
7 | 2950 #ifdef HAVE_SYS_ACL_H |
2951 # include <sys/acl.h> | |
2952 #endif | |
2953 #ifdef HAVE_SYS_ACCESS_H | |
2954 # include <sys/access.h> | |
2955 #endif | |
2956 #define _ALL_SOURCE | |
2957 | |
2958 #include <sys/stat.h> | |
2959 | |
2960 int aclsize; | |
2961 struct acl *aclent;], [aclsize = sizeof(struct acl); | |
2962 aclent = (void *)malloc(aclsize); | |
2963 statacl("foo", STX_NORMAL, aclent, aclsize); | |
2964 ], | |
2965 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL), | |
2966 AC_MSG_RESULT(no)) | |
2967 else | |
2968 AC_MSG_RESULT(yes) | |
2969 fi | |
2970 | |
2971 AC_MSG_CHECKING(--disable-gpm argument) | |
2972 AC_ARG_ENABLE(gpm, | |
2973 [ --disable-gpm Don't use gpm (Linux mouse daemon).], , | |
2974 [enable_gpm="yes"]) | |
2975 | |
2976 if test "$enable_gpm" = "yes"; then | |
2977 AC_MSG_RESULT(no) | |
2978 dnl Checking if gpm support can be compiled | |
2979 AC_CACHE_CHECK([for gpm], vi_cv_have_gpm, | |
2980 [olibs="$LIBS" ; LIBS="-lgpm"] | |
2981 AC_TRY_LINK( | |
2982 [#include <gpm.h> | |
2983 #include <linux/keyboard.h>], | |
2984 [Gpm_GetLibVersion(NULL);], | |
2985 dnl Configure defines HAVE_GPM, if it is defined feature.h defines | |
2986 dnl FEAT_MOUSE_GPM if mouse support is included | |
2987 [vi_cv_have_gpm=yes], | |
2988 [vi_cv_have_gpm=no]) | |
2989 [LIBS="$olibs"] | |
2990 ) | |
2991 if test $vi_cv_have_gpm = yes; then | |
2992 LIBS="$LIBS -lgpm" | |
2993 AC_DEFINE(HAVE_GPM) | |
2994 fi | |
2995 else | |
2996 AC_MSG_RESULT(yes) | |
2997 fi | |
2998 | |
1621 | 2999 AC_MSG_CHECKING(--disable-sysmouse argument) |
3000 AC_ARG_ENABLE(sysmouse, | |
3001 [ --disable-sysmouse Don't use sysmouse (mouse in *BSD console).], , | |
3002 [enable_sysmouse="yes"]) | |
3003 | |
3004 if test "$enable_sysmouse" = "yes"; then | |
3005 AC_MSG_RESULT(no) | |
3006 dnl Checking if sysmouse support can be compiled | |
3007 dnl Configure defines HAVE_SYSMOUSE, if it is defined feature.h | |
3008 dnl defines FEAT_SYSMOUSE if mouse support is included | |
3009 AC_CACHE_CHECK([for sysmouse], vi_cv_have_sysmouse, | |
3010 AC_TRY_LINK( | |
3011 [#include <sys/consio.h> | |
3012 #include <signal.h> | |
3013 #include <sys/fbio.h>], | |
3014 [struct mouse_info mouse; | |
3015 mouse.operation = MOUSE_MODE; | |
3016 mouse.operation = MOUSE_SHOW; | |
3017 mouse.u.mode.mode = 0; | |
3018 mouse.u.mode.signal = SIGUSR2;], | |
3019 [vi_cv_have_sysmouse=yes], | |
3020 [vi_cv_have_sysmouse=no]) | |
3021 ) | |
3022 if test $vi_cv_have_sysmouse = yes; then | |
3023 AC_DEFINE(HAVE_SYSMOUSE) | |
3024 fi | |
3025 else | |
3026 AC_MSG_RESULT(yes) | |
3027 fi | |
3028 | |
2003 | 3029 dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known |
3030 AC_MSG_CHECKING(for FD_CLOEXEC) | |
3031 AC_TRY_COMPILE( | |
3032 [#if HAVE_FCNTL_H | |
3033 # include <fcntl.h> | |
3034 #endif], | |
3035 [ int flag = FD_CLOEXEC;], | |
3036 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC), | |
3037 AC_MSG_RESULT(not usable)) | |
3038 | |
7 | 3039 dnl rename needs to be checked separately to work on Nextstep with cc |
3040 AC_MSG_CHECKING(for rename) | |
3041 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")], | |
3042 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), | |
3043 AC_MSG_RESULT(no)) | |
3044 | |
3045 dnl sysctl() may exist but not the arguments we use | |
3046 AC_MSG_CHECKING(for sysctl) | |
3047 AC_TRY_COMPILE( | |
3048 [#include <sys/types.h> | |
3049 #include <sys/sysctl.h>], | |
3050 [ int mib[2], r; | |
3051 size_t len; | |
3052 | |
3053 mib[0] = CTL_HW; | |
3054 mib[1] = HW_USERMEM; | |
3055 len = sizeof(r); | |
3056 (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0); | |
3057 ], | |
3058 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL), | |
3059 AC_MSG_RESULT(not usable)) | |
3060 | |
3061 dnl sysinfo() may exist but not be Linux compatible | |
3062 AC_MSG_CHECKING(for sysinfo) | |
3063 AC_TRY_COMPILE( | |
3064 [#include <sys/types.h> | |
3065 #include <sys/sysinfo.h>], | |
3066 [ struct sysinfo sinfo; | |
3067 int t; | |
3068 | |
3069 (void)sysinfo(&sinfo); | |
3070 t = sinfo.totalram; | |
3071 ], | |
3072 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO), | |
3073 AC_MSG_RESULT(not usable)) | |
3074 | |
1110 | 3075 dnl struct sysinfo may have the mem_unit field or not |
3076 AC_MSG_CHECKING(for sysinfo.mem_unit) | |
3077 AC_TRY_COMPILE( | |
3078 [#include <sys/types.h> | |
3079 #include <sys/sysinfo.h>], | |
3080 [ struct sysinfo sinfo; | |
3081 sinfo.mem_unit = 1; | |
3082 ], | |
3083 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), | |
3084 AC_MSG_RESULT(no)) | |
3085 | |
7 | 3086 dnl sysconf() may exist but not support what we want to use |
3087 AC_MSG_CHECKING(for sysconf) | |
3088 AC_TRY_COMPILE( | |
3089 [#include <unistd.h>], | |
3090 [ (void)sysconf(_SC_PAGESIZE); | |
3091 (void)sysconf(_SC_PHYS_PAGES); | |
3092 ], | |
3093 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF), | |
3094 AC_MSG_RESULT(not usable)) | |
3095 | |
2241
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3096 AC_CHECK_SIZEOF([int]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3097 AC_CHECK_SIZEOF([long]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3098 AC_CHECK_SIZEOF([time_t]) |
60da25e3aab7
Correct use of long instead of off_t for file size. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2232
diff
changeset
|
3099 AC_CHECK_SIZEOF([off_t]) |
2232
2e6906bbc5f4
A few more fixes for undo file. Split test in two parts so that it doesn't
Bram Moolenaar <bram@vim.org>
parents:
2200
diff
changeset
|
3100 |
2199
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3101 dnl Make sure that uint32_t is really 32 bits unsigned. |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3102 AC_MSG_CHECKING([uint32_t is 32 bits]) |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3103 AC_TRY_RUN([ |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3104 #ifdef HAVE_STDINT_H |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3105 # include <stdint.h> |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3106 #endif |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3107 #ifdef HAVE_INTTYPES_H |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3108 # include <inttypes.h> |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3109 #endif |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3110 main() { |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3111 uint32_t nr1 = (uint32_t)-1; |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3112 uint32_t nr2 = (uint32_t)0xffffffffUL; |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3113 if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3114 exit(0); |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3115 }], |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3116 AC_MSG_RESULT(ok), |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3117 AC_MSG_ERROR([WRONG! uint32_t not defined correctly.]), |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3118 AC_MSG_ERROR([could not compile program using uint32_t.])) |
014a996ac896
Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3119 |
1621 | 3120 dnl Check for memmove() before bcopy(), makes memmove() be used when both are |
3121 dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. | |
3122 | |
7 | 3123 [bcopy_test_prog=' |
1621 | 3124 #include "confdefs.h" |
3125 #ifdef HAVE_STRING_H | |
3126 # include <string.h> | |
3127 #endif | |
3128 #if STDC_HEADERS | |
3129 # include <stdlib.h> | |
3130 # include <stddef.h> | |
3131 #endif | |
7 | 3132 main() { |
3133 char buf[10]; | |
3134 strcpy(buf, "abcdefghi"); | |
3135 mch_memmove(buf, buf + 2, 3); | |
3136 if (strncmp(buf, "ababcf", 6)) | |
3137 exit(1); | |
3138 strcpy(buf, "abcdefghi"); | |
3139 mch_memmove(buf + 2, buf, 3); | |
3140 if (strncmp(buf, "cdedef", 6)) | |
3141 exit(1); | |
3142 exit(0); /* libc version works properly. */ | |
3143 }'] | |
3144 | |
1621 | 3145 AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap], |
3146 [ | |
3147 AC_RUN_IFELSE([[#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog]], | |
3148 [ | |
3149 vim_cv_memmove_handles_overlap=yes | |
3150 ],[ | |
3151 vim_cv_memmove_handles_overlap=no | |
3152 ],[ | |
3153 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap') | |
3154 ]) | |
3155 ]) | |
7 | 3156 |
1621 | 3157 if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then |
3158 AC_DEFINE(USEMEMMOVE) | |
3159 else | |
3160 AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap], | |
3161 [ | |
3162 AC_RUN_IFELSE([[#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog]], | |
3163 [ | |
3164 vim_cv_bcopy_handles_overlap=yes | |
3165 ],[ | |
3166 vim_cv_bcopy_handles_overlap=no | |
3167 ],[ | |
3168 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap') | |
3169 ]) | |
3170 ]) | |
3171 | |
3172 if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then | |
3173 AC_DEFINE(USEBCOPY) | |
3174 else | |
3175 AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap], | |
3176 [ | |
3177 AC_RUN_IFELSE([[#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog]], | |
3178 [ | |
3179 vim_cv_memcpy_handles_overlap=yes | |
3180 ],[ | |
3181 vim_cv_memcpy_handles_overlap=no | |
3182 ],[ | |
3183 AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap') | |
3184 ]) | |
3185 ]) | |
3186 | |
3187 if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then | |
3188 AC_DEFINE(USEMEMCPY) | |
3189 fi | |
3190 fi | |
3191 fi | |
3192 | |
7 | 3193 |
3194 dnl Check for multibyte locale functions | |
3195 dnl Find out if _Xsetlocale() is supported by libX11. | |
3196 dnl Check if X_LOCALE should be defined. | |
3197 | |
3198 if test "$enable_multibyte" = "yes"; then | |
3199 cflags_save=$CFLAGS | |
3200 ldflags_save=$LDFLAGS | |
1861 | 3201 if test "x$x_includes" != "xNONE" ; then |
7 | 3202 CFLAGS="$CFLAGS -I$x_includes" |
3203 LDFLAGS="$X_LIBS $LDFLAGS -lX11" | |
3204 AC_MSG_CHECKING(whether X_LOCALE needed) | |
3205 AC_TRY_COMPILE([#include <X11/Xlocale.h>],, | |
3206 AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes) | |
3207 AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)), | |
3208 AC_MSG_RESULT(no)) | |
3209 fi | |
3210 CFLAGS=$cflags_save | |
3211 LDFLAGS=$ldflags_save | |
3212 fi | |
3213 | |
3214 dnl Link with xpg4, it is said to make Korean locale working | |
3215 AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,) | |
3216 | |
1871 | 3217 dnl Check how we can run ctags. Default to "ctags" when nothing works. |
7 | 3218 dnl --version for Exuberant ctags (preferred) |
834 | 3219 dnl Add --fields=+S to get function signatures for omni completion. |
7 | 3220 dnl -t for typedefs (many ctags have this) |
3221 dnl -s for static functions (Elvis ctags only?) | |
3222 dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'. | |
3223 dnl -i+m to test for older Exuberant ctags | |
3224 AC_MSG_CHECKING(how to create tags) | |
3225 test -f tags && mv tags tags.save | |
3226 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then | |
834 | 3227 TAGPRG="ctags -I INIT+ --fields=+S" |
7 | 3228 else |
1871 | 3229 TAGPRG="ctags" |
7 | 3230 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags" |
3231 (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c" | |
3232 (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags" | |
3233 (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t" | |
3234 (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts" | |
3235 (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs" | |
3236 (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m" | |
3237 fi | |
3238 test -f tags.save && mv tags.save tags | |
3239 AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG) | |
3240 | |
3241 dnl Check how we can run man with a section number | |
3242 AC_MSG_CHECKING(how to run man with a section nr) | |
3243 MANDEF="man" | |
1531 | 3244 (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s" |
7 | 3245 AC_MSG_RESULT($MANDEF) |
3246 if test "$MANDEF" = "man -s"; then | |
3247 AC_DEFINE(USEMAN_S) | |
3248 fi | |
3249 | |
3250 dnl Check if gettext() is working and if it needs -lintl | |
3251 AC_MSG_CHECKING(--disable-nls argument) | |
3252 AC_ARG_ENABLE(nls, | |
3253 [ --disable-nls Don't support NLS (gettext()).], , | |
3254 [enable_nls="yes"]) | |
3255 | |
3256 if test "$enable_nls" = "yes"; then | |
3257 AC_MSG_RESULT(no) | |
282 | 3258 |
3259 INSTALL_LANGS=install-languages | |
3260 AC_SUBST(INSTALL_LANGS) | |
3261 INSTALL_TOOL_LANGS=install-tool-languages | |
3262 AC_SUBST(INSTALL_TOOL_LANGS) | |
3263 | |
7 | 3264 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, ) |
3265 AC_MSG_CHECKING([for NLS]) | |
3266 if test -f po/Makefile; then | |
3267 have_gettext="no" | |
3268 if test -n "$MSGFMT"; then | |
3269 AC_TRY_LINK( | |
3270 [#include <libintl.h>], | |
3271 [gettext("Test");], | |
3272 AC_MSG_RESULT([gettext() works]); have_gettext="yes", | |
3273 olibs=$LIBS | |
3274 LIBS="$LIBS -lintl" | |
3275 AC_TRY_LINK( | |
3276 [#include <libintl.h>], | |
3277 [gettext("Test");], | |
3278 AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes", | |
3279 AC_MSG_RESULT([gettext() doesn't work]); | |
3280 LIBS=$olibs)) | |
3281 else | |
3282 AC_MSG_RESULT([msgfmt not found - disabled]); | |
3283 fi | |
3284 if test $have_gettext = "yes"; then | |
3285 AC_DEFINE(HAVE_GETTEXT) | |
3286 MAKEMO=yes | |
3287 AC_SUBST(MAKEMO) | |
3288 dnl this was added in GNU gettext 0.10.36 | |
3289 AC_CHECK_FUNCS(bind_textdomain_codeset) | |
3290 dnl _nl_msg_cat_cntr is required for GNU gettext | |
3291 AC_MSG_CHECKING([for _nl_msg_cat_cntr]) | |
3292 AC_TRY_LINK( | |
3293 [#include <libintl.h> | |
3294 extern int _nl_msg_cat_cntr;], | |
3295 [++_nl_msg_cat_cntr;], | |
3296 AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR), | |
3297 AC_MSG_RESULT([no])) | |
3298 fi | |
3299 else | |
3300 AC_MSG_RESULT([no "po/Makefile" - disabled]); | |
3301 fi | |
3302 else | |
3303 AC_MSG_RESULT(yes) | |
3304 fi | |
3305 | |
3306 dnl Check for dynamic linking loader | |
3307 AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)]) | |
3308 if test x${DLL} = xdlfcn.h; then | |
3309 AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ]) | |
3310 AC_MSG_CHECKING([for dlopen()]) | |
3311 AC_TRY_LINK(,[ | |
3312 extern void* dlopen(); | |
3313 dlopen(); | |
3314 ], | |
3315 AC_MSG_RESULT(yes); | |
3316 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), | |
3317 AC_MSG_RESULT(no); | |
3318 AC_MSG_CHECKING([for dlopen() in -ldl]) | |
3319 olibs=$LIBS | |
3320 LIBS="$LIBS -ldl" | |
3321 AC_TRY_LINK(,[ | |
3322 extern void* dlopen(); | |
3323 dlopen(); | |
3324 ], | |
3325 AC_MSG_RESULT(yes); | |
3326 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]), | |
3327 AC_MSG_RESULT(no); | |
3328 LIBS=$olibs)) | |
3329 dnl ReliantUNIX has dlopen() in libc but everything else in libdl | |
3330 dnl ick :-) | |
3331 AC_MSG_CHECKING([for dlsym()]) | |
3332 AC_TRY_LINK(,[ | |
3333 extern void* dlsym(); | |
3334 dlsym(); | |
3335 ], | |
3336 AC_MSG_RESULT(yes); | |
3337 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), | |
3338 AC_MSG_RESULT(no); | |
3339 AC_MSG_CHECKING([for dlsym() in -ldl]) | |
3340 olibs=$LIBS | |
3341 LIBS="$LIBS -ldl" | |
3342 AC_TRY_LINK(,[ | |
3343 extern void* dlsym(); | |
3344 dlsym(); | |
3345 ], | |
3346 AC_MSG_RESULT(yes); | |
3347 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]), | |
3348 AC_MSG_RESULT(no); | |
3349 LIBS=$olibs)) | |
3350 elif test x${DLL} = xdl.h; then | |
3351 AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ]) | |
3352 AC_MSG_CHECKING([for shl_load()]) | |
3353 AC_TRY_LINK(,[ | |
3354 extern void* shl_load(); | |
3355 shl_load(); | |
3356 ], | |
3357 AC_MSG_RESULT(yes); | |
3358 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), | |
3359 AC_MSG_RESULT(no); | |
3360 AC_MSG_CHECKING([for shl_load() in -ldld]) | |
3361 olibs=$LIBS | |
3362 LIBS="$LIBS -ldld" | |
3363 AC_TRY_LINK(,[ | |
3364 extern void* shl_load(); | |
3365 shl_load(); | |
3366 ], | |
3367 AC_MSG_RESULT(yes); | |
3368 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]), | |
3369 AC_MSG_RESULT(no); | |
3370 LIBS=$olibs)) | |
3371 fi | |
3372 AC_CHECK_HEADERS(setjmp.h) | |
3373 | |
3374 if test "x$MACOSX" = "xyes" -a -n "$PERL"; then | |
3375 dnl -ldl must come after DynaLoader.a | |
3376 if echo $LIBS | grep -e '-ldl' >/dev/null; then | |
3377 LIBS=`echo $LIBS | sed s/-ldl//` | |
3378 PERL_LIBS="$PERL_LIBS -ldl" | |
3379 fi | |
3380 fi | |
3381 | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3382 if test "x$MACOSX" = "xyes"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3383 AC_MSG_CHECKING(whether we need -framework Cocoa) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3384 dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3385 dnl disabled during tiny build) |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3386 if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then |
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3387 LIBS=$"$LIBS -framework Cocoa" |
7 | 3388 AC_MSG_RESULT(yes) |
3389 else | |
3390 AC_MSG_RESULT(no) | |
3391 fi | |
3392 fi | |
2309
543ea69d037f
Add clipboard support in Mac console. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents:
2303
diff
changeset
|
3393 if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then |
2110
0f552ca271c2
updated for version 7.2.393
Bram Moolenaar <bram@zimbu.org>
parents:
2087
diff
changeset
|
3394 LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" |
697 | 3395 fi |
7 | 3396 |
548 | 3397 dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to |
3398 dnl use "-isystem" instead of "-I" for all non-Vim include dirs. | |
3399 dnl But only when making dependencies, cproto and lint don't take "-isystem". | |
685 | 3400 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow |
3401 dnl the number before the version number. | |
548 | 3402 DEPEND_CFLAGS_FILTER= |
3403 if test "$GCC" = yes; then | |
1747 | 3404 AC_MSG_CHECKING(for GCC 3 or later) |
804 | 3405 gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'` |
671 | 3406 if test "$gccmajor" -gt "2"; then |
548 | 3407 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'" |
1747 | 3408 AC_MSG_RESULT(yes) |
3409 else | |
3410 AC_MSG_RESULT(no) | |
548 | 3411 fi |
1747 | 3412 dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is |
3413 dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. | |
2019 | 3414 dnl Also remove duplicate _FORTIFY_SOURCE arguments. |
1747 | 3415 AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) |
3416 if test "$gccmajor" -gt "3"; then | |
2019 | 3417 CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -D_FORTIFY_SOURCE=1/'` |
1747 | 3418 AC_MSG_RESULT(yes) |
3419 else | |
3420 AC_MSG_RESULT(no) | |
3421 fi | |
557 | 3422 fi |
548 | 3423 AC_SUBST(DEPEND_CFLAGS_FILTER) |
7 | 3424 |
3425 dnl write output files | |
3426 AC_OUTPUT(auto/config.mk:config.mk.in) | |
3427 | |
3428 dnl vim: set sw=2 tw=78 fo+=l: |