(vc-cvs-checkin): Pass the required argument to `error'.
[emacs.git] / configure.in
blob28c419d71418497fd755c34273767becbb71e897
1 dnl  Autoconf script for GNU Emacs
2 dnl To rebuild the `configure' script from this, execute the command
3 dnl     autoconf
4 dnl in the directory containing this script.
5 dnl
6 dnl  Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002
7 dnl  Free Software Foundation, Inc.
8 dnl
9 dnl  This file is part of GNU Emacs.
10 dnl
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.
15 dnl
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.
20 dnl
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.
26 AC_PREREQ(2.51)dnl
27 AC_INIT(src/lisp.h)
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
32 AC_ARG_PROGRAM
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'
42 AC_ARG_WITH(gcc,
43 [  --without-gcc           don't use GCC to compile Emacs if GCC is found])
44 AC_ARG_WITH(pop,
45 [  --without-pop           don't support POP mail retrieval with movemail],
46 [if test "$withval" = yes; then
47    AC_DEFINE(MAIL_USE_POP)
48 else :
49 fi],
50 AC_DEFINE(MAIL_USE_POP))
51 AC_ARG_WITH(kerberos,
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
58     with_kerberos=yes
59     AC_DEFINE(KERBEROS)
60   fi
62 AC_DEFINE(KERBEROS5)])
63 AC_ARG_WITH(hesiod,
64 [  --with-hesiod           support Hesiod to get the POP server host],
65 [AC_DEFINE(HESIOD)])
67 AC_ARG_WITH(sound,
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 ;;
77             n | no )            val=no  ;;
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 ;;
84             * )
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.])
90             ;;
91           esac
92           with_x_toolkit=$val
94 AC_ARG_WITH(xpm,
95 [  --with-xpm              use -lXpm for displaying XPM images])
96 AC_ARG_WITH(jpeg,
97 [  --with-jpeg             use -ljpeg for displaying JPEG images])
98 AC_ARG_WITH(tiff,
99 [  --with-tiff             use -ltiff for displaying TIFF images])
100 AC_ARG_WITH(gif,
101 [  --with-gif              use -lungif for displaying GIF images])
102 AC_ARG_WITH(png,
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])
107 AC_ARG_WITH(xim,
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).
115 unset CDPATH
116 case "${srcdir}" in
117   /* ) ;;
118   . )
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`"  ;
125     then
126       srcdir="$PWD"
127     else
128       srcdir="`(cd ${srcdir}; pwd)`"
129     fi
130   ;;
131   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
132 esac
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.])
144 changequote(, )dnl
145   extrasub='/^VPATH[     ]*=/c\
146 changequote([, ])dnl
147 vpath %.c $(srcdir)\
148 vpath %.h $(srcdir)\
149 vpath %.y $(srcdir)\
150 vpath %.l $(srcdir)\
151 vpath %.s $(srcdir)\
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.
161 AC_CANONICAL_HOST
162 canonical=$host
163 configuration=${host_alias-$host}
165 changequote(, )dnl
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
193   ## FreeBSD ports
194   *-*-freebsd* )
195     opsys=freebsd
196     case "${canonical}" in
197       alpha*-*-freebsd*)        machine=alpha ;;
198       i[3456]86-*-freebsd*)     machine=intel386 ;;
199     esac
200   ;;
202   ## NetBSD ports
203   *-*-netbsd* )
204     opsys=netbsd
205     case "${canonical}" in
206       alpha*-*-netbsd*) machine=alpha ;;
207       i[3456]86-*-netbsd*) machine=intel386 ;;
208       m68k-*-netbsd*)
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 ;;
219     esac
220   ;;
222   ## OpenBSD ports
223   *-*-openbsd* )
224     opsys=openbsd
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 ;;
233     esac
234   ;;
236   ## Acorn RISCiX:
237   arm-acorn-riscix1.1* )
238     machine=acorn opsys=riscix1-1
239   ;;
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
244   ;;
246   ## BSDI ports
247   *-*-bsdi* )
248     opsys=bsdi
249     case "${canonical}" in
250       i[345]86-*-bsdi*) machine=intel386 ;;
251       sparc-*-bsdi*)  machine=sparc ;;
252       powerpc-*-bsdi*)  machine=macppc ;;
253     esac
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 ;;
260     esac
261   ;;
263   ## Alliant machines
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.
269   fx80-alliant-* )
270     machine=alliant4 opsys=bsd4-2
271   ;;
272   i860-alliant-* )
273     machine=alliant-2800 opsys=bsd4-3
274   ;;
276   ## Alpha (DEC) machines.
277   alpha*-dec-osf* )
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]*)
289       opsys=osf5-0 ;;
290     esac
291   ;;
293   alpha*-*-linux-gnu* )
294     machine=alpha opsys=gnu-linux
295   ;;
297   arm*-*-linux-gnu* )
298     machine=arm opsys=gnu-linux
299   ;;
301   ppc-*-linux | \
302   powerpc-*-linux* )
303     machine=macppc opsys=gnu-linux
304   ;;
306   ## Altos 3068
307   m68*-altos-sysv* )
308     machine=altos opsys=usg5-2
309   ;;
311   ## Amdahl UTS
312   580-amdahl-sysv* )
313     machine=amdahl opsys=usg5-2-2
314   ;;
316   ## Apollo, Domain/OS
317   m68*-apollo-* )
318     machine=apollo opsys=bsd4-3
319   ;;
321   ## AT&T 3b2, 3b5, 3b15, 3b20
322   we32k-att-sysv* )
323     machine=att3b opsys=usg5-2-2
324   ;;
326   ## AT&T 3b1 - The Mighty Unix PC!
327   m68*-att-sysv* )
328     machine=7300 opsys=usg5-2-2
329   ;;
331   ## Bull dpx20
332   rs6000-bull-bosx* )
333     machine=ibmrs6000 opsys=aix3-2
334   ;;
336   ## Bull dpx2
337   m68*-bull-sysv3* )
338     machine=dpx2 opsys=usg5-3
339   ;;
341   ## Bull sps7
342   m68*-bull-sysv2* )
343     machine=sps7 opsys=usg5-2
344   ;;
346   ## CCI 5/32, 6/32 -- see "Tahoe".
348   ## Celerity
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
351   ## in touch with us!
352   celerity-celerity-bsd* )
353     machine=celerity opsys=bsd4-2
354   ;;
356   ## Clipper
357   ## What operating systems does this chip run that Emacs has been
358   ## tested on?
359   clipper-* )
360     machine=clipper
361     ## We'll use the catch-all code at the bottom to guess the
362     ## operating system.
363   ;;
365   ## Compaq Nonstop
366   mips-compaq-nonstopux* )
367     machine=nonstopux opsys=nonstopux
368     ;;
370   ## Convex
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"
375   ;;
377   ## Cubix QBx/386
378   i[3456]86-cubix-sysv* )
379     machine=intel386 opsys=usg5-3
380   ;;
382   ## Cydra 5
383   cydra*-cydrome-sysv* )
384     machine=cydra5 opsys=usg5-3
385   ;;
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
395   ;;
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
400   ;;
401   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
402     machine=aviion opsys=dgux5-4r2
403   ;;
404   m88k-dg-dgux* )
405     machine=aviion opsys=dgux
406   ;;
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
413   ;;
415   ## DECstations
416   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
417     machine=pmax opsys=bsd4-2
418   ;;
419   mips-dec-ultrix4.[12]* | mips-dec-bsd* )
420     machine=pmax opsys=bsd4-3
421   ;;
422   mips-dec-ultrix* )
423     machine=pmax opsys=ultrix4-3
424   ;;
425   mips-dec-osf* )
426     machine=pmax opsys=osf1
427   ;;
428   mips-dec-mach_bsd4.3* )
429     machine=pmax opsys=mach-bsd4-3
430   ;;
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'`"
436     then
437       if test -s /etc/167config
438       then CC="gnucc -m68040"
439       else CC="gnucc -m68881"
440       fi
441     else
442       if test -z "`type gcc | grep 'not found'`"
443       then CC=gcc
444       else CC=cc
445       fi
446     fi
447   ;;
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
454   ;;
455   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
456     machine=delta88k opsys=usg5-3
457   ;;
459   ## Dual machines
460   m68*-dual-sysv* )
461     machine=dual opsys=usg5-2
462   ;;
463   m68*-dual-uniplus* )
464     machine=dual opsys=unipl5-2
465   ;;
467   ## Elxsi 6400
468   elxsi-elxsi-sysv* )
469     machine=elxsi opsys=usg5-2
470   ;;
472   ## Encore machines
473   ns16k-encore-bsd* )
474     machine=ns16000 opsys=umax
475   ;;
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
481   pn-gould-bsd4.2* )
482     machine=gould opsys=bsd4-2
483   ;;
484   pn-gould-bsd4.3* )
485     machine=gould opsys=bsd4-3
486   ;;
487   np1-gould-bsd* )
488     machine=gould-np1 opsys=bsd4-3
489   ;;
491   ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
492   ## as far as Emacs is concerned).
493   m88k-harris-cxux* )
494     # Build needs to be different on 7.0 and later releases
495     case "`uname -r`" in
496        [56].[0-9] ) machine=nh4000 opsys=cxux ;;
497        [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
498     esac
499     NON_GNU_CPP="/lib/cpp"
500   ;;
501   ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
502   m68k-harris-cxux* )
503     machine=nh3000 opsys=cxux
504   ;;
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"
509   ;;
510   ## SR2001/SR2201 running HI-UX/MPP
511   hppa1.1-hitachi-hiuxmpp* )
512     machine=sr2k opsys=hiuxmpp
513   ;;
514   hppa1.1-hitachi-hiuxwe2* )
515     machine=sr2k opsys=hiuxwe2
516   ;;
517   ## Honeywell XPS100
518   xps*-honeywell-sysv* )
519     machine=xps100 opsys=usg5-2
520   ;;
522   ## HP 9000 series 200 or 300
523   m68*-hp-bsd* )
524     machine=hp9000s300 opsys=bsd4-3
525   ;;
526   ## HP/UX 7, 8, 9, and 10 are supported on these machines.
527   m68*-hp-hpux* )
528     case "`uname -r`" in
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 ;;
536     esac
537   ;;
539   ## HP 9000 series 700 and 800, running HP/UX
540   hppa*-hp-hpux7* )
541     machine=hp800 opsys=hpux
542   ;;
543   hppa*-hp-hpux8* )
544     machine=hp800 opsys=hpux8
545   ;;
546   hppa*-hp-hpux9shr* )
547     machine=hp800 opsys=hpux9shr
548   ;;
549   hppa*-hp-hpux9* )
550     machine=hp800 opsys=hpux9
551   ;;
552   hppa*-hp-hpux10* )
553     machine=hp800 opsys=hpux10
554   ;;
555   hppa*-hp-hpux1[1-9]* )
556     machine=hp800 opsys=hpux11
557   ;;
559   hppa*-*-linux-gnu* )
560     machine=hp800 opsys=gnu-linux
561   ;;
563   ## HP 9000 series 700 and 800, running HP/UX
564   hppa*-hp-hpux* )
565     ## Cross-compilation?  Nah!
566     case "`uname -r`" in
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 ;;
573     esac
574   ;;
575   hppa*-*-nextstep* )
576     machine=hp800 opsys=nextstep
577   ;;
579   ## Orion machines
580   orion-orion-bsd* )
581     machine=orion opsys=bsd4-2
582   ;;
583   clipper-orion-bsd* )
584     machine=orion105 opsys=bsd4-2
585   ;;
587   ## IBM machines
588   i[3456]86-ibm-aix1.1* )
589     machine=ibmps2-aix opsys=usg5-2-2
590   ;;
591   i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
592     machine=ibmps2-aix opsys=usg5-3
593   ;;
594   i370-ibm-aix*)
595     machine=ibm370aix opsys=usg5-3
596   ;;
597   s390-*-linux-gnu)
598     machine=ibms390 opsys=gnu-linux
599   ;;
600   rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1*  )
601     machine=ibmrs6000 opsys=aix3-1
602   ;;
603   rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
604     machine=ibmrs6000 opsys=aix3-2-5
605   ;;
606   rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
607     machine=ibmrs6000 opsys=aix4-1
608   ;;
609   rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2*  )
610     machine=ibmrs6000 opsys=aix4-2
611   ;;
612   rs6000-ibm-aix5.1* | powerpc-ibm-aix5.1*  )
613     machine=ibmrs6000 opsys=aix4-2
614   ;;
615   rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0*  )
616     machine=ibmrs6000 opsys=aix4
617   ;;
618   rs6000-ibm-aix4* | powerpc-ibm-aix4*  )
619     machine=ibmrs6000 opsys=aix4-1
620   ;;
621   rs6000-ibm-aix* | powerpc-ibm-aix* )
622     machine=ibmrs6000 opsys=aix3-2
623   ;;
624   romp-ibm-bsd4.3* )
625     machine=ibmrt opsys=bsd4-3
626   ;;
627   romp-ibm-bsd4.2* )
628     machine=ibmrt opsys=bsd4-2
629   ;;
630   romp-ibm-aos4.3* )
631     machine=ibmrt opsys=bsd4-3
632   ;;
633   romp-ibm-aos4.2* )
634     machine=ibmrt opsys=bsd4-2
635   ;;
636   romp-ibm-aos* )
637     machine=ibmrt opsys=bsd4-3
638   ;;
639   romp-ibm-bsd* )
640     machine=ibmrt opsys=bsd4-3
641   ;;
642   romp-ibm-aix* )
643     machine=ibmrt-aix opsys=usg5-2-2
644   ;;
646   ## Integrated Solutions `Optimum V'
647   m68*-isi-bsd4.2* )
648     machine=isi-ov opsys=bsd4-2
649   ;;
650   m68*-isi-bsd4.3* )
651     machine=isi-ov opsys=bsd4-3
652   ;;
654   ## Intel 386 machines where we do care about the manufacturer
655   i[3456]86-intsys-sysv* )
656     machine=is386 opsys=usg5-2-2
657   ;;
659   ## Prime EXL
660   i[3456]86-prime-sysv* )
661     machine=i386 opsys=usg5-3
662   ;;
664   ## Sequent Symmetry running Dynix
665   i[3456]86-sequent-bsd* )
666     machine=symmetry opsys=bsd4-3
667   ;;
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
672     NON_GNU_CPP=/lib/cpp
673   ;;
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"
680   ;;
682   ## ncr machine running svr4.3.
683   i[3456]86-ncr-sysv4.3 )
684     machine=ncr386 opsys=usg5-4-3
685   ;;
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
691   ;;
693   ## Intel Paragon OSF/1
694   i860-intel-osf1* )
695     machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
696   ;;
698   ## Intel 860
699   i860-*-sysv4* )
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.
703   ;;
705   ## Macintosh PowerPC
706   powerpc*-*-linux-gnu* )
707     machine=macppc opsys=gnu-linux
708   ;;
710   ## Masscomp machines
711   m68*-masscomp-rtu* )
712     machine=masscomp opsys=rtu
713   ;;
715   ## Megatest machines
716   m68*-megatest-bsd* )
717     machine=mega68 opsys=bsd4-2
718   ;;
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.
731   mips-mips-usg* )
732     machine=mips4
733     ## Fall through to the general code at the bottom to decide on the OS.
734   ;;
735   mips-mips-riscos4* )
736     machine=mips4 opsys=bsd4-3
737     NON_GNU_CC="cc -systype bsd43"
738     NON_GNU_CPP="cc -systype bsd43 -E"
739   ;;
740   mips-mips-riscos5* )
741     machine=mips4 opsys=riscos5
742     NON_GNU_CC="cc -systype bsd43"
743     NON_GNU_CPP="cc -systype bsd43 -E"
744   ;;
745   mips-mips-bsd* )
746     machine=mips opsys=bsd4-3
747   ;;
748   mips-mips-* )
749     machine=mips opsys=usg5-2-2
750   ;;
752   ## NeXT
753   m68*-next-* | m68k-*-nextstep* )
754     machine=m68k opsys=nextstep
755   ;;
757   ## The complete machine from National Semiconductor
758   ns32k-ns-genix* )
759     machine=ns32000 opsys=usg5-2
760   ;;
762   ## NCR machines
763   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
764     machine=tower32 opsys=usg5-2-2
765   ;;
766   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
767     machine=tower32v3 opsys=usg5-3
768   ;;
770   ## NEC EWS4800
771   mips-nec-sysv4*)
772   machine=ews4800 opsys=ux4800
773   ;;
775   ## Nixdorf Targon 31
776   m68*-nixdorf-sysv* )
777     machine=targon31 opsys=usg5-2-2
778   ;;
780   ## Nu (TI or LMI)
781   m68*-nu-sysv* )
782     machine=nu opsys=usg5-2
783   ;;
785   ## Plexus
786   m68*-plexus-sysv* )
787     machine=plexus opsys=usg5-2
788   ;;
790   ## PowerPC reference platform
791   powerpcle-*-solaris2* )
792     machine=prep
793     opsys=sol2-5
794   ;;
796   ## Pyramid machines
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
801   ;;
803   ## Sequent Balance
804   ns32k-sequent-bsd4.2* )
805     machine=sequent opsys=bsd4-2
806   ;;
807   ns32k-sequent-bsd4.3* )
808     machine=sequent opsys=bsd4-3
809   ;;
811   ## Siemens Nixdorf
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
816   ;;
818   ## Silicon Graphics machines
819   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
820   m68*-sgi-iris3.5* )
821     machine=irist opsys=iris3-5
822   ;;
823   m68*-sgi-iris3.6* | m68*-sgi-iris*)
824     machine=irist opsys=iris3-6
825   ;;
826   ## Iris 4D
827   mips-sgi-irix3* )
828     machine=iris4d opsys=irix3-3
829   ;;
830   mips-sgi-irix4* )
831     machine=iris4d opsys=irix4-0
832   ;;
833   mips-sgi-irix6.5 )
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"
840   ;;
841   mips-sgi-irix6* )
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
848   ;;
849   mips-sgi-irix5.[01]* )
850     machine=iris4d opsys=irix5-0
851   ;;
852   mips-sgi-irix5* | mips-sgi-irix* )
853     machine=iris4d opsys=irix5-2
854   ;;
856   ## SONY machines
857   m68*-sony-bsd4.2* )
858     machine=news opsys=bsd4-2
859   ;;
860   m68*-sony-bsd4.3* )
861     machine=news opsys=bsd4-3
862   ;;
863   m68*-sony-newsos3* | m68*-sony-news3*)
864     machine=news opsys=bsd4-3
865   ;;
866   mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
867     machine=news-risc opsys=bsd4-3
868   ;;
869   mips-sony-newsos6* )
870     machine=news-r6 opsys=newsos6
871   ;;
872   mips-sony-news* )
873     machine=news-risc opsys=newsos5
874   ;;
876   ## Stride
877   m68*-stride-sysv* )
878     machine=stride opsys=usg5-2
879   ;;
881   ## Suns
882   sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
883     machine=sparc opsys=gnu-linux
884   ;;
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 ;;
898       * )               unported=yes ;;
899     esac
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.
907                 opsys=sunos413
908                 NON_GNU_CPP=/usr/lib/cpp
909                 NON_GCC_TEST_OPTIONS=-Bstatic
910                 GCC_TEST_OPTIONS=-static
911                 ;;
912       *-sunos4.1.[3-9]* | *-sunos4shr*)
913                 opsys=sunos4shr
914                 NON_GNU_CPP=/usr/lib/cpp
915                 ;;
916       *-sunos4* | *-sunos )
917                 opsys=sunos4-1
918                 NON_GCC_TEST_OPTIONS=-Bstatic
919                 GCC_TEST_OPTIONS=-static
920                 ;;
921       *-sunos5.3* | *-solaris2.3* )
922                 opsys=sol2-3
923                 NON_GNU_CPP=/usr/ccs/lib/cpp
924                 ;;
925       *-sunos5.4* | *-solaris2.4* )
926                 opsys=sol2-4
927                 NON_GNU_CPP=/usr/ccs/lib/cpp
928                 RANLIB="ar -ts"
929                 ;;
930       *-sunos5.5* | *-solaris2.5* )
931                 opsys=sol2-5
932                 NON_GNU_CPP=/usr/ccs/lib/cpp
933                 RANLIB="ar -ts"
934                 ;;
935       *-sunos5* | *-solaris* )
936                 opsys=sol2-5
937                 NON_GNU_CPP=/usr/ccs/lib/cpp
938                 ;;
939       *                   ) opsys=bsd4-2   ;;
940     esac
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.
947                   unset CC
948                 fi
949                 ;;
950       *) ;;
951     esac
952   ;;
953   sparc-*-nextstep* )
954     machine=sparc opsys=nextstep
955   ;;
957   ## Tadpole 68k
958   m68*-tadpole-sysv* )
959     machine=tad68k opsys=usg5-3
960   ;;
962   ## Tahoe machines
963   tahoe-tahoe-bsd4.2* )
964     machine=tahoe opsys=bsd4-2
965   ;;
966   tahoe-tahoe-bsd4.3* )
967     machine=tahoe opsys=bsd4-3
968   ;;
970   ## Tandem Integrity S2
971   mips-tandem-sysv* )
972     machine=tandem-s2 opsys=usg5-3
973   ;;
975   ## Tektronix XD88
976   m88k-tektronix-sysv3* )
977   machine=tekxd88 opsys=usg5-3
978   ;;
980   ## Tektronix 16000 box (6130?)
981   ns16k-tektronix-bsd* )
982     machine=ns16000 opsys=bsd4-2
983   ;;
984   ## Tektronix 4300
985   ## src/m/tek4300.h hints that this is a m68k machine.
986   m68*-tektronix-bsd* )
987     machine=tek4300 opsys=bsd4-3
988   ;;
990   ## Titan P2 or P3
991   ## We seem to have lost the machine-description file titan.h!
992   titan-titan-sysv* )
993     machine=titan opsys=usg5-3
994   ;;
996   ## Ustation E30 (SS5E)
997   m68*-unisys-uniplus* )
998     machine=ustation opsystem=unipl5-2
999   ;;
1001   ## Vaxen.
1002   vax-dec-* )
1003     machine=vax
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 ;;
1011       * )                                               unported=yes
1012     esac
1013   ;;
1015   ## Whitechapel MG1
1016   ns16k-whitechapel-* )
1017     machine=mg1
1018     ## We don't know what sort of OS runs on these; we'll let the
1019     ## operating system guessing code below try.
1020   ;;
1022   ## Wicat
1023   m68*-wicat-sysv* )
1024     machine=wicat opsys=usg5-2
1025   ;;
1027   ## IA-64
1028   ia64*-*-linux* )
1029     machine=ia64 opsys=gnu-linux
1030   ;;
1032   ## Intel 386 machines where we don't care about the manufacturer
1033   i[3456]86-*-* )
1034     machine=intel386
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
1043                                 ;;
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=" "
1055                                 ;;
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.
1060     esac
1061   ;;
1063   ## m68k Linux-based GNU system
1064   m68k-*-linux-gnu* )
1065     machine=m68k opsys=gnu-linux
1066   ;;
1068   ## Mips Linux-based GNU system
1069   mips-*-linux-gnu* )
1070     machine=mips opsys=gnu-linux
1071   ;;
1073   ## UXP/DS
1074   sparc-fujitsu-sysv4* )
1075     machine=sparc opsys=uxpds
1076     NON_GNU_CPP=/usr/ccs/lib/cpp
1077     RANLIB="ar -ts"
1078   ;;
1080   ## UXP/V
1081   f301-fujitsu-uxpv4.1)
1082     machine=f301 opsys=uxpv
1083   ;;
1085   * )
1086     unported=yes
1087   ;;
1088 esac
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
1095 ### above.
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
1109         opsys=usg5-4 ;;
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
1114           else
1115             NON_GNU_CPP=/lib/cpp
1116           fi
1117         fi
1118         opsys=usg5-4-2 ;;
1119     *-sysv4* | *-sysvr4* )              opsys=usg5-4 ;;
1120     * )
1121       unported=yes
1122     ;;
1123   esac
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"
1143 case ${with_gcc} in
1144   "yes" ) CC="gcc" GCC=yes ;;
1145   "no"  ) : ${CC=cc} ;;
1146   * )
1147 esac
1148 AC_PROG_CC
1150 # On Suns, sometimes $CPP names a directory.
1151 if test -n "$CPP" && test -d "$CPP"; then
1152   CPP=
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
1159 then
1160   CPP="$NON_GNU_CPP"
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
1168 then
1169   CC="$NON_GNU_CC"
1172 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1173 then
1174   CC="$CC $GCC_TEST_OPTIONS"
1177 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1178 then
1179   CC="$CC $NON_GCC_TEST_OPTIONS"
1182 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1183 then
1184   ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1187 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1188 then
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
1197 AC_PROG_LN_S
1198 AC_PROG_CPP
1199 AC_PROG_INSTALL
1200 AC_PROG_YACC
1201 if test "x$RANLIB" = x; then
1202   AC_PROG_RANLIB
1205 dnl checks for Unix variants
1206 AC_AIX
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
1226 ### anyway.
1227 tempcname="conftest.c"
1229 echo '
1230 #include "'${srcdir}'/src/'${opsysfile}'"
1231 #include "'${srcdir}'/src/'${machfile}'"
1232 #ifndef LIBS_MACHINE
1233 #define LIBS_MACHINE
1234 #endif
1235 #ifndef LIBS_SYSTEM
1236 #define LIBS_SYSTEM
1237 #endif
1238 #ifndef C_SWITCH_SYSTEM
1239 #define C_SWITCH_SYSTEM
1240 #endif
1241 #ifndef C_SWITCH_MACHINE
1242 #define C_SWITCH_MACHINE
1243 #endif
1244 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1245 configure___ c_switch_system=C_SWITCH_SYSTEM
1246 configure___ c_switch_machine=C_SWITCH_MACHINE
1248 #ifndef LIB_X11_LIB
1249 #define LIB_X11_LIB -lX11
1250 #endif
1252 #ifndef LIBX11_MACHINE
1253 #define LIBX11_MACHINE
1254 #endif
1256 #ifndef LIBX11_SYSTEM
1257 #define LIBX11_SYSTEM
1258 #endif
1259 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1261 #ifdef UNEXEC
1262 configure___ unexec=UNEXEC
1263 #else
1264 configure___ unexec=unexec.o
1265 #endif
1267 #ifdef SYSTEM_MALLOC
1268 configure___ system_malloc=yes
1269 #else
1270 configure___ system_malloc=no
1271 #endif
1273 #ifdef USE_MMAP_FOR_BUFFERS
1274 configure___ use_mmap_for_buffers=yes
1275 #else
1276 configure___ use_mmap_for_buffers=no
1277 #endif
1279 #ifndef C_DEBUG_SWITCH
1280 #define C_DEBUG_SWITCH -g
1281 #endif
1283 #ifndef C_OPTIMIZE_SWITCH
1284 #ifdef __GNUC__
1285 #define C_OPTIMIZE_SWITCH -O2
1286 #else
1287 #define C_OPTIMIZE_SWITCH -O
1288 #endif
1289 #endif
1291 #ifndef LD_SWITCH_MACHINE
1292 #define LD_SWITCH_MACHINE
1293 #endif
1295 #ifndef LD_SWITCH_SYSTEM
1296 #define LD_SWITCH_SYSTEM
1297 #endif
1299 #ifndef LD_SWITCH_X_SITE_AUX
1300 #define LD_SWITCH_X_SITE_AUX
1301 #endif  
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.  */
1309 #ifdef __GNUC__
1310 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1311 #else
1312 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1313 #endif
1315 #else /* not THIS_IS_CONFIGURE */
1317 /* Get the CFLAGS for real compilation.  */
1318 #ifdef __GNUC__
1319 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1320 #else
1321 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1322 #endif
1324 #endif /* not THIS_IS_CONFIGURE */
1325 ' > ${tempcname}
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"`
1330 changequote(, )dnl
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'`
1336 else
1337   REAL_CFLAGS="$CFLAGS"
1339 changequote([, ])dnl
1340 rm ${tempcname}
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}"
1348 else
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.
1353 AC_SYS_LARGEFILE
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=)
1360   AC_SUBST(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)
1367 AC_HEADER_STDC
1368 AC_HEADER_TIME
1369 AC_DECL_SYS_SIGLIST
1370 AC_HEADER_SYS_WAIT
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>
1376 #include <time.h>
1377 #else
1378 #ifdef HAVE_SYS_TIME_H
1379 #include <sys/time.h>
1380 #else
1381 #include <time.h>
1382 #endif
1383 #endif
1384 #ifdef HAVE_UTIME_H
1385 #include <utime.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
1393 AC_TYPE_SIGNAL
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>
1406 #include <time.h>
1407 #else
1408 #ifdef HAVE_SYS_TIME_H
1409 #include <sys/time.h>
1410 #else
1411 #include <time.h>
1412 #endif
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
1430 AC_STRUCT_TM
1431 AC_STRUCT_TIMEZONE
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
1445 dnl and void *.
1446 AC_C_PROTOTYPES
1447 AC_C_VOLATILE
1448 AC_C_CONST
1449 dnl This isn't useful because we can't turn on use of `inline' unless
1450 dnl the compiler groks `extern inline'.
1451 dnl AC_C_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)
1457 else
1458   AC_DEFINE(POINTER_TYPE, char)
1461 dnl check for Make feature
1462 AC_PROG_MAKE_SET
1464 dnl checks for operating system services
1465 AC_SYS_LONG_FILE_NAMES
1467 #### Choose a window system.
1469 AC_PATH_X
1470 if test "$no_x" = yes; then
1471   window_system=none
1472 else
1473   window_system=x11
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
1481     x_search_path="\
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}
1490     else
1491       x_default_search_path="${x_search_path}:${x_default_search_path}"
1492     fi
1493   done
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
1501 else
1502   # accumulate include directories that have X11 bitmap subdirectories
1503   bmd_acc="dummyval"
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"
1507     fi
1508     if test -d "${bmd}/bitmaps"; then
1509       bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1510     fi
1511   done
1512   if test ${bmd_acc} != "dummyval"; then
1513     bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1514   fi
1517 case "${window_system}" in
1518   x11 )
1519     HAVE_X_WINDOWS=yes
1520     HAVE_X11=yes
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 ;;
1529     esac
1530   ;;
1531   none )
1532     HAVE_X_WINDOWS=no
1533     HAVE_X11=no
1534     USE_X_TOOLKIT=none
1535   ;;
1536 esac
1538 ### If we're using X11, we should use the X menu package.
1539 HAVE_MENUS=no
1540 case ${HAVE_X11} in
1541   yes ) HAVE_MENUS=yes ;;
1542 esac
1543   
1544 if test "${opsys}" = "hpux9"; then
1545   case "${x_libraries}" in
1546     *X11R4* )
1547       opsysfile="s/hpux9-x11r4.h"
1548       ;;
1549   esac
1552 if test "${opsys}" = "hpux9shr"; then
1553   case "${x_libraries}" in
1554     *X11R4* )
1555       opsysfile="s/hpux9shxr4.h"
1556       ;;
1557   esac
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.
1565 GNU_MALLOC=yes
1566 doug_lea_malloc=yes
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
1575   doug_lea_malloc=no
1577 if test "${system_malloc}" = "yes"; then
1578   GNU_MALLOC=no
1579   GNU_MALLOC_reason="
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
1584     GNU_MALLOC_reason="
1585       (Using Doug Lea's new malloc from the GNU C Library.)"
1586   fi
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.
1598 AC_FUNC_MMAP
1599 if test $use_mmap_for_buffers = yes; then
1600   REL_ALLOC=no
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
1619   HAVE_XFREE386=yes
1620   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1621 else
1622   HAVE_XFREE386=no
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"
1634   LIBS="$LIBX $LIBS"
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
1644     export LD_RUN_PATH
1645   fi
1647   if test "${opsys}" = "gnu-linux"; then
1648     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1649     AC_TRY_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"
1657       OLD_LIBS="$LIBS"
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"
1662       AC_TRY_LINK([],
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"
1672         LIBS="$OLD_LIBS"
1673         AC_MSG_RESULT(no)
1674       else
1675         AC_MSG_RESULT(yes)
1676       fi
1677     else
1678       AC_MSG_RESULT(no)
1679     fi
1680   fi
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)
1692   fi
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
1703 fail;
1704 #endif
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)
1709   else
1710     AC_MSG_RESULT(before 6)
1711   fi
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
1719 fail;
1720 #endif
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)
1724     HAVE_X11R5=yes
1725     AC_DEFINE(HAVE_X11R5)
1726   else
1727     HAVE_X11R5=no
1728     AC_MSG_RESULT(before 5)
1729   fi
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,
1738     [AC_TRY_LINK([
1739 #include <X11/Intrinsic.h>
1740 #include <X11/Xaw/Simple.h>],
1741       [],
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])
1746       USE_X_TOOLKIT=LUCID
1747     else
1748       AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1749       USE_X_TOOLKIT=none
1750     fi
1751   else
1752     USE_X_TOOLKIT=none
1753   fi
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
1763 fail;
1764 #endif
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)
1770   else
1771     AC_MSG_RESULT(before 6)
1772   fi
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.
1776   OLDLIBS="$LIBS"
1777   if test x$HAVE_X11XTR6 = xyes; then
1778     LIBS="-lXt -lSM -lICE $LIBS"
1779   else
1780     LIBS="-lXt $LIBS"
1781   fi
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)
1790   fi
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)
1797 int x = 5;
1798 #else
1799 Motif version prior to 2.1.
1800 #endif],
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
1804     HAVE_LIBXP=no
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)
1809     fi  
1810   fi
1813 ### Is -lXaw3d available?
1814 HAVE_XAW3D=no
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)
1821     fi
1822   fi
1824   
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)
1834       HAVE_XAW3D=no
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
1839     fi
1840   fi
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
1847   AC_DEFINE(USE_XIM)
1850 ### Use -lXpm if available, unless `--with-xpm=no'.
1851 HAVE_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
1862 #endif
1863       ], HAVE_XPM=no, HAVE_XPM=yes)
1865       if test "${HAVE_XPM}" = "yes"; then
1866         AC_MSG_RESULT(yes)
1867       else
1868         AC_MSG_RESULT(no)
1869       fi
1870     fi
1871   fi
1873   if test "${HAVE_XPM}" = "yes"; then
1874     AC_DEFINE(HAVE_XPM)
1875   fi
1877   
1878 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1879 HAVE_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
1883     dnl  HAVE_STDLIB_H.
1884     AC_CHECK_HEADER(jerror.h,
1885       AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
1886   fi
1888   if test "${HAVE_JPEG}" = "yes"; then
1889     AC_DEFINE(HAVE_JPEG)
1890     AC_EGREP_CPP(
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
1896 ],    
1897         AC_DEFINE(HAVE_JPEG),
1898         [AC_MSG_WARN([libjpeg found, but not version 6b or later])
1899         HAVE_JPEG=no])
1900   fi
1902   
1903 ### Use -lpng if available, unless `--with-png=no'.
1904 HAVE_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))
1909   fi
1911   if test "${HAVE_PNG}" = "yes"; then
1912     AC_DEFINE(HAVE_PNG)
1913   fi
1915   
1916 ### Use -ltiff if available, unless `--with-tiff=no'.
1917 HAVE_TIFF=no
1918 if test "${HAVE_X11}" = "yes"; then
1919   if test "${with_tiff}" != "no"; then
1920     AC_CHECK_HEADER(tiffio.h,
1921       tifflibs="-lz -lm"
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))
1925   fi
1927   if test "${HAVE_TIFF}" = "yes"; then
1928     AC_DEFINE(HAVE_TIFF)
1929   fi
1931   
1932 ### Use -lgif if available, unless `--with-gif=no'.
1933 HAVE_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))
1940   fi
1942   if test "${HAVE_GIF}" = "yes"; then
1943     AC_DEFINE(HAVE_GIF)
1944   fi
1947 ### Use session management (-lSM -lICE) if available
1948 HAVE_X_SM=no
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)
1955     case "$LIBS" in
1956       *-lSM*) ;;
1957       *)      LIBS="-lSM -lICE $LIBS" ;;
1958     esac
1959   fi
1961   
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>],
1966   [return h_errno;],
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)
1972 AC_FUNC_ALLOCA
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)
1996   fi
1997   else :
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)
2013 AC_FUNC_MKTIME
2014 if test "$ac_cv_func_working_mktime" = no; then
2015   AC_DEFINE(BROKEN_MKTIME)
2018 AC_FUNC_GETLOADAVG
2020 AC_FUNC_FSEEKO
2022 # UNIX98 PTYs.
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.
2037   resolv=no
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
2042     RESOLVLIB=-lresolv
2043     AC_DEFINE(HAVE_LIBRESOLV)
2044   else
2045     RESOLVLIB=
2046   fi
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))
2062   fi
2064   if test "${with_kerberos5+set}" = set; then
2065     AC_CHECK_HEADERS(krb5.h)
2066   else
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)])])
2073   fi
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;
2086 unset_TZ ()
2088   char **from, **to;
2089   for (to = from = environ; (*to = *from); from++)
2090     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2091       to++;
2093 char TZ_GMT0[] = "TZ=GMT0";
2094 char TZ_PST8[] = "TZ=PST8";
2095 main()
2097   time_t now = time ((time_t *) 0);
2098   int hour_GMT0, hour_unset;
2099   if (putenv (TZ_GMT0) != 0)
2100     exit (1);
2101   hour_GMT0 = localtime (&now)->tm_hour;
2102   unset_TZ ();
2103   hour_unset = localtime (&now)->tm_hour;
2104   if (putenv (TZ_PST8) != 0)
2105     exit (1);
2106   if (localtime (&now)->tm_hour == hour_GMT0)
2107     exit (1);
2108   unset_TZ ();
2109   if (localtime (&now)->tm_hour != hour_unset)
2110     exit (1);
2111   exit (0);
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])
2115 else
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
2119 fi])dnl
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,
2129   [AC_TRY_COMPILE([
2130 #ifdef TIME_WITH_SYS_TIME
2131 #include <sys/time.h>
2132 #include <time.h>
2133 #else
2134 #ifdef HAVE_SYS_TIME_H
2135 #include <sys/time.h>
2136 #else
2137 #include <time.h>
2138 #endif
2139 #endif],
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)
2146   fi
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.
2157     [AC_TRY_RUN([
2158 #ifdef TIME_WITH_SYS_TIME
2159 #include <sys/time.h>
2160 #include <time.h>
2161 #else
2162 #ifdef HAVE_SYS_TIME_H
2163 #include <sys/time.h>
2164 #else
2165 #include <time.h>
2166 #endif
2167 #endif
2168 main () {
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)])
2178 ok_so_far=yes
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
2196   AC_MSG_RESULT(yes)
2197   AC_DEFINE(HAVE_DEV_PTMX)
2198 else
2199   AC_MSG_RESULT(no)
2202 AC_FUNC_FORK
2204 # Fixme: This should be replaced when we have autoconf 2.14.
2205 AC_SIZE_T
2207 # Set up the CFLAGS for real compilation, so we can substitute it.
2208 CFLAGS="$REAL_CFLAGS"
2209 CPPFLAGS="$REAL_CPPFLAGS"
2211 changequote(, )dnl
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.
2222 AC_SUBST(version)
2223 AC_SUBST(configuration)
2224 AC_SUBST(canonical)
2225 AC_SUBST(srcdir)
2226 AC_SUBST(prefix)
2227 AC_SUBST(exec_prefix)
2228 AC_SUBST(bindir)
2229 AC_SUBST(datadir)
2230 AC_SUBST(sharedstatedir)
2231 AC_SUBST(libexecdir)
2232 AC_SUBST(mandir)
2233 AC_SUBST(infodir)
2234 AC_SUBST(lispdir)
2235 AC_SUBST(locallisppath)
2236 AC_SUBST(lisppath)
2237 AC_SUBST(x_default_search_path)
2238 AC_SUBST(etcdir)
2239 AC_SUBST(archlibdir)
2240 AC_SUBST(docdir)
2241 AC_SUBST(bitmapdir)
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)
2247 AC_SUBST(CFLAGS)
2248 AC_SUBST(X_TOOLKIT_TYPE)
2249 AC_SUBST(machfile)
2250 AC_SUBST(opsysfile)
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
2269   AC_DEFINE(HAVE_X11)
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.
2288 echo "
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}"
2303 else
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}"
2308 else
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}"
2319 echo
2321 # Remove any trailing slashes in these variables.
2322 changequote(, )dnl
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
2332 ## C preprocessor.
2334 AC_EGREP_CPP(yes..yes,
2335         [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}
2346 done
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
2376 ( cd lib-src
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
2392 ( cd src
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"])