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