1 dnl Autoconf script for GNU Emacs
2 dnl To rebuild the `configure' script from this, execute the command
4 dnl in the directory containing this script.
6 dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002
7 dnl Free Software Foundation, Inc.
9 dnl This file is part of GNU Emacs.
11 dnl GNU Emacs is free software; you can redistribute it and/or modify
12 dnl it under the terms of the GNU General Public License as published by
13 dnl the Free Software Foundation; either version 2, or (at your option)
14 dnl any later version.
16 dnl GNU Emacs is distributed in the hope that it will be useful,
17 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
18 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 dnl GNU General Public License for more details.
21 dnl You should have received a copy of the GNU General Public License
22 dnl along with GNU Emacs; see the file COPYING. If not, write to the
23 dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 dnl Boston, MA 02111-1307, USA.
28 AC_CONFIG_HEADER(src/config.h:src/config.in)
30 dnl Support for --program-prefix, --program-suffix and
31 dnl --program-transform-name options
34 lispdir='${datadir}/emacs/${version}/lisp'
35 locallisppath='${datadir}/emacs/${version}/site-lisp:'\
36 '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
37 lisppath='${locallisppath}:${lispdir}'
38 etcdir='${datadir}/emacs/${version}/etc'
39 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
40 docdir='${datadir}/emacs/${version}/etc'
43 [ --without-gcc don't use GCC to compile Emacs if GCC is found])
45 [ --without-pop don't support POP mail retrieval with movemail],
46 [if test "$withval" = yes; then
47 AC_DEFINE(MAIL_USE_POP)
50 AC_DEFINE(MAIL_USE_POP))
51 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
53 [ --with-kerberos support Kerberos-authenticated POP],
54 [AC_DEFINE(KERBEROS)])
56 [Define to support Kerberos-authenticated POP mail retrieval.])dnl
57 AC_ARG_WITH(kerberos5,
58 [ --with-kerberos5 support Kerberos version 5 authenticated POP],
59 [if test "${with_kerberos5+set}" = set; then
60 if test "${with_kerberos+set}" != set; then
65 AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])])
67 [ --with-hesiod support Hesiod to get the POP server host],
68 [AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])])
70 dnl This should be the last --with option, because --with-x is
71 dnl added later on when we find the path of X, and it's best to
72 dnl keep them together visually.
73 AC_ARG_WITH(x-toolkit,
74 [ --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)],
75 [ case "${withval}" in
76 y | ye | yes ) val=athena ;;
78 l | lu | luc | luci | lucid ) val=lucid ;;
79 a | at | ath | athe | athen | athena ) val=athena ;;
80 m | mo | mot | moti | motif ) val=motif ;;
81 dnl These don't currently work.
82 dnl o | op | ope | open | open- | open-l | open-lo \
83 dnl | open-loo | open-look ) val=open-look ;;
85 dnl AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
86 dnl which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.])
87 AC_MSG_ERROR([\`--with-x-toolkit=$withval' is invalid\;
88 this option's value should be \`yes', \`no', \`lucid', \`athena', or \`motif'.
89 Currently, \`yes', \`athena' and \`lucid' are synonyms.])
95 [ --with-xpm use -lXpm for displaying XPM images])
97 [ --with-jpeg use -ljpeg for displaying JPEG images])
99 [ --with-tiff use -ltiff for displaying TIFF images])
101 [ --with-gif use -lungif for displaying GIF images])
103 [ --with-png use -lpng for displaying PNG images])
104 AC_ARG_WITH(toolkit-scroll-bars,
105 [ --without-toolkit-scroll-bars
106 don't use Motif or Xaw3d scroll bars])
108 [ --without-xim don't use X11 XIM])
110 #### Make srcdir absolute, if it isn't already. It's important to
111 #### avoid running the path through pwd unnecessarily, since pwd can
112 #### give you automounter prefixes, which can go away. We do all this
113 #### so Emacs can find its files when run uninstalled.
114 ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
119 ## We may be able to use the $PWD environment variable to make this
120 ## absolute. But sometimes PWD is inaccurate.
121 ## Note: we used to use ${PWD} at the end instead of `pwd`,
122 ## but that tested only for a well-formed and valid PWD,
123 ## it did not object when PWD was well-formed and valid but just wrong.
124 if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
128 srcdir="`(cd ${srcdir}; pwd)`"
131 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
134 #### Check if the source directory already has a configured system in it.
135 if test `pwd` != `(cd ${srcdir} && pwd)` \
136 && test -f "${srcdir}/src/config.h" ; then
137 AC_MSG_WARN([The directory tree \`${srcdir}' is being used
138 as a build directory right now; it has been configured in its own
139 right. To configure in another directory as well, you MUST
140 use GNU make. If you do not have GNU make, then you must
141 now do \`make distclean' in ${srcdir},
142 and then run $0 again.])
145 extrasub='/^VPATH[ ]*=/c\
152 vpath %.in $(srcdir)\
153 vpath %.texi $(srcdir)'
156 #### Given the configuration name, set machfile and opsysfile to the
157 #### names of the m/*.h and s/*.h files we should use.
159 ### Canonicalize the configuration name.
163 configuration=${host_alias-$host}
167 ### If you add support for a new configuration, add code to this
168 ### switch statement to recognize your configuration name and select
169 ### the appropriate operating system and machine description files.
171 ### You would hope that you could choose an m/*.h file pretty much
172 ### based on the machine portion of the configuration name, and an s-
173 ### file based on the operating system portion. However, it turns out
174 ### that each m/*.h file is pretty manufacturer-specific - for
175 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
176 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
177 ### machines. So we basically have to have a special case for each
178 ### configuration name.
180 ### As far as handling version numbers on operating systems is
181 ### concerned, make sure things will fail in a fixable way. If
182 ### /etc/MACHINES doesn't say anything about version numbers, be
183 ### prepared to handle anything reasonably. If version numbers
184 ### matter, be sure /etc/MACHINES says something about it.
186 ### Eric Raymond says we should accept strings like "sysvr4" to mean
187 ### "System V Release 4"; he writes, "The old convention encouraged
188 ### confusion between `system' and `release' levels'."
190 machine='' opsys='' unported=no
191 case "${canonical}" in
196 case "${canonical}" in
197 alpha*-*-freebsd*) machine=alpha ;;
198 i[3456]86-*-freebsd*) machine=intel386 ;;
205 case "${canonical}" in
206 alpha*-*-netbsd*) machine=alpha ;;
207 i[3456]86-*-netbsd*) machine=intel386 ;;
209 # This is somewhat bogus.
210 machine=hp9000s300 ;;
211 powerpc-apple-netbsd*) machine=macppc ;;
212 mips-*-netbsd*) machine=pmax ;;
213 mipsel-*-netbsd*) machine=pmax ;;
214 ns32k-*-netbsd*) machine=ns32000 ;;
215 powerpc-*-netbsd*) machine=macppc ;;
216 sparc*-*-netbsd*) machine=sparc ;;
217 vax-*-netbsd*) machine=vax ;;
218 arm-*-netbsd*) machine=arm ;;
225 case "${canonical}" in
226 alpha*-*-openbsd*) machine=alpha ;;
227 i386-*-openbsd*) machine=intel386 ;;
228 m68k-*-openbsd*) machine=hp9000s300 ;;
229 mipsel-*-openbsd*) machine=pmax ;;
230 ns32k-*-openbsd*) machine=ns32000 ;;
231 sparc-*-openbsd*) machine=sparc ;;
232 vax-*-openbsd*) machine=vax ;;
237 arm-acorn-riscix1.1* )
238 machine=acorn opsys=riscix1-1
240 arm-acorn-riscix1.2* | arm-acorn-riscix )
241 ## This name is riscix12 instead of riscix1.2
242 ## to avoid a file name conflict on MSDOS.
243 machine=acorn opsys=riscix12
249 case "${canonical}" in
250 i[345]86-*-bsdi*) machine=intel386 ;;
251 sparc-*-bsdi*) machine=sparc ;;
252 powerpc-*-bsdi*) machine=macppc ;;
254 case "${canonical}" in
255 *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
256 *-*-bsdi2.0* ) opsys=bsdos2 ;;
257 *-*-bsdi2* ) opsys=bsdos2-1 ;;
258 *-*-bsdi3* ) opsys=bsdos3 ;;
259 *-*-bsdi[45]* ) opsys=bsdos4 ;;
264 ## Strictly speaking, we need the version of the alliant operating
265 ## system to choose the right machine file, but currently the
266 ## configuration name doesn't tell us enough to choose the right
267 ## one; we need to give alliants their own operating system name to
268 ## do this right. When someone cares, they can help us.
270 machine=alliant4 opsys=bsd4-2
273 machine=alliant-2800 opsys=bsd4-3
276 ## Alpha (DEC) machines.
278 machine=alpha opsys=osf1
279 # This is needed to find X11R6.1 libraries for certain tests.
280 NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
281 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
282 # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile
283 # due to non-traditional preprocessing with the current compiler
284 # defaults. OSF 4 can also have that compiler version, and there
285 # seems always to have been a usable /usr/bin/cpp.
286 NON_GNU_CPP=/usr/bin/cpp
287 case "${canonical}" in
288 alpha*-dec-osf[5-9]*)
293 alpha*-*-linux-gnu* )
294 machine=alpha opsys=gnu-linux
298 machine=arm opsys=gnu-linux
303 machine=macppc opsys=gnu-linux
308 machine=altos opsys=usg5-2
313 machine=amdahl opsys=usg5-2-2
318 machine=apollo opsys=bsd4-3
321 ## AT&T 3b2, 3b5, 3b15, 3b20
323 machine=att3b opsys=usg5-2-2
326 ## AT&T 3b1 - The Mighty Unix PC!
328 machine=7300 opsys=usg5-2-2
333 machine=ibmrs6000 opsys=aix3-2
338 machine=dpx2 opsys=usg5-3
343 machine=sps7 opsys=usg5-2
346 ## CCI 5/32, 6/32 -- see "Tahoe".
349 ## I don't know what configuration name to use for this; config.sub
350 ## doesn't seem to know anything about it. Hey, Celerity users, get
352 celerity-celerity-bsd* )
353 machine=celerity opsys=bsd4-2
357 ## What operating systems does this chip run that Emacs has been
361 ## We'll use the catch-all code at the bottom to guess the
366 mips-compaq-nonstopux* )
367 machine=nonstopux opsys=nonstopux
371 *-convex-bsd* | *-convex-convexos* )
372 machine=convex opsys=bsd4-3
373 ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov
374 NON_GNU_CPP="cc -E -P"
378 i[3456]86-cubix-sysv* )
379 machine=intel386 opsys=usg5-3
383 cydra*-cydrome-sysv* )
384 machine=cydra5 opsys=usg5-3
387 ## Data General AViiON Machines
388 ## DG changed naming conventions with the release of 5.4.4.10, they
389 ## dropped the initial 5.4 but left the intervening R. Because of the
390 ## R this shouldn't conflict with older versions of the OS (which I
391 ## think were named like dgux4.*). In addition, DG new AViiONs series
392 ## uses either Motorola M88k or Intel Pentium CPUs.
393 m88k-dg-dguxR4.* | m88k-dg-dgux4* )
394 machine=aviion opsys=dgux4
396 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
397 ## This name is dgux5-4-3 instead of dgux5-4r3
398 ## to avoid a file name conflict on MSDOS.
399 machine=aviion opsys=dgux5-4-3
401 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
402 machine=aviion opsys=dgux5-4r2
405 machine=aviion opsys=dgux
408 ## Data General AViiON Intel (x86) Machines
409 ## Exists from 5.4.3 (current i586-dg-dguxR4.11)
410 ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il
411 i[345]86-dg-dguxR4* )
412 machine=aviion-intel opsys=dgux4
416 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
417 machine=pmax opsys=bsd4-2
419 mips-dec-ultrix4.[12]* | mips-dec-bsd* )
420 machine=pmax opsys=bsd4-3
423 machine=pmax opsys=ultrix4-3
426 machine=pmax opsys=osf1
428 mips-dec-mach_bsd4.3* )
429 machine=pmax opsys=mach-bsd4-3
432 ## Motorola Delta machines
433 m68k-motorola-sysv* | m68000-motorola-sysv* )
434 machine=delta opsys=usg5-3
435 if test -z "`type gnucc | grep 'not found'`"
437 if test -s /etc/167config
438 then CC="gnucc -m68040"
439 else CC="gnucc -m68881"
442 if test -z "`type gcc | grep 'not found'`"
448 m88k-motorola-sysv4* )
449 # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
450 # needs POSIX_SIGNALS and therefore needs usg5-4-2.
451 # I hope there are not other 4.0 versions for this machine
452 # which really need usg5-4 instead.
453 machine=delta88k opsys=usg5-4-2
455 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
456 machine=delta88k opsys=usg5-3
461 machine=dual opsys=usg5-2
464 machine=dual opsys=unipl5-2
469 machine=elxsi opsys=usg5-2
474 machine=ns16000 opsys=umax
477 ## The GEC 63 - apparently, this port isn't really finished yet.
478 # I'm sure we finished off the last of the machines, though. -- fx
480 ## Gould Power Node and NP1
482 machine=gould opsys=bsd4-2
485 machine=gould opsys=bsd4-3
488 machine=gould-np1 opsys=bsd4-3
491 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
492 ## as far as Emacs is concerned).
494 # Build needs to be different on 7.0 and later releases
496 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
497 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
499 NON_GNU_CPP="/lib/cpp"
501 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
503 machine=nh3000 opsys=cxux
505 ## Harris power pc NightHawk running Power UNIX (Series 6000)
506 powerpc-harris-powerunix )
507 machine=nh6000 opsys=powerunix
508 NON_GNU_CPP="cc -Xo -E -P"
510 ## SR2001/SR2201 running HI-UX/MPP
511 hppa1.1-hitachi-hiuxmpp* )
512 machine=sr2k opsys=hiuxmpp
514 hppa1.1-hitachi-hiuxwe2* )
515 machine=sr2k opsys=hiuxwe2
518 xps*-honeywell-sysv* )
519 machine=xps100 opsys=usg5-2
522 ## HP 9000 series 200 or 300
524 machine=hp9000s300 opsys=bsd4-3
526 ## HP/UX 7, 8, 9, and 10 are supported on these machines.
529 ## Someone's system reports A.B8.05 for this.
530 ## I wonder what other possibilities there are.
531 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
532 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
533 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
534 *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
535 *) machine=hp9000s300 opsys=hpux ;;
539 ## HP 9000 series 700 and 800, running HP/UX
541 machine=hp800 opsys=hpux
544 machine=hp800 opsys=hpux8
547 machine=hp800 opsys=hpux9shr
550 machine=hp800 opsys=hpux9
553 machine=hp800 opsys=hpux10
555 hppa*-hp-hpux1[1-9]* )
556 machine=hp800 opsys=hpux11
560 machine=hp800 opsys=gnu-linux
563 ## HP 9000 series 700 and 800, running HP/UX
565 ## Cross-compilation? Nah!
567 ## Someone's system reports A.B8.05 for this.
568 ## I wonder what other possibilities there are.
569 *.B8.* ) machine=hp800 opsys=hpux8 ;;
570 *.08.* ) machine=hp800 opsys=hpux8 ;;
571 *.09.* ) machine=hp800 opsys=hpux9 ;;
572 *) machine=hp800 opsys=hpux10 ;;
576 machine=hp800 opsys=nextstep
581 machine=orion opsys=bsd4-2
584 machine=orion105 opsys=bsd4-2
588 i[3456]86-ibm-aix1.1* )
589 machine=ibmps2-aix opsys=usg5-2-2
591 i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
592 machine=ibmps2-aix opsys=usg5-3
595 machine=ibm370aix opsys=usg5-3
598 machine=ibms390 opsys=gnu-linux
600 rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
601 machine=ibmrs6000 opsys=aix3-1
603 rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
604 machine=ibmrs6000 opsys=aix3-2-5
606 rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* )
607 machine=ibmrs6000 opsys=aix4-1
609 rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
610 machine=ibmrs6000 opsys=aix4-2
612 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
613 machine=ibmrs6000 opsys=aix4
615 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
616 machine=ibmrs6000 opsys=aix4-1
618 rs6000-ibm-aix* | powerpc-ibm-aix* )
619 machine=ibmrs6000 opsys=aix3-2
622 machine=ibmrt opsys=bsd4-3
625 machine=ibmrt opsys=bsd4-2
628 machine=ibmrt opsys=bsd4-3
631 machine=ibmrt opsys=bsd4-2
634 machine=ibmrt opsys=bsd4-3
637 machine=ibmrt opsys=bsd4-3
640 machine=ibmrt-aix opsys=usg5-2-2
643 ## Integrated Solutions `Optimum V'
645 machine=isi-ov opsys=bsd4-2
648 machine=isi-ov opsys=bsd4-3
651 ## Intel 386 machines where we do care about the manufacturer
652 i[3456]86-intsys-sysv* )
653 machine=is386 opsys=usg5-2-2
657 i[3456]86-prime-sysv* )
658 machine=i386 opsys=usg5-3
661 ## Sequent Symmetry running Dynix
662 i[3456]86-sequent-bsd* )
663 machine=symmetry opsys=bsd4-3
666 ## Sequent Symmetry running ptx 4, which is a modified SVR4.
667 i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
668 machine=sequent-ptx opsys=ptx4
672 ## Sequent Symmetry running DYNIX/ptx
673 ## Use the old cpp rather than the newer ANSI one.
674 i[3456]86-sequent-ptx* )
675 machine=sequent-ptx opsys=ptx
676 NON_GNU_CPP="/lib/cpp"
679 ## ncr machine running svr4.3.
680 i[3456]86-ncr-sysv4.3 )
681 machine=ncr386 opsys=usg5-4-3
684 ## Unspecified sysv on an ncr machine defaults to svr4.2.
685 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
686 i[3456]86-ncr-sysv* )
687 machine=ncr386 opsys=usg5-4-2
690 ## Intel Paragon OSF/1
692 machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
697 machine=i860 opsys=usg5-4
698 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
699 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
703 powerpc*-*-linux-gnu* )
704 machine=macppc opsys=gnu-linux
709 machine=masscomp opsys=rtu
714 machine=mega68 opsys=bsd4-2
717 ## Workstations sold by MIPS
718 ## This is not necessarily all workstations using the MIPS processor -
719 ## Irises are produced by SGI, and DECstations by DEC.
721 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
722 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
723 ## it gives for choosing between the alternatives seems to be "Use
724 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
725 ## the BSD world." I'll assume that these are instructions for
726 ## handling two odd situations, and that every other situation
727 ## should use mips.h and usg5-2-2, they being listed first.
730 ## Fall through to the general code at the bottom to decide on the OS.
733 machine=mips4 opsys=bsd4-3
734 NON_GNU_CC="cc -systype bsd43"
735 NON_GNU_CPP="cc -systype bsd43 -E"
738 machine=mips4 opsys=riscos5
739 NON_GNU_CC="cc -systype bsd43"
740 NON_GNU_CPP="cc -systype bsd43 -E"
743 machine=mips opsys=bsd4-3
746 machine=mips opsys=usg5-2-2
750 m68*-next-* | m68k-*-nextstep* )
751 machine=m68k opsys=nextstep
754 ## The complete machine from National Semiconductor
756 machine=ns32000 opsys=usg5-2
760 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
761 machine=tower32 opsys=usg5-2-2
763 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
764 machine=tower32v3 opsys=usg5-3
769 machine=ews4800 opsys=ux4800
774 machine=targon31 opsys=usg5-2-2
779 machine=nu opsys=usg5-2
784 machine=plexus opsys=usg5-2
787 ## PowerPC reference platform
788 powerpcle-*-solaris2* )
794 ## I don't really have any idea what sort of processor the Pyramid has,
795 ## so I'm assuming it is its own architecture.
796 pyramid-pyramid-bsd* )
797 machine=pyramid opsys=bsd4-2
801 ns32k-sequent-bsd4.2* )
802 machine=sequent opsys=bsd4-2
804 ns32k-sequent-bsd4.3* )
805 machine=sequent opsys=bsd4-3
809 mips-siemens-sysv* | mips-sni-sysv*)
810 machine=mips-siemens opsys=usg5-4
811 NON_GNU_CC=/usr/ccs/bin/cc
812 NON_GNU_CPP=/usr/ccs/lib/cpp
815 ## Silicon Graphics machines
816 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
818 machine=irist opsys=iris3-5
820 m68*-sgi-iris3.6* | m68*-sgi-iris*)
821 machine=irist opsys=iris3-6
825 machine=iris4d opsys=irix3-3
828 machine=iris4d opsys=irix4-0
831 machine=iris4d opsys=irix6-5
832 # Without defining _LANGUAGE_C, things get masked out in the headers
833 # so that, for instance, grepping for `free' in stdlib.h fails and
834 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
835 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
836 NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
839 machine=iris4d opsys=irix6-0
840 # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
841 # but presumably it does no harm.
842 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
843 # -32 probably isn't necessary in later v.6s -- anyone know which?
844 NON_GCC_TEST_OPTIONS=-32
846 mips-sgi-irix5.[01]* )
847 machine=iris4d opsys=irix5-0
849 mips-sgi-irix5* | mips-sgi-irix* )
850 machine=iris4d opsys=irix5-2
855 machine=news opsys=bsd4-2
858 machine=news opsys=bsd4-3
860 m68*-sony-newsos3* | m68*-sony-news3*)
861 machine=news opsys=bsd4-3
863 mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
864 machine=news-risc opsys=bsd4-3
867 machine=news-r6 opsys=newsos6
870 machine=news-risc opsys=newsos5
875 machine=stride opsys=usg5-2
879 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
880 machine=sparc opsys=gnu-linux
883 *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
884 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
885 | rs6000-*-solaris2*)
886 case "${canonical}" in
887 m68*-sunos1* ) machine=sun1 ;;
888 m68*-sunos2* ) machine=sun2 ;;
889 m68* ) machine=sun3 ;;
890 i[3456]86-sun-sunos[34]* ) machine=sun386 ;;
891 i[3456]86-*-* ) machine=intel386 ;;
892 powerpcle* ) machine=powerpcle ;;
893 powerpc* | rs6000* ) machine=ibmrs6000 ;;
894 sparc* ) machine=sparc ;;
897 case "${canonical}" in
898 ## The Sun386 didn't get past 4.0.
899 i[3456]86-*-sunos4 ) opsys=sunos4-0 ;;
900 *-sunos4.0* ) opsys=sunos4-0 ;;
901 *-sunos4.1.[3-9]*noshare )
902 ## This name is sunos413 instead of sunos4-1-3
903 ## to avoid a file name conflict on MSDOS.
905 NON_GNU_CPP=/usr/lib/cpp
906 NON_GCC_TEST_OPTIONS=-Bstatic
907 GCC_TEST_OPTIONS=-static
909 *-sunos4.1.[3-9]* | *-sunos4shr*)
911 NON_GNU_CPP=/usr/lib/cpp
913 *-sunos4* | *-sunos )
915 NON_GCC_TEST_OPTIONS=-Bstatic
916 GCC_TEST_OPTIONS=-static
918 *-sunos5.3* | *-solaris2.3* )
920 NON_GNU_CPP=/usr/ccs/lib/cpp
922 *-sunos5.4* | *-solaris2.4* )
924 NON_GNU_CPP=/usr/ccs/lib/cpp
927 *-sunos5.5* | *-solaris2.5* )
929 NON_GNU_CPP=/usr/ccs/lib/cpp
932 *-sunos5* | *-solaris* )
934 NON_GNU_CPP=/usr/ccs/lib/cpp
938 ## Watch out for a compiler that we know will not work.
939 case "${canonical}" in
940 *-solaris* | *-sunos5* )
941 if [ "x$CC" = x/usr/ucb/cc ]; then
942 ## /usr/ucb/cc doesn't work;
943 ## we should find some other compiler that does work.
951 machine=sparc opsys=nextstep
956 machine=tad68k opsys=usg5-3
960 tahoe-tahoe-bsd4.2* )
961 machine=tahoe opsys=bsd4-2
963 tahoe-tahoe-bsd4.3* )
964 machine=tahoe opsys=bsd4-3
967 ## Tandem Integrity S2
969 machine=tandem-s2 opsys=usg5-3
973 m88k-tektronix-sysv3* )
974 machine=tekxd88 opsys=usg5-3
977 ## Tektronix 16000 box (6130?)
978 ns16k-tektronix-bsd* )
979 machine=ns16000 opsys=bsd4-2
982 ## src/m/tek4300.h hints that this is a m68k machine.
983 m68*-tektronix-bsd* )
984 machine=tek4300 opsys=bsd4-3
988 ## We seem to have lost the machine-description file titan.h!
990 machine=titan opsys=usg5-3
993 ## Ustation E30 (SS5E)
994 m68*-unisys-uniplus* )
995 machine=ustation opsystem=unipl5-2
1001 case "${canonical}" in
1002 *-bsd4.1* ) opsys=bsd4-1 ;;
1003 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
1004 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
1005 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
1006 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
1007 *-vms* ) opsys=vms ;;
1013 ns16k-whitechapel-* )
1015 ## We don't know what sort of OS runs on these; we'll let the
1016 ## operating system guessing code below try.
1021 machine=wicat opsys=usg5-2
1026 machine=ia64 opsys=gnu-linux
1029 ## Intel 386 machines where we don't care about the manufacturer
1032 case "${canonical}" in
1033 *-lynxos* ) opsys=lynxos ;;
1034 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1035 *-isc2.2* ) opsys=isc2-2 ;;
1036 *-isc4.0* ) opsys=isc4-0 ;;
1037 *-isc4.* ) opsys=isc4-1
1038 GCC_TEST_OPTIONS=-posix
1039 NON_GCC_TEST_OPTIONS=-Xp
1041 *-isc* ) opsys=isc3-0 ;;
1042 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1043 *-esix* ) opsys=esix ;;
1044 *-xenix* ) opsys=xenix ;;
1045 *-linux-gnu* ) opsys=gnu-linux ;;
1046 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
1047 *-sco3.2v5* ) opsys=sco5
1048 NON_GNU_CPP=/lib/cpp
1049 # Prevent -belf from being passed to $CPP.
1050 # /lib/cpp does not accept it.
1051 OVERRIDE_CPPFLAGS=" "
1053 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1054 *-386bsd* ) opsys=386bsd ;;
1055 *-nextstep* ) opsys=nextstep ;;
1056 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1060 ## m68k Linux-based GNU system
1062 machine=m68k opsys=gnu-linux
1065 ## Mips Linux-based GNU system
1067 machine=mips opsys=gnu-linux
1071 sparc-fujitsu-sysv4* )
1072 machine=sparc opsys=uxpds
1073 NON_GNU_CPP=/usr/ccs/lib/cpp
1078 f301-fujitsu-uxpv4.1)
1079 machine=f301 opsys=uxpv
1087 ### If the code above didn't choose an operating system, just choose
1088 ### an operating system based on the configuration name. You really
1089 ### only want to use this when you have no idea what the right
1090 ### operating system is; if you know what operating systems a machine
1091 ### runs, it's cleaner to make it explicit in the case statement
1093 if test x"${opsys}" = x; then
1094 case "${canonical}" in
1095 *-gnu* ) opsys=gnu ;;
1096 *-bsd4.[01] ) opsys=bsd4-1 ;;
1097 *-bsd4.2 ) opsys=bsd4-2 ;;
1098 *-bsd4.3 ) opsys=bsd4-3 ;;
1099 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1100 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1101 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
1102 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
1103 *-sysv4.2uw* ) opsys=unixware ;;
1104 *-sysv4.1* | *-sysvr4.1* )
1105 NON_GNU_CPP=/usr/lib/cpp
1107 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1108 if [ x$NON_GNU_CPP = x ]; then
1109 if [ -f /usr/ccs/lib/cpp ]; then
1110 NON_GNU_CPP=/usr/ccs/lib/cpp
1112 NON_GNU_CPP=/lib/cpp
1116 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
1123 changequote([, ])dnl
1125 if test $unported = yes; then
1126 AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
1127 Check \`etc/MACHINES' for recognized configuration names.])
1130 machfile="m/${machine}.h"
1131 opsysfile="s/${opsys}.h"
1134 #### Choose a compiler.
1135 test -n "$CC" && cc_specified=yes
1137 # Save the value of CFLAGS that the user specified.
1138 SPECIFIED_CFLAGS="$CFLAGS"
1141 "yes" ) CC="gcc" GCC=yes ;;
1142 "no" ) : ${CC=cc} ;;
1147 # On Suns, sometimes $CPP names a directory.
1148 if test -n "$CPP" && test -d "$CPP"; then
1152 #### Some systems specify a CPP to use unless we are using GCC.
1153 #### Now that we know whether we are using GCC, we can decide whether
1154 #### to use that one.
1155 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1160 #### Some systems specify a CC to use unless we are using GCC.
1161 #### Now that we know whether we are using GCC, we can decide whether
1162 #### to use that one.
1163 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1164 test x$cc_specified != xyes
1169 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1171 CC="$CC $GCC_TEST_OPTIONS"
1174 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1176 CC="$CC $NON_GCC_TEST_OPTIONS"
1179 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1181 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1184 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1186 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1189 #### Some other nice autoconf tests. If you add a test here which
1190 #### should make an entry in src/config.h, don't forget to add an
1191 #### #undef clause to src/config.h.in for autoconf to modify.
1193 dnl checks for programs
1197 if test "x$RANLIB" = x; then
1201 dnl checks for Unix variants
1204 #### Extract some information from the operating system and machine files.
1206 AC_CHECKING([the machine- and system-dependent files to find out
1207 - which libraries the lib-src programs will want, and
1208 - whether the GNU malloc routines are usable])
1210 ### First figure out CFLAGS (which we use for running the compiler here)
1211 ### and REAL_CFLAGS (which we use for real compilation).
1212 ### The two are the same except on a few systems, where they are made
1213 ### different to work around various lossages. For example,
1214 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1215 ### as implying static linking.
1217 ### If the CFLAGS env var is specified, we use that value
1218 ### instead of the default.
1220 ### It's not important that this name contain the PID; you can't run
1221 ### two configures in the same directory and have anything work
1223 tempcname="conftest.c"
1226 #include "'${srcdir}'/src/'${opsysfile}'"
1227 #include "'${srcdir}'/src/'${machfile}'"
1228 #ifndef LIBS_MACHINE
1229 #define LIBS_MACHINE
1234 #ifndef C_SWITCH_SYSTEM
1235 #define C_SWITCH_SYSTEM
1237 #ifndef C_SWITCH_MACHINE
1238 #define C_SWITCH_MACHINE
1240 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1241 configure___ c_switch_system=C_SWITCH_SYSTEM
1242 configure___ c_switch_machine=C_SWITCH_MACHINE
1245 #define LIB_X11_LIB -lX11
1248 #ifndef LIBX11_MACHINE
1249 #define LIBX11_MACHINE
1252 #ifndef LIBX11_SYSTEM
1253 #define LIBX11_SYSTEM
1255 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1258 configure___ unexec=UNEXEC
1260 configure___ unexec=unexec.o
1263 #ifdef SYSTEM_MALLOC
1264 configure___ system_malloc=yes
1266 configure___ system_malloc=no
1269 #ifdef USE_MMAP_FOR_BUFFERS
1270 configure___ use_mmap_for_buffers=yes
1272 configure___ use_mmap_for_buffers=no
1275 #ifndef C_DEBUG_SWITCH
1276 #define C_DEBUG_SWITCH -g
1279 #ifndef C_OPTIMIZE_SWITCH
1281 #define C_OPTIMIZE_SWITCH -O2
1283 #define C_OPTIMIZE_SWITCH -O
1287 #ifndef LD_SWITCH_MACHINE
1288 #define LD_SWITCH_MACHINE
1291 #ifndef LD_SWITCH_SYSTEM
1292 #define LD_SWITCH_SYSTEM
1295 #ifndef LD_SWITCH_X_SITE_AUX
1296 #define LD_SWITCH_X_SITE_AUX
1299 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1300 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1302 #ifdef THIS_IS_CONFIGURE
1304 /* Get the CFLAGS for tests in configure. */
1306 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1308 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1311 #else /* not THIS_IS_CONFIGURE */
1313 /* Get the CFLAGS for real compilation. */
1315 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1317 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1320 #endif /* not THIS_IS_CONFIGURE */
1323 # The value of CPP is a quoted variable reference, so we need to do this
1324 # to get its actual value...
1325 CPP=`eval "echo $CPP"`
1327 eval `${CPP} -Isrc ${tempcname} \
1328 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1329 if test "x$SPECIFIED_CFLAGS" = x; then
1330 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1331 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1333 REAL_CFLAGS="$CFLAGS"
1335 changequote([, ])dnl
1338 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1340 ### Make sure subsequent tests use flags consistent with the build flags.
1342 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1343 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1345 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1348 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1351 # Sound support for GNU/Linux and the free BSDs.
1352 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1353 # Emulation library used on NetBSD.
1354 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1357 dnl checks for header files
1358 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1359 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1360 termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h pty.h sys/mman.h \
1367 dnl Some systems have utime.h but don't declare the struct anyplace.
1368 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1369 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1370 #include <sys/time.h>
1373 #ifdef HAVE_SYS_TIME_H
1374 #include <sys/time.h>
1381 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1382 emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1383 if test $emacs_cv_struct_utimbuf = yes; then
1384 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
1387 dnl checks for typedefs
1390 dnl Check for speed_t typedef.
1391 AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1392 [AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
1393 emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
1394 if test $emacs_cv_speed_t = yes; then
1395 AC_DEFINE(HAVE_SPEED_T, 1,
1396 [Define to 1 if `speed_t' is declared by <termios.h>.])
1399 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1400 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1401 #include <sys/time.h>
1404 #ifdef HAVE_SYS_TIME_H
1405 #include <sys/time.h>
1409 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1410 emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1411 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1412 if test $emacs_cv_struct_timeval = yes; then
1413 AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by <sys/time.h>.])
1416 AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1417 AC_TRY_COMPILE([#include <math.h>],
1418 [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1419 emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1420 HAVE_EXCEPTION=$emacs_cv_struct_exception
1421 if test $emacs_cv_struct_exception != yes; then
1422 AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
1425 dnl checks for structure members
1428 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
1429 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
1430 [Define to 1 if `tm_gmtoff' is member of `struct tm'.])],,
1431 [#include <time.h>])
1433 dnl checks for compiler characteristics
1435 dnl Testing __STDC__ to determine prototype support isn't good enough.
1436 dnl DEC C, for instance, doesn't define it with default options, and
1437 dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile
1442 dnl This isn't useful because we can't turn on use of `inline' unless
1443 dnl the compiler groks `extern inline'.
1445 AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1446 [AC_TRY_COMPILE(, [void * foo;],
1447 emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1448 if test $emacs_cv_void_star = yes; then
1449 AC_DEFINE(POINTER_TYPE, void)
1451 AC_DEFINE(POINTER_TYPE, char)
1453 AH_TEMPLATE(POINTER_TYPE,
1454 [Define as `void' if your compiler accepts `void *'; otherwise
1455 define as `char'.])dnl
1457 dnl check for Make feature
1460 dnl checks for operating system services
1461 AC_SYS_LONG_FILE_NAMES
1463 #### Choose a window system.
1466 if test "$no_x" = yes; then
1472 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1473 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1474 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1475 x_default_search_path=""
1476 for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
1478 ${x_library}/X11/%L/%T/%N%C%S:\
1479 ${x_library}/X11/%l/%T/%N%C%S:\
1480 ${x_library}/X11/%T/%N%C%S:\
1481 ${x_library}/X11/%L/%T/%N%S:\
1482 ${x_library}/X11/%l/%T/%N%S:\
1483 ${x_library}/X11/%T/%N%S"
1484 if test x"${x_default_search_path}" = x; then
1485 x_default_search_path=${x_search_path}
1487 x_default_search_path="${x_search_path}:${x_default_search_path}"
1491 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1492 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1495 if test x"${x_includes}" = x; then
1496 bitmapdir=/usr/include/X11/bitmaps
1498 # accumulate include directories that have X11 bitmap subdirectories
1500 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1501 if test -d "${bmd}/X11/bitmaps"; then
1502 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1504 if test -d "${bmd}/bitmaps"; then
1505 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1508 if test ${bmd_acc} != "dummyval"; then
1509 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1513 case "${window_system}" in
1517 case "${with_x_toolkit}" in
1518 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1519 motif ) USE_X_TOOLKIT=MOTIF ;;
1520 dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
1521 no ) USE_X_TOOLKIT=none ;;
1522 dnl If user did not say whether to use a toolkit,
1523 dnl make this decision later: use the toolkit if we have X11R5 or newer.
1524 * ) USE_X_TOOLKIT=maybe ;;
1534 ### If we're using X11, we should use the X menu package.
1537 yes ) HAVE_MENUS=yes ;;
1540 if test "${opsys}" = "hpux9"; then
1541 case "${x_libraries}" in
1543 opsysfile="s/hpux9-x11r4.h"
1548 if test "${opsys}" = "hpux9shr"; then
1549 case "${x_libraries}" in
1551 opsysfile="s/hpux9shxr4.h"
1556 ### Compute the unexec source name from the object name.
1557 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1559 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1560 # Assume not, until told otherwise.
1563 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1564 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1565 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1566 emacs_cv_var___after_morecore_hook,
1567 [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1568 emacs_cv_var___after_morecore_hook=yes,
1569 emacs_cv_var___after_morecore_hook=no)])
1570 if test $emacs_cv_var___after_morecore_hook = no; then
1573 if test "${system_malloc}" = "yes"; then
1576 (The GNU allocators don't work with this system configuration.)"
1578 if test "$doug_lea_malloc" = "yes" ; then
1579 if test "$GNU_MALLOC" = yes ; then
1581 (Using Doug Lea's new malloc from the GNU C Library.)"
1583 AC_DEFINE(DOUG_LEA_MALLOC, 1,
1584 [Define to 1 if you are using the GNU C Library.])
1587 if test x"${REL_ALLOC}" = x; then
1588 REL_ALLOC=${GNU_MALLOC}
1591 dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
1592 dnl the system configuration file (s/*.h) to turn the use of mmap
1593 dnl in the relocating allocator on.
1596 if test $use_mmap_for_buffers = yes; then
1600 LIBS="$libsrc_libs $LIBS"
1602 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1603 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1604 AC_CHECK_LIB(dnet, dnet_ntoa)
1605 dnl This causes -lresolv to get used in subsequent tests,
1606 dnl which causes failures on some systems such as HPUX 9.
1607 dnl AC_CHECK_LIB(resolv, gethostbyname)
1609 dnl FIXME replace main with a function we actually want from this library.
1610 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1612 AC_CHECK_LIB(pthreads, cma_open)
1614 AC_MSG_CHECKING(for XFree86 in /usr/X386)
1615 if test -d /usr/X386/include; then
1617 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1621 AC_MSG_RESULT($HAVE_XFREE386)
1623 # Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1624 # for the tests that follow. We set it back to REAL_CFLAGS later on.
1626 REAL_CPPFLAGS="$CPPFLAGS"
1628 if test "${HAVE_X11}" = "yes"; then
1629 DEFS="$C_SWITCH_X_SITE $DEFS"
1630 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1632 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1633 CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
1635 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1636 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1637 # but it's more convenient here to set LD_RUN_PATH
1638 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1639 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1640 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1644 if test "${opsys}" = "gnu-linux"; then
1645 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1647 [XOpenDisplay ("foo");],
1648 [xlinux_first_failure=no],
1649 [xlinux_first_failure=yes])
1650 if test "${xlinux_first_failure}" = "yes"; then
1651 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1652 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1653 OLD_CPPFLAGS="$CPPFLAGS"
1655 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1656 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1657 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1658 LIBS="$LIBS -b i486-linuxaout"
1660 [XOpenDisplay ("foo");],
1661 [xlinux_second_failure=no],
1662 [xlinux_second_failure=yes])
1663 if test "${xlinux_second_failure}" = "yes"; then
1664 # If we get the same failure with -b, there is no use adding -b.
1665 # So take it out. This plays safe.
1666 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1667 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1668 CPPFLAGS="$OLD_CPPFLAGS"
1679 # Reportedly, some broken Solaris systems have XKBlib.h but are missing
1680 # header files included from there.
1681 AC_MSG_CHECKING(for Xkb)
1682 AC_TRY_LINK([#include <X11/Xlib.h>
1683 #include <X11/XKBlib.h>],
1684 [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
1685 emacs_xkb=yes, emacs_xkb=no)
1686 AC_MSG_RESULT($emacs_xkb)
1687 if test $emacs_xkb = yes; then
1688 AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
1691 AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
1692 XScreenNumberOfScreen XSetWMProtocols)
1695 if test "${window_system}" = "x11"; then
1696 AC_MSG_CHECKING(X11 version 6)
1697 AC_CACHE_VAL(emacs_cv_x11_version_6,
1698 [AC_TRY_LINK([#include <X11/Xlib.h>],
1699 [#if XlibSpecificationRelease < 6
1702 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
1703 if test $emacs_cv_x11_version_6 = yes; then
1704 AC_MSG_RESULT(6 or newer)
1705 AC_DEFINE(HAVE_X11R6, 1,
1706 [Define to 1 if you have the X11R6 or newer version of Xlib.])
1708 AC_MSG_RESULT(before 6)
1712 if test "${window_system}" = "x11"; then
1713 AC_MSG_CHECKING(X11 version 5)
1714 AC_CACHE_VAL(emacs_cv_x11_version_5,
1715 [AC_TRY_LINK([#include <X11/Xlib.h>],
1716 [#if XlibSpecificationRelease < 5
1719 ], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no)])
1720 if test $emacs_cv_x11_version_5 = yes; then
1721 AC_MSG_RESULT(5 or newer)
1723 AC_DEFINE(HAVE_X11R5, 1,
1724 [Define to 1 if you have the X11R5 or newer version of Xlib.])
1727 AC_MSG_RESULT(before 5)
1731 dnl Do not put whitespace before the #include statements below.
1732 dnl Older compilers (eg sunos4 cc) choke on it.
1733 if test x"${USE_X_TOOLKIT}" = xmaybe; then
1734 if test x"${HAVE_X11R5}" = xyes; then
1735 AC_MSG_CHECKING(X11 version 5 with Xaw)
1736 AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
1738 #include <X11/Intrinsic.h>
1739 #include <X11/Xaw/Simple.h>],
1741 emacs_cv_x11_version_5_with_xaw=yes,
1742 emacs_cv_x11_version_5_with_xaw=no)])
1743 if test $emacs_cv_x11_version_5_with_xaw = yes; then
1744 AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
1747 AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1755 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1757 if test "${USE_X_TOOLKIT}" != "none"; then
1758 AC_MSG_CHECKING(X11 toolkit version)
1759 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
1760 [AC_TRY_LINK([#include <X11/Intrinsic.h>],
1761 [#if XtSpecificationRelease < 6
1764 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
1765 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1766 if test $emacs_cv_x11_toolkit_version_6 = yes; then
1767 AC_MSG_RESULT(6 or newer)
1768 AC_DEFINE(HAVE_X11XTR6, 1,
1769 [Define to 1 if you have the X11R6 or newer version of Xt.])
1771 AC_MSG_RESULT(before 6)
1774 dnl If using toolkit, check whether libXmu.a exists.
1775 dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
1777 if test x$HAVE_X11XTR6 = xyes; then
1778 LIBS="-lXt -lSM -lICE $LIBS"
1782 AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
1783 test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
1786 # On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
1787 if test "${HAVE_X11}" = "yes"; then
1788 if test "${USE_X_TOOLKIT}" != "none"; then
1789 AC_CHECK_LIB(Xext, XShapeQueryExtension)
1793 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1794 AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
1795 [AC_TRY_COMPILE([#include <Xm/Xm.h>],
1796 [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
1799 Motif version prior to 2.1.
1801 emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
1802 HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
1803 if test $emacs_cv_motif_version_2_1 = yes; then
1805 AC_DEFINE(HAVE_MOTIF_2_1, 1,
1806 [Define to 1 if you have Motif 2.1 or newer.])
1807 AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
1808 if test ${HAVE_LIBXP} = yes; then
1809 AC_DEFINE(HAVE_LIBXP, 1,
1810 [Define to 1 if you have the Xp library (-lXp).])
1815 ### Is -lXaw3d available?
1817 if test "${HAVE_X11}" = "yes"; then
1818 if test "${USE_X_TOOLKIT}" != "none"; then
1819 AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
1820 AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes))
1821 if test "${HAVE_XAW3D}" = "yes"; then
1822 AC_DEFINE(HAVE_XAW3D, 1,
1823 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
1828 dnl Use toolkit scroll bars if configured for X toolkit and either
1829 dnl using Motif or Xaw3d is available, and unless
1830 dnl --with-toolkit-scroll-bars=no was specified.
1832 AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
1833 [Define to 1 if we should use toolkit scroll bars.])dnl
1834 USE_TOOLKIT_SCROLL_BARS=no
1835 if test "${with_toolkit_scroll_bars}" != "no"; then
1836 if test "${USE_X_TOOLKIT}" != "none"; then
1837 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1838 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1840 USE_TOOLKIT_SCROLL_BARS=yes
1841 elif test "${HAVE_XAW3D}" = "yes"; then
1842 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1843 USE_TOOLKIT_SCROLL_BARS=yes
1848 dnl Don't use X11 input methods if user specifies he doesn't want it
1849 dnl with `--with-xim=no'.
1851 if test "${with_xim}" != "no"; then
1852 AC_DEFINE(USE_XIM, 1,
1853 [Define to 1 if we should use XIM, if it is available.])
1856 ### Use -lXpm if available, unless `--with-xpm=no'.
1858 if test "${HAVE_X11}" = "yes"; then
1859 if test "${with_xpm}" != "no"; then
1860 AC_CHECK_HEADER(X11/xpm.h,
1861 AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
1862 if test "${HAVE_XPM}" = "yes"; then
1863 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
1864 AC_EGREP_CPP(no_return_alloc_pixels,
1865 [#include "X11/xpm.h"
1866 #ifndef XpmReturnAllocPixels
1867 no_return_alloc_pixels
1869 ], HAVE_XPM=no, HAVE_XPM=yes)
1871 if test "${HAVE_XPM}" = "yes"; then
1879 if test "${HAVE_XPM}" = "yes"; then
1880 AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
1884 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1886 if test "${HAVE_X11}" = "yes"; then
1887 if test "${with_jpeg}" != "no"; then
1888 dnl Checking for jpeglib.h can lose becsue of a redefinition of
1890 AC_CHECK_HEADER(jerror.h,
1891 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
1894 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
1895 if test "${HAVE_JPEG}" = "yes"; then
1896 AC_DEFINE(HAVE_JPEG)
1898 changequote({, })dnl avoid leadingspace on the next line
1899 {version= *(6[2-9]|[7-9][0-9])},
1900 changequote([, ])dnl
1901 [#include <jpeglib.h>
1902 version=JPEG_LIB_VERSION
1904 AC_DEFINE(HAVE_JPEG),
1905 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
1910 ### Use -lpng if available, unless `--with-png=no'.
1912 if test "${HAVE_X11}" = "yes"; then
1913 if test "${with_png}" != "no"; then
1914 AC_CHECK_HEADER(png.h,
1915 AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm))
1918 if test "${HAVE_PNG}" = "yes"; then
1919 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
1923 ### Use -ltiff if available, unless `--with-tiff=no'.
1925 if test "${HAVE_X11}" = "yes"; then
1926 if test "${with_tiff}" != "no"; then
1927 AC_CHECK_HEADER(tiffio.h,
1929 # At least one tiff package requires the jpeg library.
1930 if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
1931 AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs))
1934 if test "${HAVE_TIFF}" = "yes"; then
1935 AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
1939 ### Use -lgif if available, unless `--with-gif=no'.
1941 if test "${HAVE_X11}" = "yes"; then
1942 if test "${with_gif}" != "no"; then
1943 AC_CHECK_HEADER(gif_lib.h,
1944 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
1945 # Earlier versions can crash Emacs.
1946 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
1949 if test "${HAVE_GIF}" = "yes"; then
1950 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have the ungif library (-lungif).])
1954 # If netdb.h doesn't declare h_errno, we must declare it by hand.
1955 AC_CACHE_CHECK(whether netdb declares h_errno,
1956 emacs_cv_netdb_declares_h_errno,
1957 [AC_TRY_LINK([#include <netdb.h>],
1959 emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
1960 if test $emacs_cv_netdb_declares_h_errno = yes; then
1961 AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
1966 # fmod, logb, and frexp are found in -lm on most systems.
1967 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
1968 AC_CHECK_LIB(m, sqrt)
1970 # Check for mail-locking functions in a "mail" library
1971 AC_CHECK_LIB(mail, maillock)
1972 dnl Debian, at least:
1973 dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)])
1974 AC_CHECK_LIB(lockfile, maillock)
1975 # If we have the shared liblockfile, assume we must use it for mail
1976 # locking (e.g. Debian). If we couldn't link against liblockfile
1977 # (no liblockfile.a installed), ensure that we don't need to.
1978 if test "$ac_cv_lib_lockfile_maillock" = no; then
1979 dnl This works for files generally, not just executables.
1980 dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
1981 AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
1982 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
1983 if test $ac_cv_prog_liblockfile = yes; then
1984 AC_MSG_ERROR([Shared liblockfile found but can't link against it.
1985 This probably means that movemail could lose mail.
1986 There may be a \`development' package to install containing liblockfile.])
1987 else AC_DEFINE(LIBMAIL, -llockfile, [Define to -llockfile if it is usable.])
1991 AC_CHECK_FUNCS(touchlock)
1992 AC_CHECK_HEADERS(maillock.h)
1994 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
1995 rename closedir mkdir rmdir sysinfo \
1996 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
1997 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
1998 utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
1999 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
2000 gai_strerror mkstemp mremap memmove)
2003 if test "$ac_cv_func_working_mktime" = no; then
2004 AC_DEFINE(BROKEN_MKTIME, 1, [Define to 1 if the mktime function is broken.])
2012 AC_CHECK_FUNCS(grantpt)
2014 # PTY-related GNU extensions.
2015 AC_CHECK_FUNCS(getpt)
2017 # Check this now, so that we will NOT find the above functions in ncurses.
2018 # That is because we have not set up to link ncurses in lib-src.
2019 # It's better to believe a function is not available
2020 # than to expect to find it in ncurses.
2021 AC_CHECK_LIB(ncurses, tparm)
2023 # Do we need the Hesiod library to provide the support routines?
2024 if test "$with_hesiod" = yes ; then
2025 # Don't set $LIBS here -- see comments above.
2027 AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2028 [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2029 [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2030 if test "$resolv" = yes ; then
2032 AC_DEFINE(HAVE_LIBRESOLV, 1,
2033 [Define to 1 if you have the resolv library (-lresolv).])
2037 AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
2038 AC_DEFINE(HAVE_LIBHESIOD, 1,
2039 [Define to 1 if you have the hesiod library (-lhesiod).]),
2043 # These tell us which Kerberos-related libraries to use.
2044 if test "${with_kerberos+set}" = set; then
2045 AC_CHECK_LIB(com_err, com_err)
2046 AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2047 AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2048 AC_CHECK_LIB(krb5, krb5_init_context)
2049 if test "${with_kerberos5+set}" != set; then
2050 AC_CHECK_LIB(des425, des_cbc_encrypt,,
2051 AC_CHECK_LIB(des, des_cbc_encrypt))
2052 AC_CHECK_LIB(krb4, krb_get_cred,,
2053 AC_CHECK_LIB(krb, krb_get_cred))
2056 if test "${with_kerberos5+set}" = set; then
2057 AC_CHECK_HEADERS(krb5.h)
2059 AC_CHECK_HEADERS(des.h,,
2060 [AC_CHECK_HEADERS(kerberosIV/des.h,,
2061 [AC_CHECK_HEADERS(kerberos/des.h)])])
2062 AC_CHECK_HEADERS(krb.h,,
2063 [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2064 [AC_CHECK_HEADERS(kerberos/krb.h)])])
2066 AC_CHECK_HEADERS(com_err.h)
2069 # Solaris requires -lintl if you want strerror (which calls dgettext)
2070 # to return localized messages.
2071 AC_CHECK_LIB(intl, dgettext)
2073 AC_MSG_CHECKING(whether localtime caches TZ)
2074 AC_CACHE_VAL(emacs_cv_localtime_cache,
2075 [if test x$ac_cv_func_tzset = xyes; then
2076 AC_TRY_RUN([#include <time.h>
2077 extern char **environ;
2081 for (to = from = environ; (*to = *from); from++)
2082 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2085 char TZ_GMT0[] = "TZ=GMT0";
2086 char TZ_PST8[] = "TZ=PST8";
2089 time_t now = time ((time_t *) 0);
2090 int hour_GMT0, hour_unset;
2091 if (putenv (TZ_GMT0) != 0)
2093 hour_GMT0 = localtime (&now)->tm_hour;
2095 hour_unset = localtime (&now)->tm_hour;
2096 if (putenv (TZ_PST8) != 0)
2098 if (localtime (&now)->tm_hour == hour_GMT0)
2101 if (localtime (&now)->tm_hour != hour_unset)
2104 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2105 [# If we have tzset, assume the worst when cross-compiling.
2106 emacs_cv_localtime_cache=yes])
2108 # If we lack tzset, report that localtime does not cache TZ,
2109 # since we can't invalidate the cache if we don't have tzset.
2110 emacs_cv_localtime_cache=no
2112 AC_MSG_RESULT($emacs_cv_localtime_cache)
2113 if test $emacs_cv_localtime_cache = yes; then
2114 AC_DEFINE(LOCALTIME_CACHE, 1,
2115 [Define to 1 if localtime caches TZ.])
2118 if test "x$HAVE_TIMEVAL" = xyes; then
2119 AC_CHECK_FUNCS(gettimeofday)
2120 if test $ac_cv_func_gettimeofday = yes; then
2121 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2122 emacs_cv_gettimeofday_two_arguments,
2124 #ifdef TIME_WITH_SYS_TIME
2125 #include <sys/time.h>
2128 #ifdef HAVE_SYS_TIME_H
2129 #include <sys/time.h>
2134 [struct timeval time;
2135 gettimeofday (&time, 0);],
2136 emacs_cv_gettimeofday_two_arguments=yes,
2137 emacs_cv_gettimeofday_two_arguments=no)])
2138 if test $emacs_cv_gettimeofday_two_arguments = no; then
2139 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
2140 [Define to 1 if gettimeofday accepts only one argument.])
2145 dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
2146 if test "$ac_cv_func_gettimeofday" = yes; then
2147 AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone,
2148 [AC_TRY_COMPILE([#include <sys/time.h>],
2149 [struct timezone tz;],
2150 dnl It may be that we can't call gettimeofday with a non-null pointer,
2151 dnl even though we have struct timezone (e.g. HPUX). In that case
2152 dnl we'll lie about struct timezone.
2154 #ifdef TIME_WITH_SYS_TIME
2155 #include <sys/time.h>
2158 #ifdef HAVE_SYS_TIME_H
2159 #include <sys/time.h>
2165 struct timeval time;
2166 struct timezone dummy;
2167 exit (gettimeofday (&time, &dummy));
2169 emacs_cv_struct_timezone=yes,
2170 emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)],
2171 emacs_cv_struct_timezone=no)])
2175 AC_CHECK_FUNC(socket, , ok_so_far=no)
2176 if test $ok_so_far = yes; then
2177 AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
2179 if test $ok_so_far = yes; then
2180 AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
2182 if test $ok_so_far = yes; then
2183 AC_DEFINE(HAVE_INET_SOCKETS, 1,
2184 [Define to 1 if you have inet sockets.])
2187 if test -f /usr/lpp/X11/bin/smt.exp; then
2188 AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
2189 [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
2192 AC_MSG_CHECKING(whether system supports dynamic ptys)
2193 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2195 AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if dynamic ptys are supported.])
2201 dnl Adapted from Haible's version.
2202 AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
2203 [AC_TRY_LINK([#include <langinfo.h>],
2204 [char* cs = nl_langinfo(CODESET);],
2205 emacs_cv_langinfo_codeset=yes,
2206 emacs_cv_langinfo_codeset=no)
2208 if test $emacs_cv_langinfo_codeset = yes; then
2209 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2210 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2213 AC_CHECK_TYPES(size_t)
2215 # Set up the CFLAGS for real compilation, so we can substitute it.
2216 CFLAGS="$REAL_CFLAGS"
2217 CPPFLAGS="$REAL_CPPFLAGS"
2220 #### Find out which version of Emacs this is.
2221 version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
2222 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
2223 changequote([, ])dnl
2224 if test x"${version}" = x; then
2225 AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
2228 ### Specify what sort of things we'll be editing into Makefile and config.h.
2229 ### Use configuration here uncanonicalized to avoid exceeding size limits.
2231 AC_SUBST(configuration)
2235 AC_SUBST(exec_prefix)
2238 AC_SUBST(sharedstatedir)
2239 AC_SUBST(libexecdir)
2243 AC_SUBST(locallisppath)
2245 AC_SUBST(x_default_search_path)
2247 AC_SUBST(archlibdir)
2250 AC_SUBST(c_switch_system)
2251 AC_SUBST(c_switch_machine)
2252 AC_SUBST(LD_SWITCH_X_SITE)
2253 AC_SUBST(LD_SWITCH_X_SITE_AUX)
2254 AC_SUBST(C_SWITCH_X_SITE)
2256 AC_SUBST(X_TOOLKIT_TYPE)
2259 AC_SUBST(GETLOADAVG_LIBS)
2261 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
2262 [Define to the canonical Emacs configuration name.])
2263 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
2264 [Define to the options passed to configure.])
2265 AC_DEFINE_UNQUOTED(config_machfile, "${machfile}",
2266 [Define to the used machine dependent file.])
2267 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
2268 [Define to the used os dependent file.])
2269 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
2270 [Define LD_SWITCH_X_SITE to contain any special flags your loader
2271 may need to deal with X Windows. For instance, if you've defined
2272 HAVE_X_WINDOWS above and your X libraries aren't in a place that
2273 your loader can find on its own, you might want to add "-L/..." or
2274 something similar.])
2275 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
2276 [Define LD_SWITCH_X_SITE_AUX with an -R option
2277 in case it's needed (for Solaris, for example).])
2278 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE},
2279 [Define C_SWITCH_X_SITE to contain any special flags your compiler
2280 may need to deal with X Windows. For instance, if you've defined
2281 HAVE_X_WINDOWS above and your X include files aren't in a place
2282 that your compiler can find on its own, you might want to add
2283 "-I/..." or something similar.])
2284 AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC},
2285 [Define to the unexec source file name.])
2287 if test "${HAVE_X_WINDOWS}" = "yes" ; then
2288 AC_DEFINE(HAVE_X_WINDOWS, 1,
2289 [Define to 1 if you want to use the X window system.])
2291 if test "${USE_X_TOOLKIT}" != "none" ; then
2292 AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
2294 if test "${HAVE_X11}" = "yes" ; then
2295 AC_DEFINE(HAVE_X11, 1,
2296 [Define to 1 if you want to use version 11 of X windows.
2297 Otherwise, Emacs expects to use version 10.])
2299 if test "${HAVE_XFREE386}" = "yes" ; then
2300 AC_DEFINE(HAVE_XFREE386, 1, [Define to 1 if you're using XFree386.])
2302 if test "${HAVE_MENUS}" = "yes" ; then
2303 AC_DEFINE(HAVE_MENUS, 1,
2304 [Define to 1 if you have mouse menus.
2305 (This is automatic if you use X, but the option to specify it remains.)
2306 It is also defined with other window systems that support xmenu.c.])
2308 if test "${GNU_MALLOC}" = "yes" ; then
2309 AC_DEFINE(GNU_MALLOC, 1,
2310 [Define to 1 if you want to use the GNU memory allocator.])
2312 if test "${REL_ALLOC}" = "yes" ; then
2313 AC_DEFINE(REL_ALLOC, 1,
2314 [Define REL_ALLOC if you want to use the relocating allocator for
2318 AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1,
2319 [Define to 1 if you have <nlist.h>.])])
2321 AH_TOP([/* GNU Emacs site configuration template file.
2322 Copyright (C) 1988, 93, 94, 99, 2000, 2002 Free Software Foundation, Inc.
2324 This file is part of GNU Emacs.
2326 GNU Emacs is free software; you can redistribute it and/or modify
2327 it under the terms of the GNU General Public License as published by
2328 the Free Software Foundation; either version 2, or (at your option)
2331 GNU Emacs is distributed in the hope that it will be useful,
2332 but WITHOUT ANY WARRANTY; without even the implied warranty of
2333 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2334 GNU General Public License for more details.
2336 You should have received a copy of the GNU General Public License
2337 along with GNU Emacs; see the file COPYING. If not, write to the
2338 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
2339 Boston, MA 02111-1307, USA. */
2342 /* No code in Emacs #includes config.h twice, but some of the code
2343 intended to work with other packages as well (like gmalloc.c)
2344 think they can include it as many times as they like. */
2345 #ifndef EMACS_CONFIG_H
2346 #define EMACS_CONFIG_H
2350 /* If we're using any sort of window system, define some consequences. */
2351 #ifdef HAVE_X_WINDOWS
2352 #define HAVE_WINDOW_SYSTEM
2353 #define MULTI_KBOARD
2357 /* If we're using the Carbon API on Mac OS X, define a few more
2358 variables as well. */
2360 #define HAVE_WINDOW_SYSTEM
2365 /* Define USER_FULL_NAME to return a string
2366 that is the user's full name.
2367 It can assume that the variable `pw'
2368 points to the password file entry for this user.
2370 At some sites, the pw_gecos field contains
2371 the user's full name. If neither this nor any other
2372 field contains the right thing, use pw_name,
2373 giving the user's login name, since that is better than nothing. */
2374 #define USER_FULL_NAME pw->pw_gecos
2376 /* Define AMPERSAND_FULL_NAME if you use the convention
2377 that & in the full name stands for the login id. */
2378 /* Turned on June 1996 supposing nobody will mind it. */
2379 #define AMPERSAND_FULL_NAME
2381 /* Define HAVE_SOUND if we have sound support. We know it works
2382 and compiles only on the specified platforms. For others,
2383 it probably doesn't make sense to try. */
2385 #if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
2386 #ifdef HAVE_MACHINE_SOUNDCARD_H
2387 #define HAVE_SOUND 1
2389 #ifdef HAVE_SYS_SOUNDCARD_H
2390 #define HAVE_SOUND 1
2392 #ifdef HAVE_SOUNDCARD_H
2393 #define HAVE_SOUND 1
2395 #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
2397 /* If using GNU, then support inline function declarations. */
2398 /* Don't try to switch on inline handling as detected by AC_C_INLINE
2399 generally, because even if non-gcc compilers accept `inline', they
2400 may reject `extern inline'. */
2402 #define INLINE __inline__
2407 /* Include the os and machine dependent files. */
2408 #include config_opsysfile
2409 #include config_machfile
2411 /* Load in the conversion definitions if this system
2412 needs them and the source file being compiled has not
2413 said to inhibit this. There should be no need for you
2414 to alter these lines. */
2417 #ifndef NO_SHORTNAMES
2418 #include "../shortnames/remap.h"
2419 #endif /* not NO_SHORTNAMES */
2420 #endif /* SHORTNAMES */
2422 /* If no remapping takes place, static variables cannot be dumped as
2423 pure, so don't worry about the `static' keyword. */
2428 /* Define `subprocesses' should be defined if you want to
2429 have code for asynchronous subprocesses
2430 (as used in M-x compile and M-x shell).
2431 These do not work for some USG systems yet;
2432 for the ones where they work, the s/SYSTEM.h file defines this flag. */
2436 /* #define subprocesses */
2440 /* SIGTYPE is the macro we actually use. */
2442 #define SIGTYPE RETSIGTYPE
2445 #ifdef emacs /* Don't do this for lib-src. */
2446 /* Tell regex.c to use a type compatible with Emacs. */
2447 #define RE_TRANSLATE_TYPE Lisp_Object
2448 #define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
2449 #define RE_TRANSLATE_P(TBL) (XFASTINT (TBL) != 0)
2452 /* Avoid link-time collision with system mktime if we will use our own. */
2453 #if ! HAVE_MKTIME || BROKEN_MKTIME
2454 #define mktime emacs_mktime
2457 /* The rest of the code currently tests the CPP symbol BSTRING.
2458 Override any claims made by the system-description files.
2459 Note that on some SCO version it is possible to have bcopy and not bcmp. */
2461 #if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
2465 /* Some of the files of Emacs which are intended for use with other
2466 programs assume that if you have a config.h file, you must declare
2469 This declaration shouldn't appear when alloca.s or Makefile.in
2470 includes config.h. */
2472 extern char *getenv ();
2475 #endif /* EMACS_CONFIG_H */
2477 /* These default definitions are good for almost all machines.
2478 The exceptions override them in m/MACHINE.h. */
2480 #ifndef BITS_PER_CHAR
2481 #define BITS_PER_CHAR 8
2484 #ifndef BITS_PER_SHORT
2485 #define BITS_PER_SHORT 16
2488 /* Note that lisp.h uses this in a preprocessor conditional, so it
2489 would not work to use sizeof. That being so, we do all of them
2490 without sizeof, for uniformity's sake. */
2491 #ifndef BITS_PER_INT
2492 #define BITS_PER_INT 32
2495 #ifndef BITS_PER_LONG
2497 #define BITS_PER_LONG 64
2499 #define BITS_PER_LONG 32
2503 /* Define if the compiler supports function prototypes. It may do so
2504 but not define __STDC__ (e.g. DEC C by default) or may define it as
2509 # if defined PROTOTYPES
2510 # define __P(args) args
2512 # define __P(args) ()
2517 /* Don't include "string.h" or <stdlib.h> in non-C code. */
2519 #ifdef HAVE_STRING_H
2522 #ifdef HAVE_STRINGS_H
2523 #include "strings.h" /* May be needed for bcopy & al. */
2525 #ifdef HAVE_STDLIB_H
2530 /* Define HAVE_X_I18N if we have usable i18n support. */
2534 #elif defined HAVE_X11R5 && !defined X11R5_INHIBIT_I18N
2538 /* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
2540 #if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
2541 #define HAVE_X11R6_XIM
2544 /* Should we enable expensive run-time checking of data types? */
2545 #undef ENABLE_CHECKING
2547 #if defined __GNUC__ && (__GNUC__ > 2 \
2548 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
2549 #define NO_RETURN __attribute__ ((__noreturn__))
2551 #define NO_RETURN /* nothing */
2561 #### Report on what we decided to do.
2563 Configured for \`${canonical}'.
2565 Where should the build process find the source code? ${srcdir}
2566 What operating system and machine description files should Emacs use?
2567 \`${opsysfile}' and \`${machfile}'
2568 What compiler should emacs be built with? ${CC} ${CFLAGS}
2569 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
2570 Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
2571 Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
2572 What window system should Emacs use? ${window_system}
2573 What toolkit should Emacs use? ${USE_X_TOOLKIT}"
2575 if test -n "${x_includes}"; then
2576 echo " Where do we find X Windows header files? ${x_includes}"
2578 echo " Where do we find X Windows header files? Standard dirs"
2580 if test -n "${x_libraries}"; then
2581 echo " Where do we find X Windows libraries? ${x_libraries}"
2583 echo " Where do we find X Windows libraries? Standard dirs"
2586 echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
2587 echo " Does Emacs use -lXpm? ${HAVE_XPM}"
2588 echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
2589 echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
2590 echo " Does Emacs use -lungif? ${HAVE_GIF}"
2591 echo " Does Emacs use -lpng? ${HAVE_PNG}"
2592 echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
2595 # Remove any trailing slashes in these variables.
2597 test "${prefix}" != NONE &&
2598 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
2599 test "${exec_prefix}" != NONE &&
2600 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
2601 changequote([, ])dnl
2603 ## Check if the C preprocessor will convert `..' to `. .'. If so, set
2604 ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
2605 ## from Makefile.c can correctly provide the arg `-traditional' to the
2608 AC_EGREP_CPP(yes..yes,
2610 CPP_NEED_TRADITIONAL=no,
2611 CPP_NEED_TRADITIONAL=yes)
2613 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
2614 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
2615 lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [
2617 ### Make the necessary directories, if they don't exist.
2618 for dir in etc lisp ; do
2619 test -d ${dir} || mkdir ${dir}
2622 # Build src/Makefile from ${srcdir}/src/Makefile.c
2623 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
2624 # This must be done after src/config.h is built, since we rely on that file.
2626 changequote(, )dnl The horror, the horror.
2627 # Now get this: Some word that is part of the ${srcdir} directory name
2628 # or the ${configuration} value might, just might, happen to be an
2629 # identifier like `sun4' or `i386' or something, and be predefined by
2630 # the C preprocessor to some helpful value like 1, or maybe the empty
2631 # string. Needless to say consequent macro substitutions are less
2632 # than conducive to the makefile finding the correct directory.
2633 undefs="`echo $top_srcdir $configuration $canonical |
2634 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
2635 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
2637 changequote([, ])dnl
2639 echo creating src/epaths.h
2640 ${MAKE-make} epaths-force
2642 # As of 2000-11-19, newest development versions of GNU cpp preprocess
2643 # `..' to `. .' unless invoked with -traditional
2645 if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
2646 CPPFLAGS="$CPPFLAGS -traditional"
2649 echo creating lib-src/Makefile
2651 rm -f junk.c junk1.c junk2.c
2652 sed -e '/start of cpp stuff/q' \
2653 < Makefile.c > junk1.c
2654 sed -e '1,/start of cpp stuff/d'\
2655 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2656 < Makefile.c > junk.c
2657 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2658 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2659 cat junk1.c junk2.c > Makefile.new
2660 rm -f junk.c junk1.c junk2.c
2661 chmod 444 Makefile.new
2662 mv -f Makefile.new Makefile
2665 echo creating src/Makefile
2667 rm -f junk.c junk1.c junk2.c
2668 sed -e '/start of cpp stuff/q' \
2669 < Makefile.c > junk1.c
2670 sed -e '1,/start of cpp stuff/d'\
2671 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2672 < Makefile.c > junk.c
2673 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2674 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2675 cat junk1.c junk2.c > Makefile.new
2676 rm -f junk.c junk1.c junk2.c
2677 chmod 444 Makefile.new
2678 mv -f Makefile.new Makefile
2681 if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
2682 echo creating src/.gdbinit
2683 echo source $srcdir/src/.gdbinit > src/.gdbinit
2686 # This is how we know whether to re-run configure in certain cases.
2687 touch src/config.stamp
2689 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])