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 Free Software Foundation, Inc.
8 dnl This file is part of GNU Emacs.
10 dnl GNU Emacs is free software; you can redistribute it and/or modify
11 dnl it under the terms of the GNU General Public License as published by
12 dnl the Free Software Foundation; either version 2, or (at your option)
13 dnl any later version.
15 dnl GNU Emacs is distributed in the hope that it will be useful,
16 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 dnl GNU General Public License for more details.
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with GNU Emacs; see the file COPYING. If not, write to the
22 dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 dnl Boston, MA 02111-1307, USA.
27 AC_CONFIG_HEADER(src/config.h:src/config.in)
29 lispdir='${datadir}/emacs/${version}/lisp'
30 locallisppath='${datadir}/emacs/${version}/site-lisp:'\
31 '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
32 lisppath='${locallisppath}:${lispdir}'
33 etcdir='${datadir}/emacs/${version}/etc'
34 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
35 docdir='${datadir}/emacs/${version}/etc'
38 [ --without-gcc don't use GCC to compile Emacs if GCC is found])
40 [ --without-pop don't support POP mail retrieval with movemail],
41 [if test "$withval" = yes; then
42 AC_DEFINE(MAIL_USE_POP)
45 AC_DEFINE(MAIL_USE_POP))
47 [ --with-kerberos support Kerberos-authenticated POP],
48 [AC_DEFINE(KERBEROS)])
49 AC_ARG_WITH(kerberos5,
50 [ --with-kerberos5 support Kerberos version 5 authenticated POP],
51 [if test "${with_kerberos5+set}" = set; then
52 if test "${with_kerberos+set}" != set; then
57 AC_DEFINE(KERBEROS5)])
59 [ --with-hesiod support Hesiod to get the POP server host],
61 dnl This should be the last --with option, because --with-x is
62 dnl added later on when we find the path of X, and it's best to
63 dnl keep them together visually.
64 AC_ARG_WITH(x-toolkit,
65 [ --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)],
66 [ case "${withval}" in
67 y | ye | yes ) val=athena ;;
69 l | lu | luc | luci | lucid ) val=lucid ;;
70 a | at | ath | athe | athen | athena ) val=athena ;;
71 m | mo | mot | moti | motif ) val=motif ;;
72 dnl These don't currently work.
73 dnl o | op | ope | open | open- | open-l | open-lo \
74 dnl | open-loo | open-look ) val=open-look ;;
76 dnl AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
77 dnl which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.])
78 AC_MSG_ERROR([\`--with-x-toolkit=$withval' is invalid\;
79 this option's value should be \`yes', \`no', \`lucid', \`athena', or \`motif'.
80 Currently, \`yes', \`athena' and \`lucid' are synonyms.])
86 [ --with-xpm use -lXpm for displaying XPM images])
88 [ --with-jpeg use -ljpeg for displaying JPEG images])
90 [ --with-tiff use -ltiff for displaying TIFF images])
92 [ --with-gif use -lungif for displaying GIF images])
94 [ --with-png use -lpng for displaying PNG images])
95 AC_ARG_WITH(toolkit-scroll-bars,
96 [ --without-toolkit-scroll-bars don't use Motif or Xaw3d scroll bars])
98 #### Make srcdir absolute, if it isn't already. It's important to
99 #### avoid running the path through pwd unnecessary, since pwd can
100 #### give you automounter prefixes, which can go away. We do all this
101 #### so Emacs can find its files when run uninstalled.
105 ## We may be able to use the $PWD environment variable to make this
106 ## absolute. But sometimes PWD is inaccurate.
107 ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
109 if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
113 srcdir="`(cd ${srcdir}; pwd)`"
116 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
119 #### Check if the source directory already has a configured system in it.
120 if test `pwd` != `(cd ${srcdir} && pwd)` \
121 && test -f "${srcdir}/src/config.h" ; then
122 AC_MSG_WARN([The directory tree \`${srcdir}' is being used
123 as a build directory right now; it has been configured in its own
124 right. To configure in another directory as well, you MUST
125 use GNU make. If you do not have GNU make, then you must
126 now do \`make distclean' in ${srcdir},
127 and then run $0 again.])
130 extrasub='/^VPATH[ ]*=/c\
137 vpath %.in $(srcdir)\
138 vpath %.texi $(srcdir)'
141 #### Given the configuration name, set machfile and opsysfile to the
142 #### names of the m/*.h and s/*.h files we should use.
144 ### Canonicalize the configuration name.
148 configuration=$host_alias
152 ### If you add support for a new configuration, add code to this
153 ### switch statement to recognize your configuration name and select
154 ### the appropriate operating system and machine description files.
156 ### You would hope that you could choose an m/*.h file pretty much
157 ### based on the machine portion of the configuration name, and an s-
158 ### file based on the operating system portion. However, it turns out
159 ### that each m/*.h file is pretty manufacturer-specific - for
160 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
161 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
162 ### machines. So we basically have to have a special case for each
163 ### configuration name.
165 ### As far as handling version numbers on operating systems is
166 ### concerned, make sure things will fail in a fixable way. If
167 ### /etc/MACHINES doesn't say anything about version numbers, be
168 ### prepared to handle anything reasonably. If version numbers
169 ### matter, be sure /etc/MACHINES says something about it.
171 ### Eric Raymond says we should accept strings like "sysvr4" to mean
172 ### "System V Release 4"; he writes, "The old convention encouraged
173 ### confusion between `system' and `release' levels'."
175 machine='' opsys='' unported=no
176 case "${canonical}" in
181 case "${canonical}" in
182 alpha*-*-netbsd*) machine=alpha ;;
183 i[3456]86-*-netbsd*) machine=intel386 ;;
185 # This is somewhat bogus.
186 machine=hp9000s300 ;;
187 powerpc-apple-netbsd*) machine=macppc ;;
188 mips-*-netbsd*) machine=pmax ;;
189 ns32k-*-netbsd*) machine=ns32000 ;;
190 sparc-*-netbsd*) machine=sparc ;;
191 vax-*-netbsd*) machine=vax ;;
198 case "${canonical}" in
199 alpha*-*-openbsd*) machine=alpha ;;
200 i386-*-openbsd*) machine=intel386 ;;
201 m68k-*-openbsd*) machine=hp9000s300 ;;
202 mipsel-*-openbsd*) machine=pmax ;;
203 ns32k-*-openbsd*) machine=ns32000 ;;
204 sparc-*-openbsd*) machine=sparc ;;
205 vax-*-openbsd*) machine=vax ;;
210 arm-acorn-riscix1.1* )
211 machine=acorn opsys=riscix1-1
213 arm-acorn-riscix1.2* | arm-acorn-riscix )
214 ## This name is riscix12 instead of riscix1.2
215 ## to avoid a file name conflict on MSDOS.
216 machine=acorn opsys=riscix12
222 case "${canonical}" in
223 i[345]86-*-bsdi*) machine=intel386 ;;
224 sparc-*-bsdi*) machine=sparc ;;
225 powerpc-*-bsdi*) machine=powerpc ;;
227 case "${canonical}" in
228 *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
229 *-*-bsdi2.0* ) opsys=bsdos2 ;;
230 *-*-bsdi2* ) opsys=bsdos2-1 ;;
231 *-*-bsdi3* ) opsys=bsdos3 ;;
232 *-*-bsdi4* ) opsys=bsdos4 ;;
237 ## Strictly speaking, we need the version of the alliant operating
238 ## system to choose the right machine file, but currently the
239 ## configuration name doesn't tell us enough to choose the right
240 ## one; we need to give alliants their own operating system name to
241 ## do this right. When someone cares, they can help us.
243 machine=alliant4 opsys=bsd4-2
246 machine=alliant-2800 opsys=bsd4-3
249 ## Alpha (DEC) machines.
251 machine=alpha opsys=osf1
252 # This is needed to find X11R6.1 libraries for certain tests.
253 NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
254 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
257 alpha*-*-linux-gnu* )
258 machine=alpha opsys=gnu-linux
262 machine=arm opsys=gnu-linux
267 machine=powerpc opsys=gnu-linux
272 machine=altos opsys=usg5-2
277 machine=amdahl opsys=usg5-2-2
282 machine=apollo opsys=bsd4-3
287 machine=arm opsys=gnu-linux
290 ## AT&T 3b2, 3b5, 3b15, 3b20
292 machine=att3b opsys=usg5-2-2
295 ## AT&T 3b1 - The Mighty Unix PC!
297 machine=7300 opsys=usg5-2-2
302 machine=ibmrs6000 opsys=aix3-2
307 machine=dpx2 opsys=usg5-3
312 machine=sps7 opsys=usg5-2
315 ## CCI 5/32, 6/32 -- see "Tahoe".
318 ## I don't know what configuration name to use for this; config.sub
319 ## doesn't seem to know anything about it. Hey, Celerity users, get
321 celerity-celerity-bsd* )
322 machine=celerity opsys=bsd4-2
326 ## What operating systems does this chip run that Emacs has been
330 ## We'll use the catch-all code at the bottom to guess the
335 *-convex-bsd* | *-convex-convexos* )
336 machine=convex opsys=bsd4-3
337 ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov
338 NON_GNU_CPP="cc -E -P"
342 i[3456]86-cubix-sysv* )
343 machine=intel386 opsys=usg5-3
347 cydra*-cydrome-sysv* )
348 machine=cydra5 opsys=usg5-3
351 ## Data General AViiON Machines
352 ## DG changed naming conventions with the release of 5.4.4.10, they
353 ## dropped the initial 5.4 but left the intervening R. Because of the
354 ## R this shouldn't conflict with older versions of the OS (which I
355 ## think were named like dgux4.*). In addition, DG new AViiONs series
356 ## uses either Motorola M88k or Intel Pentium CPUs.
357 m88k-dg-dguxR4.* | m88k-dg-dgux4* )
358 machine=aviion opsys=dgux4
360 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
361 ## This name is dgux5-4-3 instead of dgux5-4r3
362 ## to avoid a file name conflict on MSDOS.
363 machine=aviion opsys=dgux5-4-3
365 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
366 machine=aviion opsys=dgux5-4r2
369 machine=aviion opsys=dgux
372 ## Data General AViiON Intel (x86) Machines
373 ## Exists from 5.4.3 (current i586-dg-dguxR4.11)
374 ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il
375 i[345]86-dg-dguxR4* )
376 machine=aviion-intel opsys=dgux4
380 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
381 machine=pmax opsys=bsd4-2
383 mips-dec-ultrix4.[12]* | mips-dec-bsd* )
384 machine=pmax opsys=bsd4-3
387 machine=pmax opsys=ultrix4-3
390 machine=pmax opsys=osf1
392 mips-dec-mach_bsd4.3* )
393 machine=pmax opsys=mach-bsd4-3
396 ## Motorola Delta machines
397 m68k-motorola-sysv* | m68000-motorola-sysv* )
398 machine=delta opsys=usg5-3
399 if test -z "`type gnucc | grep 'not found'`"
401 if test -s /etc/167config
402 then CC="gnucc -m68040"
403 else CC="gnucc -m68881"
406 if test -z "`type gcc | grep 'not found'`"
412 m88k-motorola-sysv4* )
413 # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
414 # needs POSIX_SIGNALS and therefore needs usg5-4-2.
415 # I hope there are not other 4.0 versions for this machine
416 # which really need usg5-4 instead.
417 machine=delta88k opsys=usg5-4-2
419 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
420 machine=delta88k opsys=usg5-3
425 machine=dual opsys=usg5-2
428 machine=dual opsys=unipl5-2
433 machine=elxsi opsys=usg5-2
438 machine=ns16000 opsys=umax
441 ## The GEC 93 - apparently, this port isn't really finished yet.
443 ## Gould Power Node and NP1
445 machine=gould opsys=bsd4-2
448 machine=gould opsys=bsd4-3
451 machine=gould-np1 opsys=bsd4-3
454 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
455 ## as far as Emacs is concerned).
457 # Build needs to be different on 7.0 and later releases
459 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
460 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
462 NON_GNU_CPP="/lib/cpp"
464 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
466 machine=nh3000 opsys=cxux
468 ## Harris power pc NightHawk running Power UNIX (Series 6000)
469 powerpc-harris-powerunix )
470 machine=nh6000 opsys=powerunix
471 NON_GNU_CPP="cc -Xo -E -P"
473 ## SR2001/SR2201 running HI-UX/MPP
474 hppa1.1-hitachi-hiuxmpp* )
475 machine=sr2k opsys=hiuxmpp
478 xps*-honeywell-sysv* )
479 machine=xps100 opsys=usg5-2
482 ## HP 9000 series 200 or 300
484 machine=hp9000s300 opsys=bsd4-3
486 ## HP/UX 7, 8, 9, and 10 are supported on these machines.
489 ## Someone's system reports A.B8.05 for this.
490 ## I wonder what other possibilities there are.
491 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
492 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
493 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
494 *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
495 *) machine=hp9000s300 opsys=hpux ;;
499 ## HP 9000 series 700 and 800, running HP/UX
501 machine=hp800 opsys=hpux
504 machine=hp800 opsys=hpux8
507 machine=hp800 opsys=hpux9shr
510 machine=hp800 opsys=hpux9
512 hppa*-hp-hpux1[0-9]* )
513 machine=hp800 opsys=hpux10
516 ## HP 9000 series 700 and 800, running HP/UX
518 ## Cross-compilation? Nah!
520 ## Someone's system reports A.B8.05 for this.
521 ## I wonder what other possibilities there are.
522 *.B8.* ) machine=hp800 opsys=hpux8 ;;
523 *.08.* ) machine=hp800 opsys=hpux8 ;;
524 *.09.* ) machine=hp800 opsys=hpux9 ;;
525 *) machine=hp800 opsys=hpux10 ;;
529 machine=hp800 opsys=nextstep
534 machine=orion opsys=bsd4-2
537 machine=orion105 opsys=bsd4-2
541 i[3456]86-ibm-aix1.1* )
542 machine=ibmps2-aix opsys=usg5-2-2
544 i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
545 machine=ibmps2-aix opsys=usg5-3
548 machine=ibm370aix opsys=usg5-3
550 rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
551 machine=ibmrs6000 opsys=aix3-1
553 rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
554 machine=ibmrs6000 opsys=aix3-2-5
556 rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* )
557 machine=ibmrs6000 opsys=aix4-1
559 rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
560 machine=ibmrs6000 opsys=aix4-2
562 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
563 machine=ibmrs6000 opsys=aix4
565 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
566 machine=ibmrs6000 opsys=aix4-1
568 rs6000-ibm-aix* | powerpc-ibm-aix* )
569 machine=ibmrs6000 opsys=aix3-2
572 machine=ibmrt opsys=bsd4-3
575 machine=ibmrt opsys=bsd4-2
578 machine=ibmrt opsys=bsd4-3
581 machine=ibmrt opsys=bsd4-2
584 machine=ibmrt opsys=bsd4-3
587 machine=ibmrt opsys=bsd4-3
590 machine=ibmrt-aix opsys=usg5-2-2
593 ## Integrated Solutions `Optimum V'
595 machine=isi-ov opsys=bsd4-2
598 machine=isi-ov opsys=bsd4-3
601 ## Intel 386 machines where we do care about the manufacturer
602 i[3456]86-intsys-sysv* )
603 machine=is386 opsys=usg5-2-2
607 i[3456]86-prime-sysv* )
608 machine=i386 opsys=usg5-3
611 ## Sequent Symmetry running Dynix
612 i[3456]86-sequent-bsd* )
613 machine=symmetry opsys=bsd4-3
616 ## Sequent Symmetry running ptx 4, which is a modified SVR4.
617 i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
618 machine=sequent-ptx opsys=ptx4
622 ## Sequent Symmetry running DYNIX/ptx
623 ## Use the old cpp rather than the newer ANSI one.
624 i[3456]86-sequent-ptx* )
625 machine=sequent-ptx opsys=ptx
626 NON_GNU_CPP="/lib/cpp"
629 ## ncr machine running svr4.3.
630 i[3456]86-ncr-sysv4.3 )
631 machine=ncr386 opsys=usg5-4-3
634 ## Unspecified sysv on an ncr machine defaults to svr4.2.
635 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
636 i[3456]86-ncr-sysv* )
637 machine=ncr386 opsys=usg5-4-2
640 ## Intel Paragon OSF/1
642 machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
647 machine=i860 opsys=usg5-4
648 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
649 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
654 machine=masscomp opsys=rtu
659 machine=mega68 opsys=bsd4-2
662 ## Workstations sold by MIPS
663 ## This is not necessarily all workstations using the MIPS processor -
664 ## Irises are produced by SGI, and DECstations by DEC.
666 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
667 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
668 ## it gives for choosing between the alternatives seems to be "Use
669 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
670 ## the BSD world." I'll assume that these are instructions for
671 ## handling two odd situations, and that every other situation
672 ## should use mips.h and usg5-2-2, they being listed first.
675 ## Fall through to the general code at the bottom to decide on the OS.
678 machine=mips4 opsys=bsd4-3
679 NON_GNU_CC="cc -systype bsd43"
680 NON_GNU_CPP="cc -systype bsd43 -E"
683 machine=mips4 opsys=riscos5
684 NON_GNU_CC="cc -systype bsd43"
685 NON_GNU_CPP="cc -systype bsd43 -E"
688 machine=mips opsys=bsd4-3
691 machine=mips opsys=usg5-2-2
695 m68*-next-* | m68k-*-nextstep* )
696 machine=m68k opsys=nextstep
699 ## The complete machine from National Semiconductor
701 machine=ns32000 opsys=usg5-2
705 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
706 machine=tower32 opsys=usg5-2-2
708 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
709 machine=tower32v3 opsys=usg5-3
714 machine=ews4800 opsys=ux4800
719 machine=targon31 opsys=usg5-2-2
724 machine=nu opsys=usg5-2
729 machine=plexus opsys=usg5-2
732 ## PowerPC reference platform
733 powerpcle-*-solaris2* )
739 ## I don't really have any idea what sort of processor the Pyramid has,
740 ## so I'm assuming it is its own architecture.
741 pyramid-pyramid-bsd* )
742 machine=pyramid opsys=bsd4-2
746 ns32k-sequent-bsd4.2* )
747 machine=sequent opsys=bsd4-2
749 ns32k-sequent-bsd4.3* )
750 machine=sequent opsys=bsd4-3
754 mips-siemens-sysv* | mips-sni-sysv*)
755 machine=mips-siemens opsys=usg5-4
756 NON_GNU_CC=/usr/ccs/bin/cc
757 NON_GNU_CPP=/usr/ccs/lib/cpp
760 ## Silicon Graphics machines
761 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
763 machine=irist opsys=iris3-5
765 m68*-sgi-iris3.6* | m68*-sgi-iris*)
766 machine=irist opsys=iris3-6
770 machine=iris4d opsys=irix3-3
773 machine=iris4d opsys=irix4-0
776 machine=iris4d opsys=irix6-5
777 # Without defining _LANGUAGE_C, things get masked out in the headers
778 # so that, for instance, grepping for `free' in stdlib.h fails and
779 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
780 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
781 NON_GCC_TEST_OPTIONS="-n32 -G0 -D_LANGUAGE_C"
784 machine=iris4d opsys=irix6-0
785 # It's not clear whether -D_LANGUAGE_C is necessary as for 6.5,
786 # but presumably it does no harm.
787 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
788 NON_GCC_TEST_OPTIONS=-32
790 mips-sgi-irix5.[01]* )
791 machine=iris4d opsys=irix5-0
793 mips-sgi-irix5* | mips-sgi-irix* )
794 machine=iris4d opsys=irix5-2
799 machine=news opsys=bsd4-2
802 machine=news opsys=bsd4-3
804 m68*-sony-newsos3* | m68*-sony-news3*)
805 machine=news opsys=bsd4-3
807 mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
808 machine=news-risc opsys=bsd4-3
811 machine=news-r6 opsys=newsos6
814 machine=news-risc opsys=newsos5
819 machine=stride opsys=usg5-2
823 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
824 machine=sparc opsys=gnu-linux
827 *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
828 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
829 | rs6000-*-solaris2*)
830 case "${canonical}" in
831 m68*-sunos1* ) machine=sun1 ;;
832 m68*-sunos2* ) machine=sun2 ;;
833 m68* ) machine=sun3 ;;
834 i[3456]86-sun-sunos[34]* ) machine=sun386 ;;
835 i[3456]86-*-* ) machine=intel386 ;;
836 powerpcle* ) machine=powerpcle ;;
837 powerpc* | rs6000* ) machine=ibmrs6000 ;;
838 sparc* ) machine=sparc ;;
841 case "${canonical}" in
842 ## The Sun386 didn't get past 4.0.
843 i[3456]86-*-sunos4 ) opsys=sunos4-0 ;;
844 *-sunos4.0* ) opsys=sunos4-0 ;;
845 *-sunos4.1.[3-9]*noshare )
846 ## This name is sunos413 instead of sunos4-1-3
847 ## to avoid a file name conflict on MSDOS.
849 NON_GNU_CPP=/usr/lib/cpp
850 NON_GCC_TEST_OPTIONS=-Bstatic
851 GCC_TEST_OPTIONS=-static
853 *-sunos4.1.[3-9]* | *-sunos4shr*)
855 NON_GNU_CPP=/usr/lib/cpp
857 *-sunos4* | *-sunos )
859 NON_GCC_TEST_OPTIONS=-Bstatic
860 GCC_TEST_OPTIONS=-static
862 *-sunos5.3* | *-solaris2.3* )
864 NON_GNU_CPP=/usr/ccs/lib/cpp
866 *-sunos5.4* | *-solaris2.4* )
868 NON_GNU_CPP=/usr/ccs/lib/cpp
871 *-sunos5.5* | *-solaris2.5* )
873 NON_GNU_CPP=/usr/ccs/lib/cpp
876 *-sunos5* | *-solaris* )
878 NON_GNU_CPP=/usr/ccs/lib/cpp
882 ## Watch out for a compiler that we know will not work.
883 case "${canonical}" in
884 *-solaris* | *-sunos5* )
885 if [ "x$CC" = x/usr/ucb/cc ]; then
886 ## /usr/ucb/cc doesn't work;
887 ## we should find some other compiler that does work.
895 machine=sparc opsys=nextstep
900 machine=tad68k opsys=usg5-3
904 tahoe-tahoe-bsd4.2* )
905 machine=tahoe opsys=bsd4-2
907 tahoe-tahoe-bsd4.3* )
908 machine=tahoe opsys=bsd4-3
911 ## Tandem Integrity S2
913 machine=tandem-s2 opsys=usg5-3
917 m88k-tektronix-sysv3* )
918 machine=tekxd88 opsys=usg5-3
921 ## Tektronix 16000 box (6130?)
922 ns16k-tektronix-bsd* )
923 machine=ns16000 opsys=bsd4-2
926 ## src/m/tek4300.h hints that this is a m68k machine.
927 m68*-tektronix-bsd* )
928 machine=tek4300 opsys=bsd4-3
932 ## We seem to have lost the machine-description file titan.h!
934 machine=titan opsys=usg5-3
937 ## Ustation E30 (SS5E)
938 m68*-unisys-uniplus* )
939 machine=ustation opsystem=unipl5-2
945 case "${canonical}" in
946 *-bsd4.1* ) opsys=bsd4-1 ;;
947 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
948 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
949 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
950 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
951 *-vms* ) opsys=vms ;;
957 ns16k-whitechapel-* )
959 ## We don't know what sort of OS runs on these; we'll let the
960 ## operating system guessing code below try.
965 machine=wicat opsys=usg5-2
968 ## Intel 386 machines where we don't care about the manufacturer
971 case "${canonical}" in
972 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
973 *-isc2.2* ) opsys=isc2-2 ;;
974 *-isc4.0* ) opsys=isc4-0 ;;
975 *-isc4.* ) opsys=isc4-1
976 GCC_TEST_OPTIONS=-posix
977 NON_GCC_TEST_OPTIONS=-Xp
979 *-isc* ) opsys=isc3-0 ;;
980 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
981 *-esix* ) opsys=esix ;;
982 *-xenix* ) opsys=xenix ;;
983 *-linux-gnu* ) opsys=gnu-linux ;;
984 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
985 *-sco3.2v5* ) opsys=sco5
987 # Prevent -belf from being passed to $CPP.
988 # /lib/cpp does not accept it.
989 OVERRIDE_CPPFLAGS=" "
991 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
992 *-386bsd* ) opsys=386bsd ;;
993 *-freebsd* ) opsys=freebsd ;;
994 *-nextstep* ) opsys=nextstep ;;
995 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
999 ## m68k Linux-based GNU system
1001 machine=m68k opsys=gnu-linux
1004 ## Mips Linux-based GNU system
1006 machine=mips opsys=gnu-linux
1010 sparc-fujitsu-sysv4* )
1011 machine=sparc opsys=uxpds
1012 NON_GNU_CPP=/usr/ccs/lib/cpp
1017 f301-fujitsu-uxpv4.1)
1018 machine=f301 opsys=uxpv
1026 ### If the code above didn't choose an operating system, just choose
1027 ### an operating system based on the configuration name. You really
1028 ### only want to use this when you have no idea what the right
1029 ### operating system is; if you know what operating systems a machine
1030 ### runs, it's cleaner to make it explicit in the case statement
1032 if test x"${opsys}" = x; then
1033 case "${canonical}" in
1034 *-gnu* ) opsys=gnu ;;
1035 *-bsd4.[01] ) opsys=bsd4-1 ;;
1036 *-bsd4.2 ) opsys=bsd4-2 ;;
1037 *-bsd4.3 ) opsys=bsd4-3 ;;
1038 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1039 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1040 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
1041 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
1042 *-sysv4.2uw* ) opsys=unixware ;;
1043 *-sysv4.1* | *-sysvr4.1* )
1044 NON_GNU_CPP=/usr/lib/cpp
1046 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1047 if [ x$NON_GNU_CPP = x ]; then
1048 if [ -f /usr/ccs/lib/cpp ]; then
1049 NON_GNU_CPP=/usr/ccs/lib/cpp
1051 NON_GNU_CPP=/lib/cpp
1055 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
1062 if test "x$RANLIB" = x; then
1066 changequote([, ])dnl
1068 if test $unported = yes; then
1069 AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
1070 Check \`etc/MACHINES' for recognized configuration names.])
1073 machfile="m/${machine}.h"
1074 opsysfile="s/${opsys}.h"
1077 #### Choose a compiler.
1078 test -n "$CC" && cc_specified=yes
1080 # Save the value of CFLAGS that the user specified.
1081 SPECIFIED_CFLAGS="$CFLAGS"
1084 "yes" ) CC="gcc" GCC=yes ;;
1085 "no" ) : ${CC=cc} ;;
1089 # On Suns, sometimes $CPP names a directory.
1090 if test -n "$CPP" && test -d "$CPP"; then
1094 #### Some systems specify a CPP to use unless we are using GCC.
1095 #### Now that we know whether we are using GCC, we can decide whether
1096 #### to use that one.
1097 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1102 #### Some systems specify a CC to use unless we are using GCC.
1103 #### Now that we know whether we are using GCC, we can decide whether
1104 #### to use that one.
1105 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1106 test x$cc_specified != xyes
1111 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1113 CC="$CC $GCC_TEST_OPTIONS"
1116 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1118 CC="$CC $NON_GCC_TEST_OPTIONS"
1121 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1123 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1126 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1128 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1131 #### Some other nice autoconf tests. If you add a test here which
1132 #### should make an entry in src/config.h, don't forget to add an
1133 #### #undef clause to src/config.h.in for autoconf to modify.
1135 dnl checks for programs
1141 dnl checks for Unix variants
1144 # Sound support for GNU/Linux and the free BSDs.
1145 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h)
1147 dnl checks for header files
1148 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1149 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1150 termcap.h stdio_ext.h)
1155 dnl Some systems have utime.h but don't declare the struct anyplace.
1156 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1157 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1158 #include <sys/time.h>
1161 #ifdef HAVE_SYS_TIME_H
1162 #include <sys/time.h>
1169 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1170 emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1171 if test $emacs_cv_struct_utimbuf = yes; then
1172 AC_DEFINE(HAVE_STRUCT_UTIMBUF)
1175 dnl checks for typedefs
1178 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1179 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1180 #include <sys/time.h>
1183 #ifdef HAVE_SYS_TIME_H
1184 #include <sys/time.h>
1188 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1189 emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1190 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1191 if test $emacs_cv_struct_timeval = yes; then
1192 AC_DEFINE(HAVE_TIMEVAL)
1195 dnl checks for structure members
1198 AC_CACHE_CHECK(for tm_gmtoff in struct tm, emacs_cv_tm_gmtoff,
1199 AC_TRY_LINK([#include <time.h>], [struct tm t; t.tm_gmtoff = 0],
1200 emacs_cv_tm_gmtoff=yes,
1201 emacs_cv_tm_gmtoff=no))
1202 if test $emacs_cv_tm_gmtoff = yes; then
1203 AC_DEFINE(HAVE_TM_GMTOFF)
1206 dnl checks for compiler characteristics
1209 dnl check for Make feature
1212 dnl checks for operating system services
1213 AC_SYS_LONG_FILE_NAMES
1215 #### Choose a window system.
1218 if test "$no_x" = yes; then
1224 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1225 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1226 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1227 x_default_search_path=""
1228 for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
1229 x_search_path="${x_library}/X11/%L/%T/%N%C%S:\
1230 ${x_library}/X11/%L/%T/%N%C%S:${x_libary}/X11/%l/%T/%N%C%S:\
1231 ${x_library}/X11/%T/%N%C%S:${x_library}/X11/%L/%T/%N%S:\
1232 ${x_library}/X11/%l/%T/%N%S:${x_library}/X11/%T/%N%S"
1233 if test x"${x_default_search_path}" = x; then
1234 x_default_search_path=${x_search_path}
1236 x_default_search_path="${x_search_path}:${x_default_search_path}"
1240 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1241 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1244 if test x"${x_includes}" = x; then
1245 bitmapdir=/usr/include/X11/bitmaps
1247 # accumulate include directories that have X11 bitmap subdirectories
1249 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1250 if test -d "${bmd}/X11/bitmaps"; then
1251 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1253 if test -d "${bmd}/bitmaps"; then
1254 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1257 if test ${bmd_acc} != "dummyval"; then
1258 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1262 case "${window_system}" in
1266 case "${with_x_toolkit}" in
1267 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1268 motif ) USE_X_TOOLKIT=MOTIF ;;
1269 dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
1270 no ) USE_X_TOOLKIT=none ;;
1271 dnl If user did not say whether to use a toolkit,
1272 dnl make this decision later: use the toolkit if we have X11R5 or newer.
1273 * ) USE_X_TOOLKIT=maybe ;;
1283 ### If we're using X11, we should use the X menu package.
1286 yes ) HAVE_MENUS=yes ;;
1289 if test "${opsys}" = "hpux9"; then
1290 case "${x_libraries}" in
1292 opsysfile="s/hpux9-x11r4.h"
1297 if test "${opsys}" = "hpux9shr"; then
1298 case "${x_libraries}" in
1300 opsysfile="s/hpux9shxr4.h"
1305 #### Extract some information from the operating system and machine files.
1307 AC_CHECKING([the machine- and system-dependent files to find out
1308 - which libraries the lib-src programs will want, and
1309 - whether the GNU malloc routines are usable])
1311 ### First figure out CFLAGS (which we use for running the compiler here)
1312 ### and REAL_CFLAGS (which we use for real compilation).
1313 ### The two are the same except on a few systems, where they are made
1314 ### different to work around various lossages. For example,
1315 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1316 ### as implying static linking.
1318 ### If the CFLAGS env var is specified, we use that value
1319 ### instead of the default.
1321 ### It's not important that this name contain the PID; you can't run
1322 ### two configures in the same directory and have anything work
1324 tempcname="conftest.c"
1327 #include "'${srcdir}'/src/'${opsysfile}'"
1328 #include "'${srcdir}'/src/'${machfile}'"
1329 #ifndef LIBS_MACHINE
1330 #define LIBS_MACHINE
1335 #ifndef C_SWITCH_SYSTEM
1336 #define C_SWITCH_SYSTEM
1338 #ifndef C_SWITCH_MACHINE
1339 #define C_SWITCH_MACHINE
1341 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1342 configure___ c_switch_system=C_SWITCH_SYSTEM
1343 configure___ c_switch_machine=C_SWITCH_MACHINE
1346 #define LIB_X11_LIB -lX11
1349 #ifndef LIBX11_MACHINE
1350 #define LIBX11_MACHINE
1353 #ifndef LIBX11_SYSTEM
1354 #define LIBX11_SYSTEM
1356 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1359 configure___ unexec=UNEXEC
1361 configure___ unexec=unexec.o
1364 #ifdef SYSTEM_MALLOC
1365 configure___ system_malloc=yes
1367 configure___ system_malloc=no
1370 #ifndef C_DEBUG_SWITCH
1371 #define C_DEBUG_SWITCH -g
1374 #ifndef C_OPTIMIZE_SWITCH
1375 #define C_OPTIMIZE_SWITCH -O
1378 #ifndef LD_SWITCH_MACHINE
1379 #define LD_SWITCH_MACHINE
1382 #ifndef LD_SWITCH_SYSTEM
1383 #define LD_SWITCH_SYSTEM
1386 #ifndef LD_SWITCH_X_SITE_AUX
1387 #define LD_SWITCH_X_SITE_AUX
1390 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1391 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1393 #ifdef THIS_IS_CONFIGURE
1395 /* Get the CFLAGS for tests in configure. */
1397 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1399 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1402 #else /* not THIS_IS_CONFIGURE */
1404 /* Get the CFLAGS for real compilation. */
1406 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1408 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1411 #endif /* not THIS_IS_CONFIGURE */
1414 # The value of CPP is a quoted variable reference, so we need to do this
1415 # to get its actual value...
1416 CPP=`eval "echo $CPP"`
1418 eval `${CPP} -Isrc ${tempcname} \
1419 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1420 if test "x$SPECIFIED_CFLAGS" = x; then
1421 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1422 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1424 REAL_CFLAGS="$CFLAGS"
1426 changequote([, ])dnl
1429 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1431 ### Compute the unexec source name from the object name.
1432 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1434 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1435 # Assume not, until told otherwise.
1438 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1439 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1440 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1441 emacs_cv_var___after_morecore_hook,
1442 AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1443 emacs_cv_var___after_morecore_hook=yes,
1444 emacs_cv_var___after_morecore_hook=no))
1445 if test $emacs_cv_var___after_morecore_hook = no; then
1448 if test "${system_malloc}" = "yes"; then
1451 (The GNU allocators don't work with this system configuration.)"
1453 if test "$doug_lea_malloc" = "yes" ; then
1454 if test "$GNU_MALLOC" = yes ; then
1456 (Using Doug Lea's new malloc from the GNU C Library.)"
1458 AC_DEFINE(DOUG_LEA_MALLOC)
1461 if test x"${REL_ALLOC}" = x; then
1462 REL_ALLOC=${GNU_MALLOC}
1468 #### Add the libraries to LIBS and check for some functions.
1470 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1471 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1473 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1476 LIBS="$libsrc_libs $LIBS"
1478 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1479 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1480 AC_CHECK_LIB(dnet, dnet_ntoa)
1481 dnl This causes -lresolv to get used in subsequent tests,
1482 dnl which causes failures on some systems such as HPUX 9.
1483 dnl AC_CHECK_LIB(resolv, gethostbyname)
1485 dnl FIXME replace main with a function we actually want from this library.
1486 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1488 AC_CHECK_LIB(pthreads, cma_open)
1490 AC_MSG_CHECKING(for XFree86 in /usr/X386)
1491 if test -d /usr/X386/include; then
1493 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1497 AC_MSG_RESULT($HAVE_XFREE386)
1499 # Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1500 # for the tests that follow. We set it back to REAL_CFLAGS later on.
1502 if test "${HAVE_X11}" = "yes"; then
1503 DEFS="$C_SWITCH_X_SITE $DEFS"
1504 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1506 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1508 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1509 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1510 # but it's more convenient here to set LD_RUN_PATH
1511 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1512 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1513 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1517 if test "${opsys}" = "gnu-linux"; then
1518 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1520 [XOpenDisplay ("foo");],
1521 [xlinux_first_failure=no],
1522 [xlinux_first_failure=yes])
1523 if test "${xlinux_first_failure}" = "yes"; then
1524 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1525 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1526 OLD_CPPFLAGS="$CPPFLAGS"
1528 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1529 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1530 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1531 LIBS="$LIBS -b i486-linuxaout"
1533 [XOpenDisplay ("foo");],
1534 [xlinux_second_failure=no],
1535 [xlinux_second_failure=yes])
1536 if test "${xlinux_second_failure}" = "yes"; then
1537 # If we get the same failure with -b, there is no use adding -b.
1538 # So take it out. This plays safe.
1539 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1540 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1541 CPPFLAGS="$OLD_CPPFLAGS"
1552 AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
1553 XScreenNumberOfScreen XSetWMProtocols)
1556 if test "${window_system}" = "x11"; then
1557 AC_MSG_CHECKING(X11 version 6)
1558 AC_CACHE_VAL(emacs_cv_x11_version_6,
1559 AC_TRY_LINK([#include <X11/Xlib.h>],
1560 [#if XlibSpecificationRelease < 6
1563 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no))
1564 if test $emacs_cv_x11_version_6 = yes; then
1565 AC_MSG_RESULT(6 or newer)
1566 AC_DEFINE(HAVE_X11R6)
1568 AC_MSG_RESULT(before 6)
1572 if test "${window_system}" = "x11"; then
1573 AC_MSG_CHECKING(X11 version 5)
1574 AC_CACHE_VAL(emacs_cv_x11_version_5,
1575 AC_TRY_LINK([#include <X11/Xlib.h>],
1576 [#if XlibSpecificationRelease < 5
1579 ], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no))
1580 if test $emacs_cv_x11_version_5 = yes; then
1581 AC_MSG_RESULT(5 or newer)
1583 AC_DEFINE(HAVE_X11R5)
1586 AC_MSG_RESULT(before 5)
1590 dnl Do not put whitespace before the #include statements below.
1591 dnl Older compilers (eg sunos4 cc) choke on it.
1592 if test x"${USE_X_TOOLKIT}" = xmaybe; then
1593 if test x"${HAVE_X11R5}" = xyes; then
1594 AC_MSG_CHECKING(X11 version 5 with Xaw)
1595 AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
1597 #include <X11/Intrinsic.h>
1598 #include <X11/Xaw/Simple.h>],
1600 emacs_cv_x11_version_5_with_xaw=yes,
1601 emacs_cv_x11_version_5_with_xaw=no))
1602 if test $emacs_cv_x11_version_5_with_xaw = yes; then
1603 AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
1606 AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1614 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1616 if test "${USE_X_TOOLKIT}" != "none"; then
1617 AC_MSG_CHECKING(X11 toolkit version)
1618 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
1619 AC_TRY_LINK([#include <X11/Intrinsic.h>],
1620 [#if XtSpecificationRelease < 6
1623 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no))
1624 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1625 if test $emacs_cv_x11_toolkit_version_6 = yes; then
1626 AC_MSG_RESULT(6 or newer)
1627 AC_DEFINE(HAVE_X11XTR6)
1629 AC_MSG_RESULT(before 6)
1632 dnl If using toolkit, check whether libXmu.a exists.
1633 dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
1635 if test x$HAVE_X11XTR6 = xyes; then
1636 LIBS="-lXt -lSM -lICE $LIBS"
1640 AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
1644 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1645 AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
1646 AC_TRY_COMPILE([#include <Xm/Xm.h>],
1647 [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
1650 Motif version prior to 2.1.
1652 emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no))
1653 HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
1654 if test $emacs_cv_motif_version_2_1 = yes; then
1655 AC_DEFINE(HAVE_MOTIF_2_1)
1656 AC_CHECK_LIB(Xp, XpCreateContext)
1660 ### Is -lXaw3d available?
1662 if test "${HAVE_X11}" = "yes"; then
1663 if test "${USE_X_TOOLKIT}" != "none"; then
1664 old_c_flags="${CFLAGS}"
1665 CFLAGS="${LD_SWITCH_X_SITE}"
1666 AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
1667 AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes, , -lX11))
1668 CFLAGS="${old_c_flags}"
1670 if test "${HAVE_XAW3D}" = "yes"; then
1671 AC_DEFINE(HAVE_XAW3D)
1676 dnl Use toolkit scroll bars if configured for X toolkit and either
1677 dnl using Motif or Xaw3d is available, and unless
1678 dnl --with-toolkit-scroll-bars=no was specified.
1680 USE_TOOLKIT_SCROLL_BARS=no
1681 if test "${with_toolkit_scroll_bars}" != "no"; then
1682 if test "${USE_X_TOOLKIT}" != "none"; then
1683 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1684 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1686 USE_TOOLKIT_SCROLL_BARS=yes
1687 elif test "${HAVE_XAW3D}" = "yes"; then
1688 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1689 USE_TOOLKIT_SCROLL_BARS=yes
1694 ### Use -lXpm if available, unless `--with-xpm=no'.
1696 if test "${HAVE_X11}" = "yes"; then
1697 if test "${with_xpm}" != "no"; then
1698 old_c_flags="${CFLAGS}"
1699 CFLAGS="${LD_SWITCH_X_SITE}"
1700 AC_CHECK_HEADER(X11/xpm.h,
1701 AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
1702 CFLAGS="${old_c_flags}"
1705 if test "${HAVE_XPM}" = "yes"; then
1710 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1712 if test "${HAVE_X11}" = "yes"; then
1713 if test "${with_jpeg}" != "no"; then
1714 old_c_flags="${CFLAGS}"
1715 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
1716 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes, , -lX11)
1717 CFLAGS="${old_c_flags}"
1720 if test "${HAVE_JPEG}" = "yes"; then
1721 AC_DEFINE(HAVE_JPEG)
1725 ### Use -lpng if available, unless `--with-png=no'.
1727 if test "${HAVE_X11}" = "yes"; then
1728 if test "${with_png}" != "no"; then
1729 old_c_flags="${CFLAGS}"
1730 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
1731 AC_CHECK_HEADER(png.h,
1732 AC_CHECK_LIB(png, png_set_expand, HAVE_PNG=yes, , -lX11 -lz -lm))
1733 CFLAGS="${old_c_flags}"
1736 if test "${HAVE_PNG}" = "yes"; then
1741 ### Use -ltiff if available, unless `--with-tiff=no'.
1743 if test "${HAVE_X11}" = "yes"; then
1744 if test "${with_tiff}" != "no"; then
1745 old_c_flags="${CFLAGS}"
1746 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
1747 AC_CHECK_HEADER(tiffio.h,
1748 AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , -lX11 -lm))
1749 CFLAGS="${old_c_flags}"
1752 if test "${HAVE_TIFF}" = "yes"; then
1753 AC_DEFINE(HAVE_TIFF)
1757 ### Use -lgif if available, unless `--with-gif=no'.
1759 if test "${HAVE_X11}" = "yes"; then
1760 if test "${with_gif}" != "no"; then
1761 old_c_flags="${CFLAGS}"
1762 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
1763 AC_CHECK_HEADER(gif_lib.h,
1764 AC_CHECK_LIB(ungif, DGifOpenFileName, HAVE_GIF=yes, , -lX11))
1765 CFLAGS="${old_c_flags}"
1768 if test "${HAVE_GIF}" = "yes"; then
1773 # If netdb.h doesn't declare h_errno, we must declare it by hand.
1774 AC_CACHE_CHECK(whether netdb declares h_errno,
1775 emacs_cv_netdb_declares_h_errno,
1776 AC_TRY_LINK([#include <netdb.h>],
1778 emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no))
1779 if test $emacs_cv_netdb_declares_h_errno = yes; then
1780 AC_DEFINE(HAVE_H_ERRNO)
1785 # fmod, logb, and frexp are found in -lm on most systems.
1786 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
1787 AC_CHECK_LIB(m, sqrt)
1789 # Check for mail-locking functions in a "mail" library
1790 AC_CHECK_LIB(mail, maillock)
1791 dnl Debian, at least:
1792 dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)])
1793 AC_CHECK_LIB(lockfile, maillock)
1794 # If we have the shared liblockfile, assume we must use it for mail
1795 # locking (e.g. Debian). If we couldn't link against liblockfile
1796 # (no liblockfile.a installed), ensure that we don't need to.
1797 if test "$ac_cv_lib_lockfile_maillock" = no; then
1798 dnl This works for files generally, not just executables.
1799 dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
1800 AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
1801 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
1802 if test $ac_cv_prog_liblockfile = yes; then
1803 AC_MSG_ERROR([Shared liblockfile found but can't link against it.
1804 This probably means that movemail could lose mail.
1805 There may be a \`development' package to install containing liblockfile.])
1806 else AC_DEFINE(LIBMAIL, -llockfile)
1810 AC_CHECK_FUNCS(touchlock)
1811 AC_CHECK_HEADERS(maillock.h)
1813 AC_CHECK_FUNCS(gettimeofday gethostname getdomainname dup2 \
1814 rename closedir mkdir rmdir sysinfo \
1815 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
1816 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
1817 utimes setrlimit setpgid getcwd shutdown strftime getaddrinfo \
1818 __fpending ftello getloadavg mblen mbrlen strsignal setitimer ualarm)
1820 # Check this now, so that we will NOT find the above functions in ncurses.
1821 # That is because we have not set up to link ncurses in lib-src.
1822 # It's better to believe a function is not available
1823 # than to expect to find it in ncurses.
1824 AC_CHECK_LIB(ncurses, tparm)
1826 # These tell us which Kerberos-related libraries to use.
1827 if test "${with_kerberos+set}" = set; then
1828 AC_CHECK_LIB(com_err, com_err)
1829 AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
1830 AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
1831 AC_CHECK_LIB(krb5, krb5_init_context)
1832 if test "${with_kerberos5+set}" != set; then
1833 AC_CHECK_LIB(des425, des_cbc_encrypt,,
1834 AC_CHECK_LIB(des, des_cbc_encrypt))
1835 AC_CHECK_LIB(krb4, krb_get_cred,,
1836 AC_CHECK_LIB(krb, krb_get_cred))
1839 if test "${with_kerberos5+set}" = set; then
1840 AC_CHECK_HEADERS(krb5.h)
1842 AC_CHECK_HEADERS(des.h,,
1843 AC_CHECK_HEADERS(kerberosIV/des.h,,
1844 AC_CHECK_HEADERS(kerberos/des.h)))
1845 AC_CHECK_HEADERS(krb.h,,
1846 AC_CHECK_HEADERS(kerberosIV/krb.h,,
1847 AC_CHECK_HEADERS(kerberos/krb.h)))
1849 AC_CHECK_HEADERS(com_err.h)
1852 # Solaris requires -lintl if you want strerror (which calls dgettext)
1853 # to return localized messages.
1854 AC_CHECK_LIB(intl, dgettext)
1856 AC_MSG_CHECKING(whether localtime caches TZ)
1857 AC_CACHE_VAL(emacs_cv_localtime_cache,
1858 [if test x$ac_cv_func_tzset = xyes; then
1859 AC_TRY_RUN([#include <time.h>
1860 extern char **environ;
1864 for (to = from = environ; (*to = *from); from++)
1865 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
1868 char TZ_GMT0[] = "TZ=GMT0";
1869 char TZ_PST8[] = "TZ=PST8";
1872 time_t now = time ((time_t *) 0);
1873 int hour_GMT0, hour_unset;
1874 if (putenv (TZ_GMT0) != 0)
1876 hour_GMT0 = localtime (&now)->tm_hour;
1878 hour_unset = localtime (&now)->tm_hour;
1879 if (putenv (TZ_PST8) != 0)
1881 if (localtime (&now)->tm_hour == hour_GMT0)
1884 if (localtime (&now)->tm_hour != hour_unset)
1887 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
1888 [# If we have tzset, assume the worst when cross-compiling.
1889 emacs_cv_localtime_cache=yes])
1891 # If we lack tzset, report that localtime does not cache TZ,
1892 # since we can't invalidate the cache if we don't have tzset.
1893 emacs_cv_localtime_cache=no
1895 AC_MSG_RESULT($emacs_cv_localtime_cache)
1896 if test $emacs_cv_localtime_cache = yes; then
1897 AC_DEFINE(LOCALTIME_CACHE)
1900 if test "x$HAVE_TIMEVAL" = xyes; then
1901 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
1902 emacs_cv_gettimeofday_two_arguments,
1904 #ifdef TIME_WITH_SYS_TIME
1905 #include <sys/time.h>
1908 #ifdef HAVE_SYS_TIME_H
1909 #include <sys/time.h>
1916 struct timeval time;
1917 struct timezone dummy;
1918 gettimeofday (&time, &dummy);
1920 emacs_cv_gettimeofday_two_arguments=yes,
1921 emacs_cv_gettimeofday_two_arguments=no))
1922 if test $emacs_cv_gettimeofday_two_arguments = no; then
1923 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)
1928 AC_CHECK_FUNC(socket, , ok_so_far=no)
1929 if test $ok_so_far = yes; then
1930 AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
1932 if test $ok_so_far = yes; then
1933 AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
1935 if test $ok_so_far = yes; then
1936 AC_DEFINE(HAVE_INET_SOCKETS)
1939 if test -f /usr/lpp/X11/bin/smt.exp; then
1940 AC_DEFINE(HAVE_AIX_SMT_EXP)
1943 AC_MSG_CHECKING(whether system supports dynamic ptys)
1944 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
1946 AC_DEFINE(HAVE_DEV_PTMX)
1951 # Set up the CFLAGS for real compilation, so we can substitute it.
1952 CFLAGS="$REAL_CFLAGS"
1955 #### Find out which version of Emacs this is.
1956 version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
1957 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
1958 changequote([, ])dnl
1959 if test x"${version}" = x; then
1960 AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
1963 ### Specify what sort of things we'll be editing into Makefile and config.h.
1964 ### Use configuration here uncanonicalized to avoid exceeding size limits.
1966 AC_SUBST(configuration)
1970 AC_SUBST(exec_prefix)
1973 AC_SUBST(sharedstatedir)
1974 AC_SUBST(libexecdir)
1978 AC_SUBST(locallisppath)
1980 AC_SUBST(x_default_search_path)
1982 AC_SUBST(archlibdir)
1985 AC_SUBST(c_switch_system)
1986 AC_SUBST(c_switch_machine)
1987 AC_SUBST(LD_SWITCH_X_SITE)
1988 AC_SUBST(LD_SWITCH_X_SITE_AUX)
1989 AC_SUBST(C_SWITCH_X_SITE)
1991 AC_SUBST(X_TOOLKIT_TYPE)
1996 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}")
1997 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}")
1998 AC_DEFINE_UNQUOTED(config_machfile, "${machfile}")
1999 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}")
2000 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
2001 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
2002 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE})
2003 AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC})
2005 if test "${HAVE_X_WINDOWS}" = "yes" ; then
2006 AC_DEFINE(HAVE_X_WINDOWS)
2008 if test "${USE_X_TOOLKIT}" != "none" ; then
2009 AC_DEFINE(USE_X_TOOLKIT)
2011 if test "${HAVE_X11}" = "yes" ; then
2014 if test "${HAVE_XFREE386}" = "yes" ; then
2015 AC_DEFINE(HAVE_XFREE386)
2017 if test "${HAVE_MENUS}" = "yes" ; then
2018 AC_DEFINE(HAVE_MENUS)
2020 if test "${GNU_MALLOC}" = "yes" ; then
2021 AC_DEFINE(GNU_MALLOC)
2023 if test "${REL_ALLOC}" = "yes" ; then
2024 AC_DEFINE(REL_ALLOC)
2026 if test "${LISP_FLOAT_TYPE}" = "yes" ; then
2027 AC_DEFINE(LISP_FLOAT_TYPE)
2030 #### Report on what we decided to do.
2032 Configured for \`${canonical}'.
2034 Where should the build process find the source code? ${srcdir}
2035 What operating system and machine description files should Emacs use?
2036 \`${opsysfile}' and \`${machfile}'
2037 What compiler should emacs be built with? ${CC} ${CFLAGS}
2038 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
2039 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
2040 What window system should Emacs use? ${window_system}
2041 What toolkit should Emacs use? ${USE_X_TOOLKIT}"
2043 if test -n "${x_includes}"; then
2044 echo " Where do we find X Windows header files? ${x_includes}"
2046 echo " Where do we find X Windows header files? Standard dirs"
2048 if test -n "${x_libraries}"; then
2049 echo " Where do we find X Windows libraries? ${x_libraries}"
2051 echo " Where do we find X Windows libraries? Standard dirs"
2054 echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
2055 echo " Does Emacs use -lXpm? ${HAVE_XPM}"
2056 echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
2057 echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
2058 echo " Does Emacs use -lungif? ${HAVE_GIF}"
2059 echo " Does Emacs use -lpng? ${HAVE_PNG}"
2060 echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
2063 # Remove any trailing slashes in these variables.
2065 test "${prefix}" != NONE &&
2066 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
2067 test "${exec_prefix}" != NONE &&
2068 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
2069 changequote([, ])dnl
2071 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
2072 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
2075 ### Make the necessary directories, if they don't exist.
2076 for dir in etc lisp ; do
2077 test -d ${dir} || mkdir ${dir}
2080 # Build src/Makefile from ${srcdir}/src/Makefile.c
2081 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
2082 # This must be done after src/config.h is built, since we rely on that file.
2084 changequote(, )dnl The horror, the horror.
2085 # Now get this: Some word that is part of the ${srcdir} directory name
2086 # or the ${configuration} value might, just might, happen to be an
2087 # identifier like `sun4' or `i386' or something, and be predefined by
2088 # the C preprocessor to some helpful value like 1, or maybe the empty
2089 # string. Needless to say consequent macro substitutions are less
2090 # than conducive to the makefile finding the correct directory.
2091 undefs="`echo $top_srcdir $configuration $canonical |
2092 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
2093 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
2095 changequote([, ])dnl
2097 echo creating src/epaths.h
2100 echo creating lib-src/Makefile
2102 rm -f junk.c junk1.c junk2.c
2103 sed -e '/start of cpp stuff/q' \
2104 < Makefile.c > junk1.c
2105 sed -e '1,/start of cpp stuff/d'\
2106 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
2107 < Makefile.c > junk.c
2108 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
2109 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2110 cat junk1.c junk2.c > Makefile.new
2111 rm -f junk.c junk1.c junk2.c
2112 chmod 444 Makefile.new
2113 mv -f Makefile.new Makefile
2116 echo creating src/Makefile
2118 rm -f junk.c junk1.c junk2.c
2119 sed -e '/start of cpp stuff/q' \
2120 < Makefile.c > junk1.c
2121 sed -e '1,/start of cpp stuff/d'\
2122 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
2123 < Makefile.c > junk.c
2124 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
2125 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
2126 cat junk1.c junk2.c > Makefile.new
2127 rm -f junk.c junk1.c junk2.c
2128 chmod 444 Makefile.new
2129 mv -f Makefile.new Makefile
2132 if test ! -f src/.gdbinit && test -f $top_srcdir/src/.gdbinit; then
2133 echo creating src/.gdbinit
2134 echo source $top_srcdir/src/.gdbinit > src/.gdbinit
2137 # This is how we know whether to re-run configure in certain cases.
2138 touch src/config.stamp
2140 ], [CPP="$CPP" CPPFLAGS="$CPPFLAGS"])