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))
52 [ --with-kerberos support Kerberos-authenticated POP],
53 [AC_DEFINE(KERBEROS)])
54 AC_ARG_WITH(kerberos5,
55 [ --with-kerberos5 support Kerberos version 5 authenticated POP],
56 [if test "${with_kerberos5+set}" = set; then
57 if test "${with_kerberos+set}" != set; then
62 AC_DEFINE(KERBEROS5)])
64 [ --with-hesiod support Hesiod to get the POP server host],
68 [ --without-sound don't compile with sound support])
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-aix5.1* | powerpc-ibm-aix5.1* )
613 machine=ibmrs6000 opsys=aix4-2
615 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
616 machine=ibmrs6000 opsys=aix4
618 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
619 machine=ibmrs6000 opsys=aix4-1
621 rs6000-ibm-aix* | powerpc-ibm-aix* )
622 machine=ibmrs6000 opsys=aix3-2
625 machine=ibmrt opsys=bsd4-3
628 machine=ibmrt opsys=bsd4-2
631 machine=ibmrt opsys=bsd4-3
634 machine=ibmrt opsys=bsd4-2
637 machine=ibmrt opsys=bsd4-3
640 machine=ibmrt opsys=bsd4-3
643 machine=ibmrt-aix opsys=usg5-2-2
646 ## Integrated Solutions `Optimum V'
648 machine=isi-ov opsys=bsd4-2
651 machine=isi-ov opsys=bsd4-3
654 ## Intel 386 machines where we do care about the manufacturer
655 i[3456]86-intsys-sysv* )
656 machine=is386 opsys=usg5-2-2
660 i[3456]86-prime-sysv* )
661 machine=i386 opsys=usg5-3
664 ## Sequent Symmetry running Dynix
665 i[3456]86-sequent-bsd* )
666 machine=symmetry opsys=bsd4-3
669 ## Sequent Symmetry running ptx 4, which is a modified SVR4.
670 i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
671 machine=sequent-ptx opsys=ptx4
675 ## Sequent Symmetry running DYNIX/ptx
676 ## Use the old cpp rather than the newer ANSI one.
677 i[3456]86-sequent-ptx* )
678 machine=sequent-ptx opsys=ptx
679 NON_GNU_CPP="/lib/cpp"
682 ## ncr machine running svr4.3.
683 i[3456]86-ncr-sysv4.3 )
684 machine=ncr386 opsys=usg5-4-3
687 ## Unspecified sysv on an ncr machine defaults to svr4.2.
688 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
689 i[3456]86-ncr-sysv* )
690 machine=ncr386 opsys=usg5-4-2
693 ## Intel Paragon OSF/1
695 machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
700 machine=i860 opsys=usg5-4
701 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
702 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
706 powerpc*-*-linux-gnu* )
707 machine=macppc opsys=gnu-linux
712 machine=masscomp opsys=rtu
717 machine=mega68 opsys=bsd4-2
720 ## Workstations sold by MIPS
721 ## This is not necessarily all workstations using the MIPS processor -
722 ## Irises are produced by SGI, and DECstations by DEC.
724 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
725 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
726 ## it gives for choosing between the alternatives seems to be "Use
727 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
728 ## the BSD world." I'll assume that these are instructions for
729 ## handling two odd situations, and that every other situation
730 ## should use mips.h and usg5-2-2, they being listed first.
733 ## Fall through to the general code at the bottom to decide on the OS.
736 machine=mips4 opsys=bsd4-3
737 NON_GNU_CC="cc -systype bsd43"
738 NON_GNU_CPP="cc -systype bsd43 -E"
741 machine=mips4 opsys=riscos5
742 NON_GNU_CC="cc -systype bsd43"
743 NON_GNU_CPP="cc -systype bsd43 -E"
746 machine=mips opsys=bsd4-3
749 machine=mips opsys=usg5-2-2
753 m68*-next-* | m68k-*-nextstep* )
754 machine=m68k opsys=nextstep
757 ## The complete machine from National Semiconductor
759 machine=ns32000 opsys=usg5-2
763 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
764 machine=tower32 opsys=usg5-2-2
766 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
767 machine=tower32v3 opsys=usg5-3
772 machine=ews4800 opsys=ux4800
777 machine=targon31 opsys=usg5-2-2
782 machine=nu opsys=usg5-2
787 machine=plexus opsys=usg5-2
790 ## PowerPC reference platform
791 powerpcle-*-solaris2* )
797 ## I don't really have any idea what sort of processor the Pyramid has,
798 ## so I'm assuming it is its own architecture.
799 pyramid-pyramid-bsd* )
800 machine=pyramid opsys=bsd4-2
804 ns32k-sequent-bsd4.2* )
805 machine=sequent opsys=bsd4-2
807 ns32k-sequent-bsd4.3* )
808 machine=sequent opsys=bsd4-3
812 mips-siemens-sysv* | mips-sni-sysv*)
813 machine=mips-siemens opsys=usg5-4
814 NON_GNU_CC=/usr/ccs/bin/cc
815 NON_GNU_CPP=/usr/ccs/lib/cpp
818 ## Silicon Graphics machines
819 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
821 machine=irist opsys=iris3-5
823 m68*-sgi-iris3.6* | m68*-sgi-iris*)
824 machine=irist opsys=iris3-6
828 machine=iris4d opsys=irix3-3
831 machine=iris4d opsys=irix4-0
834 machine=iris4d opsys=irix6-5
835 # Without defining _LANGUAGE_C, things get masked out in the headers
836 # so that, for instance, grepping for `free' in stdlib.h fails and
837 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
838 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
839 NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
842 machine=iris4d opsys=irix6-0
843 # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
844 # but presumably it does no harm.
845 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
846 # -32 probably isn't necessary in later v.6s -- anyone know which?
847 NON_GCC_TEST_OPTIONS=-32
849 mips-sgi-irix5.[01]* )
850 machine=iris4d opsys=irix5-0
852 mips-sgi-irix5* | mips-sgi-irix* )
853 machine=iris4d opsys=irix5-2
858 machine=news opsys=bsd4-2
861 machine=news opsys=bsd4-3
863 m68*-sony-newsos3* | m68*-sony-news3*)
864 machine=news opsys=bsd4-3
866 mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
867 machine=news-risc opsys=bsd4-3
870 machine=news-r6 opsys=newsos6
873 machine=news-risc opsys=newsos5
878 machine=stride opsys=usg5-2
882 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
883 machine=sparc opsys=gnu-linux
886 *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
887 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
888 | rs6000-*-solaris2*)
889 case "${canonical}" in
890 m68*-sunos1* ) machine=sun1 ;;
891 m68*-sunos2* ) machine=sun2 ;;
892 m68* ) machine=sun3 ;;
893 i[3456]86-sun-sunos[34]* ) machine=sun386 ;;
894 i[3456]86-*-* ) machine=intel386 ;;
895 powerpcle* ) machine=powerpcle ;;
896 powerpc* | rs6000* ) machine=ibmrs6000 ;;
897 sparc* ) machine=sparc ;;
900 case "${canonical}" in
901 ## The Sun386 didn't get past 4.0.
902 i[3456]86-*-sunos4 ) opsys=sunos4-0 ;;
903 *-sunos4.0* ) opsys=sunos4-0 ;;
904 *-sunos4.1.[3-9]*noshare )
905 ## This name is sunos413 instead of sunos4-1-3
906 ## to avoid a file name conflict on MSDOS.
908 NON_GNU_CPP=/usr/lib/cpp
909 NON_GCC_TEST_OPTIONS=-Bstatic
910 GCC_TEST_OPTIONS=-static
912 *-sunos4.1.[3-9]* | *-sunos4shr*)
914 NON_GNU_CPP=/usr/lib/cpp
916 *-sunos4* | *-sunos )
918 NON_GCC_TEST_OPTIONS=-Bstatic
919 GCC_TEST_OPTIONS=-static
921 *-sunos5.3* | *-solaris2.3* )
923 NON_GNU_CPP=/usr/ccs/lib/cpp
925 *-sunos5.4* | *-solaris2.4* )
927 NON_GNU_CPP=/usr/ccs/lib/cpp
930 *-sunos5.5* | *-solaris2.5* )
932 NON_GNU_CPP=/usr/ccs/lib/cpp
935 *-sunos5* | *-solaris* )
937 NON_GNU_CPP=/usr/ccs/lib/cpp
941 ## Watch out for a compiler that we know will not work.
942 case "${canonical}" in
943 *-solaris* | *-sunos5* )
944 if [ "x$CC" = x/usr/ucb/cc ]; then
945 ## /usr/ucb/cc doesn't work;
946 ## we should find some other compiler that does work.
954 machine=sparc opsys=nextstep
959 machine=tad68k opsys=usg5-3
963 tahoe-tahoe-bsd4.2* )
964 machine=tahoe opsys=bsd4-2
966 tahoe-tahoe-bsd4.3* )
967 machine=tahoe opsys=bsd4-3
970 ## Tandem Integrity S2
972 machine=tandem-s2 opsys=usg5-3
976 m88k-tektronix-sysv3* )
977 machine=tekxd88 opsys=usg5-3
980 ## Tektronix 16000 box (6130?)
981 ns16k-tektronix-bsd* )
982 machine=ns16000 opsys=bsd4-2
985 ## src/m/tek4300.h hints that this is a m68k machine.
986 m68*-tektronix-bsd* )
987 machine=tek4300 opsys=bsd4-3
991 ## We seem to have lost the machine-description file titan.h!
993 machine=titan opsys=usg5-3
996 ## Ustation E30 (SS5E)
997 m68*-unisys-uniplus* )
998 machine=ustation opsystem=unipl5-2
1004 case "${canonical}" in
1005 *-bsd4.1* ) opsys=bsd4-1 ;;
1006 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
1007 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
1008 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
1009 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
1010 *-vms* ) opsys=vms ;;
1016 ns16k-whitechapel-* )
1018 ## We don't know what sort of OS runs on these; we'll let the
1019 ## operating system guessing code below try.
1024 machine=wicat opsys=usg5-2
1029 machine=ia64 opsys=gnu-linux
1032 ## Intel 386 machines where we don't care about the manufacturer
1035 case "${canonical}" in
1036 *-lynxos* ) opsys=lynxos ;;
1037 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1038 *-isc2.2* ) opsys=isc2-2 ;;
1039 *-isc4.0* ) opsys=isc4-0 ;;
1040 *-isc4.* ) opsys=isc4-1
1041 GCC_TEST_OPTIONS=-posix
1042 NON_GCC_TEST_OPTIONS=-Xp
1044 *-isc* ) opsys=isc3-0 ;;
1045 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1046 *-esix* ) opsys=esix ;;
1047 *-xenix* ) opsys=xenix ;;
1048 *-linux-gnu* ) opsys=gnu-linux ;;
1049 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
1050 *-sco3.2v5* ) opsys=sco5
1051 NON_GNU_CPP=/lib/cpp
1052 # Prevent -belf from being passed to $CPP.
1053 # /lib/cpp does not accept it.
1054 OVERRIDE_CPPFLAGS=" "
1056 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1057 *-386bsd* ) opsys=386bsd ;;
1058 *-nextstep* ) opsys=nextstep ;;
1059 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1063 ## m68k Linux-based GNU system
1065 machine=m68k opsys=gnu-linux
1068 ## Mips Linux-based GNU system
1070 machine=mips opsys=gnu-linux
1074 sparc-fujitsu-sysv4* )
1075 machine=sparc opsys=uxpds
1076 NON_GNU_CPP=/usr/ccs/lib/cpp
1081 f301-fujitsu-uxpv4.1)
1082 machine=f301 opsys=uxpv
1090 ### If the code above didn't choose an operating system, just choose
1091 ### an operating system based on the configuration name. You really
1092 ### only want to use this when you have no idea what the right
1093 ### operating system is; if you know what operating systems a machine
1094 ### runs, it's cleaner to make it explicit in the case statement
1096 if test x"${opsys}" = x; then
1097 case "${canonical}" in
1098 *-gnu* ) opsys=gnu ;;
1099 *-bsd4.[01] ) opsys=bsd4-1 ;;
1100 *-bsd4.2 ) opsys=bsd4-2 ;;
1101 *-bsd4.3 ) opsys=bsd4-3 ;;
1102 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1103 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1104 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
1105 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
1106 *-sysv4.2uw* ) opsys=unixware ;;
1107 *-sysv4.1* | *-sysvr4.1* )
1108 NON_GNU_CPP=/usr/lib/cpp
1110 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1111 if [ x$NON_GNU_CPP = x ]; then
1112 if [ -f /usr/ccs/lib/cpp ]; then
1113 NON_GNU_CPP=/usr/ccs/lib/cpp
1115 NON_GNU_CPP=/lib/cpp
1119 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
1126 changequote([, ])dnl
1128 if test $unported = yes; then
1129 AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
1130 Check \`etc/MACHINES' for recognized configuration names.])
1133 machfile="m/${machine}.h"
1134 opsysfile="s/${opsys}.h"
1137 #### Choose a compiler.
1138 test -n "$CC" && cc_specified=yes
1140 # Save the value of CFLAGS that the user specified.
1141 SPECIFIED_CFLAGS="$CFLAGS"
1144 "yes" ) CC="gcc" GCC=yes ;;
1145 "no" ) : ${CC=cc} ;;
1150 # On Suns, sometimes $CPP names a directory.
1151 if test -n "$CPP" && test -d "$CPP"; then
1155 #### Some systems specify a CPP to use unless we are using GCC.
1156 #### Now that we know whether we are using GCC, we can decide whether
1157 #### to use that one.
1158 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1163 #### Some systems specify a CC to use unless we are using GCC.
1164 #### Now that we know whether we are using GCC, we can decide whether
1165 #### to use that one.
1166 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1167 test x$cc_specified != xyes
1172 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1174 CC="$CC $GCC_TEST_OPTIONS"
1177 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1179 CC="$CC $NON_GCC_TEST_OPTIONS"
1182 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1184 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1187 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1189 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1192 #### Some other nice autoconf tests. If you add a test here which
1193 #### should make an entry in src/config.h, don't forget to add an
1194 #### #undef clause to src/config.h.in for autoconf to modify.
1196 dnl checks for programs
1201 if test "x$RANLIB" = x; then
1205 dnl checks for Unix variants
1208 #### Extract some information from the operating system and machine files.
1210 AC_CHECKING([the machine- and system-dependent files to find out
1211 - which libraries the lib-src programs will want, and
1212 - whether the GNU malloc routines are usable])
1214 ### First figure out CFLAGS (which we use for running the compiler here)
1215 ### and REAL_CFLAGS (which we use for real compilation).
1216 ### The two are the same except on a few systems, where they are made
1217 ### different to work around various lossages. For example,
1218 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1219 ### as implying static linking.
1221 ### If the CFLAGS env var is specified, we use that value
1222 ### instead of the default.
1224 ### It's not important that this name contain the PID; you can't run
1225 ### two configures in the same directory and have anything work
1227 tempcname="conftest.c"
1230 #include "'${srcdir}'/src/'${opsysfile}'"
1231 #include "'${srcdir}'/src/'${machfile}'"
1232 #ifndef LIBS_MACHINE
1233 #define LIBS_MACHINE
1238 #ifndef C_SWITCH_SYSTEM
1239 #define C_SWITCH_SYSTEM
1241 #ifndef C_SWITCH_MACHINE
1242 #define C_SWITCH_MACHINE
1244 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1245 configure___ c_switch_system=C_SWITCH_SYSTEM
1246 configure___ c_switch_machine=C_SWITCH_MACHINE
1249 #define LIB_X11_LIB -lX11
1252 #ifndef LIBX11_MACHINE
1253 #define LIBX11_MACHINE
1256 #ifndef LIBX11_SYSTEM
1257 #define LIBX11_SYSTEM
1259 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1262 configure___ unexec=UNEXEC
1264 configure___ unexec=unexec.o
1267 #ifdef SYSTEM_MALLOC
1268 configure___ system_malloc=yes
1270 configure___ system_malloc=no
1273 #ifdef USE_MMAP_FOR_BUFFERS
1274 configure___ use_mmap_for_buffers=yes
1276 configure___ use_mmap_for_buffers=no
1279 #ifndef C_DEBUG_SWITCH
1280 #define C_DEBUG_SWITCH -g
1283 #ifndef C_OPTIMIZE_SWITCH
1285 #define C_OPTIMIZE_SWITCH -O2
1287 #define C_OPTIMIZE_SWITCH -O
1291 #ifndef LD_SWITCH_MACHINE
1292 #define LD_SWITCH_MACHINE
1295 #ifndef LD_SWITCH_SYSTEM
1296 #define LD_SWITCH_SYSTEM
1299 #ifndef LD_SWITCH_X_SITE_AUX
1300 #define LD_SWITCH_X_SITE_AUX
1303 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1304 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1306 #ifdef THIS_IS_CONFIGURE
1308 /* Get the CFLAGS for tests in configure. */
1310 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1312 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1315 #else /* not THIS_IS_CONFIGURE */
1317 /* Get the CFLAGS for real compilation. */
1319 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1321 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1324 #endif /* not THIS_IS_CONFIGURE */
1327 # The value of CPP is a quoted variable reference, so we need to do this
1328 # to get its actual value...
1329 CPP=`eval "echo $CPP"`
1331 eval `${CPP} -Isrc ${tempcname} \
1332 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1333 if test "x$SPECIFIED_CFLAGS" = x; then
1334 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1335 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1337 REAL_CFLAGS="$CFLAGS"
1339 changequote([, ])dnl
1342 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1344 ### Make sure subsequent tests use flags consistent with the build flags.
1346 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1347 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1349 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1352 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1355 if test "${with_sound}" != "no"; then
1356 # Sound support for GNU/Linux and the free BSDs.
1357 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1358 # Emulation library used on NetBSD.
1359 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1363 dnl checks for header files
1364 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1365 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1366 termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h)
1372 dnl Some systems have utime.h but don't declare the struct anyplace.
1373 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1374 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1375 #include <sys/time.h>
1378 #ifdef HAVE_SYS_TIME_H
1379 #include <sys/time.h>
1386 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1387 emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1388 if test $emacs_cv_struct_utimbuf = yes; then
1389 AC_DEFINE(HAVE_STRUCT_UTIMBUF)
1392 dnl checks for typedefs
1395 dnl Check for speed_t typedef.
1396 AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1397 AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
1398 emacs_cv_speed_t=yes, emacs_cv_speed_t=no))
1399 if test $emacs_cv_speed_t = yes; then
1400 AC_DEFINE(HAVE_SPEED_T)
1403 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1404 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1405 #include <sys/time.h>
1408 #ifdef HAVE_SYS_TIME_H
1409 #include <sys/time.h>
1413 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1414 emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1415 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1416 if test $emacs_cv_struct_timeval = yes; then
1417 AC_DEFINE(HAVE_TIMEVAL)
1420 AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1421 AC_TRY_COMPILE([#include <math.h>],
1422 [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1423 emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1424 HAVE_EXCEPTION=$emacs_cv_struct_exception
1425 if test $emacs_cv_struct_exception != yes; then
1426 AC_DEFINE(NO_MATHERR)
1429 dnl checks for structure members
1432 AC_CACHE_CHECK(for tm_gmtoff in struct tm, emacs_cv_tm_gmtoff,
1433 AC_TRY_LINK([#include <time.h>], [struct tm t; t.tm_gmtoff = 0],
1434 emacs_cv_tm_gmtoff=yes,
1435 emacs_cv_tm_gmtoff=no))
1436 if test $emacs_cv_tm_gmtoff = yes; then
1437 AC_DEFINE(HAVE_TM_GMTOFF)
1440 dnl checks for compiler characteristics
1442 dnl Testing __STDC__ to determine prototype support isn't good enough.
1443 dnl DEC C, for instance, doesn't define it with default options, and
1444 dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile
1449 dnl This isn't useful because we can't turn on use of `inline' unless
1450 dnl the compiler groks `extern inline'.
1452 AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1453 [AC_TRY_COMPILE(, [void * foo;],
1454 emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1455 if test $emacs_cv_void_star = yes; then
1456 AC_DEFINE(POINTER_TYPE, void)
1458 AC_DEFINE(POINTER_TYPE, char)
1461 dnl check for Make feature
1464 dnl checks for operating system services
1465 AC_SYS_LONG_FILE_NAMES
1467 #### Choose a window system.
1470 if test "$no_x" = yes; then
1476 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1477 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1478 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1479 x_default_search_path=""
1480 for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
1482 ${x_library}/X11/%L/%T/%N%C%S:\
1483 ${x_library}/X11/%l/%T/%N%C%S:\
1484 ${x_library}/X11/%T/%N%C%S:\
1485 ${x_library}/X11/%L/%T/%N%S:\
1486 ${x_library}/X11/%l/%T/%N%S:\
1487 ${x_library}/X11/%T/%N%S"
1488 if test x"${x_default_search_path}" = x; then
1489 x_default_search_path=${x_search_path}
1491 x_default_search_path="${x_search_path}:${x_default_search_path}"
1495 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1496 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1499 if test x"${x_includes}" = x; then
1500 bitmapdir=/usr/include/X11/bitmaps
1502 # accumulate include directories that have X11 bitmap subdirectories
1504 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1505 if test -d "${bmd}/X11/bitmaps"; then
1506 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1508 if test -d "${bmd}/bitmaps"; then
1509 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1512 if test ${bmd_acc} != "dummyval"; then
1513 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1517 case "${window_system}" in
1521 case "${with_x_toolkit}" in
1522 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1523 motif ) USE_X_TOOLKIT=MOTIF ;;
1524 dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
1525 no ) USE_X_TOOLKIT=none ;;
1526 dnl If user did not say whether to use a toolkit,
1527 dnl make this decision later: use the toolkit if we have X11R5 or newer.
1528 * ) USE_X_TOOLKIT=maybe ;;
1538 ### If we're using X11, we should use the X menu package.
1541 yes ) HAVE_MENUS=yes ;;
1544 if test "${opsys}" = "hpux9"; then
1545 case "${x_libraries}" in
1547 opsysfile="s/hpux9-x11r4.h"
1552 if test "${opsys}" = "hpux9shr"; then
1553 case "${x_libraries}" in
1555 opsysfile="s/hpux9shxr4.h"
1560 ### Compute the unexec source name from the object name.
1561 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1563 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1564 # Assume not, until told otherwise.
1567 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1568 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1569 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1570 emacs_cv_var___after_morecore_hook,
1571 [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1572 emacs_cv_var___after_morecore_hook=yes,
1573 emacs_cv_var___after_morecore_hook=no)])
1574 if test $emacs_cv_var___after_morecore_hook = no; then
1577 if test "${system_malloc}" = "yes"; then
1580 (The GNU allocators don't work with this system configuration.)"
1582 if test "$doug_lea_malloc" = "yes" ; then
1583 if test "$GNU_MALLOC" = yes ; then
1585 (Using Doug Lea's new malloc from the GNU C Library.)"
1587 AC_DEFINE(DOUG_LEA_MALLOC)
1590 if test x"${REL_ALLOC}" = x; then
1591 REL_ALLOC=${GNU_MALLOC}
1594 dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
1595 dnl the system configuration file (s/*.h) to turn the use of mmap
1596 dnl in the relocating allocator on.
1599 if test $use_mmap_for_buffers = yes; then
1603 LIBS="$libsrc_libs $LIBS"
1605 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1606 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1607 AC_CHECK_LIB(dnet, dnet_ntoa)
1608 dnl This causes -lresolv to get used in subsequent tests,
1609 dnl which causes failures on some systems such as HPUX 9.
1610 dnl AC_CHECK_LIB(resolv, gethostbyname)
1612 dnl FIXME replace main with a function we actually want from this library.
1613 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1615 AC_CHECK_LIB(pthreads, cma_open)
1617 AC_MSG_CHECKING(for XFree86 in /usr/X386)
1618 if test -d /usr/X386/include; then
1620 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1624 AC_MSG_RESULT($HAVE_XFREE386)
1626 # Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1627 # for the tests that follow. We set it back to REAL_CFLAGS later on.
1629 REAL_CPPFLAGS="$CPPFLAGS"
1631 if test "${HAVE_X11}" = "yes"; then
1632 DEFS="$C_SWITCH_X_SITE $DEFS"
1633 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1635 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1636 CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
1638 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1639 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1640 # but it's more convenient here to set LD_RUN_PATH
1641 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1642 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1643 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1647 if test "${opsys}" = "gnu-linux"; then
1648 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1650 [XOpenDisplay ("foo");],
1651 [xlinux_first_failure=no],
1652 [xlinux_first_failure=yes])
1653 if test "${xlinux_first_failure}" = "yes"; then
1654 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1655 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1656 OLD_CPPFLAGS="$CPPFLAGS"
1658 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1659 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1660 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1661 LIBS="$LIBS -b i486-linuxaout"
1663 [XOpenDisplay ("foo");],
1664 [xlinux_second_failure=no],
1665 [xlinux_second_failure=yes])
1666 if test "${xlinux_second_failure}" = "yes"; then
1667 # If we get the same failure with -b, there is no use adding -b.
1668 # So take it out. This plays safe.
1669 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1670 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1671 CPPFLAGS="$OLD_CPPFLAGS"
1682 # Reportedly, some broken Solaris systems have XKBlib.h but are missing
1683 # header files included from there.
1684 AC_MSG_CHECKING(for Xkb)
1685 AC_TRY_LINK([#include <X11/Xlib.h>
1686 #include <X11/XKBlib.h>],
1687 [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
1688 emacs_xkb=yes, emacs_xkb=no)
1689 AC_MSG_RESULT($emacs_xkb)
1690 if test $emacs_xkb = yes; then
1691 AC_DEFINE(HAVE_XKBGETKEYBOARD)
1694 AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
1695 XScreenNumberOfScreen XSetWMProtocols)
1698 if test "${window_system}" = "x11"; then
1699 AC_MSG_CHECKING(X11 version 6)
1700 AC_CACHE_VAL(emacs_cv_x11_version_6,
1701 [AC_TRY_LINK([#include <X11/Xlib.h>],
1702 [#if XlibSpecificationRelease < 6
1705 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
1706 if test $emacs_cv_x11_version_6 = yes; then
1707 AC_MSG_RESULT(6 or newer)
1708 AC_DEFINE(HAVE_X11R6)
1710 AC_MSG_RESULT(before 6)
1714 if test "${window_system}" = "x11"; then
1715 AC_MSG_CHECKING(X11 version 5)
1716 AC_CACHE_VAL(emacs_cv_x11_version_5,
1717 [AC_TRY_LINK([#include <X11/Xlib.h>],
1718 [#if XlibSpecificationRelease < 5
1721 ], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no)])
1722 if test $emacs_cv_x11_version_5 = yes; then
1723 AC_MSG_RESULT(5 or newer)
1725 AC_DEFINE(HAVE_X11R5)
1728 AC_MSG_RESULT(before 5)
1732 dnl Do not put whitespace before the #include statements below.
1733 dnl Older compilers (eg sunos4 cc) choke on it.
1734 if test x"${USE_X_TOOLKIT}" = xmaybe; then
1735 if test x"${HAVE_X11R5}" = xyes; then
1736 AC_MSG_CHECKING(X11 version 5 with Xaw)
1737 AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
1739 #include <X11/Intrinsic.h>
1740 #include <X11/Xaw/Simple.h>],
1742 emacs_cv_x11_version_5_with_xaw=yes,
1743 emacs_cv_x11_version_5_with_xaw=no)])
1744 if test $emacs_cv_x11_version_5_with_xaw = yes; then
1745 AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
1748 AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1756 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1758 if test "${USE_X_TOOLKIT}" != "none"; then
1759 AC_MSG_CHECKING(X11 toolkit version)
1760 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
1761 [AC_TRY_LINK([#include <X11/Intrinsic.h>],
1762 [#if XtSpecificationRelease < 6
1765 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
1766 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1767 if test $emacs_cv_x11_toolkit_version_6 = yes; then
1768 AC_MSG_RESULT(6 or newer)
1769 AC_DEFINE(HAVE_X11XTR6)
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)
1806 AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
1807 if test ${HAVE_LIBXP} = yes; then
1808 AC_DEFINE(HAVE_LIBXP)
1813 ### Is -lXaw3d available?
1815 if test "${HAVE_X11}" = "yes"; then
1816 if test "${USE_X_TOOLKIT}" != "none"; then
1817 AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
1818 AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes))
1819 if test "${HAVE_XAW3D}" = "yes"; then
1820 AC_DEFINE(HAVE_XAW3D)
1825 dnl Use toolkit scroll bars if configured for X toolkit and either
1826 dnl using Motif or Xaw3d is available, and unless
1827 dnl --with-toolkit-scroll-bars=no was specified.
1829 USE_TOOLKIT_SCROLL_BARS=no
1830 if test "${with_toolkit_scroll_bars}" != "no"; then
1831 if test "${USE_X_TOOLKIT}" != "none"; then
1832 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1833 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1835 USE_TOOLKIT_SCROLL_BARS=yes
1836 elif test "${HAVE_XAW3D}" = "yes"; then
1837 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1838 USE_TOOLKIT_SCROLL_BARS=yes
1843 dnl Don't use X11 input methods if user specifies he doesn't want it
1844 dnl with `--with-xim=no'.
1846 if test "${with_xim}" != "no"; then
1850 ### Use -lXpm if available, unless `--with-xpm=no'.
1852 if test "${HAVE_X11}" = "yes"; then
1853 if test "${with_xpm}" != "no"; then
1854 AC_CHECK_HEADER(X11/xpm.h,
1855 AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
1856 if test "${HAVE_XPM}" = "yes"; then
1857 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
1858 AC_EGREP_CPP(no_return_alloc_pixels,
1859 [#include "X11/xpm.h"
1860 #ifndef XpmReturnAllocPixels
1861 no_return_alloc_pixels
1863 ], HAVE_XPM=no, HAVE_XPM=yes)
1865 if test "${HAVE_XPM}" = "yes"; then
1873 if test "${HAVE_XPM}" = "yes"; then
1878 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1880 if test "${HAVE_X11}" = "yes"; then
1881 if test "${with_jpeg}" != "no"; then
1882 dnl Checking for jpeglib.h can lose becsue of a redefinition of
1884 AC_CHECK_HEADER(jerror.h,
1885 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
1888 if test "${HAVE_JPEG}" = "yes"; then
1889 AC_DEFINE(HAVE_JPEG)
1891 changequote({, })dnl avoid leadingspace on the next line
1892 {version= *(6[2-9]|[7-9][0-9])},
1893 changequote([, ])dnl
1894 [#include <jpeglib.h>
1895 version=JPEG_LIB_VERSION
1897 AC_DEFINE(HAVE_JPEG),
1898 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
1903 ### Use -lpng if available, unless `--with-png=no'.
1905 if test "${HAVE_X11}" = "yes"; then
1906 if test "${with_png}" != "no"; then
1907 AC_CHECK_HEADER(png.h,
1908 AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm))
1911 if test "${HAVE_PNG}" = "yes"; then
1916 ### Use -ltiff if available, unless `--with-tiff=no'.
1918 if test "${HAVE_X11}" = "yes"; then
1919 if test "${with_tiff}" != "no"; then
1920 AC_CHECK_HEADER(tiffio.h,
1922 # At least one tiff package requires the jpeg library.
1923 if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
1924 AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs))
1927 if test "${HAVE_TIFF}" = "yes"; then
1928 AC_DEFINE(HAVE_TIFF)
1932 ### Use -lgif if available, unless `--with-gif=no'.
1934 if test "${HAVE_X11}" = "yes"; then
1935 if test "${with_gif}" != "no"; then
1936 AC_CHECK_HEADER(gif_lib.h,
1937 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
1938 # Earlier versions can crash Emacs.
1939 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
1942 if test "${HAVE_GIF}" = "yes"; then
1947 ### Use session management (-lSM -lICE) if available
1949 if test "${HAVE_X11}" = "yes"; then
1950 AC_CHECK_HEADER(X11/SM/SMlib.h,
1951 AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, -lICE))
1953 if test "${HAVE_X_SM}" = "yes"; then
1954 AC_DEFINE(HAVE_X_SM)
1957 *) LIBS="-lSM -lICE $LIBS" ;;
1962 # If netdb.h doesn't declare h_errno, we must declare it by hand.
1963 AC_CACHE_CHECK(whether netdb declares h_errno,
1964 emacs_cv_netdb_declares_h_errno,
1965 [AC_TRY_LINK([#include <netdb.h>],
1967 emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
1968 if test $emacs_cv_netdb_declares_h_errno = yes; then
1969 AC_DEFINE(HAVE_H_ERRNO)
1974 # fmod, logb, and frexp are found in -lm on most systems.
1975 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
1976 AC_CHECK_LIB(m, sqrt)
1978 # Check for mail-locking functions in a "mail" library
1979 AC_CHECK_LIB(mail, maillock)
1980 dnl Debian, at least:
1981 dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)])
1982 AC_CHECK_LIB(lockfile, maillock)
1983 # If we have the shared liblockfile, assume we must use it for mail
1984 # locking (e.g. Debian). If we couldn't link against liblockfile
1985 # (no liblockfile.a installed), ensure that we don't need to.
1986 if test "$ac_cv_lib_lockfile_maillock" = no; then
1987 dnl This works for files generally, not just executables.
1988 dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
1989 AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
1990 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
1991 if test $ac_cv_prog_liblockfile = yes; then
1992 AC_MSG_ERROR([Shared liblockfile found but can't link against it.
1993 This probably means that movemail could lose mail.
1994 There may be a \`development' package to install containing liblockfile.])
1995 else AC_DEFINE(LIBMAIL, -llockfile)
1999 AC_CHECK_FUNCS(touchlock)
2000 AC_CHECK_HEADERS(maillock.h)
2002 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
2003 rename closedir mkdir rmdir sysinfo \
2004 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
2005 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
2006 utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
2007 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
2008 sendto recvfrom getsockopt setsockopt getsockname getpeername \
2009 gai_strerror mkstemp)
2011 AC_CHECK_HEADERS(sys/un.h)
2014 if test "$ac_cv_func_working_mktime" = no; then
2015 AC_DEFINE(BROKEN_MKTIME)
2023 AC_CHECK_FUNCS(grantpt)
2025 # PTY-related GNU extensions.
2026 AC_CHECK_FUNCS(getpt)
2028 # Check this now, so that we will NOT find the above functions in ncurses.
2029 # That is because we have not set up to link ncurses in lib-src.
2030 # It's better to believe a function is not available
2031 # than to expect to find it in ncurses.
2032 AC_CHECK_LIB(ncurses, tparm)
2034 # Do we need the Hesiod library to provide the support routines?
2035 if test "$with_hesiod" = yes ; then
2036 # Don't set $LIBS here -- see comments above.
2038 AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2039 [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2040 [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2041 if test "$resolv" = yes ; then
2043 AC_DEFINE(HAVE_LIBRESOLV)
2047 AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
2048 AC_DEFINE(HAVE_LIBHESIOD), :, $RESOLVLIB)])
2051 # These tell us which Kerberos-related libraries to use.
2052 if test "${with_kerberos+set}" = set; then
2053 AC_CHECK_LIB(com_err, com_err)
2054 AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2055 AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2056 AC_CHECK_LIB(krb5, krb5_init_context)
2057 if test "${with_kerberos5+set}" != set; then
2058 AC_CHECK_LIB(des425, des_cbc_encrypt,,
2059 AC_CHECK_LIB(des, des_cbc_encrypt))
2060 AC_CHECK_LIB(krb4, krb_get_cred,,
2061 AC_CHECK_LIB(krb, krb_get_cred))
2064 if test "${with_kerberos5+set}" = set; then
2065 AC_CHECK_HEADERS(krb5.h)
2067 AC_CHECK_HEADERS(des.h,,
2068 [AC_CHECK_HEADERS(kerberosIV/des.h,,
2069 [AC_CHECK_HEADERS(kerberos/des.h)])])
2070 AC_CHECK_HEADERS(krb.h,,
2071 [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2072 [AC_CHECK_HEADERS(kerberos/krb.h)])])
2074 AC_CHECK_HEADERS(com_err.h)
2077 # Solaris requires -lintl if you want strerror (which calls dgettext)
2078 # to return localized messages.
2079 AC_CHECK_LIB(intl, dgettext)
2081 AC_MSG_CHECKING(whether localtime caches TZ)
2082 AC_CACHE_VAL(emacs_cv_localtime_cache,
2083 [if test x$ac_cv_func_tzset = xyes; then
2084 AC_TRY_RUN([#include <time.h>
2085 extern char **environ;
2089 for (to = from = environ; (*to = *from); from++)
2090 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2093 char TZ_GMT0[] = "TZ=GMT0";
2094 char TZ_PST8[] = "TZ=PST8";
2097 time_t now = time ((time_t *) 0);
2098 int hour_GMT0, hour_unset;
2099 if (putenv (TZ_GMT0) != 0)
2101 hour_GMT0 = localtime (&now)->tm_hour;
2103 hour_unset = localtime (&now)->tm_hour;
2104 if (putenv (TZ_PST8) != 0)
2106 if (localtime (&now)->tm_hour == hour_GMT0)
2109 if (localtime (&now)->tm_hour != hour_unset)
2112 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2113 [# If we have tzset, assume the worst when cross-compiling.
2114 emacs_cv_localtime_cache=yes])
2116 # If we lack tzset, report that localtime does not cache TZ,
2117 # since we can't invalidate the cache if we don't have tzset.
2118 emacs_cv_localtime_cache=no
2120 AC_MSG_RESULT($emacs_cv_localtime_cache)
2121 if test $emacs_cv_localtime_cache = yes; then
2122 AC_DEFINE(LOCALTIME_CACHE)
2125 if test "x$HAVE_TIMEVAL" = xyes; then
2126 AC_CHECK_FUNCS(gettimeofday)
2127 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2128 emacs_cv_gettimeofday_two_arguments,
2130 #ifdef TIME_WITH_SYS_TIME
2131 #include <sys/time.h>
2134 #ifdef HAVE_SYS_TIME_H
2135 #include <sys/time.h>
2140 [struct timeval time;
2141 gettimeofday (&time, 0);],
2142 emacs_cv_gettimeofday_two_arguments=yes,
2143 emacs_cv_gettimeofday_two_arguments=no)])
2144 if test $emacs_cv_gettimeofday_two_arguments = no; then
2145 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)
2149 dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
2150 if test "$ac_cv_func_gettimeofday" = yes; then
2151 AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone,
2152 [AC_TRY_COMPILE([#include <sys/time.h>],
2153 [struct timezone tz;],
2154 dnl It may be that we can't call gettimeofday with a non-null pointer,
2155 dnl even though we have struct timezone (e.g. HPUX). In that case
2156 dnl we'll lie about struct timezone.
2158 #ifdef TIME_WITH_SYS_TIME
2159 #include <sys/time.h>
2162 #ifdef HAVE_SYS_TIME_H
2163 #include <sys/time.h>
2169 struct timeval time;
2170 struct timezone dummy;
2171 exit (gettimeofday (&time, &dummy));
2173 emacs_cv_struct_timezone=yes,
2174 emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)],
2175 emacs_cv_struct_timezone=no)])
2179 AC_CHECK_FUNC(socket, , ok_so_far=no)
2180 if test $ok_so_far = yes; then
2181 AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
2183 if test $ok_so_far = yes; then
2184 AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
2186 if test $ok_so_far = yes; then
2187 AC_DEFINE(HAVE_INET_SOCKETS)
2190 if test -f /usr/lpp/X11/bin/smt.exp; then
2191 AC_DEFINE(HAVE_AIX_SMT_EXP)
2194 AC_MSG_CHECKING(whether system supports dynamic ptys)
2195 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2197 AC_DEFINE(HAVE_DEV_PTMX)
2204 # Fixme: This should be replaced when we have autoconf 2.14.
2207 # Set up the CFLAGS for real compilation, so we can substitute it.
2208 CFLAGS="$REAL_CFLAGS"
2209 CPPFLAGS="$REAL_CPPFLAGS"
2212 #### Find out which version of Emacs this is.
2213 version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
2214 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
2215 changequote([, ])dnl
2216 if test x"${version}" = x; then
2217 AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
2220 ### Specify what sort of things we'll be editing into Makefile and config.h.
2221 ### Use configuration here uncanonicalized to avoid exceeding size limits.
2223 AC_SUBST(configuration)
2227 AC_SUBST(exec_prefix)
2230 AC_SUBST(sharedstatedir)
2231 AC_SUBST(libexecdir)
2235 AC_SUBST(locallisppath)
2237 AC_SUBST(x_default_search_path)
2239 AC_SUBST(archlibdir)
2242 AC_SUBST(c_switch_system)
2243 AC_SUBST(c_switch_machine)
2244 AC_SUBST(LD_SWITCH_X_SITE)
2245 AC_SUBST(LD_SWITCH_X_SITE_AUX)
2246 AC_SUBST(C_SWITCH_X_SITE)
2248 AC_SUBST(X_TOOLKIT_TYPE)
2251 AC_SUBST(GETLOADAVG_LIBS)
2253 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}")
2254 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}")
2255 AC_DEFINE_UNQUOTED(config_machfile, "${machfile}")
2256 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}")
2257 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
2258 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
2259 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE})
2260 AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC})
2262 if test "${HAVE_X_WINDOWS}" = "yes" ; then
2263 AC_DEFINE(HAVE_X_WINDOWS)
2265 if test "${USE_X_TOOLKIT}" != "none" ; then
2266 AC_DEFINE(USE_X_TOOLKIT)
2268 if test "${HAVE_X11}" = "yes" ; then
2271 if test "${HAVE_XFREE386}" = "yes" ; then
2272 AC_DEFINE(HAVE_XFREE386)
2274 if test "${HAVE_MENUS}" = "yes" ; then
2275 AC_DEFINE(HAVE_MENUS)
2277 if test "${GNU_MALLOC}" = "yes" ; then
2278 AC_DEFINE(GNU_MALLOC)
2280 if test "${REL_ALLOC}" = "yes" ; then
2281 AC_DEFINE(REL_ALLOC)
2284 AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1,
2285 [Define if you have <nlist.h>.])])
2287 #### Report on what we decided to do.
2289 Configured for \`${canonical}'.
2291 Where should the build process find the source code? ${srcdir}
2292 What operating system and machine description files should Emacs use?
2293 \`${opsysfile}' and \`${machfile}'
2294 What compiler should emacs be built with? ${CC} ${CFLAGS}
2295 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
2296 Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
2297 Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
2298 What window system should Emacs use? ${window_system}
2299 What toolkit should Emacs use? ${USE_X_TOOLKIT}"
2301 if test -n "${x_includes}"; then
2302 echo " Where do we find X Windows header files? ${x_includes}"
2304 echo " Where do we find X Windows header files? Standard dirs"
2306 if test -n "${x_libraries}"; then
2307 echo " Where do we find X Windows libraries? ${x_libraries}"
2309 echo " Where do we find X Windows libraries? Standard dirs"
2312 echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
2313 echo " Does Emacs use -lXpm? ${HAVE_XPM}"
2314 echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
2315 echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
2316 echo " Does Emacs use -lungif? ${HAVE_GIF}"
2317 echo " Does Emacs use -lpng? ${HAVE_PNG}"
2318 echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
2321 # Remove any trailing slashes in these variables.
2323 test "${prefix}" != NONE &&
2324 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
2325 test "${exec_prefix}" != NONE &&
2326 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
2327 changequote([, ])dnl
2329 ## Check if the C preprocessor will convert `..' to `. .'. If so, set
2330 ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
2331 ## from Makefile.c can correctly provide the arg `-traditional' to the
2334 AC_EGREP_CPP(yes..yes,
2336 CPP_NEED_TRADITIONAL=no,
2337 CPP_NEED_TRADITIONAL=yes)
2339 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
2340 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
2341 lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [
2343 ### Make the necessary directories, if they don't exist.
2344 for dir in etc lisp ; do
2345 test -d ${dir} || mkdir ${dir}
2348 # Build src/Makefile from ${srcdir}/src/Makefile.c
2349 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
2350 # This must be done after src/config.h is built, since we rely on that file.
2352 changequote(, )dnl The horror, the horror.
2353 # Now get this: Some word that is part of the ${srcdir} directory name
2354 # or the ${configuration} value might, just might, happen to be an
2355 # identifier like `sun4' or `i386' or something, and be predefined by
2356 # the C preprocessor to some helpful value like 1, or maybe the empty
2357 # string. Needless to say consequent macro substitutions are less
2358 # than conducive to the makefile finding the correct directory.
2359 undefs="`echo $top_srcdir $configuration $canonical |
2360 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
2361 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
2363 changequote([, ])dnl
2365 echo creating src/epaths.h
2366 ${MAKE-make} epaths-force
2368 # As of 2000-11-19, newest development versions of GNU cpp preprocess
2369 # `..' to `. .' unless invoked with -traditional
2371 if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
2372 CPPFLAGS="$CPPFLAGS -traditional"
2375 echo creating lib-src/Makefile
2377 rm -f junk.c junk1.c junk2.c
2378 sed -e '/start of cpp stuff/q' \
2379 < Makefile.c > junk1.c
2380 sed -e '1,/start of cpp stuff/d'\
2381 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2382 < Makefile.c > junk.c
2383 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2384 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2385 cat junk1.c junk2.c > Makefile.new
2386 rm -f junk.c junk1.c junk2.c
2387 chmod 444 Makefile.new
2388 mv -f Makefile.new Makefile
2391 echo creating src/Makefile
2393 rm -f junk.c junk1.c junk2.c
2394 sed -e '/start of cpp stuff/q' \
2395 < Makefile.c > junk1.c
2396 sed -e '1,/start of cpp stuff/d'\
2397 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2398 < Makefile.c > junk.c
2399 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2400 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2401 cat junk1.c junk2.c > Makefile.new
2402 rm -f junk.c junk1.c junk2.c
2403 chmod 444 Makefile.new
2404 mv -f Makefile.new Makefile
2407 if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
2408 echo creating src/.gdbinit
2409 echo source $srcdir/src/.gdbinit > src/.gdbinit
2412 # This is how we know whether to re-run configure in certain cases.
2413 touch src/config.stamp
2415 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])