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