(save-some-buffers): Turn EXITING into the more general
[emacs.git] / configure.in
blobaa761ff02c2bec256e099dfa44d49405d44a2ab3
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 Free Software Foundation, Inc.
7 dnl
8 dnl  This file is part of GNU Emacs.
9 dnl
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.
14 dnl
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.
19 dnl
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.
25 AC_PREREQ(2.8)dnl
26 AC_INIT(src/lisp.h)
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'
37 AC_ARG_WITH(gcc,
38 [  --without-gcc           don't use GCC to compile Emacs if GCC is found])
39 AC_ARG_WITH(pop,
40 [  --without-pop           don't support POP mail retrieval with movemail],
41 [if test "$withval" = yes; then
42    AC_DEFINE(MAIL_USE_POP)
43 else :
44 fi],
45 AC_DEFINE(MAIL_USE_POP))
46 AC_ARG_WITH(kerberos,
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
53     with_kerberos=yes
54     AC_DEFINE(KERBEROS)
55   fi
57 AC_DEFINE(KERBEROS5)])
58 AC_ARG_WITH(hesiod,
59 [  --with-hesiod           support Hesiod to get the POP server host],
60 [AC_DEFINE(HESIOD)])
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 ;;
68             n | no )            val=no  ;;
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 ;;
75             * )
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.])
81             ;;
82           esac
83           with_x_toolkit=$val
85 AC_ARG_WITH(xpm,
86 [  --with-xpm              use -lXpm for displaying XPM images])
87 AC_ARG_WITH(jpeg,
88 [  --with-jpeg             use -ljpeg for displaying JPEG images])
89 AC_ARG_WITH(tiff,
90 [  --with-tiff             use -ltiff for displaying TIFF images])
91 AC_ARG_WITH(gif,
92 [  --with-gif              use -lungif for displaying GIF images])
93 AC_ARG_WITH(png,
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.
102 case "${srcdir}" in
103   /* ) ;;
104   . )
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).
108     unset CDPATH
109     if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`"  ;
110     then
111       srcdir="$PWD"
112     else
113       srcdir="`(cd ${srcdir}; pwd)`"
114     fi
115   ;;
116   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
117 esac
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.])
129 changequote(, )dnl
130   extrasub='/^VPATH[     ]*=/c\
131 changequote([, ])dnl
132 vpath %.c $(srcdir)\
133 vpath %.h $(srcdir)\
134 vpath %.y $(srcdir)\
135 vpath %.l $(srcdir)\
136 vpath %.s $(srcdir)\
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.
146 AC_CANONICAL_HOST
147 canonical=$host
148 configuration=$host_alias
150 changequote(, )dnl
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
178   ## NetBSD ports
179   *-*-netbsd* )
180     opsys=netbsd
181     case "${canonical}" in
182       alpha*-*-netbsd*) machine=alpha ;;
183       i[3456]86-*-netbsd*) machine=intel386 ;;
184       m68k-*-netbsd*)
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 ;;
192     esac
193   ;;
195   ## OpenBSD ports
196   *-*-openbsd* )
197     opsys=openbsd
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 ;;
206     esac
207   ;;
209   ## Acorn RISCiX:
210   arm-acorn-riscix1.1* )
211     machine=acorn opsys=riscix1-1
212   ;;
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
217   ;;
219   ## BSDI ports
220   *-*-bsdi* )
221     opsys=bsdi
222     case "${canonical}" in
223       i[345]86-*-bsdi*) machine=intel386 ;;
224       sparc-*-bsdi*)  machine=sparc ;;
225       powerpc-*-bsdi*)  machine=powerpc ;;
226     esac
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 ;;
233     esac
234   ;;
236   ## Alliant machines
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.
242   fx80-alliant-* )
243     machine=alliant4 opsys=bsd4-2
244   ;;
245   i860-alliant-* )
246     machine=alliant-2800 opsys=bsd4-3
247   ;;
249   ## Alpha (DEC) machines.
250   alpha*-dec-osf* )
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
255   ;;
257   alpha*-*-linux-gnu* )
258     machine=alpha opsys=gnu-linux
259   ;;
261   arm*-*-linux-gnu* )
262     machine=arm opsys=gnu-linux
263   ;;
265   ppc-*-linux | \
266   powerpc-*-linux* )
267     machine=powerpc opsys=gnu-linux
268   ;;
270   ## Altos 3068
271   m68*-altos-sysv* )
272     machine=altos opsys=usg5-2
273   ;;
275   ## Amdahl UTS
276   580-amdahl-sysv* )
277     machine=amdahl opsys=usg5-2-2
278   ;;
280   ## Apollo, Domain/OS
281   m68*-apollo-* )
282     machine=apollo opsys=bsd4-3
283   ;;
285   ## ARM, GNU/Linux
286   arm*-*-linux-gnu* )
287     machine=arm opsys=gnu-linux
288   ;;
290   ## AT&T 3b2, 3b5, 3b15, 3b20
291   we32k-att-sysv* )
292     machine=att3b opsys=usg5-2-2
293   ;;
295   ## AT&T 3b1 - The Mighty Unix PC!
296   m68*-att-sysv* )
297     machine=7300 opsys=usg5-2-2
298   ;;
300   ## Bull dpx20
301   rs6000-bull-bosx* )
302     machine=ibmrs6000 opsys=aix3-2
303   ;;
305   ## Bull dpx2
306   m68*-bull-sysv3* )
307     machine=dpx2 opsys=usg5-3
308   ;;
310   ## Bull sps7
311   m68*-bull-sysv2* )
312     machine=sps7 opsys=usg5-2
313   ;;
315   ## CCI 5/32, 6/32 -- see "Tahoe".
317   ## Celerity
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
320   ## in touch with us!
321   celerity-celerity-bsd* )
322     machine=celerity opsys=bsd4-2
323   ;;
325   ## Clipper
326   ## What operating systems does this chip run that Emacs has been
327   ## tested on?
328   clipper-* )
329     machine=clipper
330     ## We'll use the catch-all code at the bottom to guess the
331     ## operating system.
332   ;;
334   ## Convex
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"
339   ;;
341   ## Cubix QBx/386
342   i[3456]86-cubix-sysv* )
343     machine=intel386 opsys=usg5-3
344   ;;
346   ## Cydra 5
347   cydra*-cydrome-sysv* )
348     machine=cydra5 opsys=usg5-3
349   ;;
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
359   ;;
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
364   ;;
365   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
366     machine=aviion opsys=dgux5-4r2
367   ;;
368   m88k-dg-dgux* )
369     machine=aviion opsys=dgux
370   ;;
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
377   ;;
379   ## DECstations
380   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
381     machine=pmax opsys=bsd4-2
382   ;;
383   mips-dec-ultrix4.[12]* | mips-dec-bsd* )
384     machine=pmax opsys=bsd4-3
385   ;;
386   mips-dec-ultrix* )
387     machine=pmax opsys=ultrix4-3
388   ;;
389   mips-dec-osf* )
390     machine=pmax opsys=osf1
391   ;;
392   mips-dec-mach_bsd4.3* )
393     machine=pmax opsys=mach-bsd4-3
394   ;;
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'`"
400     then
401       if test -s /etc/167config
402       then CC="gnucc -m68040"
403       else CC="gnucc -m68881"
404       fi
405     else
406       if test -z "`type gcc | grep 'not found'`"
407       then CC=gcc
408       else CC=cc
409       fi
410     fi
411   ;;
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
418   ;;
419   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
420     machine=delta88k opsys=usg5-3
421   ;;
423   ## Dual machines
424   m68*-dual-sysv* )
425     machine=dual opsys=usg5-2
426   ;;
427   m68*-dual-uniplus* )
428     machine=dual opsys=unipl5-2
429   ;;
431   ## Elxsi 6400
432   elxsi-elxsi-sysv* )
433     machine=elxsi opsys=usg5-2
434   ;;
436   ## Encore machines
437   ns16k-encore-bsd* )
438     machine=ns16000 opsys=umax
439   ;;
441   ## The GEC 93 - apparently, this port isn't really finished yet.
443   ## Gould Power Node and NP1
444   pn-gould-bsd4.2* )
445     machine=gould opsys=bsd4-2
446   ;;
447   pn-gould-bsd4.3* )
448     machine=gould opsys=bsd4-3
449   ;;
450   np1-gould-bsd* )
451     machine=gould-np1 opsys=bsd4-3
452   ;;
454   ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
455   ## as far as Emacs is concerned).
456   m88k-harris-cxux* )
457     # Build needs to be different on 7.0 and later releases
458     case "`uname -r`" in
459        [56].[0-9] ) machine=nh4000 opsys=cxux ;;
460        [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
461     esac
462     NON_GNU_CPP="/lib/cpp"
463   ;;
464   ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
465   m68k-harris-cxux* )
466     machine=nh3000 opsys=cxux
467   ;;
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"
472   ;;
473   ## SR2001/SR2201 running HI-UX/MPP
474   hppa1.1-hitachi-hiuxmpp* )
475     machine=sr2k opsys=hiuxmpp
476   ;;
477   ## Honeywell XPS100
478   xps*-honeywell-sysv* )
479     machine=xps100 opsys=usg5-2
480   ;;
482   ## HP 9000 series 200 or 300
483   m68*-hp-bsd* )
484     machine=hp9000s300 opsys=bsd4-3
485   ;;
486   ## HP/UX 7, 8, 9, and 10 are supported on these machines.
487   m68*-hp-hpux* )
488     case "`uname -r`" in
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 ;;
496     esac
497   ;;
499   ## HP 9000 series 700 and 800, running HP/UX
500   hppa*-hp-hpux7* )
501     machine=hp800 opsys=hpux
502   ;;
503   hppa*-hp-hpux8* )
504     machine=hp800 opsys=hpux8
505   ;;
506   hppa*-hp-hpux9shr* )
507     machine=hp800 opsys=hpux9shr
508   ;;
509   hppa*-hp-hpux9* )
510     machine=hp800 opsys=hpux9
511   ;;
512   hppa*-hp-hpux1[0-9]* )
513     machine=hp800 opsys=hpux10
514   ;;
516   ## HP 9000 series 700 and 800, running HP/UX
517   hppa*-hp-hpux* )
518     ## Cross-compilation?  Nah!
519     case "`uname -r`" in
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 ;;
526     esac
527   ;;
528   hppa*-*-nextstep* )
529     machine=hp800 opsys=nextstep
530   ;;
532   ## Orion machines
533   orion-orion-bsd* )
534     machine=orion opsys=bsd4-2
535   ;;
536   clipper-orion-bsd* )
537     machine=orion105 opsys=bsd4-2
538   ;;
540   ## IBM machines
541   i[3456]86-ibm-aix1.1* )
542     machine=ibmps2-aix opsys=usg5-2-2
543   ;;
544   i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
545     machine=ibmps2-aix opsys=usg5-3
546   ;;
547   i370-ibm-aix*)
548     machine=ibm370aix opsys=usg5-3
549   ;;
550   rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1*  )
551     machine=ibmrs6000 opsys=aix3-1
552   ;;
553   rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
554     machine=ibmrs6000 opsys=aix3-2-5
555   ;;
556   rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
557     machine=ibmrs6000 opsys=aix4-1
558   ;;
559   rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2*  )
560     machine=ibmrs6000 opsys=aix4-2
561   ;;
562   rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0*  )
563     machine=ibmrs6000 opsys=aix4
564   ;;
565   rs6000-ibm-aix4* | powerpc-ibm-aix4*  )
566     machine=ibmrs6000 opsys=aix4-1
567   ;;
568   rs6000-ibm-aix* | powerpc-ibm-aix* )
569     machine=ibmrs6000 opsys=aix3-2
570   ;;
571   romp-ibm-bsd4.3* )
572     machine=ibmrt opsys=bsd4-3
573   ;;
574   romp-ibm-bsd4.2* )
575     machine=ibmrt opsys=bsd4-2
576   ;;
577   romp-ibm-aos4.3* )
578     machine=ibmrt opsys=bsd4-3
579   ;;
580   romp-ibm-aos4.2* )
581     machine=ibmrt opsys=bsd4-2
582   ;;
583   romp-ibm-aos* )
584     machine=ibmrt opsys=bsd4-3
585   ;;
586   romp-ibm-bsd* )
587     machine=ibmrt opsys=bsd4-3
588   ;;
589   romp-ibm-aix* )
590     machine=ibmrt-aix opsys=usg5-2-2
591   ;;
593   ## Integrated Solutions `Optimum V'
594   m68*-isi-bsd4.2* )
595     machine=isi-ov opsys=bsd4-2
596   ;;
597   m68*-isi-bsd4.3* )
598     machine=isi-ov opsys=bsd4-3
599   ;;
601   ## Intel 386 machines where we do care about the manufacturer
602   i[3456]86-intsys-sysv* )
603     machine=is386 opsys=usg5-2-2
604   ;;
606   ## Prime EXL
607   i[3456]86-prime-sysv* )
608     machine=i386 opsys=usg5-3
609   ;;
611   ## Sequent Symmetry running Dynix
612   i[3456]86-sequent-bsd* )
613     machine=symmetry opsys=bsd4-3
614   ;;
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
619     NON_GNU_CPP=/lib/cpp
620   ;;
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"
627   ;;
629   ## ncr machine running svr4.3.
630   i[3456]86-ncr-sysv4.3 )
631     machine=ncr386 opsys=usg5-4-3
632   ;;
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
638   ;;
640   ## Intel Paragon OSF/1
641   i860-intel-osf1* )
642     machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
643   ;;
645   ## Intel 860
646   i860-*-sysv4* )
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.
650   ;;
652   ## Masscomp machines
653   m68*-masscomp-rtu* )
654     machine=masscomp opsys=rtu
655   ;;
657   ## Megatest machines
658   m68*-megatest-bsd* )
659     machine=mega68 opsys=bsd4-2
660   ;;
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.
673   mips-mips-usg* )
674     machine=mips4
675     ## Fall through to the general code at the bottom to decide on the OS.
676   ;;
677   mips-mips-riscos4* )
678     machine=mips4 opsys=bsd4-3
679     NON_GNU_CC="cc -systype bsd43"
680     NON_GNU_CPP="cc -systype bsd43 -E"
681   ;;
682   mips-mips-riscos5* )
683     machine=mips4 opsys=riscos5
684     NON_GNU_CC="cc -systype bsd43"
685     NON_GNU_CPP="cc -systype bsd43 -E"
686   ;;
687   mips-mips-bsd* )
688     machine=mips opsys=bsd4-3
689   ;;
690   mips-mips-* )
691     machine=mips opsys=usg5-2-2
692   ;;
694   ## NeXT
695   m68*-next-* | m68k-*-nextstep* )
696     machine=m68k opsys=nextstep
697   ;;
699   ## The complete machine from National Semiconductor
700   ns32k-ns-genix* )
701     machine=ns32000 opsys=usg5-2
702   ;;
704   ## NCR machines
705   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
706     machine=tower32 opsys=usg5-2-2
707   ;;
708   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
709     machine=tower32v3 opsys=usg5-3
710   ;;
712   ## NEC EWS4800
713   mips-nec-sysv4*)
714   machine=ews4800 opsys=ux4800
715   ;;
717   ## Nixdorf Targon 31
718   m68*-nixdorf-sysv* )
719     machine=targon31 opsys=usg5-2-2
720   ;;
722   ## Nu (TI or LMI)
723   m68*-nu-sysv* )
724     machine=nu opsys=usg5-2
725   ;;
727   ## Plexus
728   m68*-plexus-sysv* )
729     machine=plexus opsys=usg5-2
730   ;;
732   ## PowerPC reference platform
733   powerpcle-*-solaris2* )
734     machine=prep
735     opsys=sol2-5
736   ;;
738   ## Pyramid machines
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
743   ;;
745   ## Sequent Balance
746   ns32k-sequent-bsd4.2* )
747     machine=sequent opsys=bsd4-2
748   ;;
749   ns32k-sequent-bsd4.3* )
750     machine=sequent opsys=bsd4-3
751   ;;
753   ## Siemens Nixdorf
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
758   ;;
760   ## Silicon Graphics machines
761   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
762   m68*-sgi-iris3.5* )
763     machine=irist opsys=iris3-5
764   ;;
765   m68*-sgi-iris3.6* | m68*-sgi-iris*)
766     machine=irist opsys=iris3-6
767   ;;
768   ## Iris 4D
769   mips-sgi-irix3* )
770     machine=iris4d opsys=irix3-3
771   ;;
772   mips-sgi-irix4* )
773     machine=iris4d opsys=irix4-0
774   ;;
775   mips-sgi-irix6.5 )
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"
782   ;;
783   mips-sgi-irix6* )
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
789   ;;
790   mips-sgi-irix5.[01]* )
791     machine=iris4d opsys=irix5-0
792   ;;
793   mips-sgi-irix5* | mips-sgi-irix* )
794     machine=iris4d opsys=irix5-2
795   ;;
797   ## SONY machines
798   m68*-sony-bsd4.2* )
799     machine=news opsys=bsd4-2
800   ;;
801   m68*-sony-bsd4.3* )
802     machine=news opsys=bsd4-3
803   ;;
804   m68*-sony-newsos3* | m68*-sony-news3*)
805     machine=news opsys=bsd4-3
806   ;;
807   mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
808     machine=news-risc opsys=bsd4-3
809   ;;
810   mips-sony-newsos6* )
811     machine=news-r6 opsys=newsos6
812   ;;
813   mips-sony-news* )
814     machine=news-risc opsys=newsos5
815   ;;
817   ## Stride
818   m68*-stride-sysv* )
819     machine=stride opsys=usg5-2
820   ;;
822   ## Suns
823   sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
824     machine=sparc opsys=gnu-linux
825   ;;
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 ;;
839       * )               unported=yes ;;
840     esac
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.
848                 opsys=sunos413
849                 NON_GNU_CPP=/usr/lib/cpp
850                 NON_GCC_TEST_OPTIONS=-Bstatic
851                 GCC_TEST_OPTIONS=-static
852                 ;;
853       *-sunos4.1.[3-9]* | *-sunos4shr*)
854                 opsys=sunos4shr
855                 NON_GNU_CPP=/usr/lib/cpp
856                 ;;
857       *-sunos4* | *-sunos )
858                 opsys=sunos4-1
859                 NON_GCC_TEST_OPTIONS=-Bstatic
860                 GCC_TEST_OPTIONS=-static
861                 ;;
862       *-sunos5.3* | *-solaris2.3* )
863                 opsys=sol2-3
864                 NON_GNU_CPP=/usr/ccs/lib/cpp
865                 ;;
866       *-sunos5.4* | *-solaris2.4* )
867                 opsys=sol2-4
868                 NON_GNU_CPP=/usr/ccs/lib/cpp
869                 RANLIB="ar -ts"
870                 ;;
871       *-sunos5.5* | *-solaris2.5* )
872                 opsys=sol2-5
873                 NON_GNU_CPP=/usr/ccs/lib/cpp
874                 RANLIB="ar -ts"
875                 ;;
876       *-sunos5* | *-solaris* )
877                 opsys=sol2-5
878                 NON_GNU_CPP=/usr/ccs/lib/cpp
879                 ;;
880       *                   ) opsys=bsd4-2   ;;
881     esac
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.
888                   unset CC
889                 fi
890                 ;;
891       *) ;;
892     esac
893   ;;
894   sparc-*-nextstep* )
895     machine=sparc opsys=nextstep
896   ;;
898   ## Tadpole 68k
899   m68*-tadpole-sysv* )
900     machine=tad68k opsys=usg5-3
901   ;;
903   ## Tahoe machines
904   tahoe-tahoe-bsd4.2* )
905     machine=tahoe opsys=bsd4-2
906   ;;
907   tahoe-tahoe-bsd4.3* )
908     machine=tahoe opsys=bsd4-3
909   ;;
911   ## Tandem Integrity S2
912   mips-tandem-sysv* )
913     machine=tandem-s2 opsys=usg5-3
914   ;;
916   ## Tektronix XD88
917   m88k-tektronix-sysv3* )
918   machine=tekxd88 opsys=usg5-3
919   ;;
921   ## Tektronix 16000 box (6130?)
922   ns16k-tektronix-bsd* )
923     machine=ns16000 opsys=bsd4-2
924   ;;
925   ## Tektronix 4300
926   ## src/m/tek4300.h hints that this is a m68k machine.
927   m68*-tektronix-bsd* )
928     machine=tek4300 opsys=bsd4-3
929   ;;
931   ## Titan P2 or P3
932   ## We seem to have lost the machine-description file titan.h!
933   titan-titan-sysv* )
934     machine=titan opsys=usg5-3
935   ;;
937   ## Ustation E30 (SS5E)
938   m68*-unisys-uniplus* )
939     machine=ustation opsystem=unipl5-2
940   ;;
942   ## Vaxen.
943   vax-dec-* )
944     machine=vax
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 ;;
952       * )                                               unported=yes
953     esac
954   ;;
956   ## Whitechapel MG1
957   ns16k-whitechapel-* )
958     machine=mg1
959     ## We don't know what sort of OS runs on these; we'll let the
960     ## operating system guessing code below try.
961   ;;
963   ## Wicat
964   m68*-wicat-sysv* )
965     machine=wicat opsys=usg5-2
966   ;;
968   ## Intel 386 machines where we don't care about the manufacturer
969   i[3456]86-*-* )
970     machine=intel386
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
978                                 ;;
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 
986                                 NON_GNU_CPP=/lib/cpp
987                                 # Prevent -belf from being passed to $CPP.
988                                 # /lib/cpp does not accept it.
989                                 OVERRIDE_CPPFLAGS=" "
990                                 ;;
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.
996     esac
997   ;;
999   ## m68k Linux-based GNU system
1000   m68k-*-linux-gnu* )
1001     machine=m68k opsys=gnu-linux
1002   ;;
1004   ## Mips Linux-based GNU system
1005   mips-*-linux-gnu* )
1006     machine=mips opsys=gnu-linux
1007   ;;
1009   ## UXP/DS
1010   sparc-fujitsu-sysv4* )
1011     machine=sparc opsys=uxpds
1012     NON_GNU_CPP=/usr/ccs/lib/cpp
1013     RANLIB="ar -ts"
1014   ;;
1016   ## UXP/V
1017   f301-fujitsu-uxpv4.1)
1018     machine=f301 opsys=uxpv
1019   ;;
1021   * )
1022     unported=yes
1023   ;;
1024 esac
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
1031 ### above.
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
1045         opsys=usg5-4 ;;
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
1050           else
1051             NON_GNU_CPP=/lib/cpp
1052           fi
1053         fi
1054         opsys=usg5-4-2 ;;
1055     *-sysv4* | *-sysvr4* )              opsys=usg5-4 ;;
1056     * )
1057       unported=yes
1058     ;;
1059   esac
1062 if test "x$RANLIB" = x; then
1063   RANLIB=ranlib
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"
1083 case ${with_gcc} in
1084   "yes" ) CC="gcc" GCC=yes ;;
1085   "no"  ) : ${CC=cc} ;;
1086   * ) AC_PROG_CC
1087 esac
1089 # On Suns, sometimes $CPP names a directory.
1090 if test -n "$CPP" && test -d "$CPP"; then
1091   CPP=
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
1098 then
1099   CPP="$NON_GNU_CPP"
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
1107 then
1108   CC="$NON_GNU_CC"
1111 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1112 then
1113   CC="$CC $GCC_TEST_OPTIONS"
1116 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1117 then
1118   CC="$CC $NON_GCC_TEST_OPTIONS"
1121 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1122 then
1123   ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1126 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1127 then
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
1136 AC_PROG_LN_S
1137 AC_PROG_CPP
1138 AC_PROG_INSTALL
1139 AC_PROG_YACC
1141 dnl checks for Unix variants
1142 AC_AIX
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)
1151 AC_HEADER_STDC
1152 AC_HEADER_TIME
1153 AC_DECL_SYS_SIGLIST
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>
1159 #include <time.h>
1160 #else
1161 #ifdef HAVE_SYS_TIME_H
1162 #include <sys/time.h>
1163 #else
1164 #include <time.h>
1165 #endif
1166 #endif
1167 #ifdef HAVE_UTIME_H
1168 #include <utime.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
1176 AC_TYPE_SIGNAL
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>
1181 #include <time.h>
1182 #else
1183 #ifdef HAVE_SYS_TIME_H
1184 #include <sys/time.h>
1185 #else
1186 #include <time.h>
1187 #endif
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
1196 AC_STRUCT_TM
1197 AC_STRUCT_TIMEZONE
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
1207 AC_C_CONST
1209 dnl check for Make feature
1210 AC_PROG_MAKE_SET
1212 dnl checks for operating system services
1213 AC_SYS_LONG_FILE_NAMES
1215 #### Choose a window system.
1217 AC_PATH_X
1218 if test "$no_x" = yes; then
1219   window_system=none
1220 else
1221   window_system=x11
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}
1235     else
1236       x_default_search_path="${x_search_path}:${x_default_search_path}"
1237     fi
1238   done
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
1246 else
1247   # accumulate include directories that have X11 bitmap subdirectories
1248   bmd_acc="dummyval"
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"
1252     fi
1253     if test -d "${bmd}/bitmaps"; then
1254       bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1255     fi
1256   done
1257   if test ${bmd_acc} != "dummyval"; then
1258     bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1259   fi
1262 case "${window_system}" in
1263   x11 )
1264     HAVE_X_WINDOWS=yes
1265     HAVE_X11=yes
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 ;;
1274     esac
1275   ;;
1276   none )
1277     HAVE_X_WINDOWS=no
1278     HAVE_X11=no
1279     USE_X_TOOLKIT=none
1280   ;;
1281 esac
1283 ### If we're using X11, we should use the X menu package.
1284 HAVE_MENUS=no
1285 case ${HAVE_X11} in
1286   yes ) HAVE_MENUS=yes ;;
1287 esac
1288   
1289 if test "${opsys}" = "hpux9"; then
1290   case "${x_libraries}" in
1291     *X11R4* )
1292       opsysfile="s/hpux9-x11r4.h"
1293       ;;
1294   esac
1297 if test "${opsys}" = "hpux9shr"; then
1298   case "${x_libraries}" in
1299     *X11R4* )
1300       opsysfile="s/hpux9shxr4.h"
1301       ;;
1302   esac
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
1323 ### anyway.
1324 tempcname="conftest.c"
1326 echo '
1327 #include "'${srcdir}'/src/'${opsysfile}'"
1328 #include "'${srcdir}'/src/'${machfile}'"
1329 #ifndef LIBS_MACHINE
1330 #define LIBS_MACHINE
1331 #endif
1332 #ifndef LIBS_SYSTEM
1333 #define LIBS_SYSTEM
1334 #endif
1335 #ifndef C_SWITCH_SYSTEM
1336 #define C_SWITCH_SYSTEM
1337 #endif
1338 #ifndef C_SWITCH_MACHINE
1339 #define C_SWITCH_MACHINE
1340 #endif
1341 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1342 configure___ c_switch_system=C_SWITCH_SYSTEM
1343 configure___ c_switch_machine=C_SWITCH_MACHINE
1345 #ifndef LIB_X11_LIB
1346 #define LIB_X11_LIB -lX11
1347 #endif
1349 #ifndef LIBX11_MACHINE
1350 #define LIBX11_MACHINE
1351 #endif
1353 #ifndef LIBX11_SYSTEM
1354 #define LIBX11_SYSTEM
1355 #endif
1356 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1358 #ifdef UNEXEC
1359 configure___ unexec=UNEXEC
1360 #else
1361 configure___ unexec=unexec.o
1362 #endif
1364 #ifdef SYSTEM_MALLOC
1365 configure___ system_malloc=yes
1366 #else
1367 configure___ system_malloc=no
1368 #endif
1370 #ifndef C_DEBUG_SWITCH
1371 #define C_DEBUG_SWITCH -g
1372 #endif
1374 #ifndef C_OPTIMIZE_SWITCH
1375 #define C_OPTIMIZE_SWITCH -O
1376 #endif
1378 #ifndef LD_SWITCH_MACHINE
1379 #define LD_SWITCH_MACHINE
1380 #endif
1382 #ifndef LD_SWITCH_SYSTEM
1383 #define LD_SWITCH_SYSTEM
1384 #endif
1386 #ifndef LD_SWITCH_X_SITE_AUX
1387 #define LD_SWITCH_X_SITE_AUX
1388 #endif  
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.  */
1396 #ifdef __GNUC__
1397 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1398 #else
1399 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1400 #endif
1402 #else /* not THIS_IS_CONFIGURE */
1404 /* Get the CFLAGS for real compilation.  */
1405 #ifdef __GNUC__
1406 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1407 #else
1408 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1409 #endif
1411 #endif /* not THIS_IS_CONFIGURE */
1412 ' > ${tempcname}
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"`
1417 changequote(, )dnl
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'`
1423 else
1424   REAL_CFLAGS="$CFLAGS"
1426 changequote([, ])dnl
1427 rm ${tempcname}
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.
1436 GNU_MALLOC=yes
1437 doug_lea_malloc=yes
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
1446   doug_lea_malloc=no
1448 if test "${system_malloc}" = "yes"; then
1449   GNU_MALLOC=no
1450   GNU_MALLOC_reason="
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
1455     GNU_MALLOC_reason="
1456       (Using Doug Lea's new malloc from the GNU C Library.)"
1457   fi
1458   AC_DEFINE(DOUG_LEA_MALLOC)
1461 if test x"${REL_ALLOC}" = x; then
1462   REL_ALLOC=${GNU_MALLOC}
1465 LISP_FLOAT_TYPE=yes
1468 #### Add the libraries to LIBS and check for some functions.
1470 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1471   CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1472 else
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
1492   HAVE_XFREE386=yes
1493   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1494 else
1495   HAVE_XFREE386=no
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"
1505   LIBS="$LIBX $LIBS"
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
1514     export LD_RUN_PATH
1515   fi
1517   if test "${opsys}" = "gnu-linux"; then
1518     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1519     AC_TRY_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"
1527       OLD_LIBS="$LIBS"
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"
1532       AC_TRY_LINK([],
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"
1542         LIBS="$OLD_LIBS"
1543         AC_MSG_RESULT(no)
1544       else
1545         AC_MSG_RESULT(yes)
1546       fi
1547     else
1548       AC_MSG_RESULT(no)
1549     fi
1550   fi
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
1561 fail;
1562 #endif
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)
1567   else
1568     AC_MSG_RESULT(before 6)
1569   fi
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
1577 fail;
1578 #endif
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)
1582     HAVE_X11R5=yes
1583     AC_DEFINE(HAVE_X11R5)
1584   else
1585     HAVE_X11R5=no
1586     AC_MSG_RESULT(before 5)
1587   fi
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,
1596     AC_TRY_LINK([
1597 #include <X11/Intrinsic.h>
1598 #include <X11/Xaw/Simple.h>],
1599       [],
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])
1604       USE_X_TOOLKIT=LUCID
1605     else
1606       AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1607       USE_X_TOOLKIT=none
1608     fi
1609   else
1610     USE_X_TOOLKIT=none
1611   fi
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
1621 fail;
1622 #endif
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)
1628   else
1629     AC_MSG_RESULT(before 6)
1630   fi
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.
1634   OLDLIBS="$LIBS"
1635   if test x$HAVE_X11XTR6 = xyes; then
1636     LIBS="-lXt -lSM -lICE $LIBS"
1637   else
1638     LIBS="-lXt $LIBS"
1639   fi
1640   AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
1641   LIBS="$OLDLIBS"
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)
1648 int x = 5;
1649 #else
1650 Motif version prior to 2.1.
1651 #endif],
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)
1657   fi
1660 ### Is -lXaw3d available?
1661 HAVE_XAW3D=no
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)
1672     fi
1673   fi
1675   
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)
1685       HAVE_XAW3D=no
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
1690     fi
1691   fi
1694 ### Use -lXpm if available, unless `--with-xpm=no'.
1695 HAVE_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}"
1703   fi
1705   if test "${HAVE_XPM}" = "yes"; then
1706     AC_DEFINE(HAVE_XPM)
1707   fi
1709   
1710 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1711 HAVE_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}"
1718   fi
1720   if test "${HAVE_JPEG}" = "yes"; then
1721     AC_DEFINE(HAVE_JPEG)
1722   fi
1724   
1725 ### Use -lpng if available, unless `--with-png=no'.
1726 HAVE_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}"
1734   fi
1736   if test "${HAVE_PNG}" = "yes"; then
1737     AC_DEFINE(HAVE_PNG)
1738   fi
1740   
1741 ### Use -ltiff if available, unless `--with-tiff=no'.
1742 HAVE_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}"
1750   fi
1752   if test "${HAVE_TIFF}" = "yes"; then
1753     AC_DEFINE(HAVE_TIFF)
1754   fi
1756   
1757 ### Use -lgif if available, unless `--with-gif=no'.
1758 HAVE_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}"
1766   fi
1768   if test "${HAVE_GIF}" = "yes"; then
1769     AC_DEFINE(HAVE_GIF)
1770   fi
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>],
1777   [return h_errno;],
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)
1783 AC_FUNC_ALLOCA
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)
1807   fi
1808   else :
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))
1837   fi
1839   if test "${with_kerberos5+set}" = set; then
1840     AC_CHECK_HEADERS(krb5.h)
1841   else
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)))
1848   fi
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;
1861 unset_TZ ()
1863   char **from, **to;
1864   for (to = from = environ; (*to = *from); from++)
1865     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
1866       to++;
1868 char TZ_GMT0[] = "TZ=GMT0";
1869 char TZ_PST8[] = "TZ=PST8";
1870 main()
1872   time_t now = time ((time_t *) 0);
1873   int hour_GMT0, hour_unset;
1874   if (putenv (TZ_GMT0) != 0)
1875     exit (1);
1876   hour_GMT0 = localtime (&now)->tm_hour;
1877   unset_TZ ();
1878   hour_unset = localtime (&now)->tm_hour;
1879   if (putenv (TZ_PST8) != 0)
1880     exit (1);
1881   if (localtime (&now)->tm_hour == hour_GMT0)
1882     exit (1);
1883   unset_TZ ();
1884   if (localtime (&now)->tm_hour != hour_unset)
1885     exit (1);
1886   exit (0);
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])
1890 else
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
1894 fi])dnl
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,
1903 AC_TRY_LINK([
1904 #ifdef TIME_WITH_SYS_TIME
1905 #include <sys/time.h>
1906 #include <time.h>
1907 #else
1908 #ifdef HAVE_SYS_TIME_H
1909 #include <sys/time.h>
1910 #else
1911 #include <time.h>
1912 #endif
1913 #endif
1914   ],
1915   [
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)
1924   fi
1927 ok_so_far=yes
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
1945   AC_MSG_RESULT(yes)
1946   AC_DEFINE(HAVE_DEV_PTMX)
1947 else
1948   AC_MSG_RESULT(no)
1951 # Set up the CFLAGS for real compilation, so we can substitute it.
1952 CFLAGS="$REAL_CFLAGS"
1954 changequote(, )dnl
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.
1965 AC_SUBST(version)
1966 AC_SUBST(configuration)
1967 AC_SUBST(canonical)
1968 AC_SUBST(srcdir)
1969 AC_SUBST(prefix)
1970 AC_SUBST(exec_prefix)
1971 AC_SUBST(bindir)
1972 AC_SUBST(datadir)
1973 AC_SUBST(sharedstatedir)
1974 AC_SUBST(libexecdir)
1975 AC_SUBST(mandir)
1976 AC_SUBST(infodir)
1977 AC_SUBST(lispdir)
1978 AC_SUBST(locallisppath)
1979 AC_SUBST(lisppath)
1980 AC_SUBST(x_default_search_path)
1981 AC_SUBST(etcdir)
1982 AC_SUBST(archlibdir)
1983 AC_SUBST(docdir)
1984 AC_SUBST(bitmapdir)
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)
1990 AC_SUBST(CFLAGS)
1991 AC_SUBST(X_TOOLKIT_TYPE)
1992 AC_SUBST(machfile)
1993 AC_SUBST(opsysfile)
1994 AC_SUBST(RANLIB)
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
2012   AC_DEFINE(HAVE_X11)
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.
2031 echo "
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}"
2045 else
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}"
2050 else
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}"
2061 echo
2063 # Remove any trailing slashes in these variables.
2064 changequote(, )dnl
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 \
2073         leim/Makefile, [
2075 ### Make the necessary directories, if they don't exist.
2076 for dir in etc lisp ; do
2077   test -d ${dir} || mkdir ${dir}
2078 done
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
2098 make epaths-force
2100 echo creating lib-src/Makefile
2101 ( cd lib-src
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
2117 ( cd src
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"])