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`
|
|
1481 $1
|
|
1482 else
|
|
1483 AC_MSG_RESULT(not found)
|
|
1484 if test "x$2" = xfail; then
|
|
1485 AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
|
|
1486 fi
|
|
1487 fi
|
|
1488 }
|
|
1489 elif test "x$want_gnome" = xyes; then
|
|
1490 {
|
|
1491 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
|
|
1492 if test "$GNOME_CONFIG" = "no"; then
|
|
1493 no_gnome_config="yes"
|
|
1494 else
|
|
1495 AC_MSG_CHECKING(if $GNOME_CONFIG works)
|
|
1496 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
|
|
1497 AC_MSG_RESULT(yes)
|
|
1498 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
|
|
1499 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
|
|
1500 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
|
|
1501 $1
|
|
1502 else
|
|
1503 AC_MSG_RESULT(no)
|
|
1504 no_gnome_config="yes"
|
|
1505 fi
|
|
1506 fi
|
|
1507
|
|
1508 if test x$exec_prefix = xNONE; then
|
|
1509 if test x$prefix = xNONE; then
|
|
1510 gnome_prefix=$ac_default_prefix/lib
|
|
1511 else
|
|
1512 gnome_prefix=$prefix/lib
|
|
1513 fi
|
|
1514 else
|
|
1515 gnome_prefix=`eval echo \`echo $libdir\``
|
|
1516 fi
|
|
1517
|
|
1518 if test "$no_gnome_config" = "yes"; then
|
|
1519 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
|
|
1520 if test -f $gnome_prefix/gnomeConf.sh; then
|
|
1521 AC_MSG_RESULT(found)
|
|
1522 echo "loading gnome configuration from" \
|
|
1523 "$gnome_prefix/gnomeConf.sh"
|
|
1524 . $gnome_prefix/gnomeConf.sh
|
|
1525 $1
|
|
1526 else
|
|
1527 AC_MSG_RESULT(not found)
|
|
1528 if test x$2 = xfail; then
|
|
1529 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
|
|
1530 fi
|
|
1531 fi
|
|
1532 fi
|
|
1533 }
|
|
1534 fi
|
|
1535 ])
|
|
1536
|
|
1537 AC_DEFUN([GNOME_INIT],[
|
|
1538 GNOME_INIT_HOOK([],fail)
|
|
1539 ])
|
|
1540
|
|
1541
|
|
1542 dnl ---------------------------------------------------------------------------
|
|
1543 dnl Check for GTK. First checks for gtk-config, cause it needs that to get the
|
|
1544 dnl correct compiler flags. Then checks for GTK 1.1.16. If that fails, then
|
|
1545 dnl it checks for 1.0.6. If both fail, then continue on for Motif as before...
|
|
1546 dnl ---------------------------------------------------------------------------
|
|
1547 if test -z "$SKIP_GTK"; then
|
|
1548
|
|
1549 AC_MSG_CHECKING(--with-gtk-prefix argument)
|
|
1550 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
|
|
1551 gtk_config_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
|
|
1552 gtk_config_prefix=""; AC_MSG_RESULT(no))
|
|
1553
|
|
1554 AC_MSG_CHECKING(--with-gtk-exec-prefix argument)
|
|
1555 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
|
|
1556 gtk_config_exec_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
|
|
1557 gtk_config_exec_prefix=""; AC_MSG_RESULT(no))
|
|
1558
|
|
1559 AC_MSG_CHECKING(--disable-gtktest argument)
|
|
1560 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
|
|
1561 , enable_gtktest=yes)
|
|
1562 if test "x$enable_gtktest" = "xyes" ; then
|
|
1563 AC_MSG_RESULT(gtk test enabled)
|
|
1564 else
|
|
1565 AC_MSG_RESULT(gtk test disabled)
|
|
1566 fi
|
|
1567
|
|
1568 if test "x$gtk_config_prefix" != "x" ; then
|
|
1569 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
|
|
1570 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
|
|
1571 fi
|
|
1572 if test "x$gtk_config_exec_prefix" != "x" ; then
|
|
1573 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
|
|
1574 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
|
|
1575 fi
|
|
1576 if test "X$GTK_CONFIG" = "X"; then
|
|
1577 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
|
|
1578 if test "X$GTK_CONFIG" = "Xno"; then
|
|
1579 dnl Some distributions call it gtk12-config, annoying!
|
|
1580 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no)
|
|
1581 GTK_CONFIG="$GTK12_CONFIG"
|
|
1582 fi
|
|
1583 else
|
|
1584 AC_MSG_RESULT(Using GTK configuration program $GTK_CONFIG)
|
|
1585 fi
|
|
1586 if test "X$PKG_CONFIG" = "X"; then
|
|
1587 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
|
1588 fi
|
|
1589
|
|
1590 if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
|
|
1591 dnl First try finding version 2.2.0 or later. The 2.0.x series has
|
|
1592 dnl problems (bold fonts, --remote doesn't work).
|
|
1593 if test "X$SKIP_GTK2" != "XYES"; then
|
|
1594 AM_PATH_GTK(2.2.0,
|
29
|
1595 [GUI_LIB_LOC="$GTK_LIBDIR"
|
|
1596 GTK_LIBNAME="$GTK_LIBS"
|
7
|
1597 GUI_INC_LOC="$GTK_CFLAGS"], )
|
|
1598 if test "x$GTK_CFLAGS" != "x"; then
|
|
1599 SKIP_ATHENA=YES
|
|
1600 SKIP_NEXTAW=YES
|
|
1601 SKIP_MOTIF=YES
|
|
1602 GUITYPE=GTK
|
|
1603 AC_SUBST(GTK_LIBNAME)
|
|
1604 fi
|
|
1605 fi
|
|
1606
|
|
1607 dnl If there is no 2.2.0 or later try the 1.x.x series. We require at
|
|
1608 dnl least GTK 1.1.16. 1.0.6 doesn't work. 1.1.1 to 1.1.15
|
|
1609 dnl were test versions.
|
|
1610 if test "x$GUITYPE" != "xGTK"; then
|
|
1611 SKIP_GTK2=YES
|
|
1612 AM_PATH_GTK(1.1.16,
|
|
1613 [GTK_LIBNAME="$GTK_LIBS"
|
|
1614 GUI_INC_LOC="$GTK_CFLAGS"], )
|
|
1615 if test "x$GTK_CFLAGS" != "x"; then
|
|
1616 SKIP_ATHENA=YES
|
|
1617 SKIP_NEXTAW=YES
|
|
1618 SKIP_MOTIF=YES
|
|
1619 GUITYPE=GTK
|
|
1620 AC_SUBST(GTK_LIBNAME)
|
|
1621 fi
|
|
1622 fi
|
|
1623 fi
|
|
1624 dnl Give a warning if GTK is older than 1.2.3
|
|
1625 if test "x$GUITYPE" = "xGTK"; then
|
|
1626 if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
|
|
1627 -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
|
|
1628 AC_MSG_RESULT(this GTK version is old; version 1.2.3 or later is recommended)
|
|
1629 else
|
|
1630 {
|
|
1631 if test "0$gtk_major_version" -ge 2; then
|
|
1632 AC_DEFINE(HAVE_GTK2)
|
|
1633 if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|
|
1634 || test "0$gtk_minor_version" -ge 2 \
|
|
1635 || test "0$gtk_major_version" -gt 2; then
|
|
1636 AC_DEFINE(HAVE_GTK_MULTIHEAD)
|
|
1637 fi
|
|
1638 fi
|
|
1639 dnl
|
|
1640 dnl if GTK exists, and it's not the 1.0.x series, then check for GNOME.
|
|
1641 dnl
|
|
1642 if test -z "$SKIP_GNOME"; then
|
|
1643 {
|
|
1644 GNOME_INIT_HOOK([have_gnome=yes])
|
|
1645 if test x$have_gnome = xyes ; then
|
|
1646 AC_DEFINE(FEAT_GUI_GNOME)
|
|
1647 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
|
|
1648 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
|
|
1649 fi
|
|
1650 }
|
|
1651 fi
|
|
1652 }
|
|
1653 fi
|
|
1654 fi
|
|
1655 fi
|
|
1656
|
|
1657 dnl Check for Motif include files location.
|
|
1658 dnl The LAST one found is used, this makes the highest version to be used,
|
|
1659 dnl e.g. when Motif1.2 and Motif2.0 are both present.
|
|
1660
|
|
1661 if test -z "$SKIP_MOTIF"; then
|
|
1662 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"
|
|
1663 dnl Remove "-I" from before $GUI_INC_LOC if it's there
|
|
1664 GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
|
|
1665
|
|
1666 AC_MSG_CHECKING(for location of Motif GUI includes)
|
|
1667 gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
|
|
1668 GUI_INC_LOC=
|
|
1669 for try in $gui_includes; do
|
|
1670 if test -f "$try/Xm/Xm.h"; then
|
|
1671 GUI_INC_LOC=$try
|
|
1672 fi
|
|
1673 done
|
|
1674 if test -n "$GUI_INC_LOC"; then
|
|
1675 if test "$GUI_INC_LOC" = /usr/include; then
|
|
1676 GUI_INC_LOC=
|
|
1677 AC_MSG_RESULT(in default path)
|
|
1678 else
|
|
1679 AC_MSG_RESULT($GUI_INC_LOC)
|
|
1680 fi
|
|
1681 else
|
|
1682 AC_MSG_RESULT(<not found>)
|
|
1683 SKIP_MOTIF=YES
|
|
1684 fi
|
|
1685 fi
|
|
1686
|
|
1687 dnl Check for Motif library files location. In the same order as the include
|
|
1688 dnl files, to avoid a mixup if several versions are present
|
|
1689
|
|
1690 if test -z "$SKIP_MOTIF"; then
|
|
1691 AC_MSG_CHECKING(--with-motif-lib argument)
|
|
1692 AC_ARG_WITH(motif-lib,
|
|
1693 [ --with-motif-lib=STRING Library for Motif ],
|
|
1694 [ MOTIF_LIBNAME="${withval}" ] )
|
|
1695
|
|
1696 if test -n "$MOTIF_LIBNAME"; then
|
|
1697 AC_MSG_RESULT($MOTIF_LIBNAME)
|
|
1698 GUI_LIB_LOC=
|
|
1699 else
|
|
1700 AC_MSG_RESULT(no)
|
|
1701
|
|
1702 dnl Remove "-L" from before $GUI_LIB_LOC if it's there
|
|
1703 GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
|
|
1704
|
|
1705 AC_MSG_CHECKING(for location of Motif GUI libs)
|
|
1706 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"
|
|
1707 GUI_LIB_LOC=
|
|
1708 for try in $gui_libs; do
|
14
|
1709 for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do
|
7
|
1710 if test -f "$libtry"; then
|
|
1711 GUI_LIB_LOC=$try
|
|
1712 fi
|
|
1713 done
|
|
1714 done
|
|
1715 if test -n "$GUI_LIB_LOC"; then
|
|
1716 dnl Remove /usr/lib, it causes trouble on some systems
|
|
1717 if test "$GUI_LIB_LOC" = /usr/lib; then
|
|
1718 GUI_LIB_LOC=
|
|
1719 AC_MSG_RESULT(in default path)
|
|
1720 else
|
|
1721 if test -n "$GUI_LIB_LOC"; then
|
|
1722 AC_MSG_RESULT($GUI_LIB_LOC)
|
|
1723 if test "`(uname) 2>/dev/null`" = SunOS &&
|
|
1724 uname -r | grep '^5' >/dev/null; then
|
|
1725 GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
|
|
1726 fi
|
|
1727 fi
|
|
1728 fi
|
|
1729 MOTIF_LIBNAME=-lXm
|
|
1730 else
|
|
1731 AC_MSG_RESULT(<not found>)
|
|
1732 SKIP_MOTIF=YES
|
|
1733 fi
|
|
1734 fi
|
|
1735 fi
|
|
1736
|
|
1737 if test -z "$SKIP_MOTIF"; then
|
|
1738 SKIP_ATHENA=YES
|
|
1739 SKIP_NEXTAW=YES
|
|
1740 GUITYPE=MOTIF
|
|
1741 AC_SUBST(MOTIF_LIBNAME)
|
|
1742 fi
|
|
1743
|
|
1744 dnl Check if the Athena files can be found
|
|
1745
|
|
1746 GUI_X_LIBS=
|
|
1747
|
|
1748 if test -z "$SKIP_ATHENA"; then
|
|
1749 AC_MSG_CHECKING(if Athena header files can be found)
|
|
1750 cflags_save=$CFLAGS
|
|
1751 CFLAGS="$CFLAGS $X_CFLAGS"
|
|
1752 AC_TRY_COMPILE([
|
|
1753 #include <X11/Intrinsic.h>
|
|
1754 #include <X11/Xaw/Paned.h>], ,
|
|
1755 AC_MSG_RESULT(yes),
|
|
1756 AC_MSG_RESULT(no); SKIP_ATHENA=YES )
|
|
1757 CFLAGS=$cflags_save
|
|
1758 fi
|
|
1759
|
|
1760 if test -z "$SKIP_ATHENA"; then
|
|
1761 GUITYPE=ATHENA
|
|
1762 fi
|
|
1763
|
|
1764 if test -z "$SKIP_NEXTAW"; then
|
|
1765 AC_MSG_CHECKING(if neXtaw header files can be found)
|
|
1766 cflags_save=$CFLAGS
|
|
1767 CFLAGS="$CFLAGS $X_CFLAGS"
|
|
1768 AC_TRY_COMPILE([
|
|
1769 #include <X11/Intrinsic.h>
|
|
1770 #include <X11/neXtaw/Paned.h>], ,
|
|
1771 AC_MSG_RESULT(yes),
|
|
1772 AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
|
|
1773 CFLAGS=$cflags_save
|
|
1774 fi
|
|
1775
|
|
1776 if test -z "$SKIP_NEXTAW"; then
|
|
1777 GUITYPE=NEXTAW
|
|
1778 fi
|
|
1779
|
|
1780 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
|
|
1781 dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
|
|
1782 dnl Avoid adding it when it twice
|
|
1783 if test -n "$GUI_INC_LOC"; then
|
|
1784 GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
|
|
1785 fi
|
|
1786 if test -n "$GUI_LIB_LOC"; then
|
|
1787 GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
|
|
1788 fi
|
|
1789
|
|
1790 dnl Check for -lXext and then for -lXmu
|
|
1791 ldflags_save=$LDFLAGS
|
|
1792 LDFLAGS="$X_LIBS $LDFLAGS"
|
|
1793 AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
|
|
1794 [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
|
|
1795 dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
|
|
1796 AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
|
|
1797 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
|
|
1798 AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
|
|
1799 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
|
|
1800 AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
|
|
1801 [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
|
|
1802 if test -z "$SKIP_MOTIF"; then
|
|
1803 AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
|
|
1804 [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
|
|
1805 fi
|
|
1806 LDFLAGS=$ldflags_save
|
|
1807
|
|
1808 dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
|
|
1809 AC_MSG_CHECKING(for extra X11 defines)
|
|
1810 NARROW_PROTO=
|
|
1811 rm -fr conftestdir
|
|
1812 if mkdir conftestdir; then
|
|
1813 cd conftestdir
|
|
1814 cat > Imakefile <<'EOF'
|
|
1815 acfindx:
|
|
1816 @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
|
|
1817 EOF
|
|
1818 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
|
|
1819 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
|
|
1820 fi
|
|
1821 cd ..
|
|
1822 rm -fr conftestdir
|
|
1823 fi
|
|
1824 if test -z "$NARROW_PROTO"; then
|
|
1825 AC_MSG_RESULT(no)
|
|
1826 else
|
|
1827 AC_MSG_RESULT($NARROW_PROTO)
|
|
1828 fi
|
|
1829 AC_SUBST(NARROW_PROTO)
|
|
1830 fi
|
|
1831
|
|
1832 dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
|
|
1833 dnl use the X11 include path
|
|
1834 if test "$enable_xsmp" = "yes"; then
|
|
1835 cppflags_save=$CPPFLAGS
|
|
1836 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
1837 AC_CHECK_HEADERS(X11/SM/SMlib.h)
|
|
1838 CPPFLAGS=$cppflags_save
|
|
1839 fi
|
|
1840
|
|
1841
|
|
1842 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK"; then
|
|
1843 dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
|
|
1844 cppflags_save=$CPPFLAGS
|
|
1845 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
1846 AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
|
|
1847
|
|
1848 dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
|
|
1849 if test ! "$enable_xim" = "no"; then
|
|
1850 AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
|
|
1851 AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
|
|
1852 AC_MSG_RESULT(yes),
|
|
1853 AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no")
|
|
1854 fi
|
|
1855 CPPFLAGS=$cppflags_save
|
|
1856
|
|
1857 dnl automatically enable XIM when hangul input isn't enabled
|
|
1858 if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
|
|
1859 -a "x$GUITYPE" != "xNONE" ; then
|
|
1860 AC_MSG_RESULT(X GUI selected; xim has been enabled)
|
|
1861 enable_xim="yes"
|
|
1862 fi
|
|
1863 fi
|
|
1864
|
|
1865 if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
|
|
1866 cppflags_save=$CPPFLAGS
|
|
1867 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
148
|
1868 dnl Xmu/Editres.h may exist but can only be used after including Intrinsic.h
|
|
1869 AC_MSG_CHECKING([for X11/Xmu/Editres.h])
|
|
1870 AC_TRY_COMPILE([
|
|
1871 #include <X11/Intrinsic.h>
|
|
1872 #include <X11/Xmu/Editres.h>],
|
|
1873 [int i; i = 0;],
|
|
1874 AC_MSG_RESULT(yes)
|
|
1875 AC_DEFINE(HAVE_X11_XMU_EDITRES_H),
|
|
1876 AC_MSG_RESULT(no))
|
7
|
1877 CPPFLAGS=$cppflags_save
|
|
1878 fi
|
|
1879
|
|
1880 dnl Only use the Xm directory when compiling Motif, don't use it for Athena
|
|
1881 if test -z "$SKIP_MOTIF"; then
|
|
1882 cppflags_save=$CPPFLAGS
|
|
1883 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
148
|
1884 AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
|
|
1885 Xm/UnhighlightT.h)
|
7
|
1886 CPPFLAGS=$cppflags_save
|
|
1887 fi
|
|
1888
|
|
1889 if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
|
|
1890 AC_MSG_RESULT(no GUI selected; xim has been disabled)
|
|
1891 enable_xim="no"
|
|
1892 fi
|
|
1893 if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
|
|
1894 AC_MSG_RESULT(no GUI selected; fontset has been disabled)
|
|
1895 enable_fontset="no"
|
|
1896 fi
|
|
1897 if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
|
|
1898 AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
|
|
1899 enable_fontset="no"
|
|
1900 fi
|
|
1901
|
|
1902 if test -z "$SKIP_PHOTON"; then
|
|
1903 GUITYPE=PHOTONGUI
|
|
1904 fi
|
|
1905
|
|
1906 AC_SUBST(GUI_INC_LOC)
|
|
1907 AC_SUBST(GUI_LIB_LOC)
|
|
1908 AC_SUBST(GUITYPE)
|
|
1909 AC_SUBST(GUI_X_LIBS)
|
|
1910
|
|
1911 if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
|
|
1912 AC_MSG_ERROR([cannot use workshop without Motif])
|
|
1913 fi
|
|
1914
|
|
1915 dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
|
|
1916 if test "$enable_xim" = "yes"; then
|
|
1917 AC_DEFINE(FEAT_XIM)
|
|
1918 fi
|
|
1919 if test "$enable_fontset" = "yes"; then
|
|
1920 AC_DEFINE(FEAT_XFONTSET)
|
|
1921 fi
|
|
1922
|
|
1923
|
|
1924 dnl ---------------------------------------------------------------------------
|
|
1925 dnl end of GUI-checking
|
|
1926 dnl ---------------------------------------------------------------------------
|
|
1927
|
|
1928
|
|
1929 dnl Only really enable hangul input when GUI and XFONTSET are available
|
|
1930 if test "$enable_hangulinput" = "yes"; then
|
|
1931 if test "x$GUITYPE" = "xNONE"; then
|
|
1932 AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
|
|
1933 enable_hangulinput=no
|
|
1934 else
|
|
1935 AC_DEFINE(FEAT_HANGULIN)
|
|
1936 HANGULIN_SRC=hangulin.c
|
|
1937 AC_SUBST(HANGULIN_SRC)
|
|
1938 HANGULIN_OBJ=objects/hangulin.o
|
|
1939 AC_SUBST(HANGULIN_OBJ)
|
|
1940 fi
|
|
1941 fi
|
|
1942
|
|
1943 dnl Checks for libraries and include files.
|
|
1944
|
|
1945 AC_MSG_CHECKING(quality of toupper)
|
|
1946 AC_TRY_RUN([#include <ctype.h>
|
|
1947 main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }],
|
|
1948 AC_DEFINE(BROKEN_TOUPPER) AC_MSG_RESULT(bad),
|
|
1949 AC_MSG_RESULT(good), AC_MSG_ERROR(failed to compile test program))
|
|
1950
|
|
1951 AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
|
|
1952 AC_TRY_COMPILE(, [printf("(" __DATE__ " " __TIME__ ")");],
|
|
1953 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
|
|
1954 AC_MSG_RESULT(no))
|
|
1955
|
|
1956 dnl Checks for header files.
|
|
1957 AC_CHECK_HEADER(elf.h, HAS_ELF=1)
|
|
1958 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
|
|
1959 if test "$HAS_ELF" = 1; then
|
|
1960 AC_CHECK_LIB(elf, main)
|
|
1961 fi
|
|
1962
|
|
1963 AC_HEADER_DIRENT
|
|
1964
|
|
1965 dnl check for standard headers, we don't use this in Vim but other stuff
|
|
1966 dnl in autoconf needs it
|
|
1967 AC_HEADER_STDC
|
|
1968 AC_HEADER_SYS_WAIT
|
|
1969
|
|
1970 dnl If sys/wait.h is not found it might still exist but not be POSIX
|
|
1971 dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
|
|
1972 if test $ac_cv_header_sys_wait_h = no; then
|
|
1973 AC_MSG_CHECKING([for sys/wait.h that defines union wait])
|
|
1974 AC_TRY_COMPILE([#include <sys/wait.h>],
|
|
1975 [union wait xx, yy; xx = yy],
|
|
1976 AC_MSG_RESULT(yes)
|
|
1977 AC_DEFINE(HAVE_SYS_WAIT_H)
|
|
1978 AC_DEFINE(HAVE_UNION_WAIT),
|
|
1979 AC_MSG_RESULT(no))
|
|
1980 fi
|
|
1981
|
|
1982 AC_CHECK_HEADERS(stdarg.h stdlib.h string.h sys/select.h sys/utsname.h \
|
|
1983 termcap.h fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h \
|
|
1984 iconv.h langinfo.h unistd.h stropts.h errno.h \
|
|
1985 sys/resource.h sys/systeminfo.h locale.h \
|
|
1986 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
|
|
1987 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
|
132
|
1988 libgen.h util/debug.h util/msg18n.h frame.h \
|
258
|
1989 sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h wctype.h)
|
7
|
1990
|
132
|
1991 dnl pthread_np.h may exist but can only be used after including pthread.h
|
|
1992 AC_MSG_CHECKING([for pthread_np.h])
|
|
1993 AC_TRY_COMPILE([
|
|
1994 #include <pthread.h>
|
|
1995 #include <pthread_np.h>],
|
|
1996 [int i; i = 0;],
|
|
1997 AC_MSG_RESULT(yes)
|
|
1998 AC_DEFINE(HAVE_PTHREAD_NP_H),
|
|
1999 AC_MSG_RESULT(no))
|
|
2000
|
502
|
2001 AC_CHECK_HEADERS(strings.h)
|
574
|
2002 if test "x$MACOSX" = "xyes"; then
|
|
2003 dnl The strings.h file on OS/X contains a warning and nothing useful.
|
|
2004 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
|
|
2005 else
|
7
|
2006
|
|
2007 dnl Check if strings.h and string.h can both be included when defined.
|
|
2008 AC_MSG_CHECKING([if strings.h can be included after string.h])
|
|
2009 cppflags_save=$CPPFLAGS
|
|
2010 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
2011 AC_TRY_COMPILE([
|
|
2012 #if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
|
|
2013 # define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
|
|
2014 /* but don't do it on AIX 5.1 (Uribarri) */
|
|
2015 #endif
|
|
2016 #ifdef HAVE_XM_XM_H
|
|
2017 # include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
|
|
2018 #endif
|
|
2019 #ifdef HAVE_STRING_H
|
|
2020 # include <string.h>
|
|
2021 #endif
|
|
2022 #if defined(HAVE_STRINGS_H)
|
|
2023 # include <strings.h>
|
|
2024 #endif
|
|
2025 ], [int i; i = 0;],
|
|
2026 AC_MSG_RESULT(yes),
|
|
2027 AC_DEFINE(NO_STRINGS_WITH_STRING_H)
|
|
2028 AC_MSG_RESULT(no))
|
|
2029 CPPFLAGS=$cppflags_save
|
574
|
2030 fi
|
7
|
2031
|
|
2032 dnl Checks for typedefs, structures, and compiler characteristics.
|
|
2033 AC_PROG_GCC_TRADITIONAL
|
|
2034 AC_C_CONST
|
|
2035 AC_TYPE_MODE_T
|
|
2036 AC_TYPE_OFF_T
|
|
2037 AC_TYPE_PID_T
|
|
2038 AC_TYPE_SIZE_T
|
|
2039 AC_TYPE_UID_T
|
|
2040 AC_HEADER_TIME
|
|
2041 AC_CHECK_TYPE(ino_t, long)
|
|
2042 AC_CHECK_TYPE(dev_t, unsigned)
|
|
2043
|
|
2044 AC_MSG_CHECKING(for rlim_t)
|
|
2045 if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
|
|
2046 AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
|
|
2047 else
|
|
2048 AC_EGREP_CPP(dnl
|
|
2049 changequote(<<,>>)dnl
|
|
2050 <<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
|
|
2051 changequote([,]),
|
|
2052 [
|
|
2053 #include <sys/types.h>
|
|
2054 #if STDC_HEADERS
|
|
2055 #include <stdlib.h>
|
|
2056 #include <stddef.h>
|
|
2057 #endif
|
|
2058 #ifdef HAVE_SYS_RESOURCE_H
|
|
2059 #include <sys/resource.h>
|
|
2060 #endif
|
|
2061 ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
|
|
2062 AC_MSG_RESULT($ac_cv_type_rlim_t)
|
|
2063 fi
|
|
2064 if test $ac_cv_type_rlim_t = no; then
|
|
2065 cat >> confdefs.h <<\EOF
|
|
2066 #define rlim_t unsigned long
|
|
2067 EOF
|
|
2068 fi
|
|
2069
|
|
2070 AC_MSG_CHECKING(for stack_t)
|
|
2071 if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
|
|
2072 AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
|
|
2073 else
|
|
2074 AC_EGREP_CPP(stack_t,
|
|
2075 [
|
|
2076 #include <sys/types.h>
|
|
2077 #if STDC_HEADERS
|
|
2078 #include <stdlib.h>
|
|
2079 #include <stddef.h>
|
|
2080 #endif
|
|
2081 #include <signal.h>
|
|
2082 ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
|
|
2083 AC_MSG_RESULT($ac_cv_type_stack_t)
|
|
2084 fi
|
|
2085 if test $ac_cv_type_stack_t = no; then
|
|
2086 cat >> confdefs.h <<\EOF
|
|
2087 #define stack_t struct sigaltstack
|
|
2088 EOF
|
|
2089 fi
|
|
2090
|
|
2091 dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
|
|
2092 AC_MSG_CHECKING(whether stack_t has an ss_base field)
|
|
2093 AC_TRY_COMPILE([
|
|
2094 #include <sys/types.h>
|
|
2095 #if STDC_HEADERS
|
|
2096 #include <stdlib.h>
|
|
2097 #include <stddef.h>
|
|
2098 #endif
|
|
2099 #include <signal.h>
|
|
2100 #include "confdefs.h"
|
|
2101 ], [stack_t sigstk; sigstk.ss_base = 0; ],
|
|
2102 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
|
|
2103 AC_MSG_RESULT(no))
|
|
2104
|
|
2105 olibs="$LIBS"
|
|
2106 AC_MSG_CHECKING(--with-tlib argument)
|
|
2107 AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
|
|
2108 if test -n "$with_tlib"; then
|
|
2109 AC_MSG_RESULT($with_tlib)
|
|
2110 LIBS="$LIBS -l$with_tlib"
|
39
|
2111 AC_MSG_CHECKING(for linking with $with_tlib library)
|
|
2112 AC_TRY_LINK([], [], AC_MSG_RESULT(OK), AC_MSG_ERROR(FAILED))
|
|
2113 dnl Need to check for tgetent() below.
|
|
2114 olibs="$LIBS"
|
7
|
2115 else
|
39
|
2116 AC_MSG_RESULT([empty: automatic terminal library selection])
|
7
|
2117 dnl On HP-UX 10.10 termcap or termlib should be used instead of
|
|
2118 dnl curses, because curses is much slower.
|
|
2119 dnl Newer versions of ncurses are preferred over anything.
|
|
2120 dnl Older versions of ncurses have bugs, get a new one!
|
|
2121 dnl Digital Unix (OSF1) should use curses (Ronald Schild).
|
|
2122 case "`uname -s 2>/dev/null`" in
|
|
2123 OSF1) tlibs="ncurses curses termlib termcap";;
|
|
2124 *) tlibs="ncurses termlib termcap curses";;
|
|
2125 esac
|
|
2126 for libname in $tlibs; do
|
|
2127 AC_CHECK_LIB(${libname}, tgetent,,)
|
|
2128 if test "x$olibs" != "x$LIBS"; then
|
|
2129 dnl It's possible that a library is found but it doesn't work
|
|
2130 dnl e.g., shared library that cannot be found
|
|
2131 dnl compile and run a test program to be sure
|
|
2132 AC_TRY_RUN([
|
|
2133 #ifdef HAVE_TERMCAP_H
|
|
2134 # include <termcap.h>
|
|
2135 #endif
|
|
2136 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
|
|
2137 res="OK", res="FAIL", res="FAIL")
|
|
2138 if test "$res" = "OK"; then
|
|
2139 break
|
|
2140 fi
|
|
2141 AC_MSG_RESULT($libname library is not usable)
|
|
2142 LIBS="$olibs"
|
|
2143 fi
|
|
2144 done
|
39
|
2145 if test "x$olibs" = "x$LIBS"; then
|
|
2146 AC_MSG_RESULT(no terminal library found)
|
|
2147 fi
|
7
|
2148 fi
|
39
|
2149
|
|
2150 if test "x$olibs" = "x$LIBS"; then
|
|
2151 AC_MSG_CHECKING([for tgetent()])
|
282
|
2152 AC_TRY_LINK([],
|
39
|
2153 [char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
|
|
2154 AC_MSG_RESULT(yes),
|
|
2155 AC_MSG_ERROR([NOT FOUND!
|
|
2156 You need to install a terminal library; for example ncurses.
|
|
2157 Or specify the name of the library with --with-tlib.]))
|
|
2158 fi
|
|
2159
|
|
2160 AC_MSG_CHECKING(whether we talk terminfo)
|
|
2161 AC_TRY_RUN([
|
7
|
2162 #ifdef HAVE_TERMCAP_H
|
|
2163 # include <termcap.h>
|
|
2164 #endif
|
|
2165 main()
|
|
2166 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
|
|
2167 AC_MSG_RESULT([no -- we are in termcap land]),
|
|
2168 AC_MSG_RESULT([yes -- terminfo spoken here]); AC_DEFINE(TERMINFO),
|
|
2169 AC_MSG_ERROR(failed to compile test program.))
|
|
2170
|
|
2171 if test "x$olibs" != "x$LIBS"; then
|
|
2172 AC_MSG_CHECKING(what tgetent() returns for an unknown terminal)
|
|
2173 AC_TRY_RUN([
|
|
2174 #ifdef HAVE_TERMCAP_H
|
|
2175 # include <termcap.h>
|
|
2176 #endif
|
|
2177 main()
|
|
2178 {char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }],
|
|
2179 AC_MSG_RESULT(zero); AC_DEFINE(TGETENT_ZERO_ERR, 0),
|
|
2180 AC_MSG_RESULT(non-zero),
|
|
2181 AC_MSG_ERROR(failed to compile test program.))
|
|
2182 fi
|
|
2183
|
|
2184 AC_MSG_CHECKING(whether termcap.h contains ospeed)
|
|
2185 AC_TRY_LINK([
|
|
2186 #ifdef HAVE_TERMCAP_H
|
|
2187 # include <termcap.h>
|
|
2188 #endif
|
|
2189 ], [ospeed = 20000],
|
|
2190 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
|
|
2191 [AC_MSG_RESULT(no)
|
|
2192 AC_MSG_CHECKING(whether ospeed can be extern)
|
|
2193 AC_TRY_LINK([
|
|
2194 #ifdef HAVE_TERMCAP_H
|
|
2195 # include <termcap.h>
|
|
2196 #endif
|
|
2197 extern short ospeed;
|
|
2198 ], [ospeed = 20000],
|
|
2199 AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
|
|
2200 AC_MSG_RESULT(no))]
|
|
2201 )
|
|
2202
|
|
2203 AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
|
|
2204 AC_TRY_LINK([
|
|
2205 #ifdef HAVE_TERMCAP_H
|
|
2206 # include <termcap.h>
|
|
2207 #endif
|
|
2208 ], [if (UP == 0 && BC == 0) PC = 1],
|
|
2209 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
|
|
2210 [AC_MSG_RESULT(no)
|
|
2211 AC_MSG_CHECKING([whether UP, BC and PC can be extern])
|
|
2212 AC_TRY_LINK([
|
|
2213 #ifdef HAVE_TERMCAP_H
|
|
2214 # include <termcap.h>
|
|
2215 #endif
|
|
2216 extern char *UP, *BC, PC;
|
|
2217 ], [if (UP == 0 && BC == 0) PC = 1],
|
|
2218 AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
|
|
2219 AC_MSG_RESULT(no))]
|
|
2220 )
|
|
2221
|
|
2222 AC_MSG_CHECKING(whether tputs() uses outfuntype)
|
|
2223 AC_TRY_COMPILE([
|
|
2224 #ifdef HAVE_TERMCAP_H
|
|
2225 # include <termcap.h>
|
|
2226 #endif
|
|
2227 ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
|
|
2228 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
|
|
2229 AC_MSG_RESULT(no))
|
|
2230
|
|
2231 dnl On some SCO machines sys/select redefines struct timeval
|
|
2232 AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
|
|
2233 AC_TRY_COMPILE([
|
|
2234 #include <sys/types.h>
|
|
2235 #include <sys/time.h>
|
|
2236 #include <sys/select.h>], ,
|
|
2237 AC_MSG_RESULT(yes)
|
|
2238 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
|
|
2239 AC_MSG_RESULT(no))
|
|
2240
|
|
2241 dnl AC_DECL_SYS_SIGLIST
|
|
2242
|
|
2243 dnl Checks for pty.c (copied from screen) ==========================
|
|
2244 AC_MSG_CHECKING(for /dev/ptc)
|
|
2245 if test -r /dev/ptc; then
|
|
2246 AC_DEFINE(HAVE_DEV_PTC)
|
|
2247 AC_MSG_RESULT(yes)
|
|
2248 else
|
|
2249 AC_MSG_RESULT(no)
|
|
2250 fi
|
|
2251
|
|
2252 AC_MSG_CHECKING(for SVR4 ptys)
|
|
2253 if test -c /dev/ptmx ; then
|
|
2254 AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
|
|
2255 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
|
|
2256 AC_MSG_RESULT(no))
|
|
2257 else
|
|
2258 AC_MSG_RESULT(no)
|
|
2259 fi
|
|
2260
|
|
2261 AC_MSG_CHECKING(for ptyranges)
|
|
2262 if test -d /dev/ptym ; then
|
|
2263 pdir='/dev/ptym'
|
|
2264 else
|
|
2265 pdir='/dev'
|
|
2266 fi
|
|
2267 dnl SCO uses ptyp%d
|
|
2268 AC_EGREP_CPP(yes,
|
|
2269 [#ifdef M_UNIX
|
|
2270 yes;
|
|
2271 #endif
|
|
2272 ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
|
|
2273 dnl if test -c /dev/ptyp19; then
|
|
2274 dnl ptys=`echo /dev/ptyp??`
|
|
2275 dnl else
|
|
2276 dnl ptys=`echo $pdir/pty??`
|
|
2277 dnl fi
|
|
2278 if test "$ptys" != "$pdir/pty??" ; then
|
|
2279 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
|
|
2280 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
|
|
2281 AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
|
|
2282 AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
|
|
2283 AC_MSG_RESULT([$p0 / $p1])
|
|
2284 else
|
|
2285 AC_MSG_RESULT([don't know])
|
|
2286 fi
|
|
2287
|
|
2288 dnl **** pty mode/group handling ****
|
|
2289 dnl
|
|
2290 dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
|
|
2291 AC_MSG_CHECKING(default tty permissions/group)
|
|
2292 rm -f conftest_grp
|
|
2293 AC_TRY_RUN([
|
|
2294 #include <sys/types.h>
|
|
2295 #include <sys/stat.h>
|
|
2296 #include <stdio.h>
|
|
2297 main()
|
|
2298 {
|
|
2299 struct stat sb;
|
|
2300 char *x,*ttyname();
|
|
2301 int om, m;
|
|
2302 FILE *fp;
|
|
2303
|
|
2304 if (!(x = ttyname(0))) exit(1);
|
|
2305 if (stat(x, &sb)) exit(1);
|
|
2306 om = sb.st_mode;
|
|
2307 if (om & 002) exit(0);
|
|
2308 m = system("mesg y");
|
|
2309 if (m == -1 || m == 127) exit(1);
|
|
2310 if (stat(x, &sb)) exit(1);
|
|
2311 m = sb.st_mode;
|
|
2312 if (chmod(x, om)) exit(1);
|
|
2313 if (m & 002) exit(0);
|
|
2314 if (sb.st_gid == getgid()) exit(1);
|
|
2315 if (!(fp=fopen("conftest_grp", "w")))
|
|
2316 exit(1);
|
|
2317 fprintf(fp, "%d\n", sb.st_gid);
|
|
2318 fclose(fp);
|
|
2319 exit(0);
|
|
2320 }
|
|
2321 ],[
|
|
2322 if test -f conftest_grp; then
|
|
2323 ptygrp=`cat conftest_grp`
|
|
2324 AC_MSG_RESULT([pty mode: 0620, group: $ptygrp])
|
|
2325 AC_DEFINE(PTYMODE, 0620)
|
|
2326 AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
|
|
2327 else
|
|
2328 AC_MSG_RESULT([ptys are world accessable])
|
|
2329 fi
|
|
2330 ],
|
|
2331 AC_MSG_RESULT([can't determine - assume ptys are world accessable]),
|
|
2332 AC_MSG_ERROR(failed to compile test program))
|
|
2333 rm -f conftest_grp
|
|
2334
|
|
2335 dnl Checks for library functions. ===================================
|
|
2336
|
|
2337 AC_TYPE_SIGNAL
|
|
2338
|
|
2339 dnl find out what to use at the end of a signal function
|
|
2340 if test $ac_cv_type_signal = void; then
|
|
2341 AC_DEFINE(SIGRETURN, [return])
|
|
2342 else
|
|
2343 AC_DEFINE(SIGRETURN, [return 0])
|
|
2344 fi
|
|
2345
|
|
2346 dnl check if struct sigcontext is defined (used for SGI only)
|
|
2347 AC_MSG_CHECKING(for struct sigcontext)
|
|
2348 AC_TRY_COMPILE([
|
|
2349 #include <signal.h>
|
|
2350 test_sig()
|
|
2351 {
|
|
2352 struct sigcontext *scont;
|
|
2353 scont = (struct sigcontext *)0;
|
|
2354 return 1;
|
|
2355 } ], ,
|
|
2356 AC_MSG_RESULT(yes)
|
|
2357 AC_DEFINE(HAVE_SIGCONTEXT),
|
|
2358 AC_MSG_RESULT(no))
|
|
2359
|
|
2360 dnl tricky stuff: try to find out if getcwd() is implemented with
|
|
2361 dnl system("sh -c pwd")
|
|
2362 AC_MSG_CHECKING(getcwd implementation)
|
|
2363 AC_TRY_RUN([
|
|
2364 char *dagger[] = { "IFS=pwd", 0 };
|
|
2365 main()
|
|
2366 {
|
|
2367 char buffer[500];
|
|
2368 extern char **environ;
|
|
2369 environ = dagger;
|
|
2370 return getcwd(buffer, 500) ? 0 : 1;
|
|
2371 }],
|
|
2372 AC_MSG_RESULT(it is usable),
|
|
2373 AC_MSG_RESULT(it stinks)
|
|
2374 AC_DEFINE(BAD_GETCWD),
|
|
2375 AC_MSG_ERROR(failed to compile test program))
|
|
2376
|
|
2377 dnl Check for functions in one big call, to reduce the size of configure
|
|
2378 AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
|
|
2379 getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
|
2380 memset nanosleep opendir putenv qsort readlink select setenv \
|
|
2381 setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
273
|
2382 sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
258
|
2383 strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
|
2384 usleep utime utimes)
|
7
|
2385
|
|
2386 dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
|
|
2387 AC_MSG_CHECKING(for st_blksize)
|
|
2388 AC_TRY_COMPILE(
|
|
2389 [#include <sys/types.h>
|
|
2390 #include <sys/stat.h>],
|
|
2391 [ struct stat st;
|
|
2392 int n;
|
|
2393
|
|
2394 stat("/", &st);
|
|
2395 n = (int)st.st_blksize;],
|
|
2396 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
|
|
2397 AC_MSG_RESULT(no))
|
|
2398
|
|
2399 AC_MSG_CHECKING(whether stat() ignores a trailing slash)
|
|
2400 AC_TRY_RUN(
|
|
2401 [#include <sys/types.h>
|
|
2402 #include <sys/stat.h>
|
|
2403 main() {struct stat st; exit(stat("configure/", &st) != 0); }],
|
|
2404 AC_MSG_RESULT(yes); AC_DEFINE(STAT_IGNORES_SLASH),
|
|
2405 AC_MSG_RESULT(no), AC_MSG_ERROR(failed to compile test program))
|
|
2406
|
|
2407 dnl Link with iconv for charset translation, if not found without library.
|
|
2408 dnl check for iconv() requires including iconv.h
|
|
2409 dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
|
|
2410 dnl has been installed.
|
|
2411 AC_MSG_CHECKING(for iconv_open())
|
|
2412 save_LIBS="$LIBS"
|
|
2413 LIBS="$LIBS -liconv"
|
|
2414 AC_TRY_LINK([
|
|
2415 #ifdef HAVE_ICONV_H
|
|
2416 # include <iconv.h>
|
|
2417 #endif
|
|
2418 ], [iconv_open("fr", "to");],
|
|
2419 AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
|
|
2420 LIBS="$save_LIBS"
|
|
2421 AC_TRY_LINK([
|
|
2422 #ifdef HAVE_ICONV_H
|
|
2423 # include <iconv.h>
|
|
2424 #endif
|
|
2425 ], [iconv_open("fr", "to");],
|
|
2426 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
|
|
2427 AC_MSG_RESULT(no)))
|
|
2428
|
|
2429
|
|
2430 AC_MSG_CHECKING(for nl_langinfo(CODESET))
|
|
2431 AC_TRY_LINK([
|
|
2432 #ifdef HAVE_LANGINFO_H
|
|
2433 # include <langinfo.h>
|
|
2434 #endif
|
|
2435 ], [char *cs = nl_langinfo(CODESET);],
|
|
2436 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
|
|
2437 AC_MSG_RESULT(no))
|
|
2438
|
|
2439 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
|
|
2440 dnl when -lacl works, also try to use -lattr (required for Debian).
|
|
2441 AC_MSG_CHECKING(--disable-acl argument)
|
|
2442 AC_ARG_ENABLE(acl,
|
|
2443 [ --disable-acl Don't check for ACL support.],
|
|
2444 , [enable_acl="yes"])
|
|
2445 if test "$enable_acl" = "yes"; then
|
|
2446 AC_MSG_RESULT(no)
|
|
2447 AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
|
|
2448 AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
|
|
2449 AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
|
|
2450
|
|
2451 AC_MSG_CHECKING(for POSIX ACL support)
|
|
2452 AC_TRY_LINK([
|
|
2453 #include <sys/types.h>
|
|
2454 #ifdef HAVE_SYS_ACL_H
|
|
2455 # include <sys/acl.h>
|
|
2456 #endif
|
|
2457 acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
|
|
2458 acl_set_file("foo", ACL_TYPE_ACCESS, acl);
|
|
2459 acl_free(acl);],
|
|
2460 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
|
|
2461 AC_MSG_RESULT(no))
|
|
2462
|
|
2463 AC_MSG_CHECKING(for Solaris ACL support)
|
|
2464 AC_TRY_LINK([
|
|
2465 #ifdef HAVE_SYS_ACL_H
|
|
2466 # include <sys/acl.h>
|
|
2467 #endif], [acl("foo", GETACLCNT, 0, NULL);
|
|
2468 ],
|
|
2469 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
|
|
2470 AC_MSG_RESULT(no))
|
|
2471
|
|
2472 AC_MSG_CHECKING(for AIX ACL support)
|
|
2473 AC_TRY_LINK([
|
|
2474 #ifdef HAVE_SYS_ACL_H
|
|
2475 # include <sys/acl.h>
|
|
2476 #endif
|
|
2477 #ifdef HAVE_SYS_ACCESS_H
|
|
2478 # include <sys/access.h>
|
|
2479 #endif
|
|
2480 #define _ALL_SOURCE
|
|
2481
|
|
2482 #include <sys/stat.h>
|
|
2483
|
|
2484 int aclsize;
|
|
2485 struct acl *aclent;], [aclsize = sizeof(struct acl);
|
|
2486 aclent = (void *)malloc(aclsize);
|
|
2487 statacl("foo", STX_NORMAL, aclent, aclsize);
|
|
2488 ],
|
|
2489 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
|
|
2490 AC_MSG_RESULT(no))
|
|
2491 else
|
|
2492 AC_MSG_RESULT(yes)
|
|
2493 fi
|
|
2494
|
|
2495 AC_MSG_CHECKING(--disable-gpm argument)
|
|
2496 AC_ARG_ENABLE(gpm,
|
|
2497 [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
|
|
2498 [enable_gpm="yes"])
|
|
2499
|
|
2500 if test "$enable_gpm" = "yes"; then
|
|
2501 AC_MSG_RESULT(no)
|
|
2502 dnl Checking if gpm support can be compiled
|
|
2503 AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
|
|
2504 [olibs="$LIBS" ; LIBS="-lgpm"]
|
|
2505 AC_TRY_LINK(
|
|
2506 [#include <gpm.h>
|
|
2507 #include <linux/keyboard.h>],
|
|
2508 [Gpm_GetLibVersion(NULL);],
|
|
2509 dnl Configure defines HAVE_GPM, if it is defined feature.h defines
|
|
2510 dnl FEAT_MOUSE_GPM if mouse support is included
|
|
2511 [vi_cv_have_gpm=yes],
|
|
2512 [vi_cv_have_gpm=no])
|
|
2513 [LIBS="$olibs"]
|
|
2514 )
|
|
2515 if test $vi_cv_have_gpm = yes; then
|
|
2516 LIBS="$LIBS -lgpm"
|
|
2517 AC_DEFINE(HAVE_GPM)
|
|
2518 fi
|
|
2519 else
|
|
2520 AC_MSG_RESULT(yes)
|
|
2521 fi
|
|
2522
|
|
2523 dnl rename needs to be checked separately to work on Nextstep with cc
|
|
2524 AC_MSG_CHECKING(for rename)
|
|
2525 AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
|
|
2526 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
|
|
2527 AC_MSG_RESULT(no))
|
|
2528
|
|
2529 dnl sysctl() may exist but not the arguments we use
|
|
2530 AC_MSG_CHECKING(for sysctl)
|
|
2531 AC_TRY_COMPILE(
|
|
2532 [#include <sys/types.h>
|
|
2533 #include <sys/sysctl.h>],
|
|
2534 [ int mib[2], r;
|
|
2535 size_t len;
|
|
2536
|
|
2537 mib[0] = CTL_HW;
|
|
2538 mib[1] = HW_USERMEM;
|
|
2539 len = sizeof(r);
|
|
2540 (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
|
|
2541 ],
|
|
2542 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
|
|
2543 AC_MSG_RESULT(not usable))
|
|
2544
|
|
2545 dnl sysinfo() may exist but not be Linux compatible
|
|
2546 AC_MSG_CHECKING(for sysinfo)
|
|
2547 AC_TRY_COMPILE(
|
|
2548 [#include <sys/types.h>
|
|
2549 #include <sys/sysinfo.h>],
|
|
2550 [ struct sysinfo sinfo;
|
|
2551 int t;
|
|
2552
|
|
2553 (void)sysinfo(&sinfo);
|
|
2554 t = sinfo.totalram;
|
|
2555 ],
|
|
2556 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
|
|
2557 AC_MSG_RESULT(not usable))
|
|
2558
|
|
2559 dnl sysconf() may exist but not support what we want to use
|
|
2560 AC_MSG_CHECKING(for sysconf)
|
|
2561 AC_TRY_COMPILE(
|
|
2562 [#include <unistd.h>],
|
|
2563 [ (void)sysconf(_SC_PAGESIZE);
|
|
2564 (void)sysconf(_SC_PHYS_PAGES);
|
|
2565 ],
|
|
2566 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
|
|
2567 AC_MSG_RESULT(not usable))
|
|
2568
|
|
2569 dnl Our own version of AC_CHECK_SIZEOF(int); fixes a bug when sizeof() can't
|
|
2570 dnl be printed with "%d", and avoids a warning for cross-compiling.
|
|
2571
|
|
2572 AC_MSG_CHECKING(size of int)
|
|
2573 AC_CACHE_VAL(ac_cv_sizeof_int,
|
|
2574 [AC_TRY_RUN([#include <stdio.h>
|
|
2575 main()
|
|
2576 {
|
|
2577 FILE *f=fopen("conftestval", "w");
|
|
2578 if (!f) exit(1);
|
|
2579 fprintf(f, "%d\n", (int)sizeof(int));
|
|
2580 exit(0);
|
|
2581 }],
|
|
2582 ac_cv_sizeof_int=`cat conftestval`,
|
|
2583 ac_cv_sizeof_int=0,
|
|
2584 AC_MSG_ERROR(failed to compile test program))])
|
|
2585 AC_MSG_RESULT($ac_cv_sizeof_int)
|
|
2586 AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int)
|
|
2587
|
|
2588 AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps)
|
|
2589 [bcopy_test_prog='
|
|
2590 main() {
|
|
2591 char buf[10];
|
|
2592 strcpy(buf, "abcdefghi");
|
|
2593 mch_memmove(buf, buf + 2, 3);
|
|
2594 if (strncmp(buf, "ababcf", 6))
|
|
2595 exit(1);
|
|
2596 strcpy(buf, "abcdefghi");
|
|
2597 mch_memmove(buf + 2, buf, 3);
|
|
2598 if (strncmp(buf, "cdedef", 6))
|
|
2599 exit(1);
|
|
2600 exit(0); /* libc version works properly. */
|
|
2601 }']
|
|
2602
|
|
2603 dnl Check for memmove() before bcopy(), makes memmove() be used when both are
|
|
2604 dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
|
|
2605
|
|
2606 AC_TRY_RUN([#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog],
|
|
2607 AC_DEFINE(USEMEMMOVE) AC_MSG_RESULT(memmove does),
|
|
2608 AC_TRY_RUN([#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog],
|
|
2609 AC_DEFINE(USEBCOPY) AC_MSG_RESULT(bcopy does),
|
|
2610 AC_TRY_RUN([#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog],
|
|
2611 AC_DEFINE(USEMEMCPY) AC_MSG_RESULT(memcpy does), AC_MSG_RESULT(no),
|
|
2612 AC_MSG_ERROR(failed to compile test program)),
|
|
2613 AC_MSG_ERROR(failed to compile test program)),
|
|
2614 AC_MSG_ERROR(failed to compile test program))
|
|
2615
|
|
2616 dnl Check for multibyte locale functions
|
|
2617 dnl Find out if _Xsetlocale() is supported by libX11.
|
|
2618 dnl Check if X_LOCALE should be defined.
|
|
2619
|
|
2620 if test "$enable_multibyte" = "yes"; then
|
|
2621 cflags_save=$CFLAGS
|
|
2622 ldflags_save=$LDFLAGS
|
|
2623 if test -n "$x_includes" ; then
|
|
2624 CFLAGS="$CFLAGS -I$x_includes"
|
|
2625 LDFLAGS="$X_LIBS $LDFLAGS -lX11"
|
|
2626 AC_MSG_CHECKING(whether X_LOCALE needed)
|
|
2627 AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
|
|
2628 AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
|
|
2629 AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
|
|
2630 AC_MSG_RESULT(no))
|
|
2631 fi
|
|
2632 CFLAGS=$cflags_save
|
|
2633 LDFLAGS=$ldflags_save
|
|
2634 fi
|
|
2635
|
|
2636 dnl Link with xpg4, it is said to make Korean locale working
|
|
2637 AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
|
|
2638
|
|
2639 dnl Check how we can run ctags
|
|
2640 dnl --version for Exuberant ctags (preferred)
|
|
2641 dnl -t for typedefs (many ctags have this)
|
|
2642 dnl -s for static functions (Elvis ctags only?)
|
|
2643 dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
|
|
2644 dnl -i+m to test for older Exuberant ctags
|
|
2645 AC_MSG_CHECKING(how to create tags)
|
|
2646 test -f tags && mv tags tags.save
|
|
2647 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
|
456
|
2648 TAGPRG="ctags -I INIT+"
|
7
|
2649 else
|
|
2650 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
|
|
2651 (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
|
|
2652 (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
|
|
2653 (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
|
|
2654 (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
|
|
2655 (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
|
|
2656 (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
|
|
2657 fi
|
|
2658 test -f tags.save && mv tags.save tags
|
|
2659 AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
|
|
2660
|
|
2661 dnl Check how we can run man with a section number
|
|
2662 AC_MSG_CHECKING(how to run man with a section nr)
|
|
2663 MANDEF="man"
|
|
2664 (eval man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
|
|
2665 AC_MSG_RESULT($MANDEF)
|
|
2666 if test "$MANDEF" = "man -s"; then
|
|
2667 AC_DEFINE(USEMAN_S)
|
|
2668 fi
|
|
2669
|
|
2670 dnl Check if gettext() is working and if it needs -lintl
|
|
2671 AC_MSG_CHECKING(--disable-nls argument)
|
|
2672 AC_ARG_ENABLE(nls,
|
|
2673 [ --disable-nls Don't support NLS (gettext()).], ,
|
|
2674 [enable_nls="yes"])
|
|
2675
|
|
2676 if test "$enable_nls" = "yes"; then
|
|
2677 AC_MSG_RESULT(no)
|
282
|
2678
|
|
2679 INSTALL_LANGS=install-languages
|
|
2680 AC_SUBST(INSTALL_LANGS)
|
|
2681 INSTALL_TOOL_LANGS=install-tool-languages
|
|
2682 AC_SUBST(INSTALL_TOOL_LANGS)
|
|
2683
|
7
|
2684 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
|
|
2685 AC_MSG_CHECKING([for NLS])
|
|
2686 if test -f po/Makefile; then
|
|
2687 have_gettext="no"
|
|
2688 if test -n "$MSGFMT"; then
|
|
2689 AC_TRY_LINK(
|
|
2690 [#include <libintl.h>],
|
|
2691 [gettext("Test");],
|
|
2692 AC_MSG_RESULT([gettext() works]); have_gettext="yes",
|
|
2693 olibs=$LIBS
|
|
2694 LIBS="$LIBS -lintl"
|
|
2695 AC_TRY_LINK(
|
|
2696 [#include <libintl.h>],
|
|
2697 [gettext("Test");],
|
|
2698 AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes",
|
|
2699 AC_MSG_RESULT([gettext() doesn't work]);
|
|
2700 LIBS=$olibs))
|
|
2701 else
|
|
2702 AC_MSG_RESULT([msgfmt not found - disabled]);
|
|
2703 fi
|
|
2704 if test $have_gettext = "yes"; then
|
|
2705 AC_DEFINE(HAVE_GETTEXT)
|
|
2706 MAKEMO=yes
|
|
2707 AC_SUBST(MAKEMO)
|
|
2708 dnl this was added in GNU gettext 0.10.36
|
|
2709 AC_CHECK_FUNCS(bind_textdomain_codeset)
|
|
2710 dnl _nl_msg_cat_cntr is required for GNU gettext
|
|
2711 AC_MSG_CHECKING([for _nl_msg_cat_cntr])
|
|
2712 AC_TRY_LINK(
|
|
2713 [#include <libintl.h>
|
|
2714 extern int _nl_msg_cat_cntr;],
|
|
2715 [++_nl_msg_cat_cntr;],
|
|
2716 AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
|
|
2717 AC_MSG_RESULT([no]))
|
|
2718 fi
|
|
2719 else
|
|
2720 AC_MSG_RESULT([no "po/Makefile" - disabled]);
|
|
2721 fi
|
|
2722 else
|
|
2723 AC_MSG_RESULT(yes)
|
|
2724 fi
|
|
2725
|
|
2726 dnl Check for dynamic linking loader
|
|
2727 AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
|
|
2728 if test x${DLL} = xdlfcn.h; then
|
|
2729 AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
|
|
2730 AC_MSG_CHECKING([for dlopen()])
|
|
2731 AC_TRY_LINK(,[
|
|
2732 extern void* dlopen();
|
|
2733 dlopen();
|
|
2734 ],
|
|
2735 AC_MSG_RESULT(yes);
|
|
2736 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
|
|
2737 AC_MSG_RESULT(no);
|
|
2738 AC_MSG_CHECKING([for dlopen() in -ldl])
|
|
2739 olibs=$LIBS
|
|
2740 LIBS="$LIBS -ldl"
|
|
2741 AC_TRY_LINK(,[
|
|
2742 extern void* dlopen();
|
|
2743 dlopen();
|
|
2744 ],
|
|
2745 AC_MSG_RESULT(yes);
|
|
2746 AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
|
|
2747 AC_MSG_RESULT(no);
|
|
2748 LIBS=$olibs))
|
|
2749 dnl ReliantUNIX has dlopen() in libc but everything else in libdl
|
|
2750 dnl ick :-)
|
|
2751 AC_MSG_CHECKING([for dlsym()])
|
|
2752 AC_TRY_LINK(,[
|
|
2753 extern void* dlsym();
|
|
2754 dlsym();
|
|
2755 ],
|
|
2756 AC_MSG_RESULT(yes);
|
|
2757 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
|
|
2758 AC_MSG_RESULT(no);
|
|
2759 AC_MSG_CHECKING([for dlsym() in -ldl])
|
|
2760 olibs=$LIBS
|
|
2761 LIBS="$LIBS -ldl"
|
|
2762 AC_TRY_LINK(,[
|
|
2763 extern void* dlsym();
|
|
2764 dlsym();
|
|
2765 ],
|
|
2766 AC_MSG_RESULT(yes);
|
|
2767 AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
|
|
2768 AC_MSG_RESULT(no);
|
|
2769 LIBS=$olibs))
|
|
2770 elif test x${DLL} = xdl.h; then
|
|
2771 AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
|
|
2772 AC_MSG_CHECKING([for shl_load()])
|
|
2773 AC_TRY_LINK(,[
|
|
2774 extern void* shl_load();
|
|
2775 shl_load();
|
|
2776 ],
|
|
2777 AC_MSG_RESULT(yes);
|
|
2778 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
|
|
2779 AC_MSG_RESULT(no);
|
|
2780 AC_MSG_CHECKING([for shl_load() in -ldld])
|
|
2781 olibs=$LIBS
|
|
2782 LIBS="$LIBS -ldld"
|
|
2783 AC_TRY_LINK(,[
|
|
2784 extern void* shl_load();
|
|
2785 shl_load();
|
|
2786 ],
|
|
2787 AC_MSG_RESULT(yes);
|
|
2788 AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
|
|
2789 AC_MSG_RESULT(no);
|
|
2790 LIBS=$olibs))
|
|
2791 fi
|
|
2792 AC_CHECK_HEADERS(setjmp.h)
|
|
2793
|
|
2794 if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
|
|
2795 dnl -ldl must come after DynaLoader.a
|
|
2796 if echo $LIBS | grep -e '-ldl' >/dev/null; then
|
|
2797 LIBS=`echo $LIBS | sed s/-ldl//`
|
|
2798 PERL_LIBS="$PERL_LIBS -ldl"
|
|
2799 fi
|
|
2800 fi
|
|
2801
|
|
2802 if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \
|
|
2803 && test "x$GUITYPE" != "xCARBONGUI"; then
|
|
2804 AC_MSG_CHECKING(whether we need -framework Carbon)
|
|
2805 dnl check for MACOSX without Carbon GUI, but with FEAT_MBYTE
|
|
2806 if test "x$enable_multibyte" = "xyes" || test "x$features" == "xbig" \
|
|
2807 || test "x$features" = "xhuge"; then
|
|
2808 LIBS="$LIBS -framework Carbon"
|
|
2809 AC_MSG_RESULT(yes)
|
|
2810 else
|
|
2811 AC_MSG_RESULT(no)
|
|
2812 fi
|
|
2813 fi
|
697
|
2814 if test "x$MACARCH" = "xboth"; then
|
|
2815 LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
|
|
2816 fi
|
7
|
2817
|
548
|
2818 dnl gcc 3.1 changed the meaning of -MM. The only solution appears to be to
|
|
2819 dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
|
|
2820 dnl But only when making dependencies, cproto and lint don't take "-isystem".
|
685
|
2821 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
|
|
2822 dnl the number before the version number.
|
557
|
2823 AC_MSG_CHECKING(for GCC 3 or later)
|
548
|
2824 DEPEND_CFLAGS_FILTER=
|
|
2825 if test "$GCC" = yes; then
|
685
|
2826 gccmajor=`"$CC" --version | sed -e '2,$d;s/^[[^0-9]]*\(darwin.[[^0-9]]*\)*\([[1-9]]\)\.[[0-9]].*$/\2/g'`
|
671
|
2827 if test "$gccmajor" -gt "2"; then
|
548
|
2828 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
|
|
2829 fi
|
|
2830 fi
|
557
|
2831 if test "$DEPEND_CFLAGS_FILTER" = ""; then
|
|
2832 AC_MSG_RESULT(no)
|
|
2833 else
|
|
2834 AC_MSG_RESULT(yes)
|
|
2835 fi
|
548
|
2836 AC_SUBST(DEPEND_CFLAGS_FILTER)
|
7
|
2837
|
|
2838 dnl write output files
|
|
2839 AC_OUTPUT(auto/config.mk:config.mk.in)
|
|
2840
|
|
2841 dnl vim: set sw=2 tw=78 fo+=l:
|