1 dnl Define our own header notice with own copyright
2 define([AC_INIT_NOTICE],
3 [#### Configuration script for XEmacs. Largely divergent from FSF.
4 #### Guess values for system-dependent variables and create Makefiles.
5 #### Generated automatically using autoconf version] AC_ACVERSION [
6 #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
7 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
8 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
9 #### Copyright (C) 1995, 1996 Ben Wing.
10 #### Copyright (C) 2000, 2001 Martin Buchholz.
11 #### Copyright (C) 1998, 1999 J. Kean Johnston.
13 ### Don't edit this script!
14 ### This script was automatically generated by the `autoconf' program
15 ### from the file `./configure.in'.
16 ### To rebuild it, execute the command
18 ### in the this directory. You must have autoconf version 2.13 or later.
20 ### This file is part of XEmacs.
22 ### XEmacs is free software; you can redistribute it and/or modify it
23 ### under the terms of the GNU General Public License as published by
24 ### the Free Software Foundation; either version 2, or (at your
25 ### option) any later version.
27 ### XEmacs is distributed in the hope that it will be useful, but
28 ### WITHOUT ANY WARRANTY; without even the implied warranty of
29 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 ### General Public License for more details.
32 ### You should have received a copy of the GNU General Public License
33 ### along with XEmacs; see the file COPYING. If not, write to the Free
34 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
37 ### For usage, run `./configure --help'
38 ### For more detailed information on building and installing XEmacs,
39 ### read the file `INSTALL'.
41 ### If configure succeeds, it leaves its status in config.status.
42 ### A log of configuration tests can be found in config.log.
43 ### If configure fails after disturbing the status quo,
44 ### config.status is removed.
47 dnl Since XEmacs has configuration requirements that autoconf cannot
48 dnl meet, this file is an unholy marriage of custom-baked
49 dnl configuration code and autoconf macros.
51 dnl We use the m4 quoting characters [ ] (as established by the
52 dnl autoconf system), so quote them like this: [[foo]]
55 dnl Redefine some standard autoconf macros
56 dnl here is how XEmacs is different:
58 dnl - non-standard options
59 dnl - suport for extra-verbosity
60 dnl - ordinary libs are handled separately from X libs (might be a mistake)
61 dnl - various random kludges (e.g. -with-dnet=no)
63 dnl PRINT_VAR(var var ...) prints values of shell variables
64 define([PRINT_VAR],[for var in patsubst([$1],[[
65 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])
67 dnl Disable cache files:
68 dnl This is controversial, but I am convinced this is the right way to go,
69 dnl at least by default. Otherwise there are too many surprises.
70 define([AC_CACHE_LOAD], )dnl
71 define([AC_CACHE_SAVE], )dnl
72 define([AC_CACHE_VAL], [
76 dnl Redefine AC_TRY_RUN_NATIVE to not throw away stderr while running
77 dnl AC_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]])
78 define([AC_TRY_RUN_NATIVE],
79 [cat > conftest.$ac_ext <<EOF
80 [#]line __oline__ "configure"
84 if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit $?) 2>&AC_FD_CC
86 dnl Do not remove the temporary files here, so they can be examined.
87 ifelse([$2], , :, [$2])
90 echo "configure: failed program was:" >&AC_FD_CC
91 cat conftest.$ac_ext >&AC_FD_CC
92 ifelse([$3], , , [ rm -fr conftest*
96 rm -fr conftest*])dnl AC_TRY_RUN_NATIVE
99 dnl Avoid spurious cross-compiling warnings from AC_TRY_RUN
100 dnl XEmacs is unlikely to ever cross-compile
101 define([AC_TRY_RUN],[AC_TRY_RUN_NATIVE([$1], [$2], [$3])])dnl
103 dnl Redefine AC_DEFINE* to provide more output if extra_verbose
104 dnl Set VARIABLE to VALUE, verbatim, or 1.
105 dnl AC_DEFINE(VARIABLE [, VALUE])
107 [{ test "$extra_verbose" = "yes" && cat << \EOF
108 Defining $1[]ifelse($#, 2, [ = $2],)
110 cat >> confdefs.h <<\EOF
111 [#define] $1 ifelse($#, 2, [$2], 1)
116 define([AC_DEFINE_UNQUOTED],
117 [{ test "$extra_verbose" = "yes" && cat << EOF
118 Defining $1[]ifelse($#, 2, [ = $2],)
120 cat >> confdefs.h <<EOF
121 [#define] $1 ifelse($#, 2, [$2], 1)
124 ])dnl AC_DEFINE_UNQUOTED
126 dnl redefine AC_CHECK_LIB in accordance with our own value of ac_link
127 dnl Add in extra kludgy check to support with_dnet=no
128 dnl Add in extra LDFLAGS arg, which PRECEDE libs
129 dnl Support --with-dnet=no
131 dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
132 dnl [, OTHER-LIBRARIES] [, LDFLAGS]]]])
133 define([AC_CHECK_LIB],
134 [ifelse([$1],dnet, [if test "$with_dnet" = "no" ; then
135 ac_cv_lib_dnet_dnet_ntoa=no
136 ifelse([$4], , , [$4]
140 AC_CHECK_LIB_ORIG_HACKED([$1],[$2],[$3],[$4],[$5], [$6])
141 [ifelse([$1],dnet,[fi
145 define([AC_CHECK_LIB_ORIG_HACKED],
146 [ifelse([$5],,AC_MSG_CHECKING([for $2 in -l$1]),
147 xe_msg_checking="for [$2] in -l[$1]"
148 test -n "[$5]" && xe_msg_checking="$xe_msg_checking using extra libs [$5]"
149 AC_MSG_CHECKING("$xe_msg_checking"))
150 dnl Use a cache variable name containing both the library and function name,
151 dnl because the test really is for library $1 defining function $2, not
152 dnl just for library $1. Separate tests with the same $1 and different $2s
153 dnl may have different results.
154 ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
155 AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
156 [xe_check_libs="$6 -l$1 $5"
158 ifelse([$2], [main], , dnl Avoid conflicting decl of main.
159 [/* Override any gcc2 internal prototype to avoid an error. */
160 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
164 [/* We use char because int might match the return type of a gcc2
165 builtin and then its argument prototype would still apply. */
169 eval "ac_cv_lib_$ac_lib_var=yes",
170 eval "ac_cv_lib_$ac_lib_var=no")
173 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
177 ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
178 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
180 AC_DEFINE_UNQUOTED($ac_tr_lib)
181 XE_PREPEND([-l$1], LIBS)
188 ])dnl AC_CHECK_LIB_ORIG_HACKED
193 [define([AC_LANG], [C])dnl
195 dnl CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
196 dnl ac_cpp='$CPP $CPPFLAGS'
197 dnl ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
198 dnl ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
199 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
200 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
201 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
202 ac_cpp='$CPP '"$xe_cppflags"
203 ac_compile='${CC-cc} -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext 1>&AC_FD_CC'
204 ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC'
208 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
209 dnl So we use the following instead.
210 dnl XE_SPACE(var, words)
213 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
217 dnl XE_ADD_OBJS(foo.o ...)
218 define([XE_ADD_OBJS],
219 [extra_objs="$extra_objs [$1]" && dnl
220 if test "$extra_verbose" = "yes"; then
221 echo " xemacs will be linked with \"[$1]\""
224 dnl XE_APPEND(value, varname)
226 [[$2]="$[$2] [$1]" && dnl
227 if test "$extra_verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi])
229 dnl XE_PREPEND(value, varname)
231 [[$2]="[$1] $[$2]" && dnl
232 if test "$extra_verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi])
235 define([XE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])
237 dnl XE_STRIP_4TH_COMPONENT(var)
238 dnl Changes i986-pc-linux-gnu to i986-pc-linux, as God (not RMS) intended.
239 define([XE_STRIP_4TH_COMPONENT],
240 [$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])
242 dnl Initialize some variables set by options.
243 dnl The variables have the same names as the options, with
244 dnl dashes changed to underlines.
246 define([AC_INIT_PARSE_ARGS],[
248 dnl Get sane consistent behavior from various shells
249 dnl Avoid losing with weird user CDPATHs
251 if test -n "$ZSH_VERSION"; then
252 dnl zsh's Bourne shell emulation options
253 setopt NO_BAD_PATTERN NO_BANG_HIST NO_BG_NICE NO_EQUALS NO_FUNCTION_ARGZERO
254 setopt GLOB_SUBST NO_HUP INTERACTIVE_COMMENTS KSH_ARRAYS NO_MULTIOS NO_NOMATCH
255 setopt RM_STAR_SILENT POSIX_BUILTINS SH_FILE_EXPANSION SH_GLOB SH_OPTION_LETTERS
256 setopt SH_WORD_SPLIT BSD_ECHO IGNORE_BRACES
257 dnl zsh-3.1-beta drops core on the following
259 if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
260 elif test -n "$BASH_VERSION"; then
261 dnl Use Posix mode with bash
265 if test -n "$CDPATH"; then CDPATH="."; export CDPATH; fi
268 dnl Initialize some variables set by options.
269 dnl The variables have the same names as the options, with
270 dnl dashes changed to underlines.
279 program_transform_name=s,x,x,
288 dnl Initialize some other variables.
291 SHELL=${CONFIG_SHELL-/bin/sh}
292 dnl Maximum number of lines to put in a shell here document.
294 ])dnl AC_INIT_PARSE_ARGS
296 AC_INIT(src/lisp.h)dnl
297 AC_CONFIG_HEADER(src/config.h lwlib/config.h)
298 dnl Remove any more than one leading "." element from the path name.
299 dnl If we do not remove them, then another "./" will be prepended to
300 dnl the file name each time we use config.status, and the program name
301 dnl will get larger and larger. This would not be a problem, except
302 dnl that since progname gets recorded in all the Makefiles this script
303 dnl produces, move-if-change thinks they're different when they're
306 dnl It would be nice if we could put the ./ in a \( \) group and then
307 dnl apply the * operator to that, so we remove as many leading './././'s
308 dnl as are present, but some seds (like Ultrix's sed) don't allow you to
309 dnl apply * to a \( \) group. Bleah.
310 progname="`echo $0 | sed 's:^\./\./:\./:'`"
312 dnl -----------------------------
313 dnl Establish some default values
314 dnl -----------------------------
316 XE_APPEND(lib-src, MAKE_SUBDIR)
317 XE_APPEND(lib-src, INSTALL_ARCH_DEP_SUBDIR)
320 exec_prefix='${prefix}'
321 bindir='${exec_prefix}/bin'
322 dnl FSF 19.29 changes to:
323 dnl datadir='${prefix}/share'
324 dnl sharedstatedir='${prefix}/com'
325 dnl libexecdir='${exec_prefix}/libexec'
326 datadir='${prefix}/lib'
327 statedir='${prefix}/lib'
328 libdir='${exec_prefix}/lib'
329 mandir='${prefix}/man/man1'
330 inststaticdir='${PROGNAME}'
331 instvardir='${PROGNAME}-${version}'
332 infodir='${datadir}/${instvardir}/info'
335 lispdir='${datadir}/${instvardir}/lisp'
336 moduledir='${datadir}/${instvardir}/${configuration}/modules'
337 sitelispdir='${datadir}/${inststaticdir}/site-lisp'
338 sitemoduledir='${datadir}/${inststaticdir}/site-modules'
339 pkgdir='${datadir}/${instvardir}/lisp'
341 etcdir='${datadir}/${instvardir}/etc'
342 archlibdir='${datadir}/${instvardir}/${configuration}'
343 docdir='${archlibdir}'
346 with_site_modules='yes'
352 cpp='' cppflags='' libs='' ldflags=''
358 with_system_malloc='default'
359 with_dlmalloc='default'
361 dnl use_assertions should be 'yes' by default. Too many people in this
362 dnl world have core dumps turned off by default or \"cannot find where the
363 dnl core file went\". At least we should get some useful output ...
365 dnl the following is set to yes or no later.
371 dnl dragndrop is still experimental. When it is stable, comment out the following line:
374 dnl ------------------
375 dnl Options Processing
376 dnl ------------------
378 define([USAGE_ERROR],
379 [(echo "$progname: Usage error:"
381 echo " Use \`$progname --help' to show usage.") >&2 && exit 1])
383 dnl Record all the arguments, so we can save them in config.status.
386 dnl Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date,
387 dnl in order to get the arguments back in $@, we have to do an
388 dnl 'eval set x "$quoted_arguments"; shift'
389 dnl # We use sed to turn embedded ' into '"'"'. I truly hate sh quoting.
390 quoted_sed_magic=s/"'"/"'"'"'"'"'"'"'"/g
394 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
395 | --no-cr | --no-c) ;;
396 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
397 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
399 quoted_i="`echo '' $i | sed -e 's:^ ::' -e $quoted_sed_magic`"
400 quoted_arguments="$quoted_arguments '$quoted_i'" ;;
404 dnl Do not use shift -- that destroys the argument list, which autoconf needs
405 dnl to produce config.status. It turns out that "set - $arguments" does not
407 dnl However, it also turns out that many shells cannot expand ${10} at all.
408 dnl So using an index variable does not work either. It is possible to use
409 dnl some shell magic to make 'set x "$arguments"; shift' work portably.
410 while test $# != 0; do
413 --no-create|--no-recursion) ;;
414 dnl Anything starting with a hyphen we assume is an option.
416 dnl Separate the switch name from the value it is being given.
419 opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\([[^=]]*\)=.*$:\1:'`
420 val=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*[[^=]]*=\(.*\)$:\1:'`
423 dnl special case these strings since echo may silently eat them:
424 dnl --help ) opt=help val=yes valomitted=yes ;;
425 dnl --version ) opt=version val=yes valomitted=yes ;;
426 dnl -e ) opt=e val=yes valomitted=yes ;;
427 dnl -E ) opt=E val=yes valomitted=yes ;;
428 dnl -n ) opt=n val=yes valomitted=yes ;;
430 dnl If FOO is a boolean argument, --FOO is equivalent to
431 dnl --FOO=yes. Otherwise, the value comes from the next
432 dnl argument - see below.
433 opt=`echo '' $arg | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
434 val="yes" valomitted=yes
438 dnl translate "-" in option string to "_"
440 opt="`echo '' $opt | sed -e 's:^ ::' | tr - _`"
442 dnl Support --without-FOO as a synonym for --with-FOO=no
443 case "${valomitted}-${opt}" in yes-without_* )
444 opt=`echo $opt | sed 's/without/with/'`
445 valomitted="no" val="no" ;;
448 dnl Process the option.
451 dnl Process (many) boolean options
454 with_site_modules | \
504 memory_usage_stats | \
505 with_clash_detection | \
508 dnl Make sure the value given was either "yes" or "no".
510 y | ye | yes ) val=yes ;;
512 * ) USAGE_ERROR("The \`--$optname' option requires a boolean value: \`yes' or \`no'.") ;;
514 eval "$opt=\"$val\"" ;;
517 dnl Options that take a user-supplied value, as in --x-includes=/usr/X11R6/include
518 dnl The cache-file option is ignored (for compatibility with other configures)
534 site_runtime_libraries )
535 dnl If the value was omitted, get it from the next argument.
536 if test "$valomitted" = "yes" ; then
537 dnl Get the next argument from the argument list, if there is one.
538 if test "$#" = 0 ; then
539 USAGE_ERROR("The \`--$optname' option requires a value.");
546 dnl Options that take "yes", "no", or "default" values
549 with_debug_malloc | use_debug_malloc | \
550 with_system_malloc | use_system_malloc )
552 y | ye | yes ) val=yes ;;
554 d | de | def | defa | defau | defaul | default ) val=default ;;
555 * ) USAGE_ERROR(["The \`--$optname' option requires one of these values:
556 \`yes', \`no', or \`default'."]) ;;
558 case "$opt" in use_* ) opt="`echo $opt | sed s/use/with/`" ;; esac
562 dnl Has the user requested database support?
564 with_database_berkdb=no
566 with_database_gdbm=no
567 for x in `echo "$val" | sed -e 's/,/ /g'` ; do
570 b | be | ber | berk | berkd | berkdb ) with_database_berkdb=yes ;;
571 d | db | dbm ) with_database_dbm=yes ;;
572 g | gn | gnu | gnud | gnudb | gnudbm | gdbm) with_database_gdbm=yes ;;
573 * ) USAGE_ERROR(["The \`--$optname' option value
574 must be either \`no' or a comma-separated list
575 of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."]) ;;
578 if test "$with_database_dbm" = "yes" -a \
579 "$with_database_gdbm" = "yes"; then
580 USAGE_ERROR("Only one of \`dbm' and \`gnudbm' may be specified
581 with the \`--$optname' option.")
585 dnl Has the user requested sound support?
587 dnl values is a subset of all,native,nas,esd
588 dnl or their negatives: none,nonative,nonas,noesd
589 for x in `echo "$val" | sed -e 's/,/ /g'` ; do
591 dnl all and none are only permitted as the first in the list.
592 n | no | non | none ) new_sdefault=no ;;
593 a | al | all | both ) new_sdefault=yes ;;
595 native ) with_native_sound=yes ;;
596 nonative ) with_native_sound=no ;;
598 nas ) with_nas_sound=yes ;;
599 nonas ) with_nas_sound=no ;;
601 esd ) with_esd_sound=yes ;;
602 noesd ) with_esd_sound=no ;;
604 * ) bogus_sound=yes ;;
606 if test "$bogus_sound" -o \
607 \( -n "$new_sdefault" -a -n "$sound_notfirst" \) ; then
608 types="\`all', \`none', \`(no)native', \`no(nas)', \`(no)esd'."
609 USAGE_ERROR(["Valid types for the \`--$optname' option are:
611 The default is to autodetect all sound support."])
612 elif test -n "$new_sdefault" ; then
613 with_native_sound=$new_sdefault
614 with_nas_sound=$new_sdefault
615 with_esd_sound=$new_sdefault
616 new_sdefault= # reset this
622 dnl Has the user specified a preferred Athena widget set?
623 dnl This bit expands any alias names out for us...
626 xa | xaw ) val=xaw ;;
627 3 | 3d | xaw3d ) val=3d ;;
628 dnl No `n' for next, someone may try `no'
629 ne | nex | next | naxtaw) val=next ;;
630 dnl Have not tested the next two...
631 9 | 95 | xaw95 ) val=95 ;;
632 xp | xpm | xawxpm ) val=xpm ;;
633 * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
634 \`xaw', \`3d', \`next', \`95', or \`xpm'."]) ;;
639 dnl Has the user requested XIM support?
642 y | ye | yes ) val=yes ;;
643 n | no | non | none ) val=no ;;
644 x | xl | xli | xlib ) val=xlib ;;
645 m | mo | mot | moti | motif ) val=motif ;;
646 * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
647 \`motif', \`xlib', \`yes', or \`no'."]) ;;
652 dnl Mail locking specification
657 file | dot ) val=file ;;
658 locking ) val=locking ;;
659 * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
660 \`lockf', \`flock', \`file', \`locking', or \`mmdf'."]) ;;
665 dnl Has the user requested error-checking?
667 dnl value can be all, none, and/or a list of categories to check.
668 dnl Example: --error-checking=all,noextents,nobufpos
669 dnl Example: --error-checking=none,malloc,gc
671 for x in `echo "$val" | sed -e 's/,/ /g'` ; do
673 dnl all and none are only permitted as the first in the list.
674 n | no | non | none ) new_default=no ;;
675 a | al | all ) new_default=yes ;;
677 extents ) error_check_extents=yes ;;
678 noextents ) error_check_extents=no ;;
680 typecheck ) error_check_typecheck=yes ;;
681 notypecheck ) error_check_typecheck=no ;;
683 bufpos ) error_check_bufpos=yes ;;
684 nobufpos ) error_check_bufpos=no ;;
686 gc ) error_check_gc=yes ;;
687 nogc ) error_check_gc=no ;;
689 malloc ) error_check_malloc=yes ;;
690 nomalloc ) error_check_malloc=no ;;
692 byte_code ) error_check_byte_code=yes ;;
693 nobyte_code ) error_check_byte_code=no ;;
695 glyphs ) error_check_glyphs=yes ;;
696 noglyphs ) error_check_glyphs=no ;;
698 * ) bogus_error_check=yes ;;
700 if test "$bogus_error_check" -o \
701 \( -n "$new_default" -a -n "$echeck_notfirst" \) ; then
702 if test "$error_check_default" = yes ; then
703 types="\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', \`nomalloc', \`noglyphs' and \`nobyte-code'."
705 types="\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', \`malloc', \`glyphs' and \`byte-code'."
707 USAGE_ERROR(["Valid types for the \`--$optname' option are:
709 elif test -n "$new_default" ; then
710 error_check_extents=$new_default
711 error_check_typecheck=$new_default
712 error_check_bufpos=$new_default
713 error_check_gc=$new_default
714 error_check_malloc=$new_default
715 error_check_byte_code=$new_default
716 error_check_glyphs=$new_default
717 new_default= # reset this
723 dnl Has the user tried to tell us where the X files are?
724 dnl I think these are dopey, but no less than three alpha
725 dnl testers, at large sites, have said they have their X files
726 dnl installed in odd places.
728 dnl Has the user specified one of the path options?
729 prefix | exec_prefix | bindir | datadir | statedir | libdir | \
730 mandir | infodir | infopath | lispdir | etcdir | pkgdir | \
731 archlibdir | docdir | package_path )
732 dnl If the value was omitted, get it from the next argument.
733 if test "$valomitted" = "yes"; then
734 if test "$#" = 0; then
735 USAGE_ERROR("The \`--$optname' option requires a value.");
741 dnl You need to synchronize this with the way the
742 dnl default values are built.
744 dnl prefix is taken care of by --with-prefix
745 exec_prefix ) AC_DEFINE(EXEC_PREFIX_USER_DEFINED) ;;
746 lispdir ) AC_DEFINE(LISPDIR_USER_DEFINED) ;;
747 sitelispdir ) AC_DEFINE(SITELISPDIR_USER_DEFINED) ;;
748 moduledir ) AC_DEFINE(MODULEDIR_USER_DEFINED) ;;
749 etcdir ) AC_DEFINE(ETCDIR_USER_DEFINED) ;;
750 infodir ) AC_DEFINE(INFODIR_USER_DEFINED) ;;
751 infopath ) AC_DEFINE(INFOPATH_USER_DEFINED) ;;
752 package_path ) AC_DEFINE(PACKAGE_PATH_USER_DEFINED) ;;
754 AC_DEFINE(INFODIR_USER_DEFINED)
755 AC_DEFINE(LISPDIR_USER_DEFINED)
756 AC_DEFINE(MODULEDIR_USER_DEFINED)
757 AC_DEFINE(ETCDIR_USER_DEFINED)
758 AC_DEFINE(DOCDIR_USER_DEFINED)
759 AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;;
760 docdir ) AC_DEFINE(DOCDIR_USER_DEFINED) ;;
761 exec_prefix | libdir | archlibdir ) AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;;
765 dnl --no-create added by autoconf for use by config.status
768 dnl Has the user asked for some help?
769 "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
771 dnl Has the user specified the toolkit(s) to use for GUI elements?
773 "with_scrollbars" | \
777 l | lu | luc | luci | lucid ) val=lucid ;;
778 m | mo | mot | moti | motif ) val=motif ;;
779 a | at | ath | athe | athen | athena ) val=athena ;;
780 n | no | non | none ) val=no ;;
781 y | ye | yes ) val=yes ;;
782 m | ms | msw ) val=msw ;;
783 * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
784 \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
789 dnl Obsolete legacy argument? Warn, but otherwise ignore.
790 "use_minimal_tagbits" | \
791 "use_indexed_lrecord_implementation" | \
793 "const_is_losing" | \
795 AC_MSG_WARN([Obsolete option \`--$optname' ignored.])
798 dnl Unrecognized option? No mercy for user errors.
799 * ) USAGE_ERROR("Unrecognized option: $arg") ;;
804 dnl Assume anything with multiple hyphens is a configuration name.
805 *-*-*) configuration="$arg" ;;
807 dnl Unrecognized argument? No mercy for user errors.
808 *) USAGE_ERROR("Unrecognized argument: $arg") ;;
813 dnl -------------------------
814 dnl Finish options processing
815 dnl -------------------------
817 dnl Several options are equivalent to, and override, environment variables.
818 test -n "$cpp" && CPP="$cpp"
819 test -n "$cppflags" && CPPFLAGS="$cppflags"
820 test -n "$libs" && LIBS="$libs"
821 test -n "$ldflags" && LDFLAGS="$ldflags"
823 dnl Get the arguments back. See the diatribe on Shell Magic above.
824 eval set x "$quoted_arguments"; shift
826 dnl --extra-verbose implies --verbose
827 test "$extra_verbose" = "yes" && verbose=yes
829 dnl with_x is an obsolete synonym for with_x11
830 test -n "$with_x" && with_x11="$with_x"
832 dnl --with-quantify or --with-purify imply --use-system-malloc
833 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
834 test "$with_system_malloc" = "default" && with_system_malloc=yes
837 dnl XE_CHECK_FEATURE_DEPENDENCY(feature1, feature2)
838 define([XE_CHECK_FEATURE_DEPENDENCY],
839 [if test "$with_$1 $with_$2" = "yes no"; then
840 USAGE_ERROR("--with-$1 requires --with-$2")
841 elif test "$with_$2" = "no" ; then with_$1=no
842 elif test "$with_$1" = "yes"; then with_$2=yes
846 dnl CDE requires tooltalk
847 XE_CHECK_FEATURE_DEPENDENCY(cde, tooltalk)
849 dnl Find the source directory.
852 dnl If srcdir is not specified, see if "." or ".." might work.
854 for dir in "`echo $0 | sed 's|//|/|' | sed 's|/[[^/]]*$||'`" "." ".." ; do
855 if test -f "$dir/src/lisp.h" -a \
856 -f "$dir/lisp/version.el" ; then
861 if test -z "$srcdir" ; then
862 USAGE_ERROR(["Neither the current directory nor its parent seem to
863 contain the XEmacs sources. If you do not want to build XEmacs in its
864 source tree, you should run \`$progname' in the directory in which
865 you wish to build XEmacs, using the \`--srcdir' option to say where the
866 sources may be found."])
870 dnl Otherwise, check if the directory they specified is okay.
872 if test ! -f "$srcdir/src/lisp.h" -o \
873 ! -f "$srcdir/lisp/version.el" ; then
874 USAGE_ERROR(["The directory specified with the \`--srcdir' option,
875 \`$srcdir', doesn't seem to contain the XEmacs sources. You should
876 either run the \`$progname' script at the top of the XEmacs source
877 tree, or use the \`--srcdir' option to specify the XEmacs source directory."])
882 dnl ###########################################################################
883 if test -z "$configuration"; then
884 dnl Guess the configuration
885 configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
886 if test -z "$configuration"; then
887 USAGE_ERROR(["XEmacs has not been ported to this host type.
888 Try explicitly specifying the CONFIGURATION when rerunning configure."])
894 dnl Make symlinks for etc, lisp, and info directories while the path
895 dnl is still relative. We do not symlink lock because someone may
896 dnl have stuck the source on a read-only partition. Instead we
897 dnl create it as an actual directory later on if it does not already
899 for dir in lisp etc man info tests; do
900 if test ! -d "$dir" ; then
901 echo Making symbolic link to "$srcdir/$dir"
902 ${LN_S} "$srcdir/$dir" "$dir"
906 dnl Do our best to deal with automounter brokenness
907 dnl CANONICALIZE_PATH(varname)
908 define([CANONICALIZE_PATH],
909 [if test -d "/net"; then
910 if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi
912 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"`
915 dnl Calculate canonical name for blddir (i.e. current directory).
916 dnl PWD may already be the preferable absolute name for ".",
917 dnl but we can't trust it - it is sometimes inaccurate.
918 absolute_pwd="`pwd`";
919 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd"
921 else blddir="$absolute_pwd"; CANONICALIZE_PATH(blddir)
925 dnl Make srcdir absolute, if not already. It is important to
926 dnl avoid running the path through pwd unnecessary, since pwd can
927 dnl give you automounter prefixes, which can go away.
930 . ) srcdir="$blddir" ;;
931 * ) srcdir="`cd $srcdir && pwd`"; CANONICALIZE_PATH(srcdir) ;;
934 dnl Check if the source directory already has a configured system in it.
935 if test `pwd` != `sh -c cd $srcdir && pwd` \
936 && test -f "$srcdir/src/config.h"; then
937 (echo "$progname: WARNING: The directory tree \`$srcdir' is being used"
938 echo " as a build directory right now; it has been configured in its own"
939 echo " right. To configure in another directory as well, you MUST"
940 echo " use GNU make. If you do not have GNU make, then you must"
941 echo " now do \`make distclean' in $srcdir,"
942 echo " and then run $progname again.") >&2
943 extrasub='/^VPATH[[ ]]*=/c\
949 vpath %.in $(srcdir)'
952 dnl ----------------------------------------
953 dnl Find out which version of XEmacs this is
954 dnl ----------------------------------------
955 . "$srcdir/version.sh" || exit 1;
956 dnl Must do the following first to determine verbosity for AC_DEFINE
957 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
958 : "${extra_verbose=$beta}"
959 version="${emacs_major_version}.${emacs_minor_version}"
960 AC_DEFINE_UNQUOTED(EMACS_MAJOR_VERSION, $emacs_major_version)
961 AC_DEFINE_UNQUOTED(EMACS_MINOR_VERSION, $emacs_minor_version)
962 if test -n "$emacs_beta_version" ; then
963 if test "$beta" = "yes"; then
964 version="${version}-b${emacs_beta_version}"
965 AC_DEFINE_UNQUOTED(EMACS_BETA_VERSION, $emacs_beta_version)
967 version="${version}.${emacs_beta_version}"
968 AC_DEFINE_UNQUOTED(EMACS_PATCH_LEVEL, $emacs_beta_version)
971 AC_DEFINE_UNQUOTED(XEMACS_CODENAME, "$xemacs_codename")
972 AC_DEFINE_UNQUOTED(EMACS_VERSION, "$version")
974 if test "$with_infodock" = "yes"; then
975 if test ! -f ../../ID-INSTALL; then
976 echo "Cannot build InfoDock without InfoDock sources"
981 if test "$with_infodock" = "yes"; then
982 dnl InfoDock version numbers. XEmacs will use the same style of numbering
983 dnl after the release of XEmacs 21.0.
984 AC_DEFINE_UNQUOTED(INFODOCK_MAJOR_VERSION, $infodock_major_version)
985 AC_DEFINE_UNQUOTED(INFODOCK_MINOR_VERSION, $infodock_minor_version)
986 AC_DEFINE_UNQUOTED(INFODOCK_BUILD_VERSION, $infodock_build_version)
987 version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
989 CPPFLAGS="$CPPFLAGS -DINFODOCK"
994 AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME")
996 dnl ----------------------------------
997 dnl Error checking and debugging flags
998 dnl ----------------------------------
999 dnl Error checking default to "yes" in beta versions, to "no" in releases.
1000 dnl Same goes for --debug and --extra-verbosity.
1001 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
1002 test "${error_check_extents=$beta}" = yes && AC_DEFINE(ERROR_CHECK_EXTENTS)
1003 test "${error_check_typecheck=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TYPECHECK)
1004 test "${error_check_bufpos=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BUFPOS)
1005 test "${error_check_gc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC)
1006 test "${error_check_malloc=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
1007 test "${error_check_byte_code=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE)
1008 test "${error_check_glyphs=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GLYPHS)
1009 dnl debug=yes must be set when error checking is present. This should be
1011 dnl debug implies other options
1012 if test "${debug:=$beta}" = "yes"; then
1013 use_assertions=yes memory_usage_stats=yes
1014 XE_ADD_OBJS(debug.o)
1015 XE_ADD_OBJS(tests.o)
1016 AC_DEFINE(DEBUG_XEMACS)
1018 test "$use_assertions" = "yes" && AC_DEFINE(USE_ASSERTIONS)
1019 test "$memory_usage_stats" = "yes" && AC_DEFINE(MEMORY_USAGE_STATS)
1021 dnl ------------------------------
1022 dnl Determine the s&m files to use
1023 dnl ------------------------------
1024 dnl Given the configuration name, set machfile and opsysfile to the
1025 dnl names of the m/*.h and s/*.h files we should use.
1027 dnl Canonicalize the configuration name.
1028 AC_MSG_CHECKING("host system type")
1029 dnl allow -workshop suffix on configuration name
1030 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
1031 canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
1032 XE_STRIP_4TH_COMPONENT(configuration)
1033 XE_STRIP_4TH_COMPONENT(canonical)
1034 AC_MSG_RESULT($configuration)
1036 dnl If you add support for a new configuration, add code to this
1037 dnl switch statement to recognize your configuration name and select
1038 dnl the appropriate operating system and machine description files.
1040 dnl You would hope that you could choose an m/*.h file pretty much
1041 dnl based on the machine portion of the configuration name, and an s-
1042 dnl file based on the operating system portion. However, it turns out
1043 dnl that each m/*.h file is pretty manufacturer-specific - for
1044 dnl example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
1045 dnl all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
1046 dnl machines. So we basically have to have a special case for each
1047 dnl configuration name.
1049 dnl As far as handling version numbers on operating systems is
1050 dnl concerned, make sure things will fail in a fixable way. If
1051 dnl /etc/MACHINES says nothing about version numbers, be
1052 dnl prepared to handle anything reasonably. If version numbers
1053 dnl matter, be sure /etc/MACHINES says something about it.
1055 dnl Eric Raymond says we should accept strings like "sysvr4" to mean
1056 dnl "System V Release 4"; he writes, "The old convention encouraged"
1057 dnl "confusion between `system' and `release' levels'."
1061 dnl Straightforward machine determination
1062 case "$canonical" in
1063 sparc-*-* ) machine=sparc ;;
1064 alpha*-*-* ) machine=alpha ;;
1065 vax-*-* ) machine=vax ;;
1066 mips-dec-* ) machine=pmax ;;
1067 mips-sgi-irix6* ) machine=iris6d ;;
1068 mips-sgi-* ) machine=iris4d ;;
1069 mips*-linux ) machine=mips ;;
1070 romp-ibm-* ) machine=ibmrt ;;
1071 rs6000-ibm-aix* ) machine=ibmrs6000 ;;
1072 powerpc-ibm-aix* ) machine=ibmrs6000 ;;
1073 powerpc*-* ) machine=powerpc ;;
1074 hppa-*-* ) machine=hp800 ;;
1075 m88k-dg-* ) machine=aviion ;;
1076 m68*-sony-* ) machine=news ;;
1077 mips-sony-* ) machine=news-risc ;;
1078 clipper-* ) machine=clipper ;;
1079 arm* ) machine=arm ;;
1080 ns32k-* ) machine=ns32000 ;;
1083 dnl Straightforward OS determination
1084 case "$canonical" in
1085 *-*-linux* ) opsys=linux ;;
1086 *-*-netbsd* ) opsys=netbsd ;;
1087 *-*-openbsd* ) opsys=openbsd ;;
1088 *-*-nextstep* ) opsys=nextstep ;;
1089 *-*-vms ) opsys=vms ;;
1092 *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;;
1093 *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;;
1094 *-dec-osf3.[[2-9]] ) opsys=decosf3-2 ;;
1095 *-dec-osf3* ) opsys=decosf3-1 ;;
1096 *-dec-osf[[4-9]]* ) opsys=decosf4-0 ;;
1099 *-*-ultrix[[0-3]].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;;
1100 *-*-ultrix4.[[12]]* ) opsys=bsd4-3 ;;
1101 *-*-ultrix* ) opsys=ultrix4-3 ;;
1104 *-*-aix3.1* ) opsys=aix3-1 ;;
1105 *-*-aix3.2.5 ) opsys=aix3-2-5 ;;
1106 *-*-aix3* ) opsys=aix3-2 ;;
1107 *-*-aix4.0* ) opsys=aix4 ;;
1108 *-*-aix4.1* ) opsys=aix4-1 ;;
1109 *-*-aix4* ) opsys=aix4-2 ;;
1111 dnl Other generic OSes
1112 *-gnu* ) opsys=gnu ;;
1113 *-*-bsd4.[[01]] ) opsys=bsd4-1 ;;
1114 *-*-bsd4.2 ) opsys=bsd4-2 ;;
1115 *-*-bsd4.3 ) opsys=bsd4-3 ;;
1116 *-*-aos4.2 ) opsys=bsd4-2 ;;
1117 *-*-aos* ) opsys=bsd4-3 ;;
1118 *-*-sysv0 | *-*-sysvr0 ) opsys=usg5-0 ;;
1119 *-*-sysv2 | *-*-sysvr2 ) opsys=usg5-2 ;;
1120 *-*-sysv2.2 | *-*-sysvr2.2 ) opsys=usg5-2-2 ;;
1121 *-*-sysv3* | *-*-sysvr3* ) opsys=usg5-3 ;;
1122 *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;;
1123 *-*-sysv4.[[2-9]]* | *-sysvr4.[[2-9]]* )
1124 if test -z "$NON_GNU_CPP" ; then
1125 for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do
1126 if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi
1130 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
1131 *-*-mach_bsd4.3* ) opsys=mach-bsd4-3 ;;
1134 case "$canonical" in
1138 case "$canonical" in
1139 i[[3-9]]86-*-netbsd*) machine=intel386 ;;
1140 hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
1141 dnl Yes, this is somewhat bogus.
1142 machine=hp9000s300 ;;
1143 pc532-*-netbsd* | ns32k-*-netbsd* ) machine=ns32000 ;;
1144 pmax-*-netbsd* | mips-*-netbsd* ) machine=pmax ;;
1150 case "${canonical}" in
1151 i386-*-openbsd*) machine=intel386 ;;
1152 m68k-*-openbsd*) machine=hp9000s300 ;;
1153 mipsel-*-openbsd*) machine=pmax ;;
1158 arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;;
1159 arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;;
1161 dnl Alliant machines
1162 fx80-alliant-* ) machine=alliant4 opsys=bsd4-2 ;;
1163 i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;;
1166 m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;;
1169 580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;;
1171 dnl Apollo, Domain/OS
1172 m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;;
1174 dnl AT&T 3b2, 3b5, 3b15, 3b20
1175 we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;;
1177 dnl AT&T 3b1 - The Mighty Unix PC!
1178 m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;;
1181 rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20
1182 m68*-bull-sysv3* ) machine=dpx2 opsys=usg5-3 ;; # dpx2
1183 m68*-bull-sysv2* ) machine=sps7 opsys=usg5-2 ;; # sps7
1185 dnl CCI 5/32, 6/32 -- see "Tahoe".
1188 celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;;
1191 *-convex-bsd* | *-convex-convexos* )
1192 machine=convex opsys=bsd4-3
1193 NON_GNU_CPP="cc -E -P"
1197 i[[3-9]]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;;
1199 dnl Data General AViiON Machines
1200 i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;;
1201 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;;
1202 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;;
1203 m88k-dg-dgux* ) opsys=dgux ;;
1205 dnl Motorola Delta machines
1206 m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;;
1207 m88k-motorola-sysv4* )
1208 dnl jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
1209 dnl needs POSIX_SIGNALS and therefore needs usg5-4-2.
1210 dnl I hope there are not other 4.0 versions for this machine
1211 dnl which really need usg5-4 instead.
1212 machine=delta88k opsys=usg5-4-2
1214 m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;;
1217 m68*-dual-sysv* ) machine=dual opsys=usg5-2 ;;
1218 m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;;
1221 ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;;
1223 dnl Gould Power Node and NP1
1224 pn-gould-bsd4.2* ) machine=gould opsys=bsd4-2 ;;
1225 pn-gould-bsd4.3* ) machine=gould opsys=bsd4-3 ;;
1226 np1-gould-bsd* ) machine=gould-np1 opsys=bsd4-3 ;;
1228 dnl Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
1229 dnl as far as XEmacs is concerned).
1231 dnl Build needs to be different on 7.0 and later releases
1232 case "`uname -r`" in
1233 [[56]].[[0-9]] ) machine=nh4000 opsys=cxux ;;
1234 [[7]].[[0-9]] ) machine=nh4000 opsys=cxux7 ;;
1236 NON_GNU_CPP="/lib/cpp"
1238 dnl Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
1239 m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;;
1240 dnl Harris power pc NightHawk running Power UNIX (Series 6000)
1241 powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;;
1243 dnl Honeywell XPS100
1244 xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;;
1246 dnl HP 9000 series 200 or 300
1247 m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;;
1251 dnl Figure out machine and opsys orthogonally
1252 case "$canonical" in
1253 m68* ) machine=hp9000s300 ;;
1254 hppa* ) machine=hp800 ;;
1257 case "$canonical" in
1258 *-hp-hpux7* ) opsys=hpux ;;
1259 *-hp-hpux8* ) opsys=hpux8 ;;
1260 *-hp-hpux9* ) opsys=hpux9 ;;
1261 *-hp-hpux10* ) opsys=hpux10 ;;
1262 *-hp-hpux11* ) opsys=hpux11 ;;
1266 dnl HP has a broken "strcat"
1267 case "$opsys" in hpux9 | hpux10 ) XE_ADD_OBJS(strcat.o) ;; esac
1269 if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
1270 ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
1271 NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
1273 case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
1277 orion-orion-bsd* ) machine=orion opsys=bsd4-2 ;;
1278 clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;;
1281 i[[3-9]]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;;
1282 i[[3-9]]86-ibm-aix1.[[23]]* | i[[3-9]]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;;
1283 i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;;
1284 romp-ibm-aos* ) opsys=bsd4-3 ;;
1285 romp-ibm-bsd* ) opsys=bsd4-3 ;;
1286 romp-ibm-mach* ) opsys=mach-bsd4-3 ;;
1288 dnl Integrated Solutions "Optimum V"
1289 m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;;
1290 m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;;
1292 dnl Intel 386 machines where we do care about the manufacturer
1293 i[[3-9]]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;;
1296 i[[3-9]]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;;
1298 dnl Sequent Symmetry running Dynix
1299 i[[3-9]]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;;
1301 dnl Sequent Symmetry running DYNIX/ptx
1302 i[[3-9]]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;;
1304 dnl Unspecified sysv on an ncr machine defaults to svr4.2.
1305 dnl (Plain usg5-4 does not turn on POSIX signals, which we need.)
1306 i[[3-9]]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;;
1308 dnl Intel Paragon OSF/1
1309 i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;;
1312 i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;;
1314 dnl Masscomp machines
1315 m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;;
1317 dnl Megatest machines
1318 m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;;
1320 dnl Workstations sold by MIPS
1321 dnl This is not necessarily all workstations using the MIPS processor -
1322 dnl Irises are produced by SGI, and DECstations by DEC.
1323 mips-mips-usg* ) machine=mips4 ;;
1326 NON_GNU_CC="cc -systype bsd43"
1327 NON_GNU_CPP="cc -systype bsd43 -E"
1328 case "$canonical" in
1329 mips-mips-riscos4* ) opsys=bsd4-3 ;;
1330 mips-mips-riscos5* ) opsys=riscos5 ;;
1333 mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;;
1334 mips-mips-* ) machine=mips opsys=usg5-2-2 ;;
1337 m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;;
1339 dnl The complete machine from National Semiconductor
1340 ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;;
1343 m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32 opsys=usg5-2-2 ;;
1344 m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;;
1346 dnl Nixdorf Targon 31
1347 m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;;
1350 m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;;
1353 m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;;
1355 dnl Pyramid machines
1356 pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;;
1359 ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;;
1360 ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;;
1363 mips-siemens-sysv* | mips-sni-sysv*)
1364 machine=mips-siemens opsys=usg5-4
1365 NON_GNU_CC=/usr/ccs/bin/cc
1366 NON_GNU_CPP=/usr/ccs/lib/cpp
1372 NON_GNU_CC=/usr/ccs/bin/cc
1373 NON_GNU_CPP=/usr/ccs/lib/cpp
1376 dnl Silicon Graphics machines
1377 dnl Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
1378 m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
1379 m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
1381 mips-sgi-irix3.* ) opsys=irix3-3 ;;
1382 mips-sgi-irix4.* ) opsys=irix4-0 ;;
1383 mips-sgi-irix6* ) opsys=irix6-0 ;;
1384 mips-sgi-irix5.1* ) opsys=irix5-1 ;;
1385 mips-sgi-irix5.2* ) opsys=irix5-2 ;;
1386 mips-sgi-irix5.* ) opsys=irix5-3 ;;
1387 mips-sgi-irix* ) opsys=irix5-0 ;;
1390 *-sony-newsos[[34]]* | *-sony-news[[34]]* ) opsys=bsd4-3 ;;
1391 *-sony-news* ) opsys=newsos5 ;;
1394 m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;;
1397 *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* )
1399 case "$canonical" in
1400 m68*-sunos1* ) machine=sun1 ;;
1401 m68*-sunos2* ) machine=sun2 ;;
1402 m68* ) machine=sun3 ;;
1403 i*86*-sun-sunos[[34]]* ) machine=sun386 ;;
1404 i*86-*-* ) machine=intel386 ;;
1405 rs6000* ) machine=rs6000 ;;
1408 dnl Make $canonical even more so.
1409 case "$canonical" in *-sunos5*)
1410 canonical=`echo $canonical | sed -e s/sunos5/solaris2/`;;
1413 dnl On SunOS 4, use /usr/lib/cpp, sans dynodump, /bin/ranlib
1414 dnl On SunOS 5, use cc -E, need dynodump, RANLIB not needed
1415 dnl But, SunOS 5.6 no longer needs dynodump because it has a similar
1416 dnl function integrated.
1417 case "$canonical" in
1419 #test -f /usr/lib/cpp && NON_GNU_CPP=/usr/lib/cpp ;;
1422 #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp
1426 case "$canonical" in
1429 os_release=`uname -r | sed -e 's/^\([[0-9]]\)\.\([[0-9]]\).*/\1\2/'`
1430 AC_DEFINE_UNQUOTED(OS_RELEASE, $os_release) ;;
1432 dnl The last Sun386 ran 4.0.
1433 i*86-*-sunos4* ) opsys=sunos4-0 ;;
1434 *-sunos4.0* ) opsys=sunos4-0 ;;
1435 *-sunos4.1.2* ) opsys=sunos4-1-2 ;;
1436 *-sunos4.1.3* ) opsys=sunos4-1-3 ;;
1437 *-sunos4.1.[[4-9]]* ) opsys=sunos4-1-4 ;;
1438 *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
1439 *-mach* ) opsys=mach-bsd4-3 ;;
1443 case "$canonical" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac
1445 dnl Watch out for a compiler guaranteed not to work.
1446 test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC=""
1450 m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;;
1453 tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;;
1454 tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;;
1456 dnl Tandem Integrity S2
1457 mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;;
1460 m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;;
1462 dnl Tektronix 16000 box (6130?)
1463 ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;;
1465 dnl src/m/tek4300.h hints that this is a m68k machine.
1466 m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;;
1469 titan-titan-sysv* ) machine=titan opsys=usg5-3 ;;
1471 dnl Ustation E30 (SS5E)
1472 m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;;
1476 case "$canonical" in
1477 *-sysv[[01]]* | *-sysvr[[01]]* ) opsys=usg5-0 ;;
1478 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
1479 *-mach* ) opsys=mach-bsd4-3 ;;
1484 ns16k-whitechapel-* ) machine=mg1 ;;
1487 m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;;
1489 dnl Intel 386 machines where we do not care about the manufacturer
1492 case "$canonical" in
1493 *-isc1.* | *-isc2.[[01]]* ) opsys=386-ix ;;
1494 *-isc2.2* ) opsys=isc2-2 ;;
1495 *-isc4.0* ) opsys=isc4-0 ;;
1496 *-isc4.* ) opsys=isc4-1
1497 GCC_TEST_OPTIONS=-posix
1498 NON_GCC_TEST_OPTIONS=-Xp
1500 *-isc* ) opsys=isc3-0 ;;
1501 *-esix5* ) opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;;
1502 *-esix* ) opsys=esix ;;
1503 *-mach* ) opsys=mach-bsd4-3 ;;
1504 *-xenix* ) opsys=xenix ;;
1505 *-sco3.2v4* ) opsys=sco4 NON_GNU_CPP=/lib/cpp ;;
1506 *-bsd386* | *-bsdi1* ) opsys=bsd386 ;;
1507 *-bsdi4* ) opsys=bsdos4 ;;
1508 *-bsdi3* ) opsys=bsdos3 ;;
1509 *-bsdi2.1* ) opsys=bsdos2-1 ;;
1510 *-bsdi2* ) opsys=bsdos2 ;;
1511 *-sco3.2v5* ) opsys=sco5 ;;
1512 *-sysv5* ) opsys=sco7 ;;
1513 *-386bsd* ) opsys=386bsd ;;
1514 *-freebsd* ) opsys=freebsd ;;
1515 *-nextstep* ) opsys=nextstep ;;
1516 *-pc-cygwin* ) opsys=cygwin32 ;;
1517 *-pc-mingw* ) opsys=mingw32 ;
1518 test -z "$with_tty" && with_tty="no";;
1519 dnl Otherwise, we fall through to the generic opsys code at the bottom.
1524 m68k-*-linux* ) machine=m68k opsys=linux ;;
1528 dnl Initialize machine and opsys from $canonical if not in our database above.
1529 test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'`
1530 test -z "$opsys" && opsys=`echo $canonical | sed 's/^[^-]*-[^-]*-//'`
1532 dnl Use configure-time autodetection if s&m not available
1533 if test -r "${srcdir}/src/m/${machine}.h"; then
1534 machfile="m/${machine}.h"
1535 AC_DEFINE_UNQUOTED(config_machfile, "$machfile")
1537 echo "XEmacs has no builtin knowledge of \`$machine' machines."
1538 echo "Using configure-time autodetection only."
1541 if test -r "${srcdir}/src/s/${opsys}.h"; then
1542 opsysfile="s/${opsys}.h"
1543 AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile")
1545 echo "XEmacs has no builtin knowledge of \`$opsys' operating systems."
1546 echo "Using configure-time autodetection only."
1550 if test -z "$dynamic"; then
1552 hpux* | sunos4* ) dynamic=no ;;
1556 if test "$dynamic" = "yes"; then
1558 hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
1559 decosf* ) ld_call_shared="-call_shared" ;;
1561 else dnl "$dynamic" = "no"
1564 echo "Static linking is not supported on Solaris 2."
1565 echo "Rerun configure without specifying --dynamic=no."
1567 linux ) ld_call_shared="-Bstatic" ;;
1568 decosf* ) ld_call_shared="-non_shared" ;;
1572 dnl Use xlc by default on AIX
1573 case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
1575 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
1576 AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher)
1578 dnl --------------------------------------------------
1579 dnl Determine the compiler, set up for feature testing
1580 dnl --------------------------------------------------
1582 dnl Sun Development environment support
1583 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
1584 XE_CHECK_FEATURE_DEPENDENCY(workshop, tooltalk)
1585 if test "$with_workshop" = "yes"; then
1587 XE_ADD_OBJS(sunpro.o)
1590 if test "$with_clash_detection" != "no"; then
1591 AC_DEFINE(CLASH_DETECTION)
1592 XE_ADD_OBJS(filelock.o)
1595 dnl Choose a compiler from (in order)
1596 dnl --compiler, env var CC, with_gcc=no && ${NON_GNU_CC:-cc}, AC_PROG_CC
1597 test -n "$compiler" && CC="$compiler"
1598 if test "$with_gcc" = "no"; then dnl Try to find a non-gcc compiler
1599 case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac
1602 dnl If we don't set CFLAGS here, AC_PROG_CC will set it.
1603 dnl But we know better what's good for us, so we do our own
1604 dnl computation of real CFLAGS later.
1605 dnl --cflags overrides environment variable CFLAGS
1606 test "${cflags-unset}" != unset && CFLAGS="$cflags"
1607 if test "${CFLAGS-unset}" != unset
1608 then cflags_specified=yes;
1609 else cflags_specified=no;
1612 xe_save_CFLAGS="$CFLAGS"
1614 AC_PROG_CC dnl Autoconf has its own magic for compiler autodetection
1616 dnl Retry using random guesswork if AC_PROG_CC got it wrong...
1617 if test "$with_gcc" = "no" -a "$GCC" = "yes"; then
1620 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
1624 CFLAGS="$xe_save_CFLAGS"
1626 dnl Figure out what C preprocessor to use.
1628 dnl On Sun systems, people sometimes set up the variable CPP
1629 dnl with a value that is a directory, not an executable at all.
1630 dnl Detect that case, and ignore that value.
1631 test -n "$CPP" -a -d "$CPP" && CPP=
1633 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1637 dnl --------------------------------------------------------------------
1638 dnl Compiler feature macros
1639 dnl --------------------------------------------------------------------
1641 AC_AIX dnl Defines _ALL_SOURCE on AIX.
1643 dnl We want feature macros defined here *and* in config.h.in, so that
1644 dnl the compilation environment at configure time and compile time agree.
1646 AC_MSG_CHECKING(for GNU libc)
1647 AC_TRY_COMPILE([#include <features.h>],[
1648 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
1649 #error Not a GNU libc system :-(
1650 ******* ======= ******** &&&&&&&&
1652 ], have_glibc=yes, have_glibc=no)
1653 AC_MSG_RESULT($have_glibc)
1654 dnl I'm tired of pop being broken with GLIBC -slb
1655 dnl Well. then why not fix fucking pop?
1656 test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE)
1658 dnl We'd like to use vendor extensions, where available.
1659 dnl We'd like to use functions from the latest Unix98 standards.
1660 dnl See http://www.opengroup.org/onlinepubs/007908799/xsh/compilation.html
1663 AC_DEFINE(__EXTENSIONS__)
1664 dnl Solaris 2 before 2.5 had some bugs with feature test macro interaction.
1665 if test "$os_release" -ge 55; then
1666 AC_DEFINE(_XOPEN_SOURCE,500)
1667 AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
1670 AC_DEFINE(_POSIX_C_SOURCE,199506L)
1671 AC_DEFINE(_XOPEN_SOURCE,500)
1672 AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
1676 dnl Identify compilers to enable compiler-specific hacks.
1677 dnl Add support for other compilers HERE!
1678 dnl GCC is already identified elsewhere.
1679 AC_TRY_RUN([int main () {
1680 #if defined __SUNPRO_C
1682 #elif defined __DECC
1684 #elif defined __USLC__ && defined __SCO_VERSION__
1690 [case "$conftest_rc" in
1691 11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
1692 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;;
1693 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;;
1697 dnl case "$canonical" in
1698 dnl *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;;
1701 dnl --------------------------------------------------------------------
1702 dnl Extract some information from the operating system and machine files
1703 dnl --------------------------------------------------------------------
1705 echo "Extracting information from the machine- and system-dependent headers..."
1707 dnl It is not important that this name contain the PID; you cannot run
1708 dnl two configures in the same directory and have anything work
1710 tempcname="conftest.c"
1712 dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE)
1715 [#]define [$1]ifelse([$3],,, [ "$3"])
1717 configure___ [$2]=[$1]
1720 dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR)
1721 define([CPP_boolean_to_sh],
1723 configure___ [$2]=yes
1725 configure___ [$2]=no
1727 ])dnl CPP_boolean_to_sh
1729 cat > $tempcname < confdefs.h
1730 cat >> $tempcname <<EOF
1732 #define C_SWITCH_SITE
1733 #define C_SWITCH_X_SITE
1734 #define LD_SWITCH_SITE
1735 #define LD_SWITCH_X_SITE
1736 #define LD_SWITCH_X_SITE_AUX
1737 #define OS_RELEASE $os_release
1739 #ifdef config_opsysfile
1740 #include "$srcdir/src/$opsysfile"
1743 #ifdef config_machfile
1744 #include "$srcdir/src/$machfile"
1747 CPP_to_sh(LIBS_MACHINE, libs_machine)
1748 CPP_to_sh(LIBS_SYSTEM, libs_system)
1749 CPP_to_sh(LIBS_TERMCAP, libs_termcap)
1750 CPP_to_sh(LIB_STANDARD, libs_standard)
1752 CPP_to_sh(OBJECTS_MACHINE, objects_machine)
1753 CPP_to_sh(OBJECTS_SYSTEM, objects_system)
1755 CPP_to_sh(C_SWITCH_MACHINE, c_switch_machine)
1756 CPP_to_sh(C_SWITCH_SYSTEM, c_switch_system)
1758 CPP_to_sh(LD_SWITCH_MACHINE, ld_switch_machine)
1759 CPP_to_sh(LD_SWITCH_SYSTEM, ld_switch_system)
1761 CPP_to_sh(UNEXEC, unexec, unexec.o)
1763 CPP_to_sh(LD_SWITCH_SHARED, ld_switch_shared, -c)
1765 #define ORDINARY_LD "\$(CC) \$(CFLAGS)"
1766 configure___ ordinary_ld=ORDINARY_LD
1768 #ifdef ORDINARY_LINK
1769 #define LD ORDINARY_LD
1770 #else /* no ORDINARY LINK */
1771 #ifdef COFF_ENCAPSULATE
1772 #define LD "\$(CC) -nostdlib"
1773 #else /* not COFF_ENCAPSULATE */
1776 #else /* ! defined (LINKER) */
1778 #endif /* ! defined (LINKER) */
1779 #endif /* ! defined (COFF_ENCAPSULATE) */
1780 #endif /* not ORDINARY_LINK */
1783 CPP_to_sh(LIB_GCC, lib_gcc)
1784 CPP_to_sh(LD_TEXT_START_ADDR, ld_text_start_addr)
1786 #if ! defined (ORDINARY_LINK) && !defined (START_FILES)
1788 #ifdef COFF_ENCAPSULATE
1789 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o"
1790 #else /* ! defined (COFF_ENCAPSULATE) */
1791 #define START_FILES "pre-crt0.o /lib/crt0.o"
1792 #endif /* ! defined (COFF_ENCAPSULATE) */
1793 #else /* ! defined (NO_REMAP) */
1794 #define START_FILES "ecrt0.o"
1795 #endif /* ! defined (NO_REMAP) */
1796 #endif /* no ORDINARY_LINK */
1800 configure___ start_files=START_FILES
1802 CPP_boolean_to_sh(ORDINARY_LINK, ordinary_link)
1803 CPP_boolean_to_sh(SYSTEM_MALLOC, system_malloc)
1804 CPP_boolean_to_sh(TERMINFO, have_terminfo)
1805 dnl The MAIL_USE_xxx variables come from the s&m headers
1806 CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock)
1807 CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf)
1808 CPP_boolean_to_sh(MAIL_USE_LOCKING, mail_use_locking)
1809 CPP_boolean_to_sh(HAVE_WIN32_PROCESSES, win32_processes)
1812 dnl The value of CPP is a quoted variable reference, so we need to do this
1813 dnl to get its actual value...
1814 CPP=`eval "echo $CPP $CPPFLAGS"`
1817 eval `$CPP -Isrc $tempcname \
1818 | sed -n -e "s/[ TAB]*=[ TAB\"]*/='/" -e "s/[ TAB\"]*\$/'/" -e "s/^configure___//p"`
1819 changequote([, ])dnl
1823 if test "$pdump" = "yes"; then
1832 dnl For debugging...
1833 test "$extra_verbose" = "yes" && \
1834 PRINT_VAR(libs_machine libs_system libs_termcap libs_standard
1835 objects_machine objects_system c_switch_machine c_switch_system
1836 ld_switch_machine ld_switch_system unexec ld_switch_shared
1837 ld lib_gcc ld_text_start_addr start_files ordinary_link
1838 have_terminfo mail_use_flock mail_use_lockf) && echo ""
1840 dnl Pick up mingw32 include path
1841 case "$opsys" in mingw* | cygwin*)
1842 cygwin_include=`eval "gcc -print-file-name=libc.a"` ;
1843 cygwin_include=`eval "dirname $cygwin_include"` ;
1844 cygwin_include="-I$cygwin_include/../include" ;
1845 extra_includes="$cygwin_include/mingw32 $cygwin_include/mingw $cygwin_include" ;
1846 case "$opsys" in mingw*)
1847 XE_APPEND($extra_includes, c_switch_system) ;;
1852 dnl Non-ordinary link usually requires -lc
1853 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
1855 dnl -----------------------
1856 dnl Compiler-specific hacks
1857 dnl -----------------------
1859 dnl DEC C `-std1' means ANSI C mode
1860 test "$__DECC" = "yes" && XE_APPEND(-std1, c_switch_site)
1862 dnl Some versions of SCO native compiler need -Kalloca
1863 if test "$__USLC__" = yes; then
1864 AC_MSG_CHECKING(for whether the -Kalloca compiler flag is needed)
1866 AC_TRY_LINK([], [void *x = alloca(4);], [:], [
1867 xe_save_c_switch_system="$c_switch_system"
1868 c_switch_system="$c_switch_system -Kalloca"
1869 AC_TRY_LINK([], [void *x = alloca(4);], [ need_kalloca=yes ])
1870 c_switch_system="$xe_save_c_switch_system"])
1871 AC_MSG_RESULT($need_kalloca)
1872 test "$need_kalloca" = "yes" && XE_APPEND(-Kalloca,c_switch_system)
1875 dnl Calculalate value of CFLAGS:
1876 dnl Use either command line flag, environment var, or autodetection
1877 if test "$cflags_specified" = "no"; then
1878 dnl Following values of CFLAGS are known to work well.
1879 dnl Should we take debugging options into consideration?
1880 if test "$GCC" = "yes"; then
1881 CFLAGS="-g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes -Wshadow"
1882 dnl glibc is intentionally not `-Wpointer-arith'-clean.
1883 dnl Ulrich Drepper has rejected patches to fix the glibc header files.
1884 test "$have_glibc" != "yes" && CFLAGS="$CFLAGS -Wpointer-arith"
1885 dnl I'm not convinced this is a good idea any more. -sb
1886 dnl test "$opsys $machine" = "linux intel386" && \
1887 dnl CFLAGS="$CFLAGS -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2"
1888 elif test "$__SUNPRO_C" = "yes"; then
1890 sol2 ) CFLAGS="-v -xO4" ;;
1891 sunos4* ) CFLAGS="-xO2";;
1893 elif test "$__DECC" = "yes"; then
1895 elif test "$CC" = "xlc"; then
1896 CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
1897 dnl ### Add optimal CFLAGS support for other compilers HERE!
1899 CFLAGS="-O" ;dnl The only POSIX-approved flag
1903 dnl Search for GCC specific build problems we know about
1904 if test "$GCC" = "yes"; then
1905 AC_MSG_CHECKING(for buggy gcc versions)
1906 GCC_VERSION=`$CC --version`
1907 case `uname -s`:`uname -m`:$GCC_VERSION in
1908 dnl egcs 2.90.21 (egcs-1.00 release)
1909 dnl egcs 2.90.29 (egcs-1.0.3 release)
1910 *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
1911 dnl Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures
1912 dnl without also using `-fno-schedule-insns'.
1916 *-fno-schedule-insns*) ;;
1919 AC_MSG_WARN(Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures)
1920 AC_MSG_WARN(without also using -fno-schedule-insns.)
1921 AC_MSG_ERROR(Aborting due to known problem)
1927 dnl egcs-2.91.57 (egcs-1.1 release)
1928 dnl egcs-2.91.66 (egcs-1.1.2 release)
1929 Linux:alpha:egcs-2.91.*)
1931 AC_MSG_WARN(There have been reports of egcs-1.1 not compiling XEmacs correctly on)
1932 AC_MSG_WARN(Alpha Linux. There have also been reports that egcs-1.0.3a is O.K.)
1933 AC_MSG_ERROR(Aborting due to known problem)
1938 case "$GCC_VERSION" in
1941 *-fno-strength-reduce*) ;;
1944 AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using)
1945 AC_MSG_WARN(-fno-strength-reduce.)
1946 AC_MSG_ERROR(Aborting due to known problem)
1952 *-fno-caller-saves*) ;;
1955 AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using)
1956 AC_MSG_WARN(-fno-caller-saves.)
1957 AC_MSG_ERROR(Aborting due to known problem)
1967 dnl Inform compiler that certain flags are meant for the linker
1968 dnl XE_PROTECT_LINKER_FLAGS(shell_var)
1969 define([XE_PROTECT_LINKER_FLAGS], [
1970 if test "$GCC" = "yes"; then
1971 set x $[$1]; shift; [$1]=""
1972 while test -n "[$]1"; do
1974 -L | -l | -u ) [$1]="$[$1] [$]1 [$]2"; shift ;;
1975 -L* | -l* | -u* | -Wl* | -pg ) [$1]="$[$1] [$]1" ;;
1977 * ) [$1]="$[$1] -Xlinker [$]1" ;;
1982 XE_PROTECT_LINKER_FLAGS(ld_switch_system)
1983 XE_PROTECT_LINKER_FLAGS(ld_switch_machine)
1984 XE_PROTECT_LINKER_FLAGS(LDFLAGS)
1985 XE_PROTECT_LINKER_FLAGS(ld_call_shared)
1987 dnl Add s&m-determined objects (including unexec) to link line
1988 test -n "$objects_machine" && XE_ADD_OBJS($objects_machine)
1989 test -n "$objects_system" && XE_ADD_OBJS($objects_system)
1990 test -n "$unexec" && test ! "$pdump" = "yes" && XE_ADD_OBJS($unexec)
1991 test "$pdump" = "yes" && XE_ADD_OBJS(dumper.o)
1993 dnl Dynodump (Solaris 2.x, x<6)
1994 AC_MSG_CHECKING(for dynodump)
1995 if test "$unexec" != "unexsol2.o"; then
2000 XE_APPEND(dynodump, MAKE_SUBDIR)
2001 XE_APPEND(dynodump, SRC_SUBDIR_DEPS)
2003 sparc ) dynodump_arch=sparc ;;
2004 *86* ) dynodump_arch=i386 ;;
2005 powerpc ) dynodump_arch=ppc ;;
2007 dnl Dynodump requires the system linker
2008 test "$GCC" = "yes" && XE_APPEND(-fno-gnu-linker, ld_switch_site)
2011 dnl Feed s&m crud to src/Makefile
2013 dnl Linux/powerpc needs the following magic for some reason
2014 test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript"
2016 if test "$unexec" = "unexaix.o"; then
2017 dnl AIX needs various hacks to make static linking work.
2018 if test "$dynamic" = "no"; then
2019 start_flags="-Wl,-bnso,-bnodelcsect"
2020 test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
2021 for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
2022 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
2024 for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do
2025 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi
2027 AC_CHECK_LIB(C, terminateAndUnload, XE_APPEND(-lC, libs_system))
2029 elif test -n "$ld_text_start_addr"; then
2030 start_flags="-T $ld_text_start_addr -e __start"
2032 AC_SUBST(start_flags)
2034 AC_SUBST(ld_switch_shared)
2035 AC_SUBST(start_files)
2036 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then
2037 test -z "$linker" && linker='$(CC) -nostdlib'
2038 test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`'
2040 test "$GCC" != "yes" && lib_gcc=
2044 dnl ---------------------------------------------------------------
2045 dnl Add site and system specific flags to compile and link commands
2046 dnl ---------------------------------------------------------------
2048 dnl Allow use of either ":" or spaces for lists of directories
2049 define(COLON_TO_SPACE,
2050 [case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
2052 dnl --site-libraries (multiple dirs)
2053 COLON_TO_SPACE(site_libraries)
2054 if test -n "$site_libraries"; then
2055 for arg in $site_libraries; do
2058 * ) test -d "$arg" || \
2059 XE_DIE("Invalid site library \`$arg': no such directory")
2062 XE_APPEND($arg, ld_switch_site)
2066 dnl --site-includes (multiple dirs)
2067 COLON_TO_SPACE(site_includes)
2068 if test -n "$site_includes"; then
2069 for arg in $site_includes; do
2072 * ) test -d "$arg" || \
2073 XE_DIE("Invalid site include \`$arg': no such directory")
2076 XE_APPEND($arg, c_switch_site)
2080 dnl --site-prefixes (multiple dirs)
2081 dnl --site-prefixes=dir1:dir2 is a convenient shorthand for
2082 dnl --site-libraries=dir1/lib:dir2/lib --site-includes=dir1/include:dir2/include
2083 dnl Site prefixes take precedence over the standard places, but not over
2084 dnl site-includes and site-libraries.
2085 COLON_TO_SPACE(site_prefixes)
2086 if test -n "$site_prefixes"; then
2087 for dir in $site_prefixes; do
2088 lib_dir="${dir}/lib"
2089 inc_dir="${dir}/include"
2090 if test ! -d "$dir"; then
2091 XE_DIE("Invalid site prefix \`$dir': no such directory")
2092 elif test ! -d "$lib_dir"; then
2093 XE_DIE("Invalid site prefix \`$dir': no such directory \`$lib_dir'")
2095 if test -d "$inc_dir"; then
2096 XE_APPEND("-I$inc_dir", c_switch_site)
2098 XE_APPEND("-L$lib_dir", ld_switch_site)
2103 dnl GNU software installs by default into /usr/local/{include,lib}
2104 dnl if test -d "/usr/local/include" -a -d "/usr/local/lib"; then
2105 dnl XE_APPEND("-L/usr/local/lib", ld_switch_site)
2106 dnl XE_APPEND("-I/usr/local/include", c_switch_site)
2109 dnl Extra system-specific library directories - please add to list
2110 for dir in "/usr/ccs/lib"; do
2111 test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system)
2114 dnl --site-runtime-libraries (multiple dirs)
2115 COLON_TO_SPACE(site_runtime_libraries)
2116 if test -n "$site_runtime_libraries"; then
2117 LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/ */:/g'`"
2121 dnl Linux systems have dynamic runtime library directories listed in
2122 dnl /etc/ld.so.conf. Since those are used at run time, it seems pretty
2123 dnl safe to use them at link time, and less controversial than forcing
2124 dnl the run-time to use the link-time libraries. This also helps avoid
2125 dnl mismatches between the link-time and run-time libraries.
2127 dnl #### Unfortunately, there are horrible libc4 and libc5 libraries
2128 dnl listed in /etc/ld.so.conf on some systems, and including them on
2129 dnl the link path leads to linking in utterly broken libc's.
2130 dnl There are many clever ways of approaching this problem,
2131 dnl but finding out that actually works...
2133 dnl if test -z "$LD_RUN_PATH" -a -r "/etc/ld.so.conf"; then
2134 dnl for dir in `cat /etc/ld.so.conf`; do
2135 dnl test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system)
2137 dnl add_runtime_path=no
2140 dnl -------------------------------------
2141 dnl Compute runtime library path
2142 dnl -------------------------------------
2144 if test -n "$add_runtime_path"; then :;
2145 elif test "$dynamic" = "no"; then add_runtime_path=no
2146 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
2147 else case "$opsys" in
2148 sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
2149 * ) add_runtime_path=no ;;
2153 if test "$add_runtime_path" = "yes"; then
2154 dnl Try to autodetect runtime library flag (usually -R),
2155 dnl and whether it works (or at least does no harm)
2156 AC_MSG_CHECKING("for runtime libraries flag")
2158 sol2 ) dash_r="-R" ;;
2159 decosf* | linux* | irix*) dash_r="-rpath " ;;
2162 for try_dash_r in "-R" "-R " "-rpath "; do
2163 xe_check_libs="${try_dash_r}/no/such/file-or-directory"
2164 XE_PROTECT_LINKER_FLAGS(xe_check_libs)
2165 AC_TRY_LINK(, , dash_r="$try_dash_r")
2167 test -n "$dash_r" && break
2170 if test -n "$dash_r";
2171 then AC_MSG_RESULT("\"${dash_r}\"")
2172 else AC_MSG_RESULT(NONE)
2176 xe_add_unique_runpath_dir='
2178 for xe_dir in $runpath_dirs; do dnl Uniquify
2179 test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no
2181 if test "$xe_add_p" = "yes"; then
2182 test -n "$runpath" && runpath="${runpath}:"
2183 runpath="${runpath}${xe_runpath_dir}"
2184 runpath_dirs="$runpath_dirs $xe_runpath_dir"
2188 dnl XE_ADD_RUNPATH_DIR(directory)
2189 define([XE_ADD_RUNPATH_DIR],[{
2191 dnl PRINT_VAR(ld_switch_site ld_switch_x_site runpath xe_runpath_dir LD_RUN_PATH xe_ldflags)
2192 test "$xe_runpath_dir" != "/lib" -a \
2193 "$xe_runpath_dir" != "/usr/lib" -a \
2194 -n "`ls ${xe_runpath_dir}/*.s[[ol]] 2>/dev/null`" && \
2195 eval "$xe_add_unique_runpath_dir"
2198 dnl XE_COMPUTE_RUNPATH()
2199 define([XE_COMPUTE_RUNPATH],[
2200 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then
2201 dnl Remove runtime paths from current ld switches
2202 ld_switch_site=`echo '' $ld_switch_site | sed -e 's:^ ::' -e "s/$dash_r[[^ ]]*//g"`
2203 ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[[^ ]]*//g"`
2204 dnl PRINT_VAR(ld_switch_site ld_switch_x_site)
2206 dnl Fix up Runtime path
2207 dnl If LD_RUN_PATH is set in environment, use that.
2208 dnl In this case, assume user has set the right value.
2209 runpath="" runpath_dirs=""
2210 if test -n "$LD_RUN_PATH"; then
2211 runpath="$LD_RUN_PATH"
2212 elif test "$GCC" = "yes"; then
2213 dnl Compute runpath from gcc's -v output
2214 ld_switch_run_save="$ld_switch_run"; ld_switch_run=""
2215 echo "int main(int argc, char *argv[[]]) {return 0;}" > conftest.c
2216 xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null'
2217 for arg in `eval "$xe_runpath_link" | grep ' -L'`; do
2218 case "$arg" in P,* | -L* | -R* )
2219 for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do
2220 XE_ADD_RUNPATH_DIR("$dir")
2224 ld_switch_run="$ld_switch_run_save"
2227 dnl Add all directories with .so files to runpath
2228 for arg in $ld_switch_site $ld_switch_x_site; do
2229 case "$arg" in -L*) XE_ADD_RUNPATH_DIR(`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`);; esac
2231 dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available
2232 if test "$opsys $need_motif" = "sol2 yes"; then
2233 xe_runpath_dir="/opt/SUNWdt/lib";
2234 eval "$xe_add_unique_runpath_dir";
2236 fi dnl Compute $runpath
2238 if test -n "$runpath"; then
2239 ld_switch_run="${dash_r}${runpath}"
2240 XE_PROTECT_LINKER_FLAGS(ld_switch_run)
2241 test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath"
2245 XE_COMPUTE_RUNPATH()
2247 dnl -----------------------------------
2248 dnl Do some misc autoconf-special tests
2249 dnl -----------------------------------
2251 dnl Do the opsystem or machine files prohibit the use of the GNU malloc?
2252 dnl Assume not, until told otherwise.
2254 if test "$with_dlmalloc" != "no"; then
2259 after_morecore_hook_exists=yes
2260 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
2261 AC_MSG_CHECKING(whether __after_morecore_hook exists)
2262 AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
2263 [AC_MSG_RESULT(yes)],
2265 after_morecore_hook_exists=no])
2266 if test "$system_malloc" = "yes" ; then
2269 - The GNU allocators don't work with this system configuration."
2270 elif test "$with_system_malloc" = "yes" ; then
2273 - User chose not to use GNU allocators."
2274 elif test "$with_debug_malloc" = "yes" ; then
2277 - User chose to use Debugging Malloc."
2280 if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then
2282 - Using Doug Lea's new malloc from the GNU C Library."
2283 AC_DEFINE(DOUG_LEA_MALLOC)
2284 if test "$after_morecore_hook_exists" = "no" ; then
2286 - Using Doug Lea's new malloc from the Linux C Library."
2287 AC_DEFINE(_NO_MALLOC_WARNING_)
2291 dnl #### mcheck is broken in all versions of Linux libc and glibc.
2292 dnl Try this again when 2.1 hits the streets.
2293 dnl Avoid using free-hook.c if support exists for malloc debugging in libc
2294 dnl have_libmcheck=no
2295 dnl if test "$error_check_malloc" = "yes" -a \
2296 dnl "$have_glibc" = "yes" -a \
2297 dnl "$doug_lea_malloc" = "yes"; then
2298 dnl AC_CHECK_HEADERS(mcheck.h)
2299 dnl AC_CHECK_LIB(mcheck, mcheck, have_libmcheck=yes, have_libmcheck=no)
2302 dnl if test "$have_libmcheck" = "yes"; then
2303 dnl AC_DEFINE(HAVE_LIBMCHECK)
2304 dnl libmcheck=-lmcheck
2305 dnl AC_SUBST(libmcheck)
2308 dnl Some other nice autoconf tests. If you add a test here which
2309 dnl should make an entry in src/config.h, do not forget to add an
2310 dnl #undef clause to src/config.h.in for autoconf to modify.
2316 dnl checks for header files
2317 AC_CHECK_HEADERS(dnl
2320 cygwin/version.h dnl
2340 dnl ----------------------------------------------------------------
2341 dnl Checking for utime() or utimes().
2342 dnl We prefer utime, since it is more standard.
2343 dnl Some systems have utime.h but do not declare the struct anyplace,
2344 dnl so we use a more sophisticated test for utime than AC_CHECK_FUNCS.
2345 dnl ----------------------------------------------------------------
2346 AC_MSG_CHECKING(for utime)
2347 AC_TRY_COMPILE([#include <sys/types.h>
2348 #include <utime.h>],
2349 [struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x);],
2351 AC_DEFINE(HAVE_UTIME)],
2353 dnl We don't have utime(); how about utimes()?
2354 AC_CHECK_FUNCS(utimes)])
2357 dnl checks for typedefs
2364 AC_CHECK_TYPE(ssize_t, int)
2366 dnl check for Unix98 socklen_t
2367 AC_MSG_CHECKING(for socklen_t)
2368 AC_TRY_COMPILE([#include <sys/socket.h>
2370 ],[],[AC_MSG_RESULT(yes)],[
2371 AC_TRY_COMPILE([#include <sys/socket.h>
2372 int accept (int, struct sockaddr *, size_t *);
2374 AC_MSG_RESULT(size_t)
2375 AC_DEFINE(socklen_t,size_t)], [
2377 AC_DEFINE(socklen_t,int)])])
2379 AC_MSG_CHECKING(for struct timeval)
2380 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
2381 #include <sys/time.h>
2384 #ifdef HAVE_SYS_TIME_H
2385 #include <sys/time.h>
2389 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
2392 AC_DEFINE(HAVE_TIMEVAL)],
2396 dnl checks for structure members
2400 dnl checks for compiler characteristics
2403 dnl check for Make feature
2406 dnl check byte order
2409 dnl define SIZEOF_TYPE
2410 AC_CHECK_SIZEOF(short)
2411 if test "$ac_cv_sizeof_short" = 0; then
2413 echo "*** PANIC *** Configure tests are not working - compiler is broken."
2414 echo "*** PANIC *** Please examine config.log for compilation errors."
2417 AC_CHECK_SIZEOF(int)
2418 AC_CHECK_SIZEOF(long)
2419 AC_CHECK_SIZEOF(long long)
2420 AC_CHECK_SIZEOF(void *)
2422 dnl check for long file names
2423 AC_SYS_LONG_FILE_NAMES
2425 dnl -lm is required by LISP_FLOAT_TYPE, among other things
2426 AC_CHECK_FUNC(sin, ,AC_CHECK_LIB(m, sin))
2428 dnl Floating operation support is now unconditional
2429 AC_DEFINE(LISP_FLOAT_TYPE)
2431 AC_TRY_LINK([#include <math.h>],
2432 [return atanh(1.0) + asinh(1.0) + acosh(1.0); ],
2433 AC_DEFINE(HAVE_INVERSE_HYPERBOLIC))
2435 dnl Determine type of mail locking from configure args and s&m headers
2436 AC_CHECKING(type of mail spool file locking)
2437 AC_CHECK_FUNCS(lockf flock)
2438 dnl The mail_use_xxx variables are set according to the s&m headers.
2439 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
2440 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
2441 test -z "$mail_locking" -a "$mail_use_locking" = "yes" && mail_locking=locking
2442 if test -z "$mail_locking"; then
2443 case "$opsys" in cygwin* | mingw*)
2448 if test "$mail_locking" = "lockf"; then AC_DEFINE(MAIL_LOCK_LOCKF)
2449 elif test "$mail_locking" = "flock"; then AC_DEFINE(MAIL_LOCK_FLOCK)
2450 elif test "$mail_locking" = "locking"; then AC_DEFINE(MAIL_LOCK_LOCKING)
2451 elif test "$mail_locking" = "pop"; then
2454 else mail_locking="dot-locking"; AC_DEFINE(MAIL_LOCK_DOT)
2456 test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \
2457 XE_DIE("lockf mail locking requested but not available.")
2458 test "$mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \
2459 XE_DIE("flock mail locking requested but not available.")
2460 test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \
2461 XE_DIE("locking mail locking requested but not available.")
2463 case "$opsys" in decosf*)
2464 AC_CHECK_LIB(pthreads, cma_open)
2465 test "$ac_cv_lib_pthreads_cma_open" = "yes" && \
2466 c_switch_site="$c_switch_site -threads" ;;
2469 AC_MSG_CHECKING(whether the -xildoff compiler flag is required)
2470 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
2471 if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
2472 then AC_MSG_RESULT(no);
2473 else AC_MSG_RESULT(yes); XE_APPEND(-xildoff, ld_switch_site)
2475 else AC_MSG_RESULT(no)
2478 dnl Link with "-z ignore" on Solaris if supported
2479 if test "$opsys" = "sol2"; then
2480 if test "$os_release" -ge 56; then
2481 AC_MSG_CHECKING(for \"-z ignore\" linker flag)
2482 case "`ld -h 2>&1`" in
2483 *-z\ ignore\|record* ) AC_MSG_RESULT(yes)
2484 XE_PREPEND(-z ignore, ld_switch_site) ;;
2485 *) AC_MSG_RESULT(no) ;;
2490 dnl ----------------------
2491 dnl Choose a window system
2492 dnl ----------------------
2494 AC_CHECKING("for specified window system")
2496 if test "$with_x11" != "no"; then
2497 dnl User-specified --x-includes or --x-libraries implies --with-x11.
2498 test "$x_includes $x_libraries" != "NONE NONE" && \
2499 window_system=x11 with_x11=yes
2501 dnl Autodetection of X11 libraries and includes
2502 dnl -------------------------------------------
2503 dnl AC_PATH_XTRA thinks it can find our X headers and includes, but
2504 dnl it often gets it wrong, so we only use it as a last resort.
2506 dnl $OPENWINHOME implies --x-includes and --x-libraries
2507 dnl Not (yet) handled by autoconf2
2508 if test "$x_includes $x_libraries" = "NONE NONE" \
2509 -a -n "$OPENWINHOME" \
2510 -a "$OPENWINHOME" != "/usr/openwin" \
2511 -a -d "$OPENWINHOME"; then
2512 test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib"
2513 test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include"
2514 test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include"
2517 if test "$x_includes" = "NONE"; then
2518 dnl AC_PATH_XTRA often guesses /usr/include, when some other
2519 dnl include directory is a MUCH better guess (Linux, HP-UX 10.20).
2520 dnl This is a workaround for idiot (esp. HP) system vendors, who
2521 dnl provide a /usr/include/X11, but DON'T FULLY POPULATE IT.
2522 for dir in "/usr/X11" "/usr/X11R6"; do
2523 if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi
2527 if test "$x_libraries" = "NONE"; then
2528 for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do
2529 if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi
2533 AC_PATH_XTRA # Autoconf claims to find X library and include dirs for us.
2534 if test "$no_x" = "yes"
2535 then with_x11=no window_system=none HAVE_X_WINDOWS=no
2536 else with_x11=yes window_system=x11 HAVE_X_WINDOWS=yes
2541 yes ) window_system=x11 HAVE_X_WINDOWS=yes ;;
2542 no ) window_system=none HAVE_X_WINDOWS=no ;;
2545 if test "$with_x11" = "yes"; then
2546 AC_DEFINE(HAVE_X_WINDOWS)
2547 XE_APPEND(lwlib, MAKE_SUBDIR)
2548 XE_APPEND(lwlib, SRC_SUBDIR_DEPS)
2550 dnl Try to find Motif/CDE/Tooltalk dirs
2551 dnl These take precedence over other X libs/includes, so PRE-pend
2552 for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
2553 inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
2554 if test -d "$lib_dir" -a -d "$inc_dir"; then
2555 case "$x_libraries" in *"$lib_dir"* ) ;; *)
2556 x_libraries="$lib_dir $x_libraries"
2557 XE_PREPEND(-L${lib_dir}, X_LIBS) ;;
2559 case "$x_includes" in "$inc_dir"* ) ;; *)
2560 x_includes="$inc_dir $x_includes"
2561 XE_PREPEND(-I${inc_dir}, X_CFLAGS) ;;
2563 break; dnl only need ONE Motif implementation!
2567 dnl Contrib X libs/includes do NOT take precedence, so AP-pend
2568 for rel in "X11R6" "X11R5" "X11R4"; do
2569 lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include"
2570 if test -d "$lib_dir" -a -d "$inc_dir"; then
2571 case "$x_libraries" in *"$lib_dir"* ) ;; *)
2572 x_libraries="$x_libraries $lib_dir"
2573 XE_APPEND(-L${lib_dir}, X_LIBS)
2575 case "$x_includes" in "$inc_dir"* ) ;; *)
2576 x_includes="$x_includes $inc_dir"
2577 XE_APPEND(-I${inc_dir}, X_CFLAGS)
2579 break; dnl Only need ONE X11 implementation !
2583 dnl Avoid version mismatch for shared library libXm.so on osf4
2585 decosf*) if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ;;
2588 ld_switch_x_site="$X_LIBS"
2590 XE_COMPUTE_RUNPATH()
2592 if test "$extra_verbose" = "yes"; then
2593 echo; echo "X11 compilation variables:"
2594 PRINT_VAR(x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS)
2598 dnl Set up bitmaps search path.
2599 dnl The original suggestion was to unconditionally to append X11/bitmaps
2600 dnl to each element of $x_includes, I'm pretty sure this is the wrong
2601 dnl thing to do. We test for bitmaps and X11/bitmaps directories on each
2602 dnl element and add them to BITMAPDIR if they exist.
2604 if test "$x_includes" != NONE; then
2605 for i in $x_includes; do
2606 if test -d "$i/bitmaps"; then
2607 bitmapdirs="$i/bitmaps:$bitmapdirs"
2609 if test -d "$i/X11/bitmaps"; then
2610 bitmapdirs="$i/X11/bitmaps:$bitmapdirs"
2613 bitmapdirs=`echo "$bitmapdirs" | sed s/.$//`
2615 test ! -z "$bitmapdirs" && AC_DEFINE_UNQUOTED(BITMAPDIR, "$bitmapdirs")
2617 dnl Autodetect defines extracted from X config by xmkmf, e.g. NARROWPROTO
2618 AC_CHECKING(for X defines extracted by xmkmf)
2620 if mkdir conftestdir; then
2622 cat > Imakefile <<'EOF'
2624 @echo ${PROTO_DEFINES} ${STD_DEFINES}
2626 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2627 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2628 xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make`
2632 for word in $xmkmf_defines; do
2633 case "$word" in -D* )
2634 sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
2636 -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
2639 dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
2640 if grep "^#define $sym " confdefs.h >/dev/null; then :; else
2641 if test "$val" = "1"
2642 then AC_DEFINE_UNQUOTED($sym)
2643 else AC_DEFINE_UNQUOTED($sym,$val)
2650 dnl make sure we can find Intrinsic.h
2651 AC_CHECK_HEADER(X11/Intrinsic.h, ,
2652 [AC_MSG_ERROR("Unable to find X11 header files.")])
2654 dnl -lXt and -lX11 are required
2655 dnl Some broken systems require the magic "-b i486-linuxaout" flag
2656 AC_CHECK_LIB(X11, XOpenDisplay, have_lib_x11=yes)
2657 if test "$have_lib_x11" != "yes"; then
2658 AC_CHECK_LIB(X11, XGetFontProperty,
2659 ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site",
2660 [AC_MSG_ERROR("Unable to find X11 libraries.")],
2664 test "$extra_verbose" = "yes" && echo " Setting libs_x to \"-lX11\""
2666 dnl Autodetect -lXext
2667 AC_CHECK_LIB(Xext, XShapeSelectInput, XE_PREPEND(-lXext, libs_x))
2670 AC_CHECK_LIB(Xt, XtOpenDisplay, XE_PREPEND(-lXt, libs_x),
2671 AC_MSG_ERROR("Unable to find X11 libraries."))
2673 AC_MSG_CHECKING(the version of X11 being used)
2674 AC_TRY_RUN([#include <X11/Intrinsic.h>
2675 int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }],
2676 [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
2677 AC_MSG_RESULT(R${x11_release})
2678 AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
2680 if test "${x11_release}" = "4"; then
2681 case "$with_widgets" in
2682 "" | "no") with_widgets=no ;;
2683 *) XE_DIE("Widget support requires X11R5 or greater") ;;
2687 AC_CHECK_FUNCS(XConvertCase)
2689 AC_CHECK_HEADERS(X11/Xlocale.h)
2691 dnl XFree86 has a non-standard prototype for this X11R6 function
2692 AC_CHECK_FUNCS(XRegisterIMInstantiateCallback)
2693 AC_MSG_CHECKING(for standard XRegisterIMInstantiateCallback prototype)
2695 #define NeedFunctionPrototypes 1
2696 #include <X11/Xlib.h>
2697 extern Bool XRegisterIMInstantiateCallback(
2698 Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*);
2700 [AC_MSG_RESULT(yes)],
2702 AC_DEFINE(XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE)])
2704 dnl autodetect -lXmu
2705 test -z "$with_xmu" && { AC_CHECK_LIB(Xmu, XmuReadBitmapDataFromFile,
2706 with_xmu=yes, with_xmu=no) }
2707 if test "$with_xmu" = "no"; then
2710 XE_PREPEND(-lXmu, libs_x)
2714 dnl Autodetect -lXbsd
2715 dnl #### Someone, please add a better function than main
2716 AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x))
2718 dnl Problem with the MIT distribution of X on AIX
2719 if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
2720 dnl X11R6 requires thread-safe code on AIX for some reason
2721 if test "$GCC" = "yes"; then
2722 XE_PREPEND(-mthreads, X_CFLAGS)
2723 XE_PREPEND(-mthreads, libs_x)
2726 "xlc" ) CC="xlc_r" ;;
2727 "xlC" ) CC="xlC_r" ;;
2733 fi dnl $with_x11 = yes
2735 if test "$with_msw" != "no"; then
2736 AC_CHECKING(for MS-Windows)
2737 AC_CHECK_LIB(gdi32,main,with_msw=yes)
2738 if test "$with_msw" = "yes"; then
2739 AC_DEFINE(HAVE_MS_WINDOWS)
2741 dnl The net installer only works with MS-Windows currently
2742 XE_APPEND(netinstall, MAKE_SUBDIR)
2743 XE_APPEND(netinstall, SRC_SUBDIR_DEPS)
2744 XE_APPEND(netinstall, INSTALL_ARCH_DEP_SUBDIR)
2746 install_pp="$blddir/lib-src/installexe.sh"
2747 XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool, libs_system)
2748 test "$with_dragndrop" != no && XE_APPEND(msw, dragndrop_proto)
2749 if test "$window_system" != x11; then
2751 test "$with_scrollbars" != "no" && with_scrollbars=msw \
2752 && XE_ADD_OBJS(scrollbar-msw.o)
2753 test "$with_menubars" != "no" && with_menubars=msw \
2754 && XE_ADD_OBJS(menubar-msw.o)
2755 test "$with_toolbars" != "no" && with_toolbars=msw \
2756 && XE_ADD_OBJS(toolbar-msw.o)
2757 test "$with_dialogs" != "no" && with_dialogs=msw \
2758 && XE_ADD_OBJS(dialog-msw.o)
2759 test "$with_widgets" != "no" && with_widgets=msw
2761 test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-msw.o)
2762 test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-msw.o)
2763 test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-msw.o)
2764 test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-msw.o)
2766 dnl check for our special version of select
2767 AC_TRY_RUN([#include <fcntl.h>
2768 int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }],
2769 [AC_DEFINE(HAVE_MSG_SELECT)])
2770 with_file_coding=yes
2771 XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o)
2775 AC_SUBST(install_pp)
2777 test -z "$window_system" && window_system="none"
2779 dnl Test for features that require a window system - ANY window system
2780 if test "$window_system" = "none"; then
2781 for feature in menubars scrollbars toolbars dialogs dragndrop xface
2783 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2784 AC_MSG_WARN([--with-$feature ignored: Not valid without window system support])
2786 eval "with_${feature}=no"
2789 test -z "$with_toolbars" && with_toolbars=yes
2792 dnl ### Test for features that require mswindows support - currently none
2793 dnl ### MS-Windows folks: add code here..... (martin)
2794 if test "$with_msw" != "yes"; then
2795 for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES
2797 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2798 AC_MSG_WARN([--with-$feature ignored: Not valid without MS-Windows support])
2800 eval "with_${feature}=no"
2806 dnl Test for features that require X11 support
2807 if test "$with_x11" != "yes"; then
2808 dnl It ought to be reasonable to have no output device at all, and only use
2809 dnl XEmacs in --batch mode.
2810 dnl if test "$with_tty" = "no" ; then
2811 dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
2813 for feature in tooltalk cde offix wmcommand xim xmu nas_sound
2815 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
2816 AC_MSG_WARN([--with-$feature ignored: Not valid without X support])
2818 eval "with_${feature}=no"
2822 dnl Balloon Help requires the Shape extension, not available everywhere,
2823 dnl for example not on AIX 4.3.
2824 if test "$with_x11" = "yes"; then
2825 AC_CHECK_HEADER(X11/extensions/shape.h, [
2826 AC_DEFINE(HAVE_BALLOON_HELP)
2827 XE_ADD_OBJS(balloon_help.o balloon-x.o)])
2830 dnl FSF 19.29 has some bitmapdir stuff here.
2833 case "$window_system" in
2834 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;;
2835 msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;;
2836 none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;;
2839 case "$x_libraries" in *X11R4* )
2840 test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h"
2841 test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h"
2844 dnl Enable or disable proper handling of WM_COMMAND
2845 AC_CHECKING(for WM_COMMAND option);
2846 dnl if test "$with_wmcommand" = "yes"; then
2847 if test "$with_wmcommand" != "no"; then
2848 AC_DEFINE(HAVE_WMCOMMAND)
2851 dnl Autodetect Xauth
2852 dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs
2853 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
2854 test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) }
2855 test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no) }
2856 test -z "$with_xauth" && with_xauth=yes
2857 if test "$with_xauth" = "yes"; then
2858 AC_DEFINE(HAVE_XAUTH)
2859 XE_SPACE(libs_xauth, $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS)
2861 AC_SUBST(libs_xauth)
2863 dnl This one is for the static initializeds variables in
2864 dnl offix.c, so that the thing is dumped after lastfile.o
2867 dnl Autodetect tooltalk
2868 if test "$with_tooltalk" != "no" ; then
2869 dnl autodetect the location of tt_c.h
2870 dnl tt_c.h might be in Tt or desktop include directories
2871 for dir in "" "Tt/" "desktop/" ; do
2872 AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_file="${dir}tt_c.h"; break)
2874 if test -z "$tt_c_h_file"; then
2875 if test "$with_tooltalk" = "yes"; then
2876 USAGE_ERROR("Unable to find required tooltalk header files.")
2881 if test "$with_tooltalk" != "no" ; then
2882 for extra_libs in "" "-lI18N -lce" "-lcxx"; do
2883 AC_CHECK_LIB(tt, tt_message_create,
2884 tt_libs="-ltt $extra_libs"; break, [:],$extra_libs)
2886 if test -z "$tt_libs"; then
2887 if test "$with_tooltalk" = "yes"; then
2888 USAGE_ERROR("Unable to find required tooltalk libraries.")
2893 test -z "$with_tooltalk" && with_tooltalk=yes
2894 if test "$with_tooltalk" = "yes"; then
2896 AC_DEFINE_UNQUOTED(TT_C_H_FILE, "$tt_c_h_file")
2897 XE_PREPEND($tt_libs, libs_x)
2898 XE_ADD_OBJS(tooltalk.o)
2902 test -z "$with_cde" && { AC_CHECK_HEADER(Dt/Dt.h, , with_cde=no) }
2903 test -z "$with_cde" && { AC_CHECK_LIB(DtSvc, DtDndDragStart, [:], with_cde=no) }
2904 test -z "$with_cde" && with_cde=yes
2905 if test "$with_dragndrop" = no; then
2906 AC_MSG_WARN([No CDE without generic Drag'n'Drop support])
2909 if test "$with_cde" = "yes" ; then
2911 XE_PREPEND(-lDtSvc, libs_x)
2912 XE_APPEND(CDE, dragndrop_proto)
2913 with_tooltalk=yes # CDE requires Tooltalk
2914 need_motif=yes # CDE requires Motif
2917 dnl Always compile OffiX unless --without-offix is given, no
2918 dnl X11 support is compiled in, no standard Xmu is available,
2919 dnl or dragndrop support is disabled
2920 dnl Because OffiX support currently loses when more than one display
2921 dnl is in use, we now disable it by default -slb 07/10/1998.
2922 test "$window_system" != "x11" && with_offix=no
2923 if test "$with_xmu" != yes -a "$with_x11" = yes; then
2924 AC_MSG_WARN([No OffiX without real Xmu support])
2927 if test "$with_dragndrop" = no; then
2928 AC_MSG_WARN([No OffiX without generic Drag'n'Drop support])
2931 if test "$with_cde" = yes; then
2932 AC_MSG_WARN([CDE already found, disabling OffiX support])
2935 test -z "$with_offix" && with_offix=no
2936 if test "$with_offix" = "yes"; then
2937 AC_DEFINE(HAVE_OFFIX_DND)
2938 XE_APPEND(offix.o, dnd_objs)
2939 XE_APPEND(OffiX, dragndrop_proto)
2942 dnl Autodetect Drag'n'Drop support
2943 dnl always included if CDE, Offix, or MSWindows are defined
2944 if test "$with_dragndrop" != "no" ; then
2945 AC_MSG_CHECKING(if drag and drop API is needed)
2946 if test -n "$dragndrop_proto" ; then
2948 AC_MSG_RESULT([yes (${dragndrop_proto} )])
2949 AC_DEFINE(HAVE_DRAGNDROP)
2950 XE_APPEND(dragdrop.o, extra_objs)
2958 AC_CHECKING(for LDAP)
2959 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) }
2960 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) }
2961 if test "$with_ldap" != "no"; then
2962 AC_CHECK_LIB(ldap, ldap_search, with_ldap_nolber=yes, with_ldap_nolber=no)
2963 test "$with_ldap_nolber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_lber=yes, with_ldap_lber=no, -llber) }
2964 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krb=yes, with_ldap_krb=no, -llber -lkrb) }
2965 test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krbdes=yes, with_ldap_krbdes=no, -llber -lkrb -ldes) }
2966 test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes
2968 if test "$with_ldap" = "yes"; then
2969 AC_DEFINE(HAVE_LDAP)
2970 XE_ADD_OBJS(eldap.o)
2971 if test "$with_ldap_nolber" = "yes" ; then
2972 XE_PREPEND(-lldap, LIBS)
2974 if test "$with_ldap_krb" = "yes" ; then
2975 XE_PREPEND(-lkrb, LIBS)
2977 if test "$with_ldap_krbdes" = "yes" ; then
2978 XE_PREPEND(-ldes, LIBS)
2979 XE_PREPEND(-lkrb, LIBS)
2981 XE_PREPEND(-llber, LIBS)
2982 XE_PREPEND(-lldap, LIBS)
2984 AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result)
2987 dnl Autodetect PostgreSQL
2988 dnl On many Linux systems, PostgreSQL is packaged to be installed in /usr;
2989 dnl in this case, configure will easily detect it there.
2991 dnl If PostgreSQL is installed into a different prefix,
2992 dnl (such as the default /usr/local/pgsql when building from source),
2993 dnl that prefix must be specified using the --site-prefixes flag.
2994 if test "$with_postgresql" != "no"; then
2995 AC_CHECKING(for PostgreSQL)
2997 dnl Look for these standard header file locations, known to be used on Linux
2998 for header_dir in "" "pgsql/" "postgresql/"; do
2999 AC_CHECK_HEADER(${header_dir}libpq-fe.h,
3000 libpq_fe_h_file=${header_dir}libpq-fe.h; break)
3003 test -n "$libpq_fe_h_file" && { AC_CHECK_LIB(pq,PQconnectdb,have_libpq=yes) }
3005 if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then
3007 AC_DEFINE(HAVE_POSTGRESQL)
3008 AC_CHECK_LIB(pq,PQconnectStart, [
3009 with_postgresqlv7=yes;
3010 AC_DEFINE(HAVE_POSTGRESQLV7)])
3011 AC_DEFINE_UNQUOTED(LIBPQ_FE_H_FILE, "$libpq_fe_h_file")
3012 XE_PREPEND(-lpq, LIBS)
3013 XE_ADD_OBJS(postgresql.o)
3014 elif test "$with_postgresql" = "yes"; then
3015 XE_DIE("Required PostgreSQL support cannot be provided. Check --site-prefixes.")
3019 dnl ----------------------
3020 dnl Graphics libraries
3021 dnl ----------------------
3023 if test "$window_system" != "none"; then
3024 AC_CHECKING(for graphics libraries)
3028 if test -z "$with_xpm"; then
3029 AC_MSG_CHECKING(for Xpm - no older than 3.4f)
3031 AC_TRY_RUN([#define XPM_NUMBERS
3032 #include <X11/xpm.h>
3033 int main(int c, char **v) {
3035 XpmIncludeVersion != XpmLibraryVersion() ? 1 :
3036 XpmIncludeVersion < 30406 ? 2 : 0 ;}],
3037 [./conftest dummy_arg; xpm_status=$?;
3038 if test "$xpm_status" = "0"; then
3042 if test "$xpm_status" = "1"; then
3043 xpm_problem="Xpm library version and header file version don't match!"
3044 elif test "$xpm_status" = "2"; then
3045 xpm_problem="Xpm library version is too old!"
3047 xpm_problem="Internal xpm detection logic error!"
3050 *** WARNING *** $xpm_problem
3051 I'm not touching that with a 10-foot pole!
3052 If you really want to use the installed version of Xpm, rerun
3053 configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
3057 AC_MSG_RESULT($with_xpm)
3059 if test "$with_xpm" = "yes"; then
3060 dnl #### This code assumes that if AC_CHECK_LIB fails,
3061 dnl #### then it will succeed if FOR_MSW is defined,
3062 dnl #### but doesn't actually verify this assumption.
3064 XE_PREPEND(-lXpm, libs_x)
3065 AC_MSG_CHECKING(for \"FOR_MSW\" xpm)
3067 AC_TRY_LINK(, [XpmCreatePixmapFromData()],
3071 AC_MSG_RESULT($xpm_for_msw)
3072 if test "$xpm_for_msw" = "yes"; then
3077 dnl Autodetect XFACE
3078 test -z "$with_xface" && { AC_CHECK_HEADER(compface.h, ,with_xface=no) }
3079 test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) }
3080 test -z "$with_xface" && with_xface=yes
3081 if test "$with_xface" = "yes"; then
3082 AC_DEFINE(HAVE_XFACE)
3083 XE_PREPEND(-lcompface, libs_x)
3086 dnl For a brief period we had the GIF code split out into a separate library,
3087 dnl but patent problems, etc. sort of squashed that idea.
3088 dnl We default to building with builtin GIF decoding
3089 if test "$with_gif" != "no"; then
3092 XE_ADD_OBJS(dgif_lib.o gif_io.o)
3095 dnl Too many stupid linkers can't detect cascaded lib dependencies until runtime
3096 dnl So we always search for libz compression support.
3097 if test "$with_png $with_tiff" != "no no"; then
3098 AC_CHECK_LIB(c, inflate, [:], [
3099 AC_CHECK_LIB(z, inflate, [XE_PREPEND(-lz, libs_x)],[
3100 AC_CHECK_LIB(gz, inflate, [XE_PREPEND(-lgz, libs_x)])])])
3104 test -z "$with_jpeg" && { AC_CHECK_HEADER(jpeglib.h, ,with_jpeg=no) }
3105 test -z "$with_jpeg" && { AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[:],with_jpeg=no) }
3106 test -z "$with_jpeg" && with_jpeg=yes
3107 if test "$with_jpeg" = "yes"; then
3108 AC_DEFINE(HAVE_JPEG)
3109 XE_PREPEND(-ljpeg, libs_x)
3114 test -z "$with_png" && { AC_CHECK_FUNC(pow, ,with_png=no) }
3115 test -z "$with_png" && { AC_CHECK_HEADER(png.h, ,with_png=no) }
3116 test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no) }
3117 if test -z "$with_png"; then
3118 AC_MSG_CHECKING(for workable png version information)
3119 xe_check_libs="-lpng -lz"
3120 AC_TRY_RUN([#include <png.h>
3121 int main(int c, char **v) {
3122 if (c == 1) return 0;
3123 if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
3124 return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}],
3125 [./conftest dummy_arg; png_status=$?;
3126 if test "$png_status" = "0"; then
3130 if test "$png_status" = "1"; then
3131 png_problem="PNG library version and header file don't match!"
3132 elif test "$png_status" = "2"; then
3133 png_problem="PNG library version too old (pre 1.0.2)!"
3136 *** WARNING *** $png_problem
3137 I'm not touching that with a 10-foot pole!
3138 If you really want to use the installed version of libPNG, rerun
3139 configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
3143 AC_MSG_RESULT($with_png)
3145 if test "$with_png" = "yes"; then
3147 XE_PREPEND(-lpng, libs_x)
3151 test -z "$with_tiff" && { AC_CHECK_HEADER(tiffio.h, ,with_tiff=no) }
3152 test -z "$with_tiff" && { AC_CHECK_LIB(tiff, TIFFClientOpen,[:],with_tiff=no) }
3153 test -z "$with_tiff" && with_tiff=yes
3154 if test "$with_tiff" = "yes"; then
3155 AC_DEFINE(HAVE_TIFF)
3156 XE_PREPEND(-ltiff, libs_x)
3160 dnl ----------------------
3161 dnl X-Specific Graphics libraries
3162 dnl ----------------------
3164 if test "$with_x11" = "yes"; then
3166 AC_CHECKING(for X11 graphics libraries)
3168 AC_CHECKING(for the Athena widgets)
3170 dnl What in heck did the user actually want?
3171 case "$with_athena" in
3172 dnl This is the default, old fashioned flat Athena.
3173 "xaw" | "") athena_variant=Xaw athena_3d=no ;;
3174 "3d") athena_variant=Xaw3d athena_3d=yes ;;
3175 "next") athena_variant=neXtaw athena_3d=yes ;;
3176 "95") athena_variant=Xaw95 athena_3d=yes ;;
3177 "xpm") athena_variant=XawXpm athena_3d=yes ;;
3178 *) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
3181 dnl Search for the Athena library...
3182 if test "$athena_3d" = "no"; then
3183 AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
3185 dnl Must not be a 3d library...
3186 AC_CHECK_LIB($athena_variant, threeDClassRec,
3187 AC_MSG_WARN("Could not find a non-3d Athena widget library."),
3188 athena_lib=$athena_variant)
3190 AC_MSG_WARN("Could not find an Athena widget library."))
3192 dnl The real configuration, need 3d library
3193 AC_CHECK_LIB($athena_variant, threeDClassRec, athena_lib=$athena_variant,
3194 dnl OK, couldn't find it with a proper name, try the standard Athena lib
3195 dnl If that is 3d, presume the user asked for what they have installed.
3196 AC_CHECK_LIB(Xaw, threeDClassRec,
3199 AC_MSG_WARN("Assuming that libXaw is actually $athena_variant.");
3201 AC_MSG_WARN("Could not find a 3d Athena widget library that looked like $athena_variant.")))
3204 dnl Now we locate the Athena headers that we need.
3205 if test "$athena_3d" = "no"; then
3206 AC_CHECK_HEADER(X11/Xaw/ThreeD.h,
3207 AC_MSG_WARN("Could not find a non-3d Athena header set."),
3208 AC_CHECK_HEADER(X11/Xaw/XawInit.h,
3209 athena_h_path=X11/Xaw,
3210 AC_MSG_WARN("Could not find a non-3d Athena header set.")))
3212 dnl The three-d Athena headers are so much more slippery.
3213 dnl Curse this `Lets replace standard libraries' thing that they did. :/
3214 AC_CHECK_HEADER(X11/$athena_variant/XawInit.h,
3215 AC_CHECK_HEADER(X11/$athena_variant/ThreeD.h,
3216 athena_h_path=X11/$athena_variant,))
3218 dnl Is the variant specific header directory directly under include?
3219 if test -z "$athena_h_path"; then
3220 AC_CHECK_HEADER($athena_variant/XawInit.h,
3221 AC_CHECK_HEADER($athena_variant/ThreeD.h,
3222 athena_h_path=$athena_variant,))
3225 dnl If we couldn't find the specific variant, try the generic Athena 3d headers
3226 if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
3227 AC_CHECK_HEADER(X11/Xaw3d/XawInit.h,
3228 AC_CHECK_HEADER(X11/Xaw3d/ThreeD.h,
3230 AC_MSG_WARN("Assuming that X11/Xaw3d headers are suitable for $athena_variant.")
3231 athena_h_path=X11/Xaw3d
3235 dnl Also generic 3d headers directly under include dir
3236 if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
3237 AC_CHECK_HEADER(Xaw3d/XawInit.h,
3238 AC_CHECK_HEADER(Xaw3d/ThreeD.h,
3240 AC_MSG_WARN("Assuming that Xaw3d headers are suitable for $athena_variant.")
3245 dnl If nothing yet found, see if Xaw is a 3d header set...
3246 dnl We AC_MSG_WARN if we fail because I am all out of ideas...
3247 if test -z "$athena_h_path"; then
3248 AC_CHECK_HEADER(X11/Xaw/ThreeD.h,
3250 AC_MSG_WARN("Assuming that X11/Xaw headers are suitable for $athena_variant.")
3251 athena_h_path=X11/Xaw
3253 AC_MSG_WARN("Could not find a suitable 3d Athena header set."))
3257 dnl Do we actually have a usable Athena widget set? Please?
3258 if test -n "$athena_lib" -a -n "$athena_h_path"; then
3264 dnl autodetect Motif - but only add to libs_x later (if necessary)
3265 AC_CHECK_HEADER(Xm/Xm.h,
3266 [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)],
3269 if test "$have_motif" = "yes"; then
3270 dnl autodetect lesstif
3271 AC_MSG_CHECKING(for Lesstif)
3274 #ifdef LESSTIF_VERSION
3277 ], have_lesstif=yes, have_lesstif=no)
3278 AC_MSG_RESULT($have_lesstif)
3281 fi dnl "$with_x11" = "yes"
3283 dnl Finish ensuring that we have values for the various toolkit items.
3284 dnl Not all toolkits support all widgets
3285 dnl if Motif is available we use it for the dialog boxes.
3287 case "$with_menubars" in "" | "yes" | "athena" )
3288 with_menubars="lucid" ;;
3290 case "$with_dialogs" in "" | "yes" | "lucid" )
3291 if test "$have_motif" = "yes"; then with_dialogs="motif"
3292 elif test "$have_xaw" = "yes"; then with_dialogs="athena"
3293 else with_dialogs=no
3296 case "$with_scrollbars" in "" | "yes" )
3297 with_scrollbars="lucid" ;;
3299 case "$with_widgets" in "" | "yes" | "lucid")
3300 if test "$have_motif" = "yes"; then with_widgets="motif"
3301 elif test "$have_xaw" = "yes"; then with_widgets="athena"
3302 else with_widgets=no
3306 all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
3308 case "$all_widgets" in
3310 if test "$have_xaw" != "yes"; then
3311 XE_DIE("Could not find a suitable Athena library to build with.")
3314 dnl Add the Lucid widget Athena code
3315 XE_APPEND(lwlib-Xaw.o, lwlib_objs)
3317 dnl Add the Athena widget library we located earlier
3318 XE_PREPEND(-l$athena_lib, libs_x)
3320 dnl Tell lwlib where to find the Athena header files.
3321 dnl Many people have tried to create a `smart' way of doing this,
3322 dnl but all have failed. Before changing the following ugly definitions,
3323 dnl consult the veterans of many a battle.
3324 AC_DEFINE_UNQUOTED(ATHENA_Scrollbar_h_,"$athena_h_path/Scrollbar.h")
3325 AC_DEFINE_UNQUOTED(ATHENA_Dialog_h_,"$athena_h_path/Dialog.h")
3326 AC_DEFINE_UNQUOTED(ATHENA_Form_h_,"$athena_h_path/Form.h")
3327 AC_DEFINE_UNQUOTED(ATHENA_Command_h_,"$athena_h_path/Command.h")
3328 AC_DEFINE_UNQUOTED(ATHENA_Label_h_,"$athena_h_path/Label.h")
3329 AC_DEFINE_UNQUOTED(ATHENA_LabelP_h_,"$athena_h_path/LabelP.h")
3330 AC_DEFINE_UNQUOTED(ATHENA_Toggle_h_,"$athena_h_path/Toggle.h")
3331 AC_DEFINE_UNQUOTED(ATHENA_ToggleP_h_,"$athena_h_path/ToggleP.h")
3332 AC_DEFINE_UNQUOTED(ATHENA_AsciiText_h_,"$athena_h_path/AsciiText.h")
3333 AC_DEFINE_UNQUOTED(ATHENA_XawInit_h_,"$athena_h_path/XawInit.h")
3335 AC_DEFINE(LWLIB_USES_ATHENA)
3336 AC_DEFINE(NEED_ATHENA)
3339 if test "$athena_3d" = "yes"; then
3340 AC_DEFINE(HAVE_ATHENA_3D)
3345 case "$all_widgets" in *motif* )
3346 AC_DEFINE(LWLIB_USES_MOTIF)
3347 AC_DEFINE(NEED_MOTIF)
3348 XE_APPEND(lwlib-Xm.o, lwlib_objs)
3352 test "$with_menubars" = "lucid" && XE_APPEND(xlwmenu.o, lwlib_objs)
3353 test "$with_menubars" = "motif" && XE_APPEND(xlwmenu.o, lwlib_objs)
3354 test "$with_scrollbars" = "lucid" && XE_APPEND(xlwscrollbar.o, lwlib_objs)
3355 test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
3356 XE_APPEND(xlwtabs.o xlwgcs.o, lwlib_objs)
3357 case "$with_widgets" in athena* )
3358 XE_APPEND(xlwradio.o xlwcheckbox.o xlwgauge.o, lwlib_objs);;
3360 case "$all_widgets" in *lucid* )
3361 AC_DEFINE(NEED_LUCID)
3362 XE_APPEND(lwlib-Xlw.o, lwlib_objs) ;;
3365 AC_SUBST(lwlib_objs)
3367 test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA)
3368 test "$with_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA)
3370 if test "$athena_3d" = "yes"; then
3371 test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D)
3372 test "$with_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D)
3375 case "$with_widgets" in athena* ) AC_DEFINE(LWLIB_WIDGETS_ATHENA);; esac
3376 test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
3377 AC_DEFINE(LWLIB_TABS_LUCID)
3379 test "$with_menubars" != "no" && AC_DEFINE(HAVE_MENUBARS)
3380 test "$with_scrollbars" != "no" && AC_DEFINE(HAVE_SCROLLBARS)
3381 test "$with_dialogs" != "no" && AC_DEFINE(HAVE_DIALOGS)
3382 test "$with_toolbars" != "no" && AC_DEFINE(HAVE_TOOLBARS)
3383 test "$with_widgets" != "no" && AC_DEFINE(HAVE_WIDGETS)
3385 test "$with_menubars" = "lucid" && AC_DEFINE(LWLIB_MENUBARS_LUCID)
3386 test "$with_scrollbars" = "lucid" && AC_DEFINE(LWLIB_SCROLLBARS_LUCID)
3388 test "$with_menubars" = "motif" && AC_DEFINE(LWLIB_MENUBARS_MOTIF)
3389 test "$with_scrollbars" = "motif" && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF)
3390 test "$with_dialogs" = "motif" && AC_DEFINE(LWLIB_DIALOGS_MOTIF)
3391 test "$with_widgets" = "motif" && AC_DEFINE(LWLIB_WIDGETS_MOTIF)
3393 test "$with_menubars" != "no" && XE_ADD_OBJS(menubar.o)
3394 test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar.o)
3395 test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog.o)
3396 test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar.o)
3398 if test "$with_x11" = "yes"; then
3399 test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-x.o)
3400 test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-x.o)
3401 test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-x.o)
3402 test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-x.o)
3403 test "$all_widgets" != "no no no no no" && XE_ADD_OBJS(gui-x.o)
3406 dnl ----------------------
3407 dnl Mule-dependent options
3408 dnl ----------------------
3410 test -z "$with_mule" && with_mule=no
3411 test -z "$with_file_coding" && with_file_coding=no
3413 dnl if test "$with_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then
3414 dnl echo "Attempt to Build with Mule without Mule/Lisp"
3415 dnl echo "Please install the XEmacs/Mule tarball or"
3416 dnl echo "rerun configure with --with-mule=no"
3420 if test "$with_file_coding" = "yes" && test "$with_mule" = "no"; then
3421 AC_DEFINE(FILE_CODING)
3422 XE_ADD_OBJS(file-coding.o)
3425 if test "$with_mule" = "yes" ; then
3426 AC_CHECKING(for Mule-related features)
3428 AC_DEFINE(FILE_CODING)
3429 XE_ADD_OBJS(mule.o mule-ccl.o mule-charset.o file-coding.o)
3431 dnl Use -lintl to get internationalized strerror for Mule
3432 AC_CHECK_HEADERS(libintl.h)
3433 AC_CHECK_LIB(intl, strerror)
3435 AC_CHECKING(for Mule input methods)
3436 dnl Do we have the XmIm* routines? And if so, do we want to use them?
3437 dnl XIM seems to be flaky except on Solaris...
3438 dnl test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no
3439 case "$with_xim" in "" | "yes" )
3440 AC_CHECKING(for XIM)
3441 AC_CHECK_LIB(X11, XOpenIM, with_xim=xlib, with_xim=no)
3442 dnl XIM + Lesstif is not (yet?) usable
3443 if test "$have_motif $have_lesstif" = "yes no"; then
3444 AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif)
3447 if test "$with_xim" != "no"; then
3449 if test "$with_xim" = "xlib"; then
3451 XE_ADD_OBJS(input-method-xlib.o)
3453 if test "$with_xim" = "motif"; then
3454 AC_DEFINE(XIM_MOTIF)
3456 XE_ADD_OBJS(input-method-motif.o)
3458 if test "$with_xim" = "motif"; then
3463 dnl "with_xfs" = "yes"
3464 if test "$with_xfs" = "yes" ; then
3465 AC_CHECKING(for XFontSet)
3466 AC_CHECK_LIB(X11, XmbDrawString, [:], with_xfs=no)
3467 if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
3468 AC_DEFINE(USE_XFONTSET)
3469 if test "$with_xim" = "no" ; then
3470 XE_ADD_OBJS(input-method-xlib.o)
3476 test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
3477 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) }
3478 dnl gcc 2.97 fixincludes breaks inclusion of wnn/commonhd.h
3479 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/commonhd.h, ,with_wnn=no) }
3480 dnl Detour to find crypt
3481 if test "$with_wnn" != "no"; then
3482 AC_CHECK_FUNCS(crypt)
3483 test "$ac_cv_func_crypt" != "yes" && { AC_CHECK_LIB(crypt, crypt) }
3485 dnl Back to our regularly scheduled wnn hunting
3486 if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
3487 AC_CHECK_LIB(wnn,jl_dic_list_e,libwnn=wnn,
3488 AC_CHECK_LIB(wnn4,jl_dic_list_e,libwnn=wnn4,
3489 AC_CHECK_LIB(wnn6,jl_dic_list_e,libwnn=wnn6,
3490 AC_CHECK_LIB(wnn6_fromsrc,dic_list_e,libwnn=wnn6_fromsrc,with_wnn=no))))
3492 test -z "$with_wnn" && with_wnn=yes
3493 if test "$with_wnn" = "yes"; then
3495 XE_PREPEND(-l$libwnn, libs_x)
3496 XE_ADD_OBJS(mule-wnnfns.o)
3497 if test "$with_wnn6" != "no"; then
3498 AC_CHECK_LIB($libwnn, jl_fi_dic_list, with_wnn6=yes)
3499 test "$with_wnn6" = "yes" && AC_DEFINE(WNN6)
3503 dnl Autodetect canna
3504 canna_includes_found=no
3505 if test "$with_canna" != "no"; then
3506 AC_CHECK_HEADER(canna/jrkanji.h,canna_includes_found=yes)
3508 if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \
3509 -d "/usr/local/canna/include"; then
3510 save_c_switch_site="$c_switch_site"
3511 c_switch_site="$c_switch_site -I/usr/local/canna/include"
3512 AC_CHECK_HEADER(canna/jrkanji.h,canna_includes_found=yes)
3513 if test "$canna_includes_found" != "yes"; then
3514 c_switch_site="$save_c_switch_site"
3519 test -z "$with_canna" && { AC_CHECK_HEADER(canna/RK.h, , with_canna=no) }
3520 test -z "$with_canna" && { AC_CHECK_LIB(RKC, RkBgnBun, [:],with_canna=no) }
3521 test -z "$with_canna" && { AC_CHECK_LIB(canna,jrKanjiControl,[:],with_canna=no) }
3522 test -z "$with_canna" && with_canna=yes
3523 if test "$with_canna" = "yes"; then
3524 AC_DEFINE(HAVE_CANNA)
3525 XE_PREPEND(-lcanna -lRKC, libs_x)
3526 XE_ADD_OBJS(mule-canna.o)
3529 else dnl "$with_mule" = "no"
3530 for feature in xim canna wnn; do
3531 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
3532 AC_MSG_WARN("--with-${feature} ignored: Not valid without Mule support")
3534 eval "with_${feature}=no"
3539 dnl At this point, we know whether we need the motif lib or not.
3540 if test "$need_motif" = "yes" ; then
3541 XE_PREPEND(-lXm, libs_x)
3542 dnl AIX needs the following library for use with Motif
3543 AC_CHECK_LIB(i18n, layout_object_getvalue, [XE_PREPEND(-li18n, libs_x)])
3544 XE_COMPUTE_RUNPATH()
3547 AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask)
3549 dnl ----------------------------------------------------------------
3550 dnl Check for PTY support functions.
3551 dnl ----------------------------------------------------------------
3553 dnl There is no "standard" pty allocation method. Every system is different.
3554 dnl getpt() is the preferred pty allocation method on glibc systems.
3555 dnl _getpty() is the preferred pty allocation method on SGI systems.
3556 dnl grantpt(), unlockpt(), ptsname() are defined by Unix98.
3557 AC_CHECK_FUNCS(getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp)
3559 dnl openpty() is the preferred pty allocation method on BSD and Tru64 systems.
3560 dnl openpty() might be declared in:
3561 dnl - pty.h (Tru64 or Linux)
3562 dnl - libutil.h (FreeBSD)
3563 dnl - util.h (NetBSD)
3564 AC_CHECK_FUNC(openpty, have_openpty=yes, [
3565 AC_CHECK_LIB(util, openpty, have_openpty=yes need_libutil=yes)])
3566 if test "$have_openpty" = "yes"; then
3567 AC_DEFINE(HAVE_OPENPTY)
3568 AC_CHECK_HEADERS(pty.h libutil.h util.h, break)
3569 test "$need_libutil" = "yes" && XE_APPEND(-lutil, libs_system)
3572 dnl Check for STREAM support functions.
3573 dnl Confusingly, "str" means both "string" and "SysV Streams".
3574 AC_CHECK_HEADERS(stropts.h)
3575 if test "$ac_cv_header_stropts_h" = "yes"; then
3576 AC_CHECK_FUNCS(isastream)
3577 AC_CHECK_HEADERS(strtio.h) dnl TIOCSIGNAL
3580 dnl Use our own realpath always.
3581 XE_ADD_OBJS(realpath.o)
3583 dnl Check whether the system provides getloadavg().
3584 AC_CHECK_FUNCS(getloadavg)
3586 if test "$ac_cv_func_getloadavg" = "yes"; then
3587 dnl Solaris 8 declares getloadavg() in <sys/loadavg.h>.
3588 dnl glibc 2.2 declares getloadavg() in <stdlib.h>...
3589 dnl ...if we #define _GNU_SOURCE, which we do.
3590 AC_CHECK_HEADERS(sys/loadavg.h)
3592 dnl We define our own getloadavg() using lower level functions.
3593 XE_ADD_OBJS(getloadavg.o)
3595 dnl Used by getloadavg() - does not require root priveleges
3596 AC_CHECK_LIB(kstat, kstat_open)
3597 AC_CHECK_HEADERS(kstat.h)
3599 dnl Another way to get the load average
3600 AC_CHECK_LIB(kvm, kvm_read)
3603 dnl If netdb.h does not declare h_errno, we must declare it by hand.
3604 AC_MSG_CHECKING(whether netdb declares h_errno)
3605 AC_TRY_LINK([#include <netdb.h>],
3608 AC_DEFINE(HAVE_H_ERRNO)],
3609 [AC_MSG_RESULT(no)])
3611 AC_MSG_CHECKING(for sigsetjmp)
3612 AC_TRY_COMPILE([#include <setjmp.h>],
3613 [sigjmp_buf bar; sigsetjmp (bar, 0);],
3615 AC_DEFINE(HAVE_SIGSETJMP)],
3616 [AC_MSG_RESULT(no)])
3618 AC_MSG_CHECKING(whether localtime caches TZ)
3619 AC_CACHE_VAL(emacs_cv_localtime_cache,
3620 [if test "$ac_cv_func_tzset" = "yes"; then
3621 AC_TRY_RUN([#include <time.h>
3623 # include <stdlib.h>
3625 extern char **environ;
3629 for (to = from = environ; (*to = *from); from++)
3630 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
3633 char TZ_GMT0[] = "TZ=GMT0";
3634 char TZ_PST8[] = "TZ=PST8";
3637 time_t now = time ((time_t *) 0);
3638 int hour_GMT0, hour_unset;
3639 if (putenv (TZ_GMT0) != 0)
3641 hour_GMT0 = localtime (&now)->tm_hour;
3643 hour_unset = localtime (&now)->tm_hour;
3644 if (putenv (TZ_PST8) != 0)
3646 if (localtime (&now)->tm_hour == hour_GMT0)
3649 if (localtime (&now)->tm_hour != hour_unset)
3652 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
3653 [# If we have tzset, assume the worst when cross-compiling.
3654 emacs_cv_localtime_cache=yes])
3656 # If we lack tzset, report that localtime does not cache TZ,
3657 # since we can't invalidate the cache if we don't have tzset.
3658 emacs_cv_localtime_cache=no
3660 AC_MSG_RESULT($emacs_cv_localtime_cache)
3661 if test $emacs_cv_localtime_cache = yes; then
3662 AC_DEFINE(LOCALTIME_CACHE)
3665 if test "$HAVE_TIMEVAL" = "yes"; then
3666 AC_MSG_CHECKING(whether gettimeofday accepts one or two arguments)
3668 #ifdef TIME_WITH_SYS_TIME
3669 #include <sys/time.h>
3672 #ifdef HAVE_SYS_TIME_H
3673 #include <sys/time.h>
3680 struct timeval time;
3681 gettimeofday (&time, 0);
3683 [AC_MSG_RESULT(two)],
3685 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)])
3690 test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && XE_ADD_OBJS(inline.o)
3692 dnl HP-UX has a working alloca in libPW.
3693 dnl case "${GCC}${opsys}" in hpux* )
3694 dnl AC_CHECK_FUNC(alloca, [:], [AC_CHECK_LIB(PW, alloca)])
3697 dnl AC_FUNC_ALLOCA doesn't know about DEC C's #pragma intrinsic(alloca)
3698 if test "$__DECC" != "yes"; then
3700 test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA)
3703 dnl Check whether vfork exists and works correctly. (This does more
3704 dnl than just check for its existence.) If so, it defines HAVE_VFORK_H.
3705 dnl If not, it defines vfork to be fork.
3708 dnl Check whether strcoll exists and works correctly. (This does more
3709 dnl than just check for its existence.) If so, it defines HAVE_STRCOLL.
3712 dnl If `getpgrp' takes no argument (the POSIX.1 version), define
3713 dnl `GETPGRP_VOID'. Otherwise, it is the BSD version, which takes a
3714 dnl process ID as an argument.
3715 AC_CHECK_FUNCS(getpgrp)
3718 dnl We used to call AC_FUNC_MMAP here
3719 dnl Instead we now use following, suggested by Neal Becker
3720 AC_MSG_CHECKING(for working mmap)
3721 case "$opsys" in ultrix* ) have_mmap=no ;; *)
3722 AC_TRY_RUN([#include <stdio.h>
3725 #include <sys/mman.h>
3727 #ifndef MAP_VARIABLE
3728 #define MAP_VARIABLE 0
3732 #define MAP_FAILED -1
3735 int main (int argc, char *argv[])
3739 #ifndef MAP_ANONYMOUS
3740 fd = open ("/dev/zero", O_RDWR);
3743 #define MAP_ANONYMOUS 0
3745 if (mmap(0, 1024, PROT_READ | PROT_WRITE,
3746 MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS,
3747 fd, 0) != (void *) MAP_FAILED)
3749 perror ("conftest: mmap failed");
3751 }], have_mmap=yes, have_mmap=no) ;;
3753 AC_MSG_RESULT($have_mmap)
3754 test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP)
3756 dnl rel_alloc requires either GNU malloc or system malloc with mmap
3757 dnl We only turn rel_alloc on by default if mmap is available.
3758 test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no
3759 if test "$rel_alloc $have_mmap" = "default yes"; then
3760 if test "$doug_lea_malloc" = "yes"; then
3761 dnl Check if malloc() calls mmap(), making rel_alloc pointless.
3762 AC_MSG_CHECKING(for M_MMAP_THRESHOLD)
3763 AC_TRY_COMPILE([#include <malloc.h>],[
3764 #ifndef M_MMAP_THRESHOLD
3765 #error No M_MMAP_THRESHOLD :-(
3766 !@+$%^&*_)(_ - unlikely to compile...
3768 ], [rel_alloc=no; AC_MSG_RESULT(yes);], [rel_alloc=yes; AC_MSG_RESULT(no);])
3773 test "$rel_alloc" = "yes" && AC_DEFINE(REL_ALLOC)
3775 dnl Check for terminal I/O variants
3776 dnl TERMIOS systems may have termio.h, but not vice-versa, I think.
3777 AC_CHECK_HEADER(termios.h,
3778 AC_DEFINE(HAVE_TERMIOS)
3779 AC_DEFINE(SIGNALS_VIA_CHARACTERS)
3780 AC_DEFINE(NO_TERMIO),
3781 [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])])
3784 dnl Check for Internet sockets.
3785 AC_CHECK_FUNC(socket,
3786 [AC_CHECK_HEADER(netinet/in.h,
3787 [AC_CHECK_HEADER(arpa/inet.h, [
3788 AC_DEFINE(HAVE_SOCKETS)
3789 AC_MSG_CHECKING("for sun_len member in struct sockaddr_un")
3791 #include <sys/types.h>
3792 #include <sys/socket.h>
3795 [static struct sockaddr_un x; x.sun_len = 1;],
3796 [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)],
3797 [AC_MSG_RESULT(no)])
3798 AC_MSG_CHECKING("for ip_mreq struct in netinet/in.h")
3800 #include <sys/types.h>
3801 #include <netinet/in.h>
3803 [static struct ip_mreq x;],
3804 [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MULTICAST)],
3805 [AC_MSG_RESULT(no)])])])])
3807 dnl Check for SYS V IPC. (Inferior to sockets.)
3808 AC_CHECK_FUNC(msgget,
3809 [AC_CHECK_HEADER(sys/ipc.h,
3810 [AC_CHECK_HEADER(sys/msg.h,
3811 [AC_DEFINE(HAVE_SYSVIPC)])])])
3813 dnl Check for directory variants
3814 AC_CHECK_HEADER(dirent.h, [AC_DEFINE(SYSV_SYSTEM_DIR)],
3815 [AC_CHECK_HEADER(sys/dir.h, , [AC_DEFINE(NONSYSTEM_DIR_LIBRARY)])])
3817 dnl Check for nlist.h
3818 AC_CHECK_HEADER(nlist.h, AC_DEFINE(NLIST_STRUCT), )
3820 dnl Check for sound of various sorts.
3822 dnl Autodetect native sound
3823 AC_CHECKING("for sound support")
3824 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
3826 if test "$with_native_sound" != "no"; then
3827 dnl Maybe sound is already on include path...
3828 if test -n "$native_sound_lib"; then
3829 AC_CHECK_HEADER(multimedia/audio_device.h,
3830 [sound_found=yes sound_cflags=""
3831 XE_ADD_OBJS(sunplay.o)])
3834 dnl Autodetect Sun native sound from SUNWaudmo package
3835 if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then
3837 XE_ADD_OBJS(sunplay.o)
3838 if test -d "/usr/demo/SOUND/include"
3839 then sound_cflags="-I/usr/demo/SOUND/include"
3840 else sound_cflags="-I/usr/demo/SOUND"
3842 if test -z "$native_sound_lib" ; then
3843 if test -r "/usr/demo/SOUND/lib/libaudio.a"
3844 then native_sound_lib="/usr/demo/SOUND/lib/libaudio.a"
3845 else native_sound_lib="/usr/demo/SOUND/libaudio.a"
3850 dnl Check for SGI and HP native sound libs
3851 if test -z "$sound_found"; then
3852 case "$canonical" in
3854 if test -z "$native_sound_lib"; then
3855 AC_CHECK_LIB(audio, ALopenport, native_sound_lib="-laudio")
3857 if test -n "$native_sound_lib"; then
3858 sound_found=yes sound_cflags=""
3859 XE_ADD_OBJS(sgiplay.o)
3862 if test -z "$native_sound_lib"; then
3863 AC_CHECK_LIB(Alib, AOpenAudio, native_sound_lib="-lAlib")
3865 if test -n "$native_sound_lib"; then
3867 XE_ADD_OBJS(hpplay.o)
3868 if test "$GCC" = "yes" # Kludge city
3869 then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples"
3870 else sound_cflags="+e -I/usr/audio/examples"
3876 dnl Check for Linux/BSD native sound
3877 if test -z "$sound_found"; then
3878 for dir in "machine" "sys" "linux"; do
3879 AC_CHECK_HEADER(${dir}/soundcard.h,
3882 XE_ADD_OBJS(linuxplay.o)
3883 [AC_DEFINE_UNQUOTED(SOUNDCARD_H_FILE, "${dir}/soundcard.h")]
3888 dnl Win32 Native uses native sound
3889 if test -z "$sound_found"; then
3890 if test "$with_msw" = "yes"; then
3896 test "$sound_found" = "yes" && with_native_sound=yes
3899 if test "$with_native_sound" = "yes"; then
3900 AC_DEFINE(HAVE_NATIVE_SOUND)
3901 test -n "$native_sound_lib" && XE_PREPEND($native_sound_lib, LIBS)
3904 dnl NAS Sound support
3905 if test "$with_nas_sound" != "no"; then
3906 AC_CHECK_HEADER(audio/audiolib.h, [
3907 AC_CHECK_LIB(audio, AuOpenServer, have_nas_sound=yes)])
3908 if test "$have_nas_sound" = "yes"; then
3910 AC_DEFINE(HAVE_NAS_SOUND)
3912 XE_PREPEND(-laudio, libs_x)
3913 dnl If the nas library does not contain the error jump point,
3914 dnl then we force safer behavior.
3915 AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[old_nas=yes; AC_DEFINE(NAS_NO_ERROR_JUMP)])
3917 test "$with_nas_sound" = "yes" && \
3918 XE_DIE("Required NAS sound support cannot be provided.")
3923 dnl ESD Sound support
3924 if test "$with_esd_sound" != "no"; then
3925 AC_CHECK_PROG(have_esd_config, esd-config, yes, no)
3926 if test "$have_esd_config" = "yes"; then
3927 save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
3928 XE_APPEND(`esd-config --cflags`, c_switch_site)
3929 XE_PREPEND(`esd-config --libs`, LIBS)
3930 AC_CHECK_FUNC(esd_play_stream,
3932 c_switch_site="$save_c_switch_site" LIBS="$save_LIBS")
3935 if test "$have_esd_sound" = "yes"; then
3939 AC_DEFINE(HAVE_ESD_SOUND)
3941 test "$with_esd_sound" = "yes" && \
3942 XE_DIE("Required ESD sound support cannot be provided.")
3947 test "$need_miscplay" = "yes" && XE_ADD_OBJS(miscplay.o)
3949 dnl ---------------------
3950 dnl TTY-dependent options
3951 dnl ---------------------
3953 test -z "$with_tty" && with_tty=yes
3955 if test "$with_tty" = "yes" ; then
3956 AC_CHECKING(for TTY-related features)
3958 XE_ADD_OBJS(console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o)
3960 dnl Autodetect ncurses.
3961 if test -z "$with_ncurses"; then
3962 AC_CHECK_LIB(ncurses, tgetent, with_ncurses=yes, with_ncurses=no)
3964 if test "$with_ncurses" = "yes"; then
3965 AC_DEFINE(HAVE_NCURSES)
3966 AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h)
3967 AC_CHECK_HEADER(ncurses/term.h, term_h_file=ncurses/term.h)
3968 XE_ADD_OBJS(terminfo.o)
3969 XE_PREPEND(-lncurses, LIBS)
3971 if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
3972 dnl Try again, and check for the bogus ncurses/ include bug.
3973 dnl (i.e. ncurses/curses.h bogusly includes <unctrl.h> instead of
3974 dnl <ncurses/unctrl.h>)
3975 save_c_switch_site="$c_switch_site"
3976 c_switch_site="$c_switch_site -I/usr/include/ncurses"
3977 AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h)
3978 if test "$ac_cv_header_ncurses_curses_h" = "yes"
3979 then AC_MSG_WARN("Your system has the bogus ncurses include bug.")
3980 else c_switch_site="$save_c_switch_site"
3983 else dnl "$with_ncurses" = "no"
3984 dnl Autodetect terminfo/-lcurses/-ltermlib/-ltermcap
3985 if test "$have_terminfo" = "yes"; then
3986 XE_ADD_OBJS(terminfo.o)
3987 if test -n "$libs_termcap"; then
3988 XE_PREPEND($libs_termcap, LIBS)
3990 for lib in curses termlib termcap; do
3991 AC_CHECK_LIB($lib, tgetent, XE_PREPEND(-l${lib}, LIBS); break)
3994 else dnl "$have_terminfo" = "no" && "with_ncurses" = "no"
3995 XE_ADD_OBJS(tparam.o)
3996 dnl The HP-UX curses library seems to have a badly broken version of select(2)
3997 dnl that makes "poll: interrupted system call" messages to appear and
3998 dnl Emacs suprocesses to hang (e.g. TeX compilation w/ AUCTeX) */
3999 case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac
4000 if test -n "$libs_termcap"; then
4001 XE_PREPEND($libs_termcap, LIBS)
4003 AC_CHECK_LIB(curses, tgetent, XE_PREPEND(-lcurses, LIBS),
4004 AC_CHECK_LIB(termcap, tgetent, XE_PREPEND(-ltermcap, LIBS),
4005 XE_ADD_OBJS(termcap.o)))
4009 AC_DEFINE_UNQUOTED(CURSES_H_FILE, "${curses_h_file-curses.h}")
4010 AC_DEFINE_UNQUOTED(TERM_H_FILE, "${term_h_file-term.h}")
4013 test -z "$with_gpm" && { AC_CHECK_HEADER(gpm.h, , with_gpm=no) }
4014 test -z "$with_gpm" && { AC_CHECK_LIB(gpm, Gpm_Open, with_gpm=yes, with_gpm=no) }
4015 if test "$with_gpm" = "yes"; then
4017 XE_ADD_OBJS(gpmevent.o)
4018 XE_PREPEND(-lgpm, LIBS)
4021 else dnl "$with_tty" = "no"
4022 for feature in ncurses gpm; do
4023 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
4024 AC_MSG_WARN("--with-${feature} ignored: Not valid without TTY support")
4026 eval "with_${feature}=no"
4030 dnl Do we need event-unixoid.o ?
4031 test "$with_x11" = "yes" -o "$with_tty" = "yes" && XE_ADD_OBJS(event-unixoid.o)
4033 dnl Database support
4034 dnl We do not necessarily have to have libdb/lib(g)dbm for DB/(G)DBM support.
4035 dnl On FreeBSD, both DB and DBM are part of libc.
4036 dnl By default, we check for DBM support in libgdbm, then libc, then libdbm.
4038 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
4039 != "no no no" && AC_CHECKING(for database support)
4041 dnl Check for ndbm.h, required for either kind of DBM support.
4042 if test "$with_database_gdbm $with_database_dbm" != "no no"; then
4043 AC_CHECK_HEADER(ndbm.h, [:], [
4044 test "$with_database_gdbm" = "yes" -o \
4045 "$with_database_dbm" = "yes" && \
4046 XE_DIE("Required DBM support cannot be provided.")
4047 with_database_gdbm=no with_database_dbm=no])
4050 dnl Check for DBM support in libgdbm.
4051 if test "$with_database_gdbm" != "no"; then
4052 AC_CHECK_LIB(gdbm, dbm_open, [
4053 with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm], [
4054 if test "$with_database_gdbm" = "yes"; then
4055 XE_DIE("Required GNU DBM support cannot be provided.")
4057 with_database_gdbm=no])
4060 dnl Check for DBM support in libc and libdbm.
4061 if test "$with_database_dbm" != "no"; then
4062 AC_CHECK_FUNC(dbm_open, [with_database_dbm=yes libdbm=], [
4063 AC_CHECK_LIB(dbm, dbm_open, [with_database_dbm=yes libdbm=-ldbm], [
4064 test "$with_database_dbm" = "yes" && \
4065 XE_DIE("Required DBM support cannot be provided.")
4066 with_database_dbm=no])])
4069 dnl Tell make about the DBM support we detected.
4070 test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS)
4071 test "$with_database_gdbm" = "yes" -o \
4072 "$with_database_dbm" = "yes" && \
4075 dnl Check for Berkeley DB.
4076 if test "$with_database_berkdb" != "no"; then
4077 AC_MSG_CHECKING(for Berkeley db.h)
4078 for header in "db/db.h" "db.h"; do
4081 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
4082 #ifdef HAVE_INTTYPES_H
4083 #define __BIT_TYPES_DEFINED__
4084 #include <inttypes.h>
4085 typedef uint8_t u_int8_t;
4086 typedef uint16_t u_int16_t;
4087 typedef uint32_t u_int32_t;
4088 #ifdef WE_DONT_NEED_QUADS
4089 typedef uint64_t u_int64_t;
4094 ],[], db_h_file="$header"; break)
4096 if test -z "$db_h_file"
4097 then AC_MSG_RESULT(no); with_database_berkdb=no
4098 else AC_MSG_RESULT($db_h_file)
4101 if test "$with_database_berkdb" != "no"; then
4102 AC_MSG_CHECKING(for Berkeley DB version)
4104 [#include <$db_h_file>
4105 #if DB_VERSION_MAJOR > 1
4108 ], [AC_EGREP_CPP(yes,
4109 [#include <$db_h_file>
4110 #if DB_VERSION_MAJOR > 2
4113 ], [AC_MSG_RESULT(3); dbfunc=db_create],[
4114 AC_MSG_RESULT(2); dbfunc=db_open])],[
4115 AC_MSG_RESULT(1); dbfunc=dbopen])
4116 AC_CHECK_FUNC($dbfunc, with_database_berkdb=yes need_libdb=no, [
4117 AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)])
4120 if test "$with_database_berkdb" = "yes"; then
4121 AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file")
4122 AC_DEFINE(HAVE_BERKELEY_DB)
4123 test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS)
4124 else with_database_berkdb=no
4128 if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
4130 AC_DEFINE(HAVE_DATABASE)
4131 XE_ADD_OBJS(database.o)
4135 if test "$with_socks" = "yes"; then
4136 AC_CHECK_LIB(socks, SOCKSinit)
4137 test -n "$ac_cv_lib_socks_SOCKSinit" && AC_DEFINE(HAVE_SOCKS)
4140 dnl Usage tracking (undocumented and likely unused option)
4141 if test "$usage_tracking" = "yes"; then
4142 AC_DEFINE(USAGE_TRACKING)
4143 XE_PREPEND(-Bstatic -lut -Bdynamic, LIBS)
4146 dnl autodetect dll support
4147 if test "$with_modules" != "no"; then
4148 AC_CHECKING(for module support)
4150 dnl Check for MS-Windows
4151 if test "$with_msw" = "yes"; then
4154 dnl Find headers and libraries
4155 AC_CHECK_HEADER(dlfcn.h, [
4156 AC_MSG_CHECKING([for dlopen in -lc])
4157 AC_TRY_LINK([#include <dlfcn.h>],dnl
4158 [dlopen ("", 0);], [ have_dl=yes ], [
4159 AC_MSG_CHECKING([for dlopen in -ldl])
4160 ac_save_LIBS="$LIBS"
4162 AC_TRY_LINK([#include <dlfcn.h>],dnl
4163 [dlopen ("", 0);], [ have_dl=yes ],
4164 [LIBS="$ac_save_LIBS"])
4166 if test -n "$have_dl"; then
4167 AC_DEFINE(HAVE_DLOPEN)
4169 AC_CHECK_LIB(dld, shl_load, [
4170 libdl=dld have_dl=yes;
4171 AC_DEFINE(HAVE_SHL_LOAD)], [
4172 AC_CHECK_LIB(dld, dld_init, [
4173 libdl=dld have_dl=yes;
4174 AC_DEFINE(HAVE_DLD_INIT)])])
4176 fi dnl end !MS-Windows
4178 if test -n "$have_dl"; then
4179 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared
4183 if test "$can_build_shared" = "yes"; then
4184 AC_DEFINE(HAVE_SHLIB)
4185 XE_ADD_OBJS(sysdll.o emodules.o)
4186 XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR)
4187 test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS)
4188 AC_CHECK_FUNCS(dlerror _dlerror)
4191 if test "$with_modules" = "yes"; then
4192 XE_DIE("Required module support cannot be provided.")
4194 AC_MSG_WARN("Module support cannot be provided.")
4200 dnl Unfortunately, just because we can link doesn't mean we can run.
4201 dnl One of the above link tests may have succeeded but caused resulting
4202 dnl executables to fail to run. Also any tests using AC_TRY_RUN will
4203 dnl have reported incorrect results.
4204 AC_TRY_RUN([int main(int c,char *v[]){return 0;}],[:],[
4206 echo "*** PANIC *** The C compiler can no longer build working executables."
4207 echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
4208 echo "*** PANIC *** The most likely reason for this problem is that configure"
4209 echo "*** PANIC *** links with shared libraries, but those libraries cannot be"
4210 echo "*** PANIC *** found at run time."
4211 echo "*** PANIC ***"
4212 echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig."
4213 echo "*** PANIC *** On other systems, try telling configure where to find the"
4214 echo "*** PANIC *** shared libraries using the --site-runtime-libraries option"
4215 echo "*** PANIC ***"
4216 echo "*** PANIC *** Another way to shoot yourself in the foot is to specify"
4217 echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed"
4218 echo "*** PANIC *** on your system. Don't do that."
4222 if test "$win32_processes" = "yes"; then
4223 XE_ADD_OBJS(process-nt.o)
4225 AC_DEFINE(HAVE_UNIX_PROCESSES)
4226 XE_ADD_OBJS(process-unix.o)
4229 dnl --------------------------------
4230 dnl Compute SUBST-itutable variables
4231 dnl --------------------------------
4233 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM)
4234 dnl Use XE_SPACE instead of plain assignment statements to remove extraneous blanks
4235 XE_SPACE(CFLAGS, $CFLAGS)
4236 XE_SPACE(extra_objs, $extra_objs)
4237 XE_SPACE(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system)
4238 XE_SPACE(c_switch_window_system, $c_switch_x_site $X_CFLAGS)
4239 XE_SPACE(c_switch_all, $c_switch_general $c_switch_window_system)
4240 XE_SPACE(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run)
4241 XE_SPACE(ld_switch_window_system, $ld_switch_x_site)
4242 XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system)
4243 XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard)
4244 XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $X_PRE_LIBS)
4245 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general)
4247 dnl Compute lists of Makefiles and subdirs
4248 AC_SUBST(SRC_SUBDIR_DEPS)
4249 XE_APPEND(src, MAKE_SUBDIR)
4250 internal_makefile_list="Makefile.in"
4252 test -d lock || mkdir lock
4253 for dir in $MAKE_SUBDIR; do
4254 case "$dir" in */* ) dnl Implement mkdir -p
4255 ( for d in `echo $dir | sed 's:/: :g'` ; do
4256 test -d "$d" || mkdir "$d"; cd "$d"
4258 * ) test -d "$dir" || mkdir "$dir" ;;
4260 XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile)
4261 XE_SPACE(internal_makefile_list, $internal_makefile_list $dir/Makefile.in)
4263 AC_SUBST(INSTALL_ARCH_DEP_SUBDIR)
4264 AC_SUBST(MAKE_SUBDIR)
4265 AC_SUBST(SUBDIR_MAKEFILES)
4267 dnl Make s&m symlinks in the src directory, for config.h
4268 for dir in src/s src/m; do
4269 if test ! -d "$dir" ; then
4270 echo Making symbolic link to "$srcdir/$dir"
4271 ${LN_S} "$srcdir/$dir" "$dir"
4275 if test "$extra_verbose" = "yes"; then
4277 PRINT_VAR(extra_objs
4278 c_switch_general c_switch_window_system c_switch_all
4279 ld_switch_general ld_switch_window_system ld_switch_all
4280 ld_libs_general ld_libs_window_system ld_libs_all)
4284 dnl ----------------------------------------------
4285 dnl Create some auxiliary files for developers.
4286 dnl ----------------------------------------------
4288 dnl Create a .gdbinit useful for debugging XEmacs
4289 if test -f "$srcdir/src/.gdbinit" -a ! -f "src/.gdbinit"; then
4290 test "$extra_verbose" = "yes" && echo "creating src/.gdbinit"
4291 echo "source $srcdir/src/.gdbinit" > "src/.gdbinit"
4294 dnl Create a .dbxrc useful for debugging XEmacs
4295 if test -f "$srcdir/src/.dbxrc" -a ! -f "src/.dbxrc"; then
4296 test "$extra_verbose" = "yes" && echo "creating src/.dbxrc"
4297 echo ". $srcdir/src/.dbxrc" > "src/.dbxrc"
4300 dnl Create a useful TAGS file
4301 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then
4302 test "$extra_verbose" = "yes" && echo "creating TAGS"
4304 $srcdir/TAGS,include" > "TAGS"
4307 dnl Create top level .sbinit for Sun compilers
4308 if test "$__SUNPRO_C" = "yes"; then
4309 test "$extra_verbose" = "yes" && echo "creating .sbinit"
4310 ( echo "# For use with Sun WorkShop's Source browser."
4311 echo "# See sbquery(1) and sbinit(4) for more information"
4312 for dir in $MAKE_SUBDIR; do echo "import $dir"; done
4316 dnl There are no more compile tests; remove the core they created.
4319 dnl ----------------------------------------------
4320 dnl Substitute into Makefile, config.h and paths.h
4321 dnl ----------------------------------------------
4323 dnl what sort of things to edit into Makefile, config.h and paths.h
4324 dnl configuration here uncanonicalized to avoid exceeding size limits.
4328 AC_SUBST(configuration)
4330 AC_SUBST(inststaticdir)
4331 AC_SUBST(instvardir)
4339 AC_SUBST(extra_includes)
4342 AC_SUBST(PREFIX_USER_DEFINED)
4343 dnl Yo, Stephen Bourne! I want to marry you!
4347 *\$* ) eval "PREFIX=$PREFIX" ;;
4353 AC_SUBST(exec_prefix)
4354 AC_SUBST(EXEC_PREFIX_USER_DEFINED)
4355 EXEC_PREFIX=$exec_prefix
4357 case "$EXEC_PREFIX" in
4358 *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
4362 AC_SUBST(EXEC_PREFIX)
4365 AC_SUBST(INFODIR_USER_DEFINED)
4369 *\$* ) eval "INFODIR=$INFODIR" ;;
4376 AC_SUBST(INFOPATH_USER_DEFINED)
4380 *\$* ) eval "INFOPATH=$INFOPATH" ;;
4386 AC_SUBST(package_path)
4387 AC_SUBST(PACKAGE_PATH_USER_DEFINED)
4388 PACKAGE_PATH=$package_path
4390 case "$PACKAGE_PATH" in
4391 *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
4395 AC_SUBST(PACKAGE_PATH)
4398 AC_SUBST(LISPDIR_USER_DEFINED)
4402 *\$* ) eval "LISPDIR=$LISPDIR" ;;
4409 AC_SUBST(MODULEDIR_USER_DEFINED)
4410 MODULEDIR=$moduledir
4412 case "$MODULEDIR" in
4413 *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
4419 AC_SUBST(sitelispdir)
4420 AC_SUBST(SITELISPDIR_USER_DEFINED)
4421 SITELISPDIR=$sitelispdir
4423 case "$SITELISPDIR" in
4424 *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
4428 AC_SUBST(SITELISPDIR)
4430 AC_SUBST(sitemoduledir)
4431 AC_SUBST(SITEMODULEDIR_USER_DEFINED)
4432 SITEMODULEDIR=$sitemoduledir
4434 case "$SITEMODULEDIR" in
4435 *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
4439 AC_SUBST(SITEMODULEDIR)
4442 AC_SUBST(ETCDIR_USER_DEFINED)
4446 *\$* ) eval "ETCDIR=$ETCDIR" ;;
4453 AC_SUBST(DOCDIR_USER_DEFINED)
4457 *\$* ) eval "DOCDIR=$DOCDIR" ;;
4463 AC_SUBST(archlibdir)
4464 AC_SUBST(ARCHLIBDIR_USER_DEFINED)
4465 ARCHLIBDIR=$archlibdir
4467 case "$ARCHLIBDIR" in
4468 *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
4472 AC_SUBST(ARCHLIBDIR)
4476 AC_SUBST(extra_objs)
4478 dnl The following flags combine all the information from:
4479 dnl - command line options (user always gets priority)
4480 dnl - user environment variables
4481 dnl - determined by configure
4482 dnl - the s&m header files (required for ellcc)
4485 AC_SUBST(c_switch_general)
4486 AC_SUBST(c_switch_window_system)
4487 AC_SUBST(c_switch_all)
4488 AC_SUBST(ld_switch_general)
4489 AC_SUBST(ld_switch_window_system)
4490 AC_SUBST(ld_switch_all)
4491 AC_SUBST(ld_libs_general)
4492 AC_SUBST(ld_libs_window_system)
4493 AC_SUBST(ld_libs_all)
4497 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
4498 AC_SUBST(RECURSIVE_MAKE)
4500 AC_SUBST(native_sound_lib)
4501 AC_SUBST(sound_cflags)
4503 AC_SUBST(dynodump_arch)
4505 dnl Preliminary support for using a different compiler for xemacs itself.
4506 dnl Useful for building XEmacs with a C++ or 64-bit compiler.
4510 dnl The default is yes
4511 if test "$with_prefix" = "yes"; then
4512 AC_DEFINE(PREFIX_USER_DEFINED)
4515 dnl The default is no
4516 if test "$with_site_lisp" = "no"; then
4517 AC_DEFINE(INHIBIT_SITE_LISP)
4519 dnl The default is yes
4520 if test "$with_site_modules" = "no"; then
4521 AC_DEFINE(INHIBIT_SITE_MODULES)
4524 XE_SPACE(ac_configure_args, $ac_configure_args)
4525 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$configuration")
4526 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "$ac_configure_args")
4528 dnl Following are deprecated
4531 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, $null_string)
4532 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, $null_string)
4533 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, $null_string)
4534 AC_DEFINE_UNQUOTED(LD_SWITCH_SITE, $null_string)
4535 AC_DEFINE_UNQUOTED(C_SWITCH_SITE, $null_string)
4537 dnl Note: as a general rule, *only* define things here that are not
4538 dnl autodetected. For things that are autodetected, define them
4539 dnl at the point where the autodetection occurs or would occur,
4540 dnl so that the user gets immediate feedback on the results of the
4543 if test "$GNU_MALLOC" = "yes"; then AC_DEFINE(GNU_MALLOC)
4544 elif test "$with_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC)
4545 elif test "$with_debug_malloc" = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC)
4546 AC_DEFINE(USE_SYSTEM_MALLOC)
4548 test "$with_i18n3" = "yes" && AC_DEFINE(I18N3)
4549 test "$GCC" = "yes" && AC_DEFINE(USE_GCC)
4550 test "$external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
4551 test "$quick_build" = "yes" && AC_DEFINE(QUICK_BUILD)
4552 test "$with_purify" = "yes" && AC_DEFINE(PURIFY)
4553 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY)
4554 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP)
4555 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS)
4556 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD)
4557 test "$use_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE)
4558 test "$pdump" = "yes" && AC_DEFINE(PDUMP)
4560 dnl -------------------------------
4561 dnl Report on what we decided to do
4562 dnl -------------------------------
4565 dnl /etc/osversion is on SONY NEWS-OS
4566 if test -f /etc/osversion; then dnl SONY NEWS-OS
4567 echo "osversion: `cat /etc/osversion`"
4569 echo "uname -a: `uname -a`"
4572 echo "$0 $quoted_arguments"
4575 if test ! -z ${emacs_beta_version} ; then
4576 if test -z "${emacs_is_beta}" ; then
4577 xemacs_betaname=".${emacs_beta_version}"
4579 xemacs_betaname="-b${emacs_beta_version}"
4585 dnl Start stdout redirection to '| tee -a Installation'
4589 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" configured for \`$canonical'.
4592 Compilation / Installation:"
4593 echo " Source code location: $srcdir"
4594 echo " Installation prefix: $prefix"
4595 if test -n "$site_includes"; then
4596 echo " Additional header files: $site_includes"
4598 if test -n "$site_libraries"; then
4599 echo " Additional libraries: $site_libraries"
4601 if test -n "$site_prefixes"; then
4602 echo " Additional prefixes: $site_prefixes"
4604 if test -n "$runpath"; then
4605 echo " Runtime library search path: $runpath"
4608 if test -n "$opsysfile"
4609 then echo " Operating system description file: \`$opsysfile'"
4610 else echo " Not using any operating system description file"
4612 if test -n "$machfile"
4613 then echo " Machine description file: \`$machfile'"
4614 else echo " Not using any machine description file"
4617 echo " Compiler: $CC $CFLAGS"
4618 echo " Relocating allocator for buffers: $rel_alloc"
4619 echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}"
4623 if test "$with_msw" = "yes"; then
4624 echo " Compiling in support for the Microsoft window system."
4626 if test "$with_x11" = "yes"; then
4627 echo " Compiling in support for the X window system:"
4628 echo " - X Windows headers location: $x_includes"
4629 echo " - X Windows libraries location: $x_libraries"
4630 if test "$with_xauth" != yes; then
4631 echo " - Xau (X authority) not available."
4633 if test "$with_xmu" != yes; then
4634 echo " - Xmu library not available; substituting equivalent routines."
4636 if test "$with_wmcommand" != no; then
4637 echo " - Handling WM_COMMAND properly."
4640 if test "$need_athena" = "yes"; then
4641 echo " Compiling in support for the Athena widget set:"
4642 echo " - Athena headers location: $athena_h_path"
4643 echo " - Athena library to link: $athena_lib"
4645 case "$with_menubars" in
4646 lucid ) echo " Using Lucid menubars." ;;
4647 motif ) echo " Using Motif menubars."
4648 echo " *WARNING* The Motif menubar implementation is currently buggy."
4649 echo " We recommend using the Lucid menubar instead."
4650 echo " Re-run configure with --with-menubars='lucid'." ;;
4651 msw ) echo " Using MS-Windows menubars." ;;
4653 case "$with_scrollbars" in
4654 lucid ) echo " Using Lucid scrollbars." ;;
4655 motif ) echo " Using Motif scrollbars." ;;
4656 athena ) echo " Using Athena scrollbars." ;;
4657 msw ) echo " Using MS-Windows scrollbars." ;;
4659 case "$with_dialogs" in
4660 motif ) echo " Using Motif dialog boxes."
4661 if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
4662 echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher."
4663 echo " We recommend using the Athena dialog boxes instead."
4664 echo " Install libXaw and re-run configure with --with-dialogs='athena'."
4665 echo " Read the PROBLEMS file for more information."
4667 athena ) echo " Using Athena dialog boxes." ;;
4668 msw ) echo " Using MS-Windows dialog boxes." ;;
4670 case "$with_widgets" in
4671 motif ) echo " Using Motif native widgets." ;;
4672 athena ) echo " Using Athena native widgets." ;;
4673 msw ) echo " Using MS-Windows native widgets." ;;
4675 if test "$with_dragndrop" = yes; then
4676 echo " Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
4677 echo " - Drag'n'Drop prototype: $dragndrop_proto."
4682 test "$with_ncurses" = yes && echo " Compiling in support for ncurses."
4683 test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)."
4687 test "$with_gif" = yes && echo " Compiling in support for GIF images (builtin)."
4688 if test "$with_xpm" = yes; then
4689 echo " Compiling in support for XPM images."
4690 elif test "$with_x11" = yes; then
4691 echo " WARNING: -----------------------------------------------------------"
4692 echo " WARNING: Compiling without XPM image support."
4693 if test "$xpm_problem" != ""; then
4694 echo " Reason: $xpm_problem"
4696 echo " WARNING: You should strongly consider installing XPM."
4697 echo " WARNING: Otherwise toolbars and other graphics will look suboptimal."
4698 echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
4699 echo " WARNING: -----------------------------------------------------------"
4701 if test "$with_png" = yes; then
4702 echo " Compiling in support for PNG images."
4703 elif test "$window_system" != "none"; then
4704 echo " WARNING: -----------------------------------------------------------"
4705 echo " WARNING: Compiling without PNG image support."
4706 if test "$png_problem" != ""; then
4707 echo " Reason: $png_problem"
4709 echo " WARNING: You should strongly consider installing the PNG libraries."
4710 echo " WARNING: Otherwise certain images and glyphs may not display."
4711 echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
4712 echo " WARNING: -----------------------------------------------------------"
4714 test "$with_jpeg" = yes && echo " Compiling in support for JPEG images."
4715 test "$with_tiff" = yes && echo " Compiling in support for TIFF images."
4716 test "$with_xface" = yes && echo " Compiling in support for X-Face message headers."
4720 test "$with_native_sound" = yes && echo " Compiling in support for sound (native)."
4721 test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)."
4722 test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously."
4723 test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)."
4727 test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database."
4728 test "$with_database_dbm" = yes && echo " Compiling in support for DBM."
4729 test "$with_database_gdbm" = yes && echo " Compiling in support for GNU DBM."
4730 test "$with_ldap" = yes && echo " Compiling in support for LDAP."
4731 if test "$with_postgresql" = yes; then
4732 echo " Compiling in support for PostgreSQL."
4733 echo " - Using PostgreSQL header file: $libpq_fe_h_file"
4734 test "$with_postgresqlv7" = yes && echo " - Using PostgreSQL V7 bindings."
4738 Internationalization:"
4739 test "$with_mule" = yes && echo " Compiling in support for Mule (multi-lingual Emacs)."
4740 test "$with_file_coding" = yes && echo " Compiling in support for file coding."
4741 test "$with_xim" != no && echo " Compiling in support for XIM (X11R5+ I18N input method)."
4742 test "$with_xim" = motif && echo " - Using Motif to provide XIM support."
4743 test "$with_xim" = xlib && echo " - Using raw Xlib to provide XIM support."
4744 test "$with_xfs" = yes && echo " - Using XFontSet to provide bilingual menubar."
4745 test "$with_canna" = yes && echo " Compiling in support for Canna on Mule."
4746 if test "$with_wnn" = yes; then
4747 echo " Compiling in support for the WNN input method on Mule."
4748 test "$with_wnn6" = yes && echo " - Using WNN version 6."
4750 test "$with_i18n3" = yes && echo " Compiling in support for I18N level 3 (doesn't currently work)."
4754 test "$with_pop" = yes && echo " Compiling in support for POP mail retrieval."
4755 test "$with_kerberos" = yes && echo " Compiling in support for Kerberos POP authentication."
4756 test "$with_hesiod" = yes && echo " Compiling in support for Hesiod POP server access."
4757 test -n "$mail_locking" && echo " Compiling in support for \"$mail_locking\" mail spool file locking method."
4761 test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk."
4762 test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop."
4763 test "$with_socks" = yes && echo " Compiling in support for SOCKS."
4764 test "$with_dnet" = yes && echo " Compiling in support for DNET."
4765 test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules."
4766 test "$use_union_type" = yes && echo " Using the union type for Lisp_Objects."
4767 test "$pdump" = yes && echo " Using the new portable dumper."
4768 test "$debug" = yes && echo " Compiling in support for extra debugging code."
4769 test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)."
4770 if test "$error_check_extents $error_check_typecheck $error_check_bufpos $error_check_gc $error_check_malloc $error_check_glyphs" \
4771 != "no no no no no no"; then
4772 echo " WARNING: ---------------------------------------------------------"
4773 echo " WARNING: Compiling in support for runtime error checking."
4774 echo " WARNING: XEmacs will run noticeably more slowly as a result."
4775 echo " WARNING: Error checking is on by default for XEmacs beta releases."
4776 echo " WARNING: ---------------------------------------------------------"
4779 ) | tee -a Installation
4780 dnl echo "The above configure report is appended to \"Installation\" file."
4783 dnl -----------------------------------
4784 dnl Now generate config.h and Makefiles
4785 dnl -----------------------------------
4786 dnl This has to be called in order for this variable to get into config.status
4787 AC_SUBST(internal_makefile_list)
4788 # Remove any trailing slashes in these variables.
4789 test -n "$prefix" &&
4790 prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'`
4791 test -n "$exec_prefix" &&
4792 exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'`
4794 dnl Build Makefile.in's from Makefile.in.in's
4795 dnl except ./Makefile from $srcdir/Makefile.in
4797 for file in $internal_makefile_list; do
4798 test "$file" = src/Makefile.in && \
4799 file="src/Makefile.in:src/Makefile.in.in:src/depend"
4800 XE_APPEND($file, ac_output_files)
4802 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
4803 test "$with_modules" = "yes" && XE_APPEND(lib-src/ellcc.h, ac_output_files)
4805 AC_OUTPUT($ac_output_files,
4806 [for dir in . $MAKE_SUBDIR; do
4811 sed -e '/^# Generated/d' \
4812 -e 's%/\*\*/#.*%%' \
4814 dnl Delete Makefile.in.in comment lines
4816 dnl Pass through CPP directives unchanged
4821 dnl Quote other lines to protect from CPP substitution
4828 dnl Create a GNUmakefile and Makefile from Makefile.in.
4830 changequote(<<,>>)dnl
4831 dnl CPP_MAKEFILE(CPPFLAGS,filename)
4832 define(<<CPP_MAKEFILE>>,
4833 echo creating $dir/<<$2>>
4834 $CPP -I. -I${top_srcdir}/src <<$1>> junk.c \
4835 dnl Delete line directives inserted by $CPP
4836 | sed -e 's/^\#.*//' \
4837 dnl Delete spurious blanks inserted by $CPP
4838 -e 's/^[ TAB][ TAB]*$//'\
4840 dnl Delete blank lines
4842 dnl Restore lines quoted above to original contents.
4848 chmod 444 Makefile.new
4849 mv -f Makefile.new <<$2>>
4852 CPP_MAKEFILE(,Makefile)
4853 CPP_MAKEFILE(-DUSE_GNU_MAKE,GNUmakefile)
4859 dnl Append AC_DEFINE information to lib-src/config.values
4860 dnl (AC_SUBST information is already there (see config.values.sh).
4861 sed < config.status >> lib-src/config.values \
4862 -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \
4863 -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \
4864 -e 's/^\([[^ ]]*\) $/\1 ""/' \
4869 top_srcdir="$srcdir"
4870 MAKE_SUBDIR="$MAKE_SUBDIR"