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