("Greek"): Remove unibyte-syntax property.
[emacs.git] / configure.in
blob1a663406d91ad9a8a49ab2b895175100a05fb98c
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.53)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 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
52 AC_ARG_WITH(kerberos,
53 [  --with-kerberos         support Kerberos-authenticated POP],
54 [AC_DEFINE(KERBEROS)])
55 AH_TEMPLATE(KERBEROS,
56             [Define to support Kerberos-authenticated POP mail retrieval.])dnl
57 AC_ARG_WITH(kerberos5,
58 [  --with-kerberos5        support Kerberos version 5 authenticated POP],
59 [if test "${with_kerberos5+set}" = set; then
60   if test "${with_kerberos+set}" != set; then
61     with_kerberos=yes
62     AC_DEFINE(KERBEROS)
63   fi
65 AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])])
66 AC_ARG_WITH(hesiod,
67 [  --with-hesiod           support Hesiod to get the POP server host],
68 [AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])])
70 dnl This should be the last --with option, because --with-x is
71 dnl added later on when we find the path of X, and it's best to
72 dnl keep them together visually.
73 AC_ARG_WITH(x-toolkit,
74 [  --with-x-toolkit=KIT    use an X toolkit (KIT = yes/lucid/athena/motif/no)],
75 [         case "${withval}" in
76             y | ye | yes )      val=athena ;;
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-aix4.0* | powerpc-ibm-aix4.0*  )
613     machine=ibmrs6000 opsys=aix4
614   ;;
615   rs6000-ibm-aix4* | powerpc-ibm-aix4*  )
616     machine=ibmrs6000 opsys=aix4-1
617   ;;
618   rs6000-ibm-aix* | powerpc-ibm-aix* )
619     machine=ibmrs6000 opsys=aix3-2
620   ;;
621   romp-ibm-bsd4.3* )
622     machine=ibmrt opsys=bsd4-3
623   ;;
624   romp-ibm-bsd4.2* )
625     machine=ibmrt opsys=bsd4-2
626   ;;
627   romp-ibm-aos4.3* )
628     machine=ibmrt opsys=bsd4-3
629   ;;
630   romp-ibm-aos4.2* )
631     machine=ibmrt opsys=bsd4-2
632   ;;
633   romp-ibm-aos* )
634     machine=ibmrt opsys=bsd4-3
635   ;;
636   romp-ibm-bsd* )
637     machine=ibmrt opsys=bsd4-3
638   ;;
639   romp-ibm-aix* )
640     machine=ibmrt-aix opsys=usg5-2-2
641   ;;
643   ## Integrated Solutions `Optimum V'
644   m68*-isi-bsd4.2* )
645     machine=isi-ov opsys=bsd4-2
646   ;;
647   m68*-isi-bsd4.3* )
648     machine=isi-ov opsys=bsd4-3
649   ;;
651   ## Intel 386 machines where we do care about the manufacturer
652   i[3456]86-intsys-sysv* )
653     machine=is386 opsys=usg5-2-2
654   ;;
656   ## Prime EXL
657   i[3456]86-prime-sysv* )
658     machine=i386 opsys=usg5-3
659   ;;
661   ## Sequent Symmetry running Dynix
662   i[3456]86-sequent-bsd* )
663     machine=symmetry opsys=bsd4-3
664   ;;
666   ## Sequent Symmetry running ptx 4, which is a modified SVR4.
667   i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
668     machine=sequent-ptx opsys=ptx4
669     NON_GNU_CPP=/lib/cpp
670   ;;
672   ## Sequent Symmetry running DYNIX/ptx
673   ## Use the old cpp rather than the newer ANSI one.
674   i[3456]86-sequent-ptx* )
675     machine=sequent-ptx opsys=ptx
676     NON_GNU_CPP="/lib/cpp"
677   ;;
679   ## ncr machine running svr4.3.
680   i[3456]86-ncr-sysv4.3 )
681     machine=ncr386 opsys=usg5-4-3
682   ;;
684   ## Unspecified sysv on an ncr machine defaults to svr4.2.
685   ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
686   i[3456]86-ncr-sysv* )
687     machine=ncr386 opsys=usg5-4-2
688   ;;
690   ## Intel Paragon OSF/1
691   i860-intel-osf1* )
692     machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
693   ;;
695   ## Intel 860
696   i860-*-sysv4* )
697     machine=i860 opsys=usg5-4
698     NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
699     NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
700   ;;
702   ## Macintosh PowerPC
703   powerpc*-*-linux-gnu* )
704     machine=macppc opsys=gnu-linux
705   ;;
707   ## Masscomp machines
708   m68*-masscomp-rtu* )
709     machine=masscomp opsys=rtu
710   ;;
712   ## Megatest machines
713   m68*-megatest-bsd* )
714     machine=mega68 opsys=bsd4-2
715   ;;
717   ## Workstations sold by MIPS
718   ## This is not necessarily all workstations using the MIPS processor -
719   ## Irises are produced by SGI, and DECstations by DEC.
721   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
722   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
723   ## it gives for choosing between the alternatives seems to be "Use
724   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
725   ## the BSD world."  I'll assume that these are instructions for
726   ## handling two odd situations, and that every other situation
727   ## should use mips.h and usg5-2-2, they being listed first.
728   mips-mips-usg* )
729     machine=mips4
730     ## Fall through to the general code at the bottom to decide on the OS.
731   ;;
732   mips-mips-riscos4* )
733     machine=mips4 opsys=bsd4-3
734     NON_GNU_CC="cc -systype bsd43"
735     NON_GNU_CPP="cc -systype bsd43 -E"
736   ;;
737   mips-mips-riscos5* )
738     machine=mips4 opsys=riscos5
739     NON_GNU_CC="cc -systype bsd43"
740     NON_GNU_CPP="cc -systype bsd43 -E"
741   ;;
742   mips-mips-bsd* )
743     machine=mips opsys=bsd4-3
744   ;;
745   mips-mips-* )
746     machine=mips opsys=usg5-2-2
747   ;;
749   ## NeXT
750   m68*-next-* | m68k-*-nextstep* )
751     machine=m68k opsys=nextstep
752   ;;
754   ## The complete machine from National Semiconductor
755   ns32k-ns-genix* )
756     machine=ns32000 opsys=usg5-2
757   ;;
759   ## NCR machines
760   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
761     machine=tower32 opsys=usg5-2-2
762   ;;
763   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
764     machine=tower32v3 opsys=usg5-3
765   ;;
767   ## NEC EWS4800
768   mips-nec-sysv4*)
769   machine=ews4800 opsys=ux4800
770   ;;
772   ## Nixdorf Targon 31
773   m68*-nixdorf-sysv* )
774     machine=targon31 opsys=usg5-2-2
775   ;;
777   ## Nu (TI or LMI)
778   m68*-nu-sysv* )
779     machine=nu opsys=usg5-2
780   ;;
782   ## Plexus
783   m68*-plexus-sysv* )
784     machine=plexus opsys=usg5-2
785   ;;
787   ## PowerPC reference platform
788   powerpcle-*-solaris2* )
789     machine=prep
790     opsys=sol2-5
791   ;;
793   ## Pyramid machines
794   ## I don't really have any idea what sort of processor the Pyramid has,
795   ## so I'm assuming it is its own architecture.
796   pyramid-pyramid-bsd* )
797     machine=pyramid opsys=bsd4-2
798   ;;
800   ## Sequent Balance
801   ns32k-sequent-bsd4.2* )
802     machine=sequent opsys=bsd4-2
803   ;;
804   ns32k-sequent-bsd4.3* )
805     machine=sequent opsys=bsd4-3
806   ;;
808   ## Siemens Nixdorf
809   mips-siemens-sysv* | mips-sni-sysv*)
810     machine=mips-siemens opsys=usg5-4
811     NON_GNU_CC=/usr/ccs/bin/cc
812     NON_GNU_CPP=/usr/ccs/lib/cpp
813   ;;
815   ## Silicon Graphics machines
816   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
817   m68*-sgi-iris3.5* )
818     machine=irist opsys=iris3-5
819   ;;
820   m68*-sgi-iris3.6* | m68*-sgi-iris*)
821     machine=irist opsys=iris3-6
822   ;;
823   ## Iris 4D
824   mips-sgi-irix3* )
825     machine=iris4d opsys=irix3-3
826   ;;
827   mips-sgi-irix4* )
828     machine=iris4d opsys=irix4-0
829   ;;
830   mips-sgi-irix6.5 )
831     machine=iris4d opsys=irix6-5
832     # Without defining _LANGUAGE_C, things get masked out in the headers
833     # so that, for instance, grepping for `free' in stdlib.h fails and
834     # AC_HEADER_STD_C fails.   (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
835     NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
836     NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
837   ;;
838   mips-sgi-irix6* )
839     machine=iris4d opsys=irix6-0
840     # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
841     # but presumably it does no harm.
842     NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
843     # -32 probably isn't necessary in later v.6s -- anyone know which?
844     NON_GCC_TEST_OPTIONS=-32
845   ;;
846   mips-sgi-irix5.[01]* )
847     machine=iris4d opsys=irix5-0
848   ;;
849   mips-sgi-irix5* | mips-sgi-irix* )
850     machine=iris4d opsys=irix5-2
851   ;;
853   ## SONY machines
854   m68*-sony-bsd4.2* )
855     machine=news opsys=bsd4-2
856   ;;
857   m68*-sony-bsd4.3* )
858     machine=news opsys=bsd4-3
859   ;;
860   m68*-sony-newsos3* | m68*-sony-news3*)
861     machine=news opsys=bsd4-3
862   ;;
863   mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
864     machine=news-risc opsys=bsd4-3
865   ;;
866   mips-sony-newsos6* )
867     machine=news-r6 opsys=newsos6
868   ;;
869   mips-sony-news* )
870     machine=news-risc opsys=newsos5
871   ;;
873   ## Stride
874   m68*-stride-sysv* )
875     machine=stride opsys=usg5-2
876   ;;
878   ## Suns
879   sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
880     machine=sparc opsys=gnu-linux
881   ;;
883   *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
884     | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
885     | rs6000-*-solaris2*)
886     case "${canonical}" in
887       m68*-sunos1* )    machine=sun1 ;;
888       m68*-sunos2* )    machine=sun2 ;;
889       m68* )            machine=sun3 ;;
890       i[3456]86-sun-sunos[34]* )        machine=sun386 ;;
891       i[3456]86-*-* )     machine=intel386 ;;
892       powerpcle* )      machine=powerpcle ;;
893       powerpc* | rs6000* )  machine=ibmrs6000 ;;
894       sparc* )          machine=sparc ;;
895       * )               unported=yes ;;
896     esac
897     case "${canonical}" in
898       ## The Sun386 didn't get past 4.0.
899       i[3456]86-*-sunos4          ) opsys=sunos4-0 ;;
900       *-sunos4.0*         ) opsys=sunos4-0 ;;
901       *-sunos4.1.[3-9]*noshare )
902                 ## This name is sunos413 instead of sunos4-1-3
903                 ## to avoid a file name conflict on MSDOS.
904                 opsys=sunos413
905                 NON_GNU_CPP=/usr/lib/cpp
906                 NON_GCC_TEST_OPTIONS=-Bstatic
907                 GCC_TEST_OPTIONS=-static
908                 ;;
909       *-sunos4.1.[3-9]* | *-sunos4shr*)
910                 opsys=sunos4shr
911                 NON_GNU_CPP=/usr/lib/cpp
912                 ;;
913       *-sunos4* | *-sunos )
914                 opsys=sunos4-1
915                 NON_GCC_TEST_OPTIONS=-Bstatic
916                 GCC_TEST_OPTIONS=-static
917                 ;;
918       *-sunos5.3* | *-solaris2.3* )
919                 opsys=sol2-3
920                 NON_GNU_CPP=/usr/ccs/lib/cpp
921                 ;;
922       *-sunos5.4* | *-solaris2.4* )
923                 opsys=sol2-4
924                 NON_GNU_CPP=/usr/ccs/lib/cpp
925                 RANLIB="ar -ts"
926                 ;;
927       *-sunos5.5* | *-solaris2.5* )
928                 opsys=sol2-5
929                 NON_GNU_CPP=/usr/ccs/lib/cpp
930                 RANLIB="ar -ts"
931                 ;;
932       *-sunos5* | *-solaris* )
933                 opsys=sol2-5
934                 NON_GNU_CPP=/usr/ccs/lib/cpp
935                 ;;
936       *                   ) opsys=bsd4-2   ;;
937     esac
938     ## Watch out for a compiler that we know will not work.
939     case "${canonical}" in
940      *-solaris* | *-sunos5* )
941                 if [ "x$CC" = x/usr/ucb/cc ]; then
942                   ## /usr/ucb/cc doesn't work;
943                   ## we should find some other compiler that does work.
944                   unset CC
945                 fi
946                 ;;
947       *) ;;
948     esac
949   ;;
950   sparc-*-nextstep* )
951     machine=sparc opsys=nextstep
952   ;;
954   ## Tadpole 68k
955   m68*-tadpole-sysv* )
956     machine=tad68k opsys=usg5-3
957   ;;
959   ## Tahoe machines
960   tahoe-tahoe-bsd4.2* )
961     machine=tahoe opsys=bsd4-2
962   ;;
963   tahoe-tahoe-bsd4.3* )
964     machine=tahoe opsys=bsd4-3
965   ;;
967   ## Tandem Integrity S2
968   mips-tandem-sysv* )
969     machine=tandem-s2 opsys=usg5-3
970   ;;
972   ## Tektronix XD88
973   m88k-tektronix-sysv3* )
974   machine=tekxd88 opsys=usg5-3
975   ;;
977   ## Tektronix 16000 box (6130?)
978   ns16k-tektronix-bsd* )
979     machine=ns16000 opsys=bsd4-2
980   ;;
981   ## Tektronix 4300
982   ## src/m/tek4300.h hints that this is a m68k machine.
983   m68*-tektronix-bsd* )
984     machine=tek4300 opsys=bsd4-3
985   ;;
987   ## Titan P2 or P3
988   ## We seem to have lost the machine-description file titan.h!
989   titan-titan-sysv* )
990     machine=titan opsys=usg5-3
991   ;;
993   ## Ustation E30 (SS5E)
994   m68*-unisys-uniplus* )
995     machine=ustation opsystem=unipl5-2
996   ;;
998   ## Vaxen.
999   vax-dec-* )
1000     machine=vax
1001     case "${canonical}" in
1002       *-bsd4.1* )                                       opsys=bsd4-1 ;;
1003       *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* )      opsys=bsd4-2 ;;
1004       *-bsd4.3* | *-ultrix* )                           opsys=bsd4-3 ;;
1005       *-sysv[01]* | *-sysvr[01]* )                      opsys=usg5-0 ;;
1006       *-sysv2* | *-sysvr2* )                            opsys=usg5-2 ;;
1007       *-vms* )                                          opsys=vms ;;
1008       * )                                               unported=yes
1009     esac
1010   ;;
1012   ## Whitechapel MG1
1013   ns16k-whitechapel-* )
1014     machine=mg1
1015     ## We don't know what sort of OS runs on these; we'll let the
1016     ## operating system guessing code below try.
1017   ;;
1019   ## Wicat
1020   m68*-wicat-sysv* )
1021     machine=wicat opsys=usg5-2
1022   ;;
1024   ## IA-64
1025   ia64*-*-linux* )
1026     machine=ia64 opsys=gnu-linux
1027   ;;
1029   ## Intel 386 machines where we don't care about the manufacturer
1030   i[3456]86-*-* )
1031     machine=intel386
1032     case "${canonical}" in
1033       *-lynxos* )               opsys=lynxos ;;
1034       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1035       *-isc2.2* )               opsys=isc2-2 ;;
1036       *-isc4.0* )               opsys=isc4-0 ;;
1037       *-isc4.* )                opsys=isc4-1
1038                                 GCC_TEST_OPTIONS=-posix
1039                                 NON_GCC_TEST_OPTIONS=-Xp
1040                                 ;;
1041       *-isc* )                  opsys=isc3-0 ;;
1042       *-esix5* )                opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1043       *-esix* )                 opsys=esix ;;
1044       *-xenix* )                opsys=xenix ;;
1045       *-linux-gnu* )            opsys=gnu-linux ;;
1046       *-sco3.2v4* )             opsys=sco4 ; NON_GNU_CPP=/lib/cpp  ;;
1047       *-sco3.2v5* )             opsys=sco5 
1048                                 NON_GNU_CPP=/lib/cpp
1049                                 # Prevent -belf from being passed to $CPP.
1050                                 # /lib/cpp does not accept it.
1051                                 OVERRIDE_CPPFLAGS=" "
1052                                 ;;
1053       *-sysv4.2uw* )            opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1054       *-386bsd* )               opsys=386bsd ;;
1055       *-nextstep* )             opsys=nextstep ;;
1056       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1057     esac
1058   ;;
1060   ## m68k Linux-based GNU system
1061   m68k-*-linux-gnu* )
1062     machine=m68k opsys=gnu-linux
1063   ;;
1065   ## Mips Linux-based GNU system
1066   mips-*-linux-gnu* )
1067     machine=mips opsys=gnu-linux
1068   ;;
1070   ## UXP/DS
1071   sparc-fujitsu-sysv4* )
1072     machine=sparc opsys=uxpds
1073     NON_GNU_CPP=/usr/ccs/lib/cpp
1074     RANLIB="ar -ts"
1075   ;;
1077   ## UXP/V
1078   f301-fujitsu-uxpv4.1)
1079     machine=f301 opsys=uxpv
1080   ;;
1082   * )
1083     unported=yes
1084   ;;
1085 esac
1087 ### If the code above didn't choose an operating system, just choose
1088 ### an operating system based on the configuration name.  You really
1089 ### only want to use this when you have no idea what the right
1090 ### operating system is; if you know what operating systems a machine
1091 ### runs, it's cleaner to make it explicit in the case statement
1092 ### above.
1093 if test x"${opsys}" = x; then
1094   case "${canonical}" in
1095     *-gnu* )                            opsys=gnu ;;
1096     *-bsd4.[01] )                       opsys=bsd4-1 ;;
1097     *-bsd4.2 )                          opsys=bsd4-2 ;;
1098     *-bsd4.3 )                          opsys=bsd4-3 ;;
1099     *-sysv0 | *-sysvr0 )                opsys=usg5-0 ;;
1100     *-sysv2 | *-sysvr2 )                opsys=usg5-2 ;;
1101     *-sysv2.2 | *-sysvr2.2 )            opsys=usg5-2-2 ;;
1102     *-sysv3* | *-sysvr3* )              opsys=usg5-3 ;;
1103     *-sysv4.2uw* )                      opsys=unixware ;;
1104     *-sysv4.1* | *-sysvr4.1* )
1105         NON_GNU_CPP=/usr/lib/cpp
1106         opsys=usg5-4 ;;
1107     *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1108         if [ x$NON_GNU_CPP = x ]; then
1109           if [ -f /usr/ccs/lib/cpp ]; then
1110             NON_GNU_CPP=/usr/ccs/lib/cpp
1111           else
1112             NON_GNU_CPP=/lib/cpp
1113           fi
1114         fi
1115         opsys=usg5-4-2 ;;
1116     *-sysv4* | *-sysvr4* )              opsys=usg5-4 ;;
1117     * )
1118       unported=yes
1119     ;;
1120   esac
1123 changequote([, ])dnl
1125 if test $unported = yes; then
1126   AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
1127 Check \`etc/MACHINES' for recognized configuration names.])
1130 machfile="m/${machine}.h"
1131 opsysfile="s/${opsys}.h"
1134 #### Choose a compiler.
1135 test -n "$CC" && cc_specified=yes
1137 # Save the value of CFLAGS that the user specified.
1138 SPECIFIED_CFLAGS="$CFLAGS"
1140 case ${with_gcc} in
1141   "yes" ) CC="gcc" GCC=yes ;;
1142   "no"  ) : ${CC=cc} ;;
1143   * )
1144 esac
1145 AC_PROG_CC
1147 # On Suns, sometimes $CPP names a directory.
1148 if test -n "$CPP" && test -d "$CPP"; then
1149   CPP=
1152 #### Some systems specify a CPP to use unless we are using GCC.
1153 #### Now that we know whether we are using GCC, we can decide whether
1154 #### to use that one.
1155 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1156 then
1157   CPP="$NON_GNU_CPP"
1160 #### Some systems specify a CC to use unless we are using GCC.
1161 #### Now that we know whether we are using GCC, we can decide whether
1162 #### to use that one.
1163 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1164   test x$cc_specified != xyes
1165 then
1166   CC="$NON_GNU_CC"
1169 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1170 then
1171   CC="$CC $GCC_TEST_OPTIONS"
1174 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1175 then
1176   CC="$CC $NON_GCC_TEST_OPTIONS"
1179 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1180 then
1181   ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1184 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1185 then
1186   ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1189 #### Some other nice autoconf tests.  If you add a test here which
1190 #### should make an entry in src/config.h, don't forget to add an
1191 #### #undef clause to src/config.h.in for autoconf to modify.
1193 dnl checks for programs
1194 AC_PROG_LN_S
1195 AC_PROG_CPP
1196 AC_PROG_INSTALL
1197 if test "x$RANLIB" = x; then
1198   AC_PROG_RANLIB
1201 dnl checks for Unix variants
1202 AC_AIX
1204 #### Extract some information from the operating system and machine files.
1206 AC_CHECKING([the machine- and system-dependent files to find out
1207  - which libraries the lib-src programs will want, and
1208  - whether the GNU malloc routines are usable])
1210 ### First figure out CFLAGS (which we use for running the compiler here)
1211 ### and REAL_CFLAGS (which we use for real compilation).
1212 ### The two are the same except on a few systems, where they are made
1213 ### different to work around various lossages.  For example,
1214 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1215 ### as implying static linking.
1217 ### If the CFLAGS env var is specified, we use that value
1218 ### instead of the default.
1220 ### It's not important that this name contain the PID; you can't run
1221 ### two configures in the same directory and have anything work
1222 ### anyway.
1223 tempcname="conftest.c"
1225 echo '
1226 #include "'${srcdir}'/src/'${opsysfile}'"
1227 #include "'${srcdir}'/src/'${machfile}'"
1228 #ifndef LIBS_MACHINE
1229 #define LIBS_MACHINE
1230 #endif
1231 #ifndef LIBS_SYSTEM
1232 #define LIBS_SYSTEM
1233 #endif
1234 #ifndef C_SWITCH_SYSTEM
1235 #define C_SWITCH_SYSTEM
1236 #endif
1237 #ifndef C_SWITCH_MACHINE
1238 #define C_SWITCH_MACHINE
1239 #endif
1240 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1241 configure___ c_switch_system=C_SWITCH_SYSTEM
1242 configure___ c_switch_machine=C_SWITCH_MACHINE
1244 #ifndef LIB_X11_LIB
1245 #define LIB_X11_LIB -lX11
1246 #endif
1248 #ifndef LIBX11_MACHINE
1249 #define LIBX11_MACHINE
1250 #endif
1252 #ifndef LIBX11_SYSTEM
1253 #define LIBX11_SYSTEM
1254 #endif
1255 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1257 #ifdef UNEXEC
1258 configure___ unexec=UNEXEC
1259 #else
1260 configure___ unexec=unexec.o
1261 #endif
1263 #ifdef SYSTEM_MALLOC
1264 configure___ system_malloc=yes
1265 #else
1266 configure___ system_malloc=no
1267 #endif
1269 #ifdef USE_MMAP_FOR_BUFFERS
1270 configure___ use_mmap_for_buffers=yes
1271 #else
1272 configure___ use_mmap_for_buffers=no
1273 #endif
1275 #ifndef C_DEBUG_SWITCH
1276 #define C_DEBUG_SWITCH -g
1277 #endif
1279 #ifndef C_OPTIMIZE_SWITCH
1280 #ifdef __GNUC__
1281 #define C_OPTIMIZE_SWITCH -O2
1282 #else
1283 #define C_OPTIMIZE_SWITCH -O
1284 #endif
1285 #endif
1287 #ifndef LD_SWITCH_MACHINE
1288 #define LD_SWITCH_MACHINE
1289 #endif
1291 #ifndef LD_SWITCH_SYSTEM
1292 #define LD_SWITCH_SYSTEM
1293 #endif
1295 #ifndef LD_SWITCH_X_SITE_AUX
1296 #define LD_SWITCH_X_SITE_AUX
1297 #endif  
1299 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1300 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1302 #ifdef THIS_IS_CONFIGURE
1304 /* Get the CFLAGS for tests in configure.  */
1305 #ifdef __GNUC__
1306 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1307 #else
1308 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1309 #endif
1311 #else /* not THIS_IS_CONFIGURE */
1313 /* Get the CFLAGS for real compilation.  */
1314 #ifdef __GNUC__
1315 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1316 #else
1317 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1318 #endif
1320 #endif /* not THIS_IS_CONFIGURE */
1321 ' > ${tempcname}
1323 # The value of CPP is a quoted variable reference, so we need to do this
1324 # to get its actual value...
1325 CPP=`eval "echo $CPP"`
1326 changequote(, )dnl
1327 eval `${CPP} -Isrc ${tempcname} \
1328        | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1329 if test "x$SPECIFIED_CFLAGS" = x; then
1330   eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1331          | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1332 else
1333   REAL_CFLAGS="$CFLAGS"
1335 changequote([, ])dnl
1336 rm ${tempcname}
1338 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1340 ### Make sure subsequent tests use flags consistent with the build flags.
1342 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1343   CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1344 else
1345   CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1348 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1349 AC_SYS_LARGEFILE
1351 # Sound support for GNU/Linux and the free BSDs.
1352 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1353 # Emulation library used on NetBSD.
1354 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1355 AC_SUBST(LIBSOUND)
1357 dnl checks for header files
1358 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1359   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1360   termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h pty.h sys/mman.h \
1361   sys/param.h)
1362 AC_HEADER_STDC
1363 AC_HEADER_TIME
1364 AC_DECL_SYS_SIGLIST
1365 AC_HEADER_SYS_WAIT
1367 dnl Some systems have utime.h but don't declare the struct anyplace.
1368 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1369 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1370 #include <sys/time.h>
1371 #include <time.h>
1372 #else
1373 #ifdef HAVE_SYS_TIME_H
1374 #include <sys/time.h>
1375 #else
1376 #include <time.h>
1377 #endif
1378 #endif
1379 #ifdef HAVE_UTIME_H
1380 #include <utime.h>
1381 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1382   emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1383 if test $emacs_cv_struct_utimbuf = yes; then
1384   AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
1387 dnl checks for typedefs
1388 AC_TYPE_SIGNAL
1390 dnl Check for speed_t typedef.
1391 AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1392   [AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
1393     emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
1394 if test $emacs_cv_speed_t = yes; then
1395   AC_DEFINE(HAVE_SPEED_T, 1, 
1396            [Define to 1 if `speed_t' is declared by <termios.h>.])
1399 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1400 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1401 #include <sys/time.h>
1402 #include <time.h>
1403 #else
1404 #ifdef HAVE_SYS_TIME_H
1405 #include <sys/time.h>
1406 #else
1407 #include <time.h>
1408 #endif
1409 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1410   emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1411 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1412 if test $emacs_cv_struct_timeval = yes; then
1413   AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by <sys/time.h>.])
1416 AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1417 AC_TRY_COMPILE([#include <math.h>], 
1418 [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1419   emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1420 HAVE_EXCEPTION=$emacs_cv_struct_exception
1421 if test $emacs_cv_struct_exception != yes; then
1422   AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
1425 dnl checks for structure members
1426 AC_STRUCT_TM
1427 AC_STRUCT_TIMEZONE
1428 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
1429                 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
1430                            [Define to 1 if `tm_gmtoff' is member of `struct tm'.])],,
1431                 [#include <time.h>])
1433 dnl checks for compiler characteristics
1435 dnl Testing __STDC__ to determine prototype support isn't good enough.
1436 dnl DEC C, for instance, doesn't define it with default options, and
1437 dnl is used on 64-bit systems (OSF Alphas).  Similarly for volatile
1438 dnl and void *.
1439 AC_C_PROTOTYPES
1440 AC_C_VOLATILE
1441 AC_C_CONST
1442 dnl This isn't useful because we can't turn on use of `inline' unless
1443 dnl the compiler groks `extern inline'.
1444 dnl AC_C_INLINE
1445 AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1446   [AC_TRY_COMPILE(, [void * foo;], 
1447                    emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1448 if test $emacs_cv_void_star = yes; then
1449   AC_DEFINE(POINTER_TYPE, void)
1450 else
1451   AC_DEFINE(POINTER_TYPE, char)
1453 AH_TEMPLATE(POINTER_TYPE,
1454             [Define as `void' if your compiler accepts `void *'; otherwise
1455              define as `char'.])dnl
1457 dnl check for Make feature
1458 AC_PROG_MAKE_SET
1460 dnl checks for operating system services
1461 AC_SYS_LONG_FILE_NAMES
1463 #### Choose a window system.
1465 AC_PATH_X
1466 if test "$no_x" = yes; then
1467   window_system=none
1468 else
1469   window_system=x11
1472 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1473   LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1474   LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1475   x_default_search_path=""
1476   for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
1477     x_search_path="\
1478 ${x_library}/X11/%L/%T/%N%C%S:\
1479 ${x_library}/X11/%l/%T/%N%C%S:\
1480 ${x_library}/X11/%T/%N%C%S:\
1481 ${x_library}/X11/%L/%T/%N%S:\
1482 ${x_library}/X11/%l/%T/%N%S:\
1483 ${x_library}/X11/%T/%N%S"
1484     if test x"${x_default_search_path}" = x; then
1485       x_default_search_path=${x_search_path}
1486     else
1487       x_default_search_path="${x_search_path}:${x_default_search_path}"
1488     fi
1489   done
1491 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1492   C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1495 if test x"${x_includes}" = x; then
1496   bitmapdir=/usr/include/X11/bitmaps
1497 else
1498   # accumulate include directories that have X11 bitmap subdirectories
1499   bmd_acc="dummyval"
1500   for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1501     if test -d "${bmd}/X11/bitmaps"; then
1502       bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1503     fi
1504     if test -d "${bmd}/bitmaps"; then
1505       bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1506     fi
1507   done
1508   if test ${bmd_acc} != "dummyval"; then
1509     bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1510   fi
1513 case "${window_system}" in
1514   x11 )
1515     HAVE_X_WINDOWS=yes
1516     HAVE_X11=yes
1517     case "${with_x_toolkit}" in
1518       athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1519       motif ) USE_X_TOOLKIT=MOTIF ;;
1520 dnl      open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
1521       no ) USE_X_TOOLKIT=none ;;
1522 dnl If user did not say whether to use a toolkit,
1523 dnl make this decision later: use the toolkit if we have X11R5 or newer.
1524       * ) USE_X_TOOLKIT=maybe ;;
1525     esac
1526   ;;
1527   none )
1528     HAVE_X_WINDOWS=no
1529     HAVE_X11=no
1530     USE_X_TOOLKIT=none
1531   ;;
1532 esac
1534 ### If we're using X11, we should use the X menu package.
1535 HAVE_MENUS=no
1536 case ${HAVE_X11} in
1537   yes ) HAVE_MENUS=yes ;;
1538 esac
1539   
1540 if test "${opsys}" = "hpux9"; then
1541   case "${x_libraries}" in
1542     *X11R4* )
1543       opsysfile="s/hpux9-x11r4.h"
1544       ;;
1545   esac
1548 if test "${opsys}" = "hpux9shr"; then
1549   case "${x_libraries}" in
1550     *X11R4* )
1551       opsysfile="s/hpux9shxr4.h"
1552       ;;
1553   esac
1556 ### Compute the unexec source name from the object name.
1557 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1559 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1560 # Assume not, until told otherwise.
1561 GNU_MALLOC=yes
1562 doug_lea_malloc=yes
1563 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1564 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1565 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1566                emacs_cv_var___after_morecore_hook,
1567 [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1568   emacs_cv_var___after_morecore_hook=yes,
1569   emacs_cv_var___after_morecore_hook=no)])
1570 if test $emacs_cv_var___after_morecore_hook = no; then
1571   doug_lea_malloc=no
1573 if test "${system_malloc}" = "yes"; then
1574   GNU_MALLOC=no
1575   GNU_MALLOC_reason="
1576     (The GNU allocators don't work with this system configuration.)"
1578 if test "$doug_lea_malloc" = "yes" ; then
1579   if test "$GNU_MALLOC" = yes ; then
1580     GNU_MALLOC_reason="
1581       (Using Doug Lea's new malloc from the GNU C Library.)"
1582   fi
1583   AC_DEFINE(DOUG_LEA_MALLOC, 1,
1584             [Define to 1 if you are using the GNU C Library.])
1587 if test x"${REL_ALLOC}" = x; then
1588   REL_ALLOC=${GNU_MALLOC}
1591 dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
1592 dnl the system configuration file (s/*.h) to turn the use of mmap
1593 dnl in the relocating allocator on.
1595 AC_FUNC_MMAP
1596 if test $use_mmap_for_buffers = yes; then
1597   REL_ALLOC=no
1600 LIBS="$libsrc_libs $LIBS"
1602 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1603 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1604 AC_CHECK_LIB(dnet, dnet_ntoa)
1605 dnl This causes -lresolv to get used in subsequent tests,
1606 dnl which causes failures on some systems such as HPUX 9.
1607 dnl AC_CHECK_LIB(resolv, gethostbyname)
1609 dnl FIXME replace main with a function we actually want from this library.
1610 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1612 AC_CHECK_LIB(pthreads, cma_open)
1614 AC_MSG_CHECKING(for XFree86 in /usr/X386)
1615 if test -d /usr/X386/include; then
1616   HAVE_XFREE386=yes
1617   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1618 else
1619   HAVE_XFREE386=no
1621 AC_MSG_RESULT($HAVE_XFREE386)
1623 # Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1624 # for the tests that follow.  We set it back to REAL_CFLAGS later on.
1626 REAL_CPPFLAGS="$CPPFLAGS"
1628 if test "${HAVE_X11}" = "yes"; then
1629   DEFS="$C_SWITCH_X_SITE $DEFS"
1630   LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1631   LIBS="$LIBX $LIBS"
1632   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1633   CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
1635   # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1636   # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1637   # but it's more convenient here to set LD_RUN_PATH
1638   # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1639   if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1640     LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1641     export LD_RUN_PATH
1642   fi
1644   if test "${opsys}" = "gnu-linux"; then
1645     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1646     AC_TRY_LINK([],
1647      [XOpenDisplay ("foo");],
1648      [xlinux_first_failure=no],
1649      [xlinux_first_failure=yes])
1650     if test "${xlinux_first_failure}" = "yes"; then
1651       OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1652       OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1653       OLD_CPPFLAGS="$CPPFLAGS"
1654       OLD_LIBS="$LIBS"
1655       LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1656       C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1657       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1658       LIBS="$LIBS -b i486-linuxaout"
1659       AC_TRY_LINK([],
1660        [XOpenDisplay ("foo");],
1661        [xlinux_second_failure=no],
1662        [xlinux_second_failure=yes])
1663       if test "${xlinux_second_failure}" = "yes"; then
1664         # If we get the same failure with -b, there is no use adding -b.
1665         # So take it out.  This plays safe.
1666         LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1667         C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1668         CPPFLAGS="$OLD_CPPFLAGS"
1669         LIBS="$OLD_LIBS"
1670         AC_MSG_RESULT(no)
1671       else
1672         AC_MSG_RESULT(yes)
1673       fi
1674     else
1675       AC_MSG_RESULT(no)
1676     fi
1677   fi
1679   # Reportedly, some broken Solaris systems have XKBlib.h but are missing
1680   # header files included from there.
1681   AC_MSG_CHECKING(for Xkb)
1682   AC_TRY_LINK([#include <X11/Xlib.h>
1683 #include <X11/XKBlib.h>],
1684         [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
1685         emacs_xkb=yes, emacs_xkb=no)
1686   AC_MSG_RESULT($emacs_xkb)
1687   if test $emacs_xkb = yes; then
1688     AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
1689   fi
1691   AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
1692 XScreenNumberOfScreen XSetWMProtocols)
1695 if test "${window_system}" = "x11"; then
1696   AC_MSG_CHECKING(X11 version 6)
1697   AC_CACHE_VAL(emacs_cv_x11_version_6,
1698   [AC_TRY_LINK([#include <X11/Xlib.h>],
1699 [#if XlibSpecificationRelease < 6
1700 fail;
1701 #endif
1702 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
1703   if test $emacs_cv_x11_version_6 = yes; then
1704     AC_MSG_RESULT(6 or newer)
1705     AC_DEFINE(HAVE_X11R6, 1,
1706               [Define to 1 if you have the X11R6 or newer version of Xlib.])
1707   else
1708     AC_MSG_RESULT(before 6)
1709   fi
1712 if test "${window_system}" = "x11"; then
1713   AC_MSG_CHECKING(X11 version 5)
1714   AC_CACHE_VAL(emacs_cv_x11_version_5,
1715   [AC_TRY_LINK([#include <X11/Xlib.h>],
1716 [#if XlibSpecificationRelease < 5
1717 fail;
1718 #endif
1719 ], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no)])
1720   if test $emacs_cv_x11_version_5 = yes; then
1721     AC_MSG_RESULT(5 or newer)
1722     HAVE_X11R5=yes
1723     AC_DEFINE(HAVE_X11R5, 1,
1724               [Define to 1 if you have the X11R5 or newer version of Xlib.])
1725   else
1726     HAVE_X11R5=no
1727     AC_MSG_RESULT(before 5)
1728   fi
1731 dnl Do not put whitespace before the #include statements below.
1732 dnl Older compilers (eg sunos4 cc) choke on it.
1733 if test x"${USE_X_TOOLKIT}" = xmaybe; then
1734   if test x"${HAVE_X11R5}" = xyes; then
1735     AC_MSG_CHECKING(X11 version 5 with Xaw)
1736     AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
1737     [AC_TRY_LINK([
1738 #include <X11/Intrinsic.h>
1739 #include <X11/Xaw/Simple.h>],
1740       [],
1741       emacs_cv_x11_version_5_with_xaw=yes,
1742       emacs_cv_x11_version_5_with_xaw=no)])
1743     if test $emacs_cv_x11_version_5_with_xaw = yes; then
1744       AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
1745       USE_X_TOOLKIT=LUCID
1746     else
1747       AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1748       USE_X_TOOLKIT=none
1749     fi
1750   else
1751     USE_X_TOOLKIT=none
1752   fi
1755 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1757 if test "${USE_X_TOOLKIT}" != "none"; then
1758   AC_MSG_CHECKING(X11 toolkit version)
1759   AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
1760   [AC_TRY_LINK([#include <X11/Intrinsic.h>],
1761 [#if XtSpecificationRelease < 6
1762 fail;
1763 #endif
1764 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
1765   HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1766   if test $emacs_cv_x11_toolkit_version_6 = yes; then
1767     AC_MSG_RESULT(6 or newer)
1768     AC_DEFINE(HAVE_X11XTR6, 1,
1769               [Define to 1 if you have the X11R6 or newer version of Xt.])
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, 1,
1806               [Define to 1 if you have Motif 2.1 or newer.])
1807     AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
1808     if test ${HAVE_LIBXP} = yes; then
1809       AC_DEFINE(HAVE_LIBXP, 1,
1810                 [Define to 1 if you have the Xp library (-lXp).])
1811     fi  
1812   fi
1815 ### Is -lXaw3d available?
1816 HAVE_XAW3D=no
1817 if test "${HAVE_X11}" = "yes"; then
1818   if test "${USE_X_TOOLKIT}" != "none"; then
1819     AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
1820         AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes))
1821     if test "${HAVE_XAW3D}" = "yes"; then
1822         AC_DEFINE(HAVE_XAW3D, 1,
1823                   [Define to 1 if you have the Xaw3d library (-lXaw3d).])
1824     fi
1825   fi
1827   
1828 dnl Use toolkit scroll bars if configured for X toolkit and either
1829 dnl using Motif or Xaw3d is available, and unless
1830 dnl --with-toolkit-scroll-bars=no was specified.
1832 AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
1833             [Define to 1 if we should use toolkit scroll bars.])dnl
1834 USE_TOOLKIT_SCROLL_BARS=no
1835 if test "${with_toolkit_scroll_bars}" != "no"; then
1836   if test "${USE_X_TOOLKIT}" != "none"; then
1837     if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1838       AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1839       HAVE_XAW3D=no
1840       USE_TOOLKIT_SCROLL_BARS=yes
1841     elif test "${HAVE_XAW3D}" = "yes"; then
1842       AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1843       USE_TOOLKIT_SCROLL_BARS=yes
1844     fi
1845   fi
1848 dnl Don't use X11 input methods if user specifies he doesn't want it
1849 dnl with `--with-xim=no'.
1851 if test "${with_xim}" != "no"; then
1852   AC_DEFINE(USE_XIM, 1,
1853             [Define to 1 if we should use XIM, if it is available.])
1856 ### Use -lXpm if available, unless `--with-xpm=no'.
1857 HAVE_XPM=no
1858 if test "${HAVE_X11}" = "yes"; then
1859   if test "${with_xpm}" != "no"; then
1860     AC_CHECK_HEADER(X11/xpm.h,
1861       AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
1862     if test "${HAVE_XPM}" = "yes"; then
1863       AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
1864       AC_EGREP_CPP(no_return_alloc_pixels,
1865       [#include "X11/xpm.h"
1866 #ifndef XpmReturnAllocPixels
1867 no_return_alloc_pixels
1868 #endif
1869       ], HAVE_XPM=no, HAVE_XPM=yes)
1871       if test "${HAVE_XPM}" = "yes"; then
1872         AC_MSG_RESULT(yes)
1873       else
1874         AC_MSG_RESULT(no)
1875       fi
1876     fi
1877   fi
1879   if test "${HAVE_XPM}" = "yes"; then
1880     AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
1881   fi
1883   
1884 ### Use -ljpeg if available, unless `--with-jpeg=no'.
1885 HAVE_JPEG=no
1886 if test "${HAVE_X11}" = "yes"; then
1887   if test "${with_jpeg}" != "no"; then
1888     dnl Checking for jpeglib.h can lose becsue of a redefinition of
1889     dnl  HAVE_STDLIB_H.
1890     AC_CHECK_HEADER(jerror.h,
1891       AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
1892   fi
1894   AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
1895   if test "${HAVE_JPEG}" = "yes"; then
1896     AC_DEFINE(HAVE_JPEG)
1897     AC_EGREP_CPP(
1898 changequote({, })dnl avoid leadingspace on the next line
1899 {version= *(6[2-9]|[7-9][0-9])},
1900 changequote([, ])dnl
1901         [#include <jpeglib.h>
1902          version=JPEG_LIB_VERSION
1903 ],    
1904         AC_DEFINE(HAVE_JPEG),
1905         [AC_MSG_WARN([libjpeg found, but not version 6b or later])
1906         HAVE_JPEG=no])
1907   fi
1909   
1910 ### Use -lpng if available, unless `--with-png=no'.
1911 HAVE_PNG=no
1912 if test "${HAVE_X11}" = "yes"; then
1913   if test "${with_png}" != "no"; then
1914     AC_CHECK_HEADER(png.h,
1915       AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm))
1916   fi
1918   if test "${HAVE_PNG}" = "yes"; then
1919     AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
1920   fi
1922   
1923 ### Use -ltiff if available, unless `--with-tiff=no'.
1924 HAVE_TIFF=no
1925 if test "${HAVE_X11}" = "yes"; then
1926   if test "${with_tiff}" != "no"; then
1927     AC_CHECK_HEADER(tiffio.h,
1928       tifflibs="-lz -lm"
1929       # At least one tiff package requires the jpeg library.
1930       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
1931       AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs))
1932   fi
1934   if test "${HAVE_TIFF}" = "yes"; then
1935     AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
1936   fi
1938   
1939 ### Use -lgif if available, unless `--with-gif=no'.
1940 HAVE_GIF=no
1941 if test "${HAVE_X11}" = "yes"; then
1942   if test "${with_gif}" != "no"; then
1943     AC_CHECK_HEADER(gif_lib.h,
1944 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
1945 # Earlier versions can crash Emacs.
1946       AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
1947   fi
1949   if test "${HAVE_GIF}" = "yes"; then
1950     AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have the ungif library (-lungif).])
1951   fi
1954 # If netdb.h doesn't declare h_errno, we must declare it by hand.
1955 AC_CACHE_CHECK(whether netdb declares h_errno,
1956                emacs_cv_netdb_declares_h_errno,
1957 [AC_TRY_LINK([#include <netdb.h>],
1958   [return h_errno;],
1959   emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
1960 if test $emacs_cv_netdb_declares_h_errno = yes; then
1961   AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
1964 AC_FUNC_ALLOCA
1966 # fmod, logb, and frexp are found in -lm on most systems.
1967 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
1968 AC_CHECK_LIB(m, sqrt)
1970 # Check for mail-locking functions in a "mail" library
1971 AC_CHECK_LIB(mail, maillock)
1972 dnl Debian, at least:
1973 dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)])
1974 AC_CHECK_LIB(lockfile, maillock)
1975 # If we have the shared liblockfile, assume we must use it for mail
1976 # locking (e.g. Debian).  If we couldn't link against liblockfile
1977 # (no liblockfile.a installed), ensure that we don't need to.
1978 if test "$ac_cv_lib_lockfile_maillock" = no; then
1979   dnl This works for files generally, not just executables.
1980   dnl Should we look elsewhere for it?  Maybe examine /etc/ld.so.conf?
1981   AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
1982                 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
1983   if test $ac_cv_prog_liblockfile = yes; then
1984     AC_MSG_ERROR([Shared liblockfile found but can't link against it.
1985 This probably means that movemail could lose mail.
1986 There may be a \`development' package to install containing liblockfile.])
1987   else AC_DEFINE(LIBMAIL, -llockfile, [Define to -llockfile if it is usable.])
1988   fi
1989   else :
1991 AC_CHECK_FUNCS(touchlock)
1992 AC_CHECK_HEADERS(maillock.h)
1994 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
1995 rename closedir mkdir rmdir sysinfo \
1996 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
1997 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
1998 utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
1999 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
2000 gai_strerror mkstemp mremap memmove)
2002 AC_FUNC_MKTIME
2003 if test "$ac_cv_func_working_mktime" = no; then
2004   AC_DEFINE(BROKEN_MKTIME, 1, [Define to 1 if the mktime function is broken.])
2007 AC_FUNC_GETLOADAVG
2009 AC_FUNC_FSEEKO
2011 # UNIX98 PTYs.
2012 AC_CHECK_FUNCS(grantpt)
2014 # PTY-related GNU extensions.
2015 AC_CHECK_FUNCS(getpt)
2017 # Check this now, so that we will NOT find the above functions in ncurses.
2018 # That is because we have not set up to link ncurses in lib-src.
2019 # It's better to believe a function is not available
2020 # than to expect to find it in ncurses.
2021 AC_CHECK_LIB(ncurses, tparm)
2023 # Do we need the Hesiod library to provide the support routines?
2024 if test "$with_hesiod" = yes ; then
2025   # Don't set $LIBS here -- see comments above.
2026   resolv=no
2027   AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2028      [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2029                   [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2030   if test "$resolv" = yes ; then
2031     RESOLVLIB=-lresolv
2032     AC_DEFINE(HAVE_LIBRESOLV, 1,
2033               [Define to 1 if you have the resolv library (-lresolv).])
2034   else
2035     RESOLVLIB=
2036   fi
2037   AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
2038         AC_DEFINE(HAVE_LIBHESIOD, 1,
2039                   [Define to 1 if you have the hesiod library (-lhesiod).]),
2040         :, $RESOLVLIB)])
2043 # These tell us which Kerberos-related libraries to use.
2044 if test "${with_kerberos+set}" = set; then
2045   AC_CHECK_LIB(com_err, com_err)
2046   AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2047   AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2048   AC_CHECK_LIB(krb5, krb5_init_context)
2049   if test "${with_kerberos5+set}" != set; then
2050     AC_CHECK_LIB(des425, des_cbc_encrypt,,
2051                  AC_CHECK_LIB(des, des_cbc_encrypt))
2052     AC_CHECK_LIB(krb4, krb_get_cred,,
2053                  AC_CHECK_LIB(krb, krb_get_cred))
2054   fi
2056   if test "${with_kerberos5+set}" = set; then
2057     AC_CHECK_HEADERS(krb5.h)
2058   else
2059     AC_CHECK_HEADERS(des.h,,
2060                      [AC_CHECK_HEADERS(kerberosIV/des.h,,
2061                                        [AC_CHECK_HEADERS(kerberos/des.h)])])
2062     AC_CHECK_HEADERS(krb.h,,
2063                      [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2064                                        [AC_CHECK_HEADERS(kerberos/krb.h)])])
2065   fi
2066   AC_CHECK_HEADERS(com_err.h)
2069 # Solaris requires -lintl if you want strerror (which calls dgettext)
2070 # to return localized messages.
2071 AC_CHECK_LIB(intl, dgettext)
2073 AC_MSG_CHECKING(whether localtime caches TZ)
2074 AC_CACHE_VAL(emacs_cv_localtime_cache,
2075 [if test x$ac_cv_func_tzset = xyes; then
2076 AC_TRY_RUN([#include <time.h>
2077 extern char **environ;
2078 unset_TZ ()
2080   char **from, **to;
2081   for (to = from = environ; (*to = *from); from++)
2082     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2083       to++;
2085 char TZ_GMT0[] = "TZ=GMT0";
2086 char TZ_PST8[] = "TZ=PST8";
2087 main()
2089   time_t now = time ((time_t *) 0);
2090   int hour_GMT0, hour_unset;
2091   if (putenv (TZ_GMT0) != 0)
2092     exit (1);
2093   hour_GMT0 = localtime (&now)->tm_hour;
2094   unset_TZ ();
2095   hour_unset = localtime (&now)->tm_hour;
2096   if (putenv (TZ_PST8) != 0)
2097     exit (1);
2098   if (localtime (&now)->tm_hour == hour_GMT0)
2099     exit (1);
2100   unset_TZ ();
2101   if (localtime (&now)->tm_hour != hour_unset)
2102     exit (1);
2103   exit (0);
2104 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2105 [# If we have tzset, assume the worst when cross-compiling.
2106 emacs_cv_localtime_cache=yes])
2107 else
2108         # If we lack tzset, report that localtime does not cache TZ,
2109         # since we can't invalidate the cache if we don't have tzset.
2110         emacs_cv_localtime_cache=no
2111 fi])dnl
2112 AC_MSG_RESULT($emacs_cv_localtime_cache)
2113 if test $emacs_cv_localtime_cache = yes; then
2114   AC_DEFINE(LOCALTIME_CACHE, 1,
2115             [Define to 1 if localtime caches TZ.])
2118 if test "x$HAVE_TIMEVAL" = xyes; then
2119   AC_CHECK_FUNCS(gettimeofday)
2120   if test $ac_cv_func_gettimeofday = yes; then
2121     AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2122                    emacs_cv_gettimeofday_two_arguments,
2123     [AC_TRY_COMPILE([
2124 #ifdef TIME_WITH_SYS_TIME
2125 #include <sys/time.h>
2126 #include <time.h>
2127 #else
2128 #ifdef HAVE_SYS_TIME_H
2129 #include <sys/time.h>
2130 #else
2131 #include <time.h>
2132 #endif
2133 #endif],
2134       [struct timeval time;
2135        gettimeofday (&time, 0);],
2136       emacs_cv_gettimeofday_two_arguments=yes,
2137       emacs_cv_gettimeofday_two_arguments=no)])
2138     if test $emacs_cv_gettimeofday_two_arguments = no; then
2139       AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
2140                 [Define to 1 if gettimeofday accepts only one argument.])
2141     fi
2142   fi
2145 dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
2146 if test "$ac_cv_func_gettimeofday" = yes; then
2147   AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone,
2148     [AC_TRY_COMPILE([#include <sys/time.h>],
2149     [struct timezone tz;],
2150     dnl It may be that we can't call gettimeofday with a non-null pointer,
2151     dnl even though we have struct timezone (e.g. HPUX).  In that case
2152     dnl we'll lie about struct timezone.
2153     [AC_TRY_RUN([
2154 #ifdef TIME_WITH_SYS_TIME
2155 #include <sys/time.h>
2156 #include <time.h>
2157 #else
2158 #ifdef HAVE_SYS_TIME_H
2159 #include <sys/time.h>
2160 #else
2161 #include <time.h>
2162 #endif
2163 #endif
2164 main () {
2165   struct timeval time;
2166   struct timezone dummy;
2167   exit (gettimeofday (&time, &dummy));
2169       emacs_cv_struct_timezone=yes,
2170       emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)],
2171     emacs_cv_struct_timezone=no)])
2174 ok_so_far=yes
2175 AC_CHECK_FUNC(socket, , ok_so_far=no)
2176 if test $ok_so_far = yes; then
2177   AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
2179 if test $ok_so_far = yes; then
2180   AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
2182 if test $ok_so_far = yes; then
2183   AC_DEFINE(HAVE_INET_SOCKETS, 1,
2184             [Define to 1 if you have inet sockets.])
2187 if test -f /usr/lpp/X11/bin/smt.exp; then
2188   AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
2189             [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
2192 AC_MSG_CHECKING(whether system supports dynamic ptys)
2193 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2194   AC_MSG_RESULT(yes)
2195   AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if dynamic ptys are supported.])
2196 else
2197   AC_MSG_RESULT(no)
2200 AC_FUNC_FORK
2201 dnl Adapted from Haible's version.
2202 AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
2203   [AC_TRY_LINK([#include <langinfo.h>],
2204     [char* cs = nl_langinfo(CODESET);],
2205     emacs_cv_langinfo_codeset=yes,
2206     emacs_cv_langinfo_codeset=no)
2207   ])
2208 if test $emacs_cv_langinfo_codeset = yes; then
2209   AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2210     [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2213 AC_CHECK_TYPES(size_t)
2215 # Set up the CFLAGS for real compilation, so we can substitute it.
2216 CFLAGS="$REAL_CFLAGS"
2217 CPPFLAGS="$REAL_CPPFLAGS"
2219 changequote(, )dnl
2220 #### Find out which version of Emacs this is.
2221 version=`grep 'defconst[         ]*emacs-version' ${srcdir}/lisp/version.el \
2222          | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
2223 changequote([, ])dnl
2224 if test x"${version}" = x; then
2225   AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
2228 ### Specify what sort of things we'll be editing into Makefile and config.h.
2229 ### Use configuration here uncanonicalized to avoid exceeding size limits.
2230 AC_SUBST(version)
2231 AC_SUBST(configuration)
2232 AC_SUBST(canonical)
2233 AC_SUBST(srcdir)
2234 AC_SUBST(prefix)
2235 AC_SUBST(exec_prefix)
2236 AC_SUBST(bindir)
2237 AC_SUBST(datadir)
2238 AC_SUBST(sharedstatedir)
2239 AC_SUBST(libexecdir)
2240 AC_SUBST(mandir)
2241 AC_SUBST(infodir)
2242 AC_SUBST(lispdir)
2243 AC_SUBST(locallisppath)
2244 AC_SUBST(lisppath)
2245 AC_SUBST(x_default_search_path)
2246 AC_SUBST(etcdir)
2247 AC_SUBST(archlibdir)
2248 AC_SUBST(docdir)
2249 AC_SUBST(bitmapdir)
2250 AC_SUBST(c_switch_system)
2251 AC_SUBST(c_switch_machine)
2252 AC_SUBST(LD_SWITCH_X_SITE)
2253 AC_SUBST(LD_SWITCH_X_SITE_AUX)
2254 AC_SUBST(C_SWITCH_X_SITE)
2255 AC_SUBST(CFLAGS)
2256 AC_SUBST(X_TOOLKIT_TYPE)
2257 AC_SUBST(machfile)
2258 AC_SUBST(opsysfile)
2259 AC_SUBST(GETLOADAVG_LIBS)
2261 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}",
2262                    [Define to the canonical Emacs configuration name.])
2263 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
2264                    [Define to the options passed to configure.])
2265 AC_DEFINE_UNQUOTED(config_machfile,  "${machfile}",
2266                    [Define to the used machine dependent file.])
2267 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
2268                    [Define to the used os dependent file.])
2269 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
2270 [Define LD_SWITCH_X_SITE to contain any special flags your loader
2271  may need to deal with X Windows.  For instance, if you've defined
2272  HAVE_X_WINDOWS above and your X libraries aren't in a place that
2273  your loader can find on its own, you might want to add "-L/..." or
2274  something similar.])
2275 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
2276                    [Define LD_SWITCH_X_SITE_AUX with an -R option
2277                     in case it's needed (for Solaris, for example).])
2278 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE,  ${C_SWITCH_X_SITE},
2279 [Define C_SWITCH_X_SITE to contain any special flags your compiler
2280  may need to deal with X Windows.  For instance, if you've defined
2281  HAVE_X_WINDOWS above and your X include files aren't in a place
2282  that your compiler can find on its own, you might want to add
2283  "-I/..." or something similar.])
2284 AC_DEFINE_UNQUOTED(UNEXEC_SRC,       ${UNEXEC_SRC},
2285                    [Define to the unexec source file name.])
2287 if test "${HAVE_X_WINDOWS}" = "yes" ; then
2288   AC_DEFINE(HAVE_X_WINDOWS, 1,
2289             [Define to 1 if you want to use the X window system.])
2291 if test "${USE_X_TOOLKIT}" != "none" ; then
2292   AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
2294 if test "${HAVE_X11}" = "yes" ; then
2295   AC_DEFINE(HAVE_X11, 1,
2296             [Define to 1 if you want to use version 11 of X windows.
2297              Otherwise, Emacs expects to use version 10.])
2299 if test "${HAVE_XFREE386}" = "yes" ; then
2300   AC_DEFINE(HAVE_XFREE386, 1, [Define to 1 if you're using XFree386.])
2302 if test "${HAVE_MENUS}" = "yes" ; then
2303   AC_DEFINE(HAVE_MENUS, 1,
2304             [Define to 1 if you have mouse menus.
2305              (This is automatic if you use X, but the option to specify it remains.)
2306              It is also defined with other window systems that support xmenu.c.])
2308 if test "${GNU_MALLOC}" = "yes" ; then
2309   AC_DEFINE(GNU_MALLOC, 1,
2310             [Define to 1 if you want to use the GNU memory allocator.])
2312 if test "${REL_ALLOC}" = "yes" ; then
2313   AC_DEFINE(REL_ALLOC, 1,
2314             [Define REL_ALLOC if you want to use the relocating allocator for
2315              buffer space.])
2318 AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1,
2319                  [Define to 1 if you have <nlist.h>.])])
2321 AH_TOP([/* GNU Emacs site configuration template file.
2322    Copyright (C) 1988, 93, 94, 99, 2000, 2002 Free Software Foundation, Inc.
2324 This file is part of GNU Emacs.
2326 GNU Emacs is free software; you can redistribute it and/or modify
2327 it under the terms of the GNU General Public License as published by
2328 the Free Software Foundation; either version 2, or (at your option)
2329 any later version.
2331 GNU Emacs is distributed in the hope that it will be useful,
2332 but WITHOUT ANY WARRANTY; without even the implied warranty of
2333 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2334 GNU General Public License for more details.
2336 You should have received a copy of the GNU General Public License
2337 along with GNU Emacs; see the file COPYING.  If not, write to the
2338 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
2339 Boston, MA 02111-1307, USA.  */
2342 /* No code in Emacs #includes config.h twice, but some of the code
2343    intended to work with other packages as well (like gmalloc.c) 
2344    think they can include it as many times as they like.  */
2345 #ifndef EMACS_CONFIG_H
2346 #define EMACS_CONFIG_H
2347 ])dnl
2349 AH_BOTTOM([
2350 /* If we're using any sort of window system, define some consequences.  */
2351 #ifdef HAVE_X_WINDOWS
2352 #define HAVE_WINDOW_SYSTEM
2353 #define MULTI_KBOARD
2354 #define HAVE_MOUSE
2355 #endif
2357 /* If we're using the Carbon API on Mac OS X, define a few more
2358    variables as well.  */
2359 #ifdef HAVE_CARBON
2360 #define HAVE_WINDOW_SYSTEM
2361 #define HAVE_MOUSE
2362 #define HAVE_MENUS
2363 #endif
2365 /* Define USER_FULL_NAME to return a string
2366    that is the user's full name.
2367    It can assume that the variable `pw'
2368    points to the password file entry for this user.
2370    At some sites, the pw_gecos field contains
2371    the user's full name.  If neither this nor any other
2372    field contains the right thing, use pw_name,
2373    giving the user's login name, since that is better than nothing.  */
2374 #define USER_FULL_NAME pw->pw_gecos
2376 /* Define AMPERSAND_FULL_NAME if you use the convention
2377    that & in the full name stands for the login id.  */
2378 /* Turned on June 1996 supposing nobody will mind it.  */
2379 #define AMPERSAND_FULL_NAME
2381 /* Define HAVE_SOUND if we have sound support.  We know it works
2382    and compiles only on the specified platforms.   For others,
2383    it probably doesn't make sense to try.  */
2385 #if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
2386 #ifdef HAVE_MACHINE_SOUNDCARD_H
2387 #define HAVE_SOUND 1
2388 #endif
2389 #ifdef HAVE_SYS_SOUNDCARD_H
2390 #define HAVE_SOUND 1
2391 #endif
2392 #ifdef HAVE_SOUNDCARD_H
2393 #define HAVE_SOUND 1
2394 #endif
2395 #endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
2397 /* If using GNU, then support inline function declarations. */
2398 /* Don't try to switch on inline handling as detected by AC_C_INLINE
2399    generally, because even if non-gcc compilers accept `inline', they
2400    may reject `extern inline'.  */
2401 #ifdef __GNUC__
2402 #define INLINE __inline__
2403 #else
2404 #define INLINE
2405 #endif
2407 /* Include the os and machine dependent files.  */
2408 #include config_opsysfile
2409 #include config_machfile
2411 /* Load in the conversion definitions if this system
2412    needs them and the source file being compiled has not
2413    said to inhibit this.  There should be no need for you
2414    to alter these lines.  */
2416 #ifdef SHORTNAMES
2417 #ifndef NO_SHORTNAMES
2418 #include "../shortnames/remap.h"
2419 #endif /* not NO_SHORTNAMES */
2420 #endif /* SHORTNAMES */
2422 /* If no remapping takes place, static variables cannot be dumped as
2423    pure, so don't worry about the `static' keyword. */
2424 #ifdef NO_REMAP
2425 #undef static
2426 #endif
2428 /* Define `subprocesses' should be defined if you want to
2429    have code for asynchronous subprocesses
2430    (as used in M-x compile and M-x shell).
2431    These do not work for some USG systems yet;
2432    for the ones where they work, the s/SYSTEM.h file defines this flag.  */
2434 #ifndef VMS
2435 #ifndef USG
2436 /* #define subprocesses */
2437 #endif
2438 #endif
2440 /* SIGTYPE is the macro we actually use.  */
2441 #ifndef SIGTYPE
2442 #define SIGTYPE RETSIGTYPE
2443 #endif
2445 #ifdef emacs /* Don't do this for lib-src.  */
2446 /* Tell regex.c to use a type compatible with Emacs.  */
2447 #define RE_TRANSLATE_TYPE Lisp_Object
2448 #define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
2449 #define RE_TRANSLATE_P(TBL) (XFASTINT (TBL) != 0)
2450 #endif
2452 /* Avoid link-time collision with system mktime if we will use our own.  */
2453 #if ! HAVE_MKTIME || BROKEN_MKTIME
2454 #define mktime emacs_mktime
2455 #endif
2457 /* The rest of the code currently tests the CPP symbol BSTRING.
2458    Override any claims made by the system-description files.
2459    Note that on some SCO version it is possible to have bcopy and not bcmp.  */
2460 #undef BSTRING
2461 #if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
2462 #define BSTRING
2463 #endif
2465 /* Some of the files of Emacs which are intended for use with other
2466    programs assume that if you have a config.h file, you must declare
2467    the type of getenv.
2469    This declaration shouldn't appear when alloca.s or Makefile.in
2470    includes config.h.  */
2471 #ifndef NOT_C_CODE
2472 extern char *getenv ();
2473 #endif
2475 #endif /* EMACS_CONFIG_H */
2477 /* These default definitions are good for almost all machines.
2478    The exceptions override them in m/MACHINE.h.  */
2480 #ifndef BITS_PER_CHAR
2481 #define BITS_PER_CHAR 8
2482 #endif
2484 #ifndef BITS_PER_SHORT
2485 #define BITS_PER_SHORT 16
2486 #endif
2488 /* Note that lisp.h uses this in a preprocessor conditional, so it
2489    would not work to use sizeof.  That being so, we do all of them
2490    without sizeof, for uniformity's sake.  */
2491 #ifndef BITS_PER_INT
2492 #define BITS_PER_INT 32
2493 #endif
2495 #ifndef BITS_PER_LONG
2496 #ifdef _LP64
2497 #define BITS_PER_LONG 64
2498 #else
2499 #define BITS_PER_LONG 32
2500 #endif
2501 #endif
2503 /* Define if the compiler supports function prototypes.  It may do so
2504    but not define __STDC__ (e.g. DEC C by default) or may define it as
2505    zero.  */
2506 #undef PROTOTYPES
2507 /* For mktime.c:  */
2508 #ifndef __P
2509 # if defined PROTOTYPES
2510 #  define __P(args) args
2511 # else
2512 #  define __P(args) ()
2513 # endif  /* GCC.  */
2514 #endif /* __P */
2517 /* Don't include "string.h" or <stdlib.h> in non-C code.  */
2518 #ifndef NOT_C_CODE
2519 #ifdef HAVE_STRING_H
2520 #include "string.h"
2521 #endif
2522 #ifdef HAVE_STRINGS_H
2523 #include "strings.h"  /* May be needed for bcopy & al. */
2524 #endif
2525 #ifdef HAVE_STDLIB_H
2526 #include <stdlib.h>
2527 #endif
2528 #endif
2530 /* Define HAVE_X_I18N if we have usable i18n support.  */
2532 #ifdef HAVE_X11R6
2533 #define HAVE_X_I18N
2534 #elif defined HAVE_X11R5 && !defined X11R5_INHIBIT_I18N
2535 #define HAVE_X_I18N
2536 #endif
2538 /* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support.  */
2540 #if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
2541 #define HAVE_X11R6_XIM
2542 #endif
2544 /* Should we enable expensive run-time checking of data types?  */
2545 #undef ENABLE_CHECKING
2547 #if defined __GNUC__ && (__GNUC__ > 2 \
2548                          || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
2549 #define NO_RETURN       __attribute__ ((__noreturn__))
2550 #else
2551 #define NO_RETURN       /* nothing */
2552 #endif
2554 /* 
2555 Local Variables:
2556 mode: c
2557 End:
2559 ])dnl
2561 #### Report on what we decided to do.
2562 echo "
2563 Configured for \`${canonical}'.
2565   Where should the build process find the source code?    ${srcdir}
2566   What operating system and machine description files should Emacs use?
2567         \`${opsysfile}' and \`${machfile}'
2568   What compiler should emacs be built with?               ${CC} ${CFLAGS}
2569   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
2570   Should Emacs use a relocating allocator for buffers?    ${REL_ALLOC}
2571   Should Emacs use mmap(2) for buffer allocation?         $use_mmap_for_buffers
2572   What window system should Emacs use?                    ${window_system}
2573   What toolkit should Emacs use?                          ${USE_X_TOOLKIT}"
2575 if test -n "${x_includes}"; then
2576 echo "  Where do we find X Windows header files?                ${x_includes}"
2577 else
2578 echo "  Where do we find X Windows header files?                Standard dirs"
2580 if test -n "${x_libraries}"; then
2581 echo "  Where do we find X Windows libraries?                   ${x_libraries}"
2582 else
2583 echo "  Where do we find X Windows libraries?                   Standard dirs"
2586 echo "  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D}"
2587 echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
2588 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
2589 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
2590 echo "  Does Emacs use -lungif?                                 ${HAVE_GIF}"
2591 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
2592 echo "  Does Emacs use X toolkit scroll bars?                   ${USE_TOOLKIT_SCROLL_BARS}"
2593 echo
2595 # Remove any trailing slashes in these variables.
2596 changequote(, )dnl
2597 test "${prefix}" != NONE &&
2598   prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
2599 test "${exec_prefix}" != NONE &&
2600   exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
2601 changequote([, ])dnl
2603 ## Check if the C preprocessor will convert `..' to `. .'.  If so, set
2604 ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
2605 ## from Makefile.c can correctly provide the arg `-traditional' to the
2606 ## C preprocessor.
2608 AC_EGREP_CPP(yes..yes,
2609         [yes..yes],
2610         CPP_NEED_TRADITIONAL=no,
2611         CPP_NEED_TRADITIONAL=yes)
2613 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
2614         man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
2615         lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [
2617 ### Make the necessary directories, if they don't exist.
2618 for dir in etc lisp ; do
2619   test -d ${dir} || mkdir ${dir}
2620 done
2622 # Build src/Makefile from ${srcdir}/src/Makefile.c
2623 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
2624 # This must be done after src/config.h is built, since we rely on that file.
2626 changequote(, )dnl The horror, the horror.
2627 # Now get this: Some word that is part of the ${srcdir} directory name
2628 # or the ${configuration} value might, just might, happen to be an
2629 # identifier like `sun4' or `i386' or something, and be predefined by
2630 # the C preprocessor to some helpful value like 1, or maybe the empty
2631 # string.  Needless to say consequent macro substitutions are less
2632 # than conducive to the makefile finding the correct directory.
2633 undefs="`echo $top_srcdir $configuration $canonical |
2634 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/  *$//' \
2635     -e 's/  */ -U/g' -e 's/-U[0-9][^ ]*//g' \
2637 changequote([, ])dnl
2639 echo creating src/epaths.h
2640 ${MAKE-make} epaths-force
2642 # As of 2000-11-19, newest development versions of GNU cpp preprocess
2643 # `..' to `. .'  unless invoked with -traditional
2645 if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
2646   CPPFLAGS="$CPPFLAGS -traditional"
2649 echo creating lib-src/Makefile
2650 ( cd lib-src
2651   rm -f junk.c junk1.c junk2.c
2652   sed -e '/start of cpp stuff/q' \
2653       < Makefile.c > junk1.c
2654   sed -e '1,/start of cpp stuff/d'\
2655       -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2656       < Makefile.c > junk.c
2657   $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2658       sed -e 's/^ /     /' -e '/^#/d' -e '/^[   \f]*$/d' > junk2.c
2659   cat junk1.c junk2.c > Makefile.new
2660   rm -f junk.c junk1.c junk2.c
2661   chmod 444 Makefile.new
2662   mv -f Makefile.new Makefile
2665 echo creating src/Makefile
2666 ( cd src
2667   rm -f junk.c junk1.c junk2.c
2668   sed -e '/start of cpp stuff/q' \
2669       < Makefile.c > junk1.c
2670   sed -e '1,/start of cpp stuff/d'\
2671       -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
2672       < Makefile.c > junk.c
2673   $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
2674       sed -e 's/^ /     /' -e '/^#/d' -e '/^[   \f]*$/d' > junk2.c
2675   cat junk1.c junk2.c > Makefile.new
2676   rm -f junk.c junk1.c junk2.c
2677   chmod 444 Makefile.new
2678   mv -f Makefile.new Makefile
2681 if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
2682   echo creating src/.gdbinit
2683   echo source $srcdir/src/.gdbinit > src/.gdbinit
2686 # This is how we know whether to re-run configure in certain cases.
2687 touch src/config.stamp
2689 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])