* vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, vc-mcvs.el, vc-svn.el:
[emacs.git] / configure.in
blobc07541fe1babc52f4e8a7f5e3af58929ea833460
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, 2003,
7 dnl    2004, 2005, 2006, 2007  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 3, 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., 51 Franklin Street, Fifth Floor,
24 dnl  Boston, MA 02110-1301, USA.
26 AC_PREREQ(2.61)dnl
27 AC_INIT(emacs, 23.0.50)
28 AC_CONFIG_HEADER(src/config.h:src/config.in)
29 AC_CONFIG_SRCDIR(src/lisp.h)
31 dnl Support for --program-prefix, --program-suffix and
32 dnl --program-transform-name options
33 AC_ARG_PROGRAM
35 lispdir='${datadir}/emacs/${version}/lisp'
36 locallisppath='${datadir}/emacs/${version}/site-lisp:'\
37 '${datadir}/emacs/site-lisp'
38 lisppath='${locallisppath}:${lispdir}:${datadir}/emacs/${version}/leim'
39 etcdir='${datadir}/emacs/${version}/etc'
40 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
41 docdir='${datadir}/emacs/${version}/etc'
42 gamedir='${localstatedir}/games/emacs'
44 gameuser=games
46 dnl Autoconf is so much less fun under VMS, maybe
47 dnl because everything is less fun under VMS. --ttn
48 AC_DEFUN([EMACS_ARG_Y],[dnl
49 AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[$3],[$4])dnl
50 ])dnl
51 AC_DEFUN([EMACS_ARG_N],[dnl
52 AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[$3],[$4])dnl
53 ])dnl
55 EMACS_ARG_N([gcc],[don't use GCC to compile Emacs if GCC is found])
57 EMACS_ARG_N([pop],[don't support POP mail retrieval with movemail],
58 [if test "$withval" = yes; then
59    AC_DEFINE(MAIL_USE_POP)
60 else :
61 fi],
62 AC_DEFINE(MAIL_USE_POP))
63 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
65 EMACS_ARG_Y([kerberos],[support Kerberos-authenticated POP],
66 [if test "$withval" = yes; then
67    AC_DEFINE(KERBEROS)
68 fi])
69 AH_TEMPLATE(KERBEROS,
70             [Define to support Kerberos-authenticated POP mail retrieval.])dnl
72 EMACS_ARG_Y([kerberos5],[support Kerberos version 5 authenticated POP],
73 [if test "${with_kerberos5+set}" = set; then
74   if test "${with_kerberos+set}" != set; then
75     with_kerberos=yes
76     AC_DEFINE(KERBEROS)
77   fi
78   AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])
79 fi])
81 EMACS_ARG_Y([hesiod],[support Hesiod to get the POP server host],
82 [if test "$withval" = yes; then
83   AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
84 fi])
86 EMACS_ARG_N([sound],[don't compile with sound support])
88 dnl This should be the last --with option, because --with-x is
89 dnl added later on when we find the path of X, and it's best to
90 dnl keep them together visually.
91 AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
92  [use an X toolkit (KIT one of: yes, lucid, athena, motif, gtk, no)])],
93 [         case "${withval}" in
94             y | ye | yes )      val=gtk ;;
95             n | no )            val=no  ;;
96             l | lu | luc | luci | lucid )       val=lucid ;;
97             a | at | ath | athe | athen | athena )      val=athena ;;
98             m | mo | mot | moti | motif )       val=motif ;;
99             g | gt | gtk  )     val=gtk ;;
100             * )
101 AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
102 this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
103 `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
104             ;;
105           esac
106           with_x_toolkit=$val
109 EMACS_ARG_Y([xpm],[use -lXpm for displaying XPM images])
110 EMACS_ARG_Y([jpeg],[use -ljpeg for displaying JPEG images])
111 EMACS_ARG_Y([tiff],[use -ltiff for displaying TIFF images])
112 EMACS_ARG_Y([gif],[use -lgif (or -lungif) for displaying GIF images])
113 EMACS_ARG_Y([png],[use -lpng for displaying PNG images])
114 EMACS_ARG_Y([gpm],[use -lgpm for mouse support on a GNU/Linux console])
115 EMACS_ARG_Y([rsvg],[use -lrsvg-2 for displaying SVG images])
116 EMACS_ARG_Y([gtk],[use GTK (same as --with-x-toolkit=gtk)])
117 EMACS_ARG_Y([pkg-config-prog],[Path to pkg-config for finding GTK and librsvg])
118 EMACS_ARG_N([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
119 EMACS_ARG_N([xaw3d],[don't use Xaw3d])
120 EMACS_ARG_N([xim],[don't use X11 XIM])
121 EMACS_ARG_N([carbon],[don't use Carbon GUI on Mac OS X])
122 EMACS_ARG_Y([dbus],[use D-Bus])
124 AC_ARG_ENABLE(carbon-app,
125 [AS_HELP_STRING([--enable-carbon-app@<:@=DIR@:>@],
126                 [specify install directory for Emacs.app on Mac OS X
127                  [DIR=/Application]])],
128 [ carbon_appdir_x=${enableval}])
130 AC_ARG_ENABLE(asserts,
131 [AS_HELP_STRING([--enable-asserts], [compile code with asserts enabled])],
132       USE_XASSERTS=$enableval,
133       USE_XASSERTS=no)
135 AC_ARG_ENABLE(maintainer-mode,
136 [AS_HELP_STRING([--enable-maintainer-mode],
137                 [enable make rules and dependencies not useful (and sometimes
138                  confusing) to the casual installer])],
139       USE_MAINTAINER_MODE=$enableval,
140       USE_MAINTAINER_MODE=no)
141 if test $USE_MAINTAINER_MODE = yes; then
142   MAINT=
143 else
144   MAINT=#
146 AC_SUBST(MAINT)
148 AC_ARG_ENABLE(locallisppath,
149 [AS_HELP_STRING([--enable-locallisppath=PATH],
150                 [directories Emacs should search for lisp files specific
151                  to this site])],
152 if test "${enableval}" = "no"; then
153   locallisppath=
154 elif test "${enableval}" != "yes"; then
155   locallisppath=${enableval}
158 #### Make srcdir absolute, if it isn't already.  It's important to
159 #### avoid running the path through pwd unnecessarily, since pwd can
160 #### give you automounter prefixes, which can go away.  We do all this
161 #### so Emacs can find its files when run uninstalled.
162 ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
163 unset CDPATH
164 case "${srcdir}" in
165   /* ) ;;
166   . )
167     ## We may be able to use the $PWD environment variable to make this
168     ## absolute.  But sometimes PWD is inaccurate.
169     ## Note: we used to use ${PWD} at the end instead of `pwd`,
170     ## but that tested only for a well-formed and valid PWD,
171     ## it did not object when PWD was well-formed and valid but just wrong.
172     if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`"  ;
173     then
174       srcdir="$PWD"
175     else
176       srcdir="`(cd ${srcdir}; pwd)`"
177     fi
178   ;;
179   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
180 esac
182 #### Check if the source directory already has a configured system in it.
183 if test `pwd` != `(cd ${srcdir} && pwd)` \
184    && test -f "${srcdir}/src/config.h" ; then
185   AC_MSG_WARN([[The directory tree `${srcdir}' is being used
186    as a build directory right now; it has been configured in its own
187    right.  To configure in another directory as well, you MUST
188    use GNU make.  If you do not have GNU make, then you must
189    now do `make distclean' in ${srcdir},
190    and then run $0 again.]])
193 #### Given the configuration name, set machfile and opsysfile to the
194 #### names of the m/*.h and s/*.h files we should use.
196 ### Canonicalize the configuration name.
198 AC_CANONICAL_HOST
199 canonical=$host
200 configuration=${host_alias-${build_alias-$host}}
202 dnl This used to use changequote, but, apart from `changequote is evil'
203 dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
204 dnl the great gob of text.  Thus it's not processed for possible expansion.
205 dnl Just make sure the brackets remain balanced.
207 dnl Since Emacs can't find matching pairs of quotes, boundaries are
208 dnl indicated by comments.
209 dnl quotation begins
212 ### If you add support for a new configuration, add code to this
213 ### switch statement to recognize your configuration name and select
214 ### the appropriate operating system and machine description files.
216 ### You would hope that you could choose an m/*.h file pretty much
217 ### based on the machine portion of the configuration name, and an s-
218 ### file based on the operating system portion.  However, it turns out
219 ### that each m/*.h file is pretty manufacturer-specific - for
220 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
221 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
222 ### machines.  So we basically have to have a special case for each
223 ### configuration name.
225 ### As far as handling version numbers on operating systems is
226 ### concerned, make sure things will fail in a fixable way.  If
227 ### /etc/MACHINES doesn't say anything about version numbers, be
228 ### prepared to handle anything reasonably.  If version numbers
229 ### matter, be sure /etc/MACHINES says something about it.
231 ### Eric Raymond says we should accept strings like "sysvr4" to mean
232 ### "System V Release 4"; he writes, "The old convention encouraged
233 ### confusion between `system' and `release' levels'."
235 machine='' opsys='' unported=no
236 case "${canonical}" in
238   ## FreeBSD ports
239   *-*-freebsd* )
240     opsys=freebsd
241     case "${canonical}" in
242       alpha*-*-freebsd*)        machine=alpha ;;
243       ia64-*-freebsd*)          machine=ia64 ;;
244       sparc64-*-freebsd*)       machine=sparc ;;
245       powerpc-*-freebsd*)       machine=macppc ;;
246       i[3456]86-*-freebsd*)     machine=intel386 ;;
247       amd64-*-freebsd*|x86_64-*-freebsd*) machine=amdx86-64 ;;
248     esac
249   ;;
251   ## FreeBSD kernel + glibc based userland
252   *-*-kfreebsd*gnu* )
253     opsys=gnu-kfreebsd
254     case "${canonical}" in
255       alpha*-*-kfreebsd*)       machine=alpha ;;
256       ia64-*-kfreebsd*)         machine=ia64 ;;
257       sparc64-*-kfreebsd*)      machine=sparc ;;
258       powerpc-*-kfreebsd*)      machine=macppc ;;
259       i[3456]86-*-kfreebsd*)    machine=intel386 ;;
260       amd64-*-kfreebsd*|x86_64-*-kfreebsd*) machine=amdx86-64 ;;
261     esac
262   ;;
264   ## NetBSD ports
265   *-*-netbsd* )
266     opsys=netbsd
267     if test -f /usr/lib/crti.o; then]
268 dnl The close and open brackets here are because this section is quoted --
269 dnl see the `changequote' comment above.
270       AC_DEFINE(HAVE_CRTIN, [], [Define to 1 if you have /usr/lib/crti.o.])
271 [   fi
273     case "${canonical}" in
274       alpha*-*-netbsd*) machine=alpha ;;
275       i[3456]86-*-netbsd*) machine=intel386 ;;
276       m68k-*-netbsd*)
277                         # This is somewhat bogus.
278                         machine=hp9000s300 ;;
279       mips-*-netbsd*)   machine=pmax ;;
280       mipsel-*-netbsd*) machine=pmax ;;
281       mipseb-*-netbsd*) machine=pmax ;;
282       ns32k-*-netbsd*)  machine=ns32000 ;;
283       powerpc-*-netbsd*) machine=macppc ;;
284       sparc*-*-netbsd*) machine=sparc ;;
285       vax-*-netbsd*)    machine=vax ;;
286       arm-*-netbsd*)    machine=arm ;;
287       x86_64-*-netbsd*) machine=amdx86-64 ;;
288       hppa-*-netbsd*)   machine=hp800 ;;
289       shle-*-netbsd*)   machine=sh3el ;;
290     esac
291   ;;
293   ## OpenBSD ports
294   *-*-openbsd* )
295     opsys=openbsd
296     case "${canonical}" in
297       alpha*-*-openbsd*)        machine=alpha ;;
298       arm-*-openbsd*)          machine=arm ;;
299       hppa-*-openbsd*)         machine=hp9000s300 ;;
300       i386-*-openbsd*)         machine=intel386 ;;
301       m68k-*-openbsd*)         machine=hp9000s300 ;;
302       m88k-*-openbsd*)         machine=aviion ;;
303       mips64-*-openbsd*)       machine=mips64 ;;
304       powerpc-*-openbsd*)      machine=macppc ;;
305       sh-*-openbsd*)           machine=sh3el ;;
306       sparc*-*-openbsd*)       machine=sparc ;;
307       vax-*-openbsd*)          machine=vax ;;
308       x86_64-*-openbsd*)       machine=amdx86-64 ;;
309     esac
310   ;;
312   ## LynxOS ports
313   *-*-lynxos* )
314     opsys=lynxos
315     case "${canonical}" in
316       i[3456]86-*-lynxos*) machine=intel386 ;;
317       powerpc-*-lynxos*) machine=powerpc ;;
318     esac
319   ;;
321   ## Acorn RISCiX:
322   arm-acorn-riscix1.1* )
323     machine=acorn opsys=riscix1-1
324   ;;
325   arm-acorn-riscix1.2* | arm-acorn-riscix )
326     ## This name is riscix12 instead of riscix1.2
327     ## to avoid a file name conflict on MSDOS.
328     machine=acorn opsys=riscix12
329   ;;
331   ## BSDI ports
332   *-*-bsdi* )
333     opsys=bsdi
334     case "${canonical}" in
335       i[345]86-*-bsdi*) machine=intel386 ;;
336       sparc-*-bsdi*)  machine=sparc ;;
337       powerpc-*-bsdi*)  machine=macppc ;;
338     esac
339     case "${canonical}" in
340       *-*-bsd386* | *-*-bsdi1* )        opsys=bsd386 ;;
341       *-*-bsdi2.0* )            opsys=bsdos2 ;;
342       *-*-bsdi2* )              opsys=bsdos2-1 ;;
343       *-*-bsdi3* )              opsys=bsdos3 ;;
344       *-*-bsdi[45]* )           opsys=bsdos4 ;;
345     esac
346   ;;
348   ## Alliant machines
349   ## Strictly speaking, we need the version of the alliant operating
350   ## system to choose the right machine file, but currently the
351   ## configuration name doesn't tell us enough to choose the right
352   ## one; we need to give alliants their own operating system name to
353   ## do this right.  When someone cares, they can help us.
354   fx80-alliant-* )
355     machine=alliant4 opsys=bsd4-2
356   ;;
357   i860-alliant-* )
358     machine=alliant-2800 opsys=bsd4-3
359   ;;
361   ## Alpha (DEC) machines.
362   alpha*-dec-osf* )
363     machine=alpha opsys=osf1
364     # This is needed to find X11R6.1 libraries for certain tests.
365     NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
366     GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
367     # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile
368     # due to non-traditional preprocessing with the current compiler
369     # defaults.  OSF 4 can also have that compiler version, and there
370     # seems always to have been a usable /usr/bin/cpp.
371     NON_GNU_CPP=/usr/bin/cpp
372     case "${canonical}" in
373     alpha*-dec-osf[5-9]*)
374       opsys=osf5-0 ;;
375     esac
376   ;;
378   alpha*-*-linux-gnu* )
379     machine=alpha opsys=gnu-linux
380   ;;
382   arm*-*-linux-gnu* )
383     machine=arm opsys=gnu-linux
384   ;;
386   ## Altos 3068
387   m68*-altos-sysv* )
388     machine=altos opsys=usg5-2
389   ;;
391   ## Amdahl UTS
392   580-amdahl-sysv* )
393     machine=amdahl opsys=usg5-2-2
394   ;;
396   ## Apollo, Domain/OS
397   m68*-apollo-* )
398     machine=apollo opsys=bsd4-3
399   ;;
401   ## Apple Darwin / Mac OS X
402   *-apple-darwin* )
403     case "${canonical}" in
404       i[3456]86-* )  machine=intel386 ;;
405       powerpc-* )    machine=powermac ;;
406       * )            unported=yes ;;
407     esac
408     opsys=darwin
409     # Define CPP as follows to make autoconf work correctly.
410     CPP="${CC-cc} -E -no-cpp-precomp"
411     # Use fink packages if available.
412     if test -d /sw/include && test -d /sw/lib; then
413       GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
414       CPP="${CPP} ${GCC_TEST_OPTIONS}"
415       NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
416     fi
417   ;;
419   ## AT&T 3b2, 3b5, 3b15, 3b20
420   we32k-att-sysv* )
421     machine=att3b opsys=usg5-2-2
422   ;;
424   ## AT&T 3b1 - The Mighty Unix PC!
425   m68*-att-sysv* )
426     machine=7300 opsys=usg5-2-2
427   ;;
429   ## Bull dpx20
430   rs6000-bull-bosx* )
431     machine=ibmrs6000 opsys=aix3-2
432   ;;
434   ## Bull dpx2
435   m68*-bull-sysv3* )
436     machine=dpx2 opsys=usg5-3
437   ;;
439   ## Bull sps7
440   m68*-bull-sysv2* )
441     machine=sps7 opsys=usg5-2
442   ;;
444   ## CCI 5/32, 6/32 -- see "Tahoe".
446   ## Celerity
447   ## I don't know what configuration name to use for this; config.sub
448   ## doesn't seem to know anything about it.  Hey, Celerity users, get
449   ## in touch with us!
450   celerity-celerity-bsd* )
451     machine=celerity opsys=bsd4-2
452   ;;
454   ## Clipper
455   ## What operating systems does this chip run that Emacs has been
456   ## tested on?
457   clipper-* )
458     machine=clipper
459     ## We'll use the catch-all code at the bottom to guess the
460     ## operating system.
461   ;;
463   ## Compaq Nonstop
464   mips-compaq-nonstopux* )
465     machine=nonstopux opsys=nonstopux
466     ;;
468   ## Convex
469   *-convex-bsd* | *-convex-convexos* )
470     machine=convex opsys=bsd4-3
471     ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov
472     NON_GNU_CPP="cc -E -P"
473   ;;
475   ## Cubix QBx/386
476   i[3456]86-cubix-sysv* )
477     machine=intel386 opsys=usg5-3
478   ;;
480   ## Cydra 5
481   cydra*-cydrome-sysv* )
482     machine=cydra5 opsys=usg5-3
483   ;;
485   ## Data General AViiON Machines
486   ## DG changed naming conventions with the release of 5.4.4.10, they
487   ## dropped the initial 5.4 but left the intervening R.  Because of the
488   ## R this shouldn't conflict with older versions of the OS (which I
489   ## think were named like dgux4.*). In addition, DG new AViiONs series
490   ## uses either Motorola M88k or Intel Pentium CPUs.
491   m88k-dg-dguxR4.* | m88k-dg-dgux4* )
492     machine=aviion opsys=dgux4
493   ;;
494   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
495     ## This name is dgux5-4-3 instead of dgux5-4r3
496     ## to avoid a file name conflict on MSDOS.
497     machine=aviion opsys=dgux5-4-3
498   ;;
499   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
500     machine=aviion opsys=dgux5-4r2
501   ;;
502   m88k-dg-dgux* )
503     machine=aviion opsys=dgux
504   ;;
506   ## Data General AViiON Intel (x86) Machines
507   ## Exists from 5.4.3 (current i586-dg-dguxR4.11)
508   ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il
509   i[345]86-dg-dguxR4* )
510     machine=aviion-intel opsys=dgux4
511   ;;
513   ## DECstations
514   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
515     machine=pmax opsys=bsd4-2
516   ;;
517   mips-dec-ultrix4.[12]* | mips-dec-bsd* )
518     machine=pmax opsys=bsd4-3
519   ;;
520   mips-dec-ultrix* )
521     machine=pmax opsys=ultrix4-3
522   ;;
523   mips-dec-osf* )
524     machine=pmax opsys=osf1
525   ;;
526   mips-dec-mach_bsd4.3* )
527     machine=pmax opsys=mach-bsd4-3
528   ;;
530   ## Motorola Delta machines
531   m68k-motorola-sysv* | m68000-motorola-sysv* )
532     machine=delta opsys=usg5-3
533     if test -z "`type gnucc | grep 'not found'`"
534     then
535       if test -s /etc/167config
536       then CC="gnucc -m68040"
537       else CC="gnucc -m68881"
538       fi
539     else
540       if test -z "`type gcc | grep 'not found'`"
541       then CC=gcc
542       else CC=cc
543       fi
544     fi
545   ;;
546   m88k-motorola-sysv4* )
547     # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
548     # needs POSIX_SIGNALS and therefore needs usg5-4-2.
549     # I hope there are not other 4.0 versions for this machine
550     # which really need usg5-4 instead.
551     machine=delta88k opsys=usg5-4-2
552   ;;
553   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
554     machine=delta88k opsys=usg5-3
555   ;;
557   ## Dual machines
558   m68*-dual-sysv* )
559     machine=dual opsys=usg5-2
560   ;;
561   m68*-dual-uniplus* )
562     machine=dual opsys=unipl5-2
563   ;;
565   ## Elxsi 6400
566   elxsi-elxsi-sysv* )
567     machine=elxsi opsys=usg5-2
568   ;;
570   ## Encore machines
571   ns16k-encore-bsd* )
572     machine=ns16000 opsys=umax
573   ;;
575   ## The GEC 63 - apparently, this port isn't really finished yet.
576   #  I'm sure we finished off the last of the machines, though.  -- fx
578   ## Gould Power Node and NP1
579   pn-gould-bsd4.2* )
580     machine=gould opsys=bsd4-2
581   ;;
582   pn-gould-bsd4.3* )
583     machine=gould opsys=bsd4-3
584   ;;
585   np1-gould-bsd* )
586     machine=gould-np1 opsys=bsd4-3
587   ;;
589   ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
590   ## as far as Emacs is concerned).
591   m88k-harris-cxux* )
592     # Build needs to be different on 7.0 and later releases
593     case "`uname -r`" in
594        [56].[0-9] ) machine=nh4000 opsys=cxux ;;
595        [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
596     esac
597     NON_GNU_CPP="/lib/cpp"
598   ;;
599   ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
600   m68k-harris-cxux* )
601     machine=nh3000 opsys=cxux
602   ;;
603   ## Harris power pc NightHawk running Power UNIX (Series 6000)
604   powerpc-harris-powerunix )
605     machine=nh6000 opsys=powerunix
606     NON_GNU_CPP="cc -Xo -E -P"
607   ;;
608   ## SR2001/SR2201 running HI-UX/MPP
609   hppa1.1-hitachi-hiuxmpp* )
610     machine=sr2k opsys=hiuxmpp
611   ;;
612   hppa1.1-hitachi-hiuxwe2* )
613     machine=sr2k opsys=hiuxwe2
614   ;;
615   ## Honeywell XPS100
616   xps*-honeywell-sysv* )
617     machine=xps100 opsys=usg5-2
618   ;;
620   ## HP 9000 series 200 or 300
621   m68*-hp-bsd* )
622     machine=hp9000s300 opsys=bsd4-3
623   ;;
624   ## HP/UX 7, 8, 9, and 10 are supported on these machines.
625   m68*-hp-hpux* )
626     case "`uname -r`" in
627       ## Someone's system reports A.B8.05 for this.
628       ## I wonder what other possibilities there are.
629       *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
630       *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
631       *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
632       *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
633       *) machine=hp9000s300 opsys=hpux ;;
634     esac
635   ;;
637   ## HP 9000 series 700 and 800, running HP/UX
638   hppa*-hp-hpux7* )
639     machine=hp800 opsys=hpux
640   ;;
641   hppa*-hp-hpux8* )
642     machine=hp800 opsys=hpux8
643   ;;
644   hppa*-hp-hpux9shr* )
645     machine=hp800 opsys=hpux9shr
646   ;;
647   hppa*-hp-hpux9* )
648     machine=hp800 opsys=hpux9
649   ;;
650   hppa*-hp-hpux10.2* )
651     machine=hp800 opsys=hpux10-20
652   ;;
653   hppa*-hp-hpux10* )
654     machine=hp800 opsys=hpux10
655   ;;
656   hppa*-hp-hpux1[1-9]* )
657     machine=hp800 opsys=hpux11
658     CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
659   ;;
661   hppa*-*-linux-gnu* )
662     machine=hp800 opsys=gnu-linux
663   ;;
665   ## HP 9000 series 700 and 800, running HP/UX
666   hppa*-hp-hpux* )
667     ## Cross-compilation?  Nah!
668     case "`uname -r`" in
669       ## Someone's system reports A.B8.05 for this.
670       ## I wonder what other possibilities there are.
671       *.B8.* ) machine=hp800 opsys=hpux8 ;;
672       *.08.* ) machine=hp800 opsys=hpux8 ;;
673       *.09.* ) machine=hp800 opsys=hpux9 ;;
674       *) machine=hp800 opsys=hpux10 ;;
675     esac
676   ;;
677   hppa*-*-nextstep* )
678     machine=hp800 opsys=nextstep
679   ;;
681   ## Orion machines
682   orion-orion-bsd* )
683     machine=orion opsys=bsd4-2
684   ;;
685   clipper-orion-bsd* )
686     machine=orion105 opsys=bsd4-2
687   ;;
689   ## IBM machines
690   i[3456]86-ibm-aix1.1* )
691     machine=ibmps2-aix opsys=usg5-2-2
692   ;;
693   i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
694     machine=ibmps2-aix opsys=usg5-3
695   ;;
696   i370-ibm-aix*)
697     machine=ibm370aix opsys=usg5-3
698   ;;
699   s390-*-linux-gnu* )
700     machine=ibms390 opsys=gnu-linux
701   ;;
702   s390x-*-linux-gnu* )
703     machine=ibms390x opsys=gnu-linux
704   ;;
705   rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1*  )
706     machine=ibmrs6000 opsys=aix3-1
707   ;;
708   rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
709     machine=ibmrs6000 opsys=aix3-2-5
710   ;;
711   rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
712     machine=ibmrs6000 opsys=aix4-1
713   ;;
714   rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2*  )
715     machine=ibmrs6000 opsys=aix4-2
716   ;;
717   rs6000-ibm-aix4.3* | powerpc-ibm-aix4.3*  )
718     machine=ibmrs6000 opsys=aix4-2
719   ;;
720   rs6000-ibm-aix5* | powerpc-ibm-aix5*  )
721     machine=ibmrs6000 opsys=aix4-2
722   ;;
723   rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0*  )
724     machine=ibmrs6000 opsys=aix4
725   ;;
726   rs6000-ibm-aix4* | powerpc-ibm-aix4*  )
727     machine=ibmrs6000 opsys=aix4-1
728   ;;
729   rs6000-ibm-aix* | powerpc-ibm-aix* )
730     machine=ibmrs6000 opsys=aix3-2
731   ;;
732   romp-ibm-bsd4.3* )
733     machine=ibmrt opsys=bsd4-3
734   ;;
735   romp-ibm-bsd4.2* )
736     machine=ibmrt opsys=bsd4-2
737   ;;
738   romp-ibm-aos4.3* )
739     machine=ibmrt opsys=bsd4-3
740   ;;
741   romp-ibm-aos4.2* )
742     machine=ibmrt opsys=bsd4-2
743   ;;
744   romp-ibm-aos* )
745     machine=ibmrt opsys=bsd4-3
746   ;;
747   romp-ibm-bsd* )
748     machine=ibmrt opsys=bsd4-3
749   ;;
750   romp-ibm-aix* )
751     machine=ibmrt-aix opsys=usg5-2-2
752   ;;
754   ## Integrated Solutions `Optimum V'
755   m68*-isi-bsd4.2* )
756     machine=isi-ov opsys=bsd4-2
757   ;;
758   m68*-isi-bsd4.3* )
759     machine=isi-ov opsys=bsd4-3
760   ;;
762   ## Intel 386 machines where we do care about the manufacturer
763   i[3456]86-intsys-sysv* )
764     machine=is386 opsys=usg5-2-2
765   ;;
767   ## Prime EXL
768   i[3456]86-prime-sysv* )
769     machine=i386 opsys=usg5-3
770   ;;
772   ## Sequent Symmetry running Dynix
773   i[3456]86-sequent-bsd* )
774     machine=symmetry opsys=bsd4-3
775   ;;
777   ## Sequent Symmetry running ptx 4, which is a modified SVR4.
778   i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
779     machine=sequent-ptx opsys=ptx4
780     NON_GNU_CPP=/lib/cpp
781   ;;
783   ## Sequent Symmetry running DYNIX/ptx
784   ## Use the old cpp rather than the newer ANSI one.
785   i[3456]86-sequent-ptx* )
786     machine=sequent-ptx opsys=ptx
787     NON_GNU_CPP="/lib/cpp"
788   ;;
790   ## ncr machine running svr4.3.
791   i[3456]86-ncr-sysv4.3 )
792     machine=ncr386 opsys=usg5-4-3
793   ;;
795   ## Unspecified sysv on an ncr machine defaults to svr4.2.
796   ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
797   i[3456]86-ncr-sysv* )
798     machine=ncr386 opsys=usg5-4-2
799   ;;
801   ## Intel Paragon OSF/1
802   i860-intel-osf1* )
803     machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
804   ;;
806   ## Intel 860
807   i860-*-sysv4* )
808     machine=i860 opsys=usg5-4
809     NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
810     NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
811   ;;
813   ## Macintosh PowerPC
814   powerpc*-*-linux-gnu* )
815     machine=macppc opsys=gnu-linux
816   ;;
818   ## Masscomp machines
819   m68*-masscomp-rtu* )
820     machine=masscomp opsys=rtu
821   ;;
823   ## Megatest machines
824   m68*-megatest-bsd* )
825     machine=mega68 opsys=bsd4-2
826   ;;
828   ## Workstations sold by MIPS
829   ## This is not necessarily all workstations using the MIPS processor -
830   ## Irises are produced by SGI, and DECstations by DEC.
832   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
833   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
834   ## it gives for choosing between the alternatives seems to be "Use
835   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
836   ## the BSD world."  I'll assume that these are instructions for
837   ## handling two odd situations, and that every other situation
838   ## should use mips.h and usg5-2-2, they being listed first.
839   mips-mips-usg* )
840     machine=mips4
841     ## Fall through to the general code at the bottom to decide on the OS.
842   ;;
843   mips-mips-riscos4* )
844     machine=mips4 opsys=bsd4-3
845     NON_GNU_CC="cc -systype bsd43"
846     NON_GNU_CPP="cc -systype bsd43 -E"
847   ;;
848   mips-mips-riscos5* )
849     machine=mips4 opsys=riscos5
850     NON_GNU_CC="cc -systype bsd43"
851     NON_GNU_CPP="cc -systype bsd43 -E"
852   ;;
853   mips-mips-bsd* )
854     machine=mips opsys=bsd4-3
855   ;;
856   mips-mips-* )
857     machine=mips opsys=usg5-2-2
858   ;;
860   ## NeXT
861   m68*-next-* | m68k-*-nextstep* )
862     machine=m68k opsys=nextstep
863   ;;
865   ## The complete machine from National Semiconductor
866   ns32k-ns-genix* )
867     machine=ns32000 opsys=usg5-2
868   ;;
870   ## NCR machines
871   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
872     machine=tower32 opsys=usg5-2-2
873   ;;
874   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
875     machine=tower32v3 opsys=usg5-3
876   ;;
878   ## NEC EWS4800
879   mips-nec-sysv4*)
880   machine=ews4800 opsys=ux4800
881   ;;
883   ## Nixdorf Targon 31
884   m68*-nixdorf-sysv* )
885     machine=targon31 opsys=usg5-2-2
886   ;;
888   ## Nu (TI or LMI)
889   m68*-nu-sysv* )
890     machine=nu opsys=usg5-2
891   ;;
893   ## Plexus
894   m68*-plexus-sysv* )
895     machine=plexus opsys=usg5-2
896   ;;
898   ## Pyramid machines
899   ## I don't really have any idea what sort of processor the Pyramid has,
900   ## so I'm assuming it is its own architecture.
901   pyramid-pyramid-bsd* )
902     machine=pyramid opsys=bsd4-2
903   ;;
905   ## Sequent Balance
906   ns32k-sequent-bsd4.2* )
907     machine=sequent opsys=bsd4-2
908   ;;
909   ns32k-sequent-bsd4.3* )
910     machine=sequent opsys=bsd4-3
911   ;;
913   ## Siemens Nixdorf
914   mips-siemens-sysv* | mips-sni-sysv*)
915     machine=mips-siemens opsys=usg5-4
916     NON_GNU_CC=/usr/ccs/bin/cc
917     NON_GNU_CPP=/usr/ccs/lib/cpp
918   ;;
920   ## Silicon Graphics machines
921   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
922   m68*-sgi-iris3.5* )
923     machine=irist opsys=iris3-5
924   ;;
925   m68*-sgi-iris3.6* | m68*-sgi-iris*)
926     machine=irist opsys=iris3-6
927   ;;
928   ## Iris 4D
929   mips-sgi-irix3* )
930     machine=iris4d opsys=irix3-3
931   ;;
932   mips-sgi-irix4* )
933     machine=iris4d opsys=irix4-0
934   ;;
935   mips-sgi-irix6.5 )
936     machine=iris4d opsys=irix6-5
937     # Without defining _LANGUAGE_C, things get masked out in the headers
938     # so that, for instance, grepping for `free' in stdlib.h fails and
939     # AC_HEADER_STD_C fails.   (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
940     NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
941     NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
942   ;;
943   mips-sgi-irix6* )
944     machine=iris4d opsys=irix6-0
945     # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
946     # but presumably it does no harm.
947     NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
948     # -32 probably isn't necessary in later v.6s -- anyone know which?
949     NON_GCC_TEST_OPTIONS=-32
950   ;;
951   mips-sgi-irix5.[01]* )
952     machine=iris4d opsys=irix5-0
953   ;;
954   mips-sgi-irix5* | mips-sgi-irix* )
955     machine=iris4d opsys=irix5-2
956   ;;
958   ## SONY machines
959   m68*-sony-bsd4.2* )
960     machine=news opsys=bsd4-2
961   ;;
962   m68*-sony-bsd4.3* )
963     machine=news opsys=bsd4-3
964   ;;
965   m68*-sony-newsos3* | m68*-sony-news3*)
966     machine=news opsys=bsd4-3
967   ;;
968   mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
969     machine=news-risc opsys=bsd4-3
970   ;;
971   mips-sony-newsos6* )
972     machine=news-r6 opsys=newsos6
973   ;;
974   mips-sony-news* )
975     machine=news-risc opsys=newsos5
976   ;;
978   ## Stride
979   m68*-stride-sysv* )
980     machine=stride opsys=usg5-2
981   ;;
983   ## Suns
984   sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
985     machine=sparc opsys=gnu-linux
986   ;;
988   *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
989     | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
990     | rs6000-*-solaris2*)
991     case "${canonical}" in
992       m68*-sunos1* )    machine=sun1 ;;
993       m68*-sunos2* )    machine=sun2 ;;
994       m68* )            machine=sun3 ;;
995       i[3456]86-sun-sunos[34]* )        machine=sun386 ;;
996       i[3456]86-*-* )     machine=intel386 ;;
997       amd64-*-*|x86_64-*-*)     machine=amdx86-64 ;;
998       powerpcle* )      machine=powerpcle ;;
999       powerpc* | rs6000* )  machine=ibmrs6000 ;;
1000       sparc* )          machine=sparc ;;
1001       * )               unported=yes ;;
1002     esac
1003     case "${canonical}" in
1004       ## The Sun386 didn't get past 4.0.
1005       i[3456]86-*-sunos4          ) opsys=sunos4-0 ;;
1006       *-sunos4.0*         ) opsys=sunos4-0 ;;
1007       *-sunos4.1.[3-9]*noshare )
1008                 ## This name is sunos413 instead of sunos4-1-3
1009                 ## to avoid a file name conflict on MSDOS.
1010                 opsys=sunos413
1011                 NON_GNU_CPP=/usr/lib/cpp
1012                 NON_GCC_TEST_OPTIONS=-Bstatic
1013                 GCC_TEST_OPTIONS=-static
1014                 ;;
1015       *-sunos4.1.[3-9]* | *-sunos4shr*)
1016                 opsys=sunos4shr
1017                 NON_GNU_CPP=/usr/lib/cpp
1018                 ;;
1019       *-sunos4* | *-sunos )
1020                 opsys=sunos4-1
1021                 NON_GCC_TEST_OPTIONS=-Bstatic
1022                 GCC_TEST_OPTIONS=-static
1023                 ;;
1024       *-sunos5.3* | *-solaris2.3* )
1025                 opsys=sol2-3
1026                 NON_GNU_CPP=/usr/ccs/lib/cpp
1027                 ;;
1028       *-sunos5.4* | *-solaris2.4* )
1029                 opsys=sol2-4
1030                 NON_GNU_CPP=/usr/ccs/lib/cpp
1031                 RANLIB="ar -ts"
1032                 ;;
1033       *-sunos5.5* | *-solaris2.5* )
1034                 opsys=sol2-5
1035                 NON_GNU_CPP=/usr/ccs/lib/cpp
1036                 RANLIB="ar -ts"
1037                 ;;
1038       *-sunos5.6* | *-solaris2.6* )
1039                 opsys=sol2-6
1040                 NON_GNU_CPP=/usr/ccs/lib/cpp
1041                 RANLIB="ar -ts"
1042                 ;;
1043       *-sunos5* | *-solaris* )
1044                 opsys=sol2-6
1045                 emacs_check_sunpro_c=yes
1046                 NON_GNU_CPP=/usr/ccs/lib/cpp
1047                 ;;
1048       *                   ) opsys=bsd4-2   ;;
1049     esac
1050     ## Watch out for a compiler that we know will not work.
1051     case "${canonical}" in
1052      *-solaris* | *-sunos5* )
1053                 if [ "x$CC" = x/usr/ucb/cc ]; then
1054                   ## /usr/ucb/cc doesn't work;
1055                   ## we should find some other compiler that does work.
1056                   unset CC
1057                 fi
1058                 ;;
1059       *) ;;
1060     esac
1061   ;;
1062   sparc-*-nextstep* )
1063     machine=sparc opsys=nextstep
1064   ;;
1066   ## Tadpole 68k
1067   m68*-tadpole-sysv* )
1068     machine=tad68k opsys=usg5-3
1069   ;;
1071   ## Tahoe machines
1072   tahoe-tahoe-bsd4.2* )
1073     machine=tahoe opsys=bsd4-2
1074   ;;
1075   tahoe-tahoe-bsd4.3* )
1076     machine=tahoe opsys=bsd4-3
1077   ;;
1079   ## Tandem Integrity S2
1080   mips-tandem-sysv* )
1081     machine=tandem-s2 opsys=usg5-3
1082   ;;
1084   ## Tektronix XD88
1085   m88k-tektronix-sysv3* )
1086   machine=tekxd88 opsys=usg5-3
1087   ;;
1089   ## Tektronix 16000 box (6130?)
1090   ns16k-tektronix-bsd* )
1091     machine=ns16000 opsys=bsd4-2
1092   ;;
1093   ## Tektronix 4300
1094   ## src/m/tek4300.h hints that this is a m68k machine.
1095   m68*-tektronix-bsd* )
1096     machine=tek4300 opsys=bsd4-3
1097   ;;
1099   ## Titan P2 or P3
1100   ## We seem to have lost the machine-description file titan.h!
1101   titan-titan-sysv* )
1102     machine=titan opsys=usg5-3
1103   ;;
1105   ## Ustation E30 (SS5E)
1106   m68*-unisys-uniplus* )
1107     machine=ustation opsystem=unipl5-2
1108   ;;
1110   ## Vaxen.
1111   vax-dec-* )
1112     machine=vax
1113     case "${canonical}" in
1114       *-bsd4.1* )                                       opsys=bsd4-1 ;;
1115       *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* )      opsys=bsd4-2 ;;
1116       *-bsd4.3* | *-ultrix* )                           opsys=bsd4-3 ;;
1117       *-sysv[01]* | *-sysvr[01]* )                      opsys=usg5-0 ;;
1118       *-sysv2* | *-sysvr2* )                            opsys=usg5-2 ;;
1119       *-vms* )                                          opsys=vms ;;
1120       * )                                               unported=yes
1121     esac
1122   ;;
1124   ## Whitechapel MG1
1125   ns16k-whitechapel-* )
1126     machine=mg1
1127     ## We don't know what sort of OS runs on these; we'll let the
1128     ## operating system guessing code below try.
1129   ;;
1131   ## Wicat
1132   m68*-wicat-sysv* )
1133     machine=wicat opsys=usg5-2
1134   ;;
1136   ## IA-64
1137   ia64*-*-linux* )
1138     machine=ia64 opsys=gnu-linux
1139   ;;
1141   ## Intel 386 machines where we don't care about the manufacturer
1142   i[3456]86-*-* )
1143     machine=intel386
1144     case "${canonical}" in
1145       *-cygwin )                opsys=cygwin ;;
1146       *-darwin* )               opsys=darwin
1147                                 CPP="${CC-cc} -E -no-cpp-precomp"
1148                                 ;;
1149       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1150       *-isc2.2* )               opsys=isc2-2 ;;
1151       *-isc4.0* )               opsys=isc4-0 ;;
1152       *-isc4.* )                opsys=isc4-1
1153                                 GCC_TEST_OPTIONS=-posix
1154                                 NON_GCC_TEST_OPTIONS=-Xp
1155                                 ;;
1156       *-isc* )                  opsys=isc3-0 ;;
1157       *-esix5* )                opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1158       *-esix* )                 opsys=esix ;;
1159       *-xenix* )                opsys=xenix ;;
1160       *-linux-gnu* )            opsys=gnu-linux ;;
1161       *-sco3.2v4* )             opsys=sco4 ; NON_GNU_CPP=/lib/cpp  ;;
1162       *-sco3.2v5* )             opsys=sco5
1163                                 NON_GNU_CPP=/lib/cpp
1164                                 # Prevent -belf from being passed to $CPP.
1165                                 # /lib/cpp does not accept it.
1166                                 OVERRIDE_CPPFLAGS=" "
1167                                 ;;
1168       *-sysv4.2uw* )            opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1169       *-sysv5uw* )              opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1170       *-sysv5OpenUNIX* )        opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1171       *-386bsd* )               opsys=386bsd ;;
1172       *-nextstep* )             opsys=nextstep ;;
1173       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1174     esac
1175   ;;
1177   ## m68k Linux-based GNU system
1178   m68k-*-linux-gnu* )
1179     machine=m68k opsys=gnu-linux
1180   ;;
1182   ## Mips Linux-based GNU system
1183   mips-*-linux-gnu* | mipsel-*-linux-gnu* )
1184     machine=mips opsys=gnu-linux
1185   ;;
1187   ## UXP/DS
1188   sparc-fujitsu-sysv4* )
1189     machine=sparc opsys=uxpds
1190     NON_GNU_CPP=/usr/ccs/lib/cpp
1191     RANLIB="ar -ts"
1192   ;;
1194   ## UXP/V
1195   f301-fujitsu-uxpv4.1)
1196     machine=f301 opsys=uxpv
1197   ;;
1199   ## AMD x86-64 Linux-based GNU system
1200   x86_64-*-linux-gnu* )
1201     machine=amdx86-64 opsys=gnu-linux
1202   ;;
1204   ## Tensilica Xtensa Linux-based GNU system
1205   xtensa-*-linux-gnu* )
1206     machine=xtensa opsys=gnu-linux
1207     ;;
1209   * )
1210     unported=yes
1211   ;;
1212 esac
1214 ### If the code above didn't choose an operating system, just choose
1215 ### an operating system based on the configuration name.  You really
1216 ### only want to use this when you have no idea what the right
1217 ### operating system is; if you know what operating systems a machine
1218 ### runs, it's cleaner to make it explicit in the case statement
1219 ### above.
1220 if test x"${opsys}" = x; then
1221   case "${canonical}" in
1222     *-gnu* )                            opsys=gnu ;;
1223     *-bsd4.[01] )                       opsys=bsd4-1 ;;
1224     *-bsd4.2 )                          opsys=bsd4-2 ;;
1225     *-bsd4.3 )                          opsys=bsd4-3 ;;
1226     *-sysv0 | *-sysvr0 )                opsys=usg5-0 ;;
1227     *-sysv2 | *-sysvr2 )                opsys=usg5-2 ;;
1228     *-sysv2.2 | *-sysvr2.2 )            opsys=usg5-2-2 ;;
1229     *-sysv3* | *-sysvr3* )              opsys=usg5-3 ;;
1230     *-sysv4.2uw* )                      opsys=unixware ;;
1231     *-sysv5uw* )                        opsys=unixware ;;
1232     *-sysv5OpenUNIX* )                  opsys=unixware ;;
1233     *-sysv4.1* | *-sysvr4.1* )
1234         NON_GNU_CPP=/usr/lib/cpp
1235         opsys=usg5-4 ;;
1236     *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1237         if [ x$NON_GNU_CPP = x ]; then
1238           if [ -f /usr/ccs/lib/cpp ]; then
1239             NON_GNU_CPP=/usr/ccs/lib/cpp
1240           else
1241             NON_GNU_CPP=/lib/cpp
1242           fi
1243         fi
1244         opsys=usg5-4-2 ;;
1245     *-sysv4* | *-sysvr4* )              opsys=usg5-4 ;;
1246     * )
1247       unported=yes
1248     ;;
1249   esac
1253 dnl quotation ends
1255 if test $unported = yes; then
1256   AC_MSG_ERROR([Emacs hasn't been ported to `${canonical}' systems.
1257 Check `etc/MACHINES' for recognized configuration names.])
1260 machfile="m/${machine}.h"
1261 opsysfile="s/${opsys}.h"
1264 #### Choose a compiler.
1265 test -n "$CC" && cc_specified=yes
1267 # Save the value of CFLAGS that the user specified.
1268 SPECIFIED_CFLAGS="$CFLAGS"
1270 case ${with_gcc} in
1271   "yes" ) CC="gcc" GCC=yes ;;
1272   "no"  ) : ${CC=cc} ;;
1273   * )
1274 esac
1275 AC_PROG_CC
1277 # On Suns, sometimes $CPP names a directory.
1278 if test -n "$CPP" && test -d "$CPP"; then
1279   CPP=
1282 ## If not using gcc, and on Solaris, and no CPP specified, see if
1283 ## using a Sun compiler, which needs -Xs to prevent whitespace.
1284 if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
1285  test x"$CPP" = x; then
1286   AC_MSG_CHECKING([whether we are using a Sun C compiler])
1287   AC_CACHE_VAL(emacs_cv_sunpro_c,
1288   [AC_TRY_LINK([],
1289 [#ifndef __SUNPRO_C
1290 fail;
1291 #endif
1292 ], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
1293   AC_MSG_RESULT($emacs_cv_sunpro_c)
1295   if test x"$emacs_cv_sunpro_c" = xyes; then
1296     NON_GNU_CPP="$CC -E -Xs"
1297   fi
1300 #### Some systems specify a CPP to use unless we are using GCC.
1301 #### Now that we know whether we are using GCC, we can decide whether
1302 #### to use that one.
1303 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1304 then
1305   CPP="$NON_GNU_CPP"
1308 #### Some systems specify a CC to use unless we are using GCC.
1309 #### Now that we know whether we are using GCC, we can decide whether
1310 #### to use that one.
1311 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1312   test x$cc_specified != xyes
1313 then
1314   CC="$NON_GNU_CC"
1317 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1318 then
1319   CC="$CC $GCC_TEST_OPTIONS"
1322 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1323 then
1324   CC="$CC $NON_GCC_TEST_OPTIONS"
1327 dnl checks for Unix variants
1328 AC_AIX
1329 AC_GNU_SOURCE
1331 ### Use -Wno-pointer-sign if the compiler supports it
1332 AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
1333 SAVE_CFLAGS="$CFLAGS"
1334 CFLAGS="$CFLAGS -Wno-pointer-sign"
1335 AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
1336 if test $has_option = yes; then
1337    C_WARNINGS_SWITCH="-Wno-pointer-sign $C_WARNINGS_SWITCH"
1339 AC_MSG_RESULT($has_option)
1340 CFLAGS="$SAVE_CFLAGS"
1341 unset has_option
1342 unset SAVE_CFLAGS
1344 #### Some other nice autoconf tests.
1346 dnl checks for programs
1347 AC_PROG_LN_S
1348 AC_PROG_CPP
1349 AC_PROG_INSTALL
1350 if test "x$RANLIB" = x; then
1351   AC_PROG_RANLIB
1353 AC_PATH_PROG(INSTALL_INFO, install-info)
1354 AC_PATH_PROG(INSTALL_INFO, install-info,, /usr/sbin)
1355 AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin)
1356 dnl Don't use GZIP, which is used by gzip for additional parameters.
1357 AC_PATH_PROG(GZIP_PROG, gzip)
1360 ## Need makeinfo >= 4.6 (?) to build the manuals.
1361 AC_PATH_PROG(MAKEINFO, makeinfo, no)
1362 dnl By this stage, configure has already checked for egrep and set EGREP,
1363 dnl or exited with an error if no egrep was found.
1364 if test "$MAKEINFO" != "no" && \
1365   test x"`$MAKEINFO --version 2> /dev/null | $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[6-9]]|4\.[[1-5]][[0-9]]+)'`" = x; then
1366    MAKEINFO=no
1369 if test "$MAKEINFO" = "no"; then
1370   AC_MSG_ERROR( [makeinfo >= 4.6 is required] )
1374 dnl Add our options to ac_link now, after it is set up.
1376 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1377 then
1378   ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1381 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1382 then
1383   ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1386 dnl We need -znocombreloc if we're using a relatively recent GNU ld.
1387 dnl If we can link with the flag, it shouldn't do any harm anyhow.
1388 dnl (Don't use `-z nocombreloc' as -z takes no arg on Irix.)
1389 dnl Treat GCC specially since it just gives a non-fatal `unrecognized option'
1390 dnl if not built to support GNU ld.
1392 late_LDFLAGS=$LDFLAGS
1393 if test "$GCC" = yes; then
1394   LDFLAGS="$LDFLAGS -Wl,-znocombreloc"
1395 else
1396   LDFLAGS="$LDFLAGS -znocombreloc"
1399 AC_MSG_CHECKING([for -znocombreloc])
1400 AC_LINK_IFELSE([main(){return 0;}],
1401   [AC_MSG_RESULT(yes)],
1402   LDFLAGS=$late_LDFLAGS
1403   [AC_MSG_RESULT(no)])
1405 #### Extract some information from the operating system and machine files.
1407 AC_CHECKING([the machine- and system-dependent files to find out
1408  - which libraries the lib-src programs will want, and
1409  - whether the GNU malloc routines are usable])
1411 ### First figure out CFLAGS (which we use for running the compiler here)
1412 ### and REAL_CFLAGS (which we use for real compilation).
1413 ### The two are the same except on a few systems, where they are made
1414 ### different to work around various lossages.  For example,
1415 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1416 ### as implying static linking.
1418 ### If the CFLAGS env var is specified, we use that value
1419 ### instead of the default.
1421 ### It's not important that this name contain the PID; you can't run
1422 ### two configures in the same directory and have anything work
1423 ### anyway.
1424 tempcname="conftest.c"
1426 echo '
1427 #include "'${srcdir}'/src/'${opsysfile}'"
1428 #include "'${srcdir}'/src/'${machfile}'"
1429 #ifndef LIBS_MACHINE
1430 #define LIBS_MACHINE
1431 #endif
1432 #ifndef LIBS_SYSTEM
1433 #define LIBS_SYSTEM
1434 #endif
1435 #ifndef C_SWITCH_SYSTEM
1436 #define C_SWITCH_SYSTEM
1437 #endif
1438 #ifndef C_SWITCH_MACHINE
1439 #define C_SWITCH_MACHINE
1440 #endif
1441 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1442 configure___ c_switch_system=C_SWITCH_SYSTEM
1443 configure___ c_switch_machine=C_SWITCH_MACHINE
1445 #ifndef LIB_X11_LIB
1446 #define LIB_X11_LIB -lX11
1447 #endif
1449 #ifndef LIBX11_MACHINE
1450 #define LIBX11_MACHINE
1451 #endif
1453 #ifndef LIBX11_SYSTEM
1454 #define LIBX11_SYSTEM
1455 #endif
1456 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1458 #ifdef UNEXEC
1459 configure___ unexec=UNEXEC
1460 #else
1461 configure___ unexec=unexec.o
1462 #endif
1464 #ifdef SYSTEM_MALLOC
1465 configure___ system_malloc=yes
1466 #else
1467 configure___ system_malloc=no
1468 #endif
1470 #ifdef USE_MMAP_FOR_BUFFERS
1471 configure___ use_mmap_for_buffers=yes
1472 #else
1473 configure___ use_mmap_for_buffers=no
1474 #endif
1476 #ifndef C_DEBUG_SWITCH
1477 #define C_DEBUG_SWITCH -g
1478 #endif
1480 #ifndef C_OPTIMIZE_SWITCH
1481 #ifdef __GNUC__
1482 #define C_OPTIMIZE_SWITCH -O2
1483 #else
1484 #define C_OPTIMIZE_SWITCH -O
1485 #endif
1486 #endif
1488 #ifndef C_WARNINGS_SWITCH
1489 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
1490 #endif
1492 #ifndef LD_SWITCH_MACHINE
1493 #define LD_SWITCH_MACHINE
1494 #endif
1496 #ifndef LD_SWITCH_SYSTEM
1497 #define LD_SWITCH_SYSTEM
1498 #endif
1500 #ifndef LD_SWITCH_X_SITE_AUX
1501 #define LD_SWITCH_X_SITE_AUX
1502 #endif
1504 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1505 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1507 #ifdef THIS_IS_CONFIGURE
1509 /* Get the CFLAGS for tests in configure.  */
1510 #ifdef __GNUC__
1511 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1512 #else
1513 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1514 #endif
1516 #else /* not THIS_IS_CONFIGURE */
1518 /* Get the CFLAGS for real compilation.  */
1519 #ifdef __GNUC__
1520 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH '${SPECIFIED_CFLAGS}'
1521 #else
1522 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1523 #endif
1525 #endif /* not THIS_IS_CONFIGURE */
1526 ' > ${tempcname}
1528 # The value of CPP is a quoted variable reference, so we need to do this
1529 # to get its actual value...
1530 CPP=`eval "echo $CPP"`
1531 [eval `${CPP} -Isrc ${tempcname} \
1532        | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1533 if test "x$SPECIFIED_CFLAGS" = x; then
1534   eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1535          | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1536 else
1537   REAL_CFLAGS="$CFLAGS"
1539 rm ${tempcname}
1541 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1543 ### Make sure subsequent tests use flags consistent with the build flags.
1545 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1546   CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1547 else
1548   CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1551 dnl For AC_FUNC_GETLOADAVG, at least:
1552 AC_CONFIG_LIBOBJ_DIR(src)
1554 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1555 AC_SYS_LARGEFILE
1558 ### The standard library on x86-64 GNU/Linux distributions can
1559 ### be located in either /usr/lib64 or /usr/lib.
1560 case "${canonical}" in
1561   x86_64-*-linux-gnu* )
1562     if test -d /usr/lib64; then
1563       AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
1564         [Define to 1 if the file /usr/lib64 exists.])
1566 esac
1568 dnl This function defintion taken from Gnome 2.0
1569 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1570 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1571 dnl also defines GSTUFF_PKG_ERRORS on error
1572 AC_DEFUN([PKG_CHECK_MODULES], [
1573   succeeded=no
1575   if test -z "$PKG_CONFIG"; then
1576     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1577   fi
1579   if test "$PKG_CONFIG" = "no" ; then
1580      ifelse([$4], , [AC_MSG_ERROR([
1581       *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog.  Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.])], [$4])
1582   else
1583      PKG_CONFIG_MIN_VERSION=0.9.0
1584      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1585         AC_MSG_CHECKING(for $2)
1587         if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then
1588             AC_MSG_RESULT(yes)
1589             succeeded=yes
1591             AC_MSG_CHECKING($1_CFLAGS)
1592             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"|sed -e 's,///*,/,g'`
1593             AC_MSG_RESULT($$1_CFLAGS)
1595             AC_MSG_CHECKING($1_LIBS)
1596             $1_LIBS=`$PKG_CONFIG --libs "$2"|sed -e 's,///*,/,g'`
1597             AC_MSG_RESULT($$1_LIBS)
1598         else
1599             AC_MSG_RESULT(no)
1600             $1_CFLAGS=""
1601             $1_LIBS=""
1602             ## If we have a custom action on failure, don't print errors, but
1603             ## do set a variable so people can do so.
1604             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1605             ifelse([$4], ,echo $$1_PKG_ERRORS,)
1606         fi
1608         AC_SUBST($1_CFLAGS)
1609         AC_SUBST($1_LIBS)
1610      else
1611         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1612         echo "*** See http://www.freedesktop.org/software/pkgconfig"
1613      fi
1614   fi
1616   if test $succeeded = yes; then
1617      ifelse([$3], , :, [$3])
1618   else
1619      ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4])
1620   fi
1624 if test "${with_sound}" != "no"; then
1625   # Sound support for GNU/Linux and the free BSDs.
1626   AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1627   # Emulation library used on NetBSD.
1628   AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1629   AC_SUBST(LIBSOUND)
1631   ALSA_REQUIRED=1.0.0
1632   ALSA_MODULES="alsa >= $ALSA_REQUIRED"
1633   dnl Check if --with-pkg-config-prog has been given.
1634   if test "X${with_pkg_config_prog}" != X; then
1635     PKG_CONFIG="${with_pkg_config_prog}"
1636   fi
1637   PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
1638   if test $HAVE_ALSA = yes; then
1639     SAVE_CFLAGS="$CFLAGS"
1640     SAVE_LDFLAGS="$LDFLAGS"
1641     CFLAGS="$ALSA_CFLAGS $CFLAGS"
1642     LDFLAGS="$ALSA_LIBS $LDFLAGS"
1643     AC_TRY_COMPILE([#include <asoundlib.h>], [snd_lib_error_set_handler (0);],
1644                     emacs_alsa_normal=yes,
1645                     emacs_alsa_normal=no)
1646     if test "$emacs_alsa_normal" != yes; then
1647       AC_TRY_COMPILE([#include <alsa/asoundlib.h>],
1648                      [snd_lib_error_set_handler (0);],
1649                      emacs_alsa_subdir=yes,
1650                      emacs_alsa_subdir=no)
1651       if test "$emacs_alsa_subdir" != yes; then
1652         AC_MSG_ERROR([pkg-config found alsa, but it does not compile.  See config.log for error messages.])
1653       fi
1654       ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
1655     fi
1657     CFLAGS="$SAVE_CFLAGS"
1658     LDFLAGS="$SAVE_LDFLAGS"
1659     LIBSOUND="$LIBSOUND $ALSA_LIBS"
1660     CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
1661     AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
1662   fi
1663   AC_SUBST(CFLAGS_SOUND)
1666 dnl checks for header files
1667 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1668   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1669   termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
1670   sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
1671   sys/utsname.h pwd.h)
1673 AC_MSG_CHECKING(if personality LINUX32 can be set)
1674 AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
1675                emacs_cv_personality_linux32=yes,
1676                emacs_cv_personality_linux32=no)
1677 AC_MSG_RESULT($emacs_cv_personality_linux32)
1679 if test $emacs_cv_personality_linux32 = yes; then
1680   AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1,
1681             [Define to 1 if personality LINUX32 can be set.])
1684 dnl On Solaris 8 there's a compilation warning for term.h because
1685 dnl it doesn't define `bool'.
1686 AC_CHECK_HEADERS(term.h, , , -)
1687 AC_HEADER_STDC
1688 AC_HEADER_TIME
1689 AC_CHECK_DECLS([sys_siglist])
1690 if test $ac_cv_have_decl_sys_siglist != yes; then
1691   # For Tru64, at least:
1692   AC_CHECK_DECLS([__sys_siglist])
1693   if test $ac_cv_have_decl___sys_siglist = yes; then
1694     AC_DEFINE(sys_siglist, __sys_siglist,
1695               [Define to any substitute for sys_siglist.])
1696   fi
1698 AC_HEADER_SYS_WAIT
1700 dnl Some systems have utime.h but don't declare the struct anyplace.
1701 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1702 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1703 #include <sys/time.h>
1704 #include <time.h>
1705 #else
1706 #ifdef HAVE_SYS_TIME_H
1707 #include <sys/time.h>
1708 #else
1709 #include <time.h>
1710 #endif
1711 #endif
1712 #ifdef HAVE_UTIME_H
1713 #include <utime.h>
1714 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1715   emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1716 if test $emacs_cv_struct_utimbuf = yes; then
1717   AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
1720 dnl checks for typedefs
1721 AC_TYPE_SIGNAL
1723 dnl Check for speed_t typedef.
1724 AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1725   [AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
1726     emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
1727 if test $emacs_cv_speed_t = yes; then
1728   AC_DEFINE(HAVE_SPEED_T, 1,
1729            [Define to 1 if `speed_t' is declared by <termios.h>.])
1732 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1733 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1734 #include <sys/time.h>
1735 #include <time.h>
1736 #else
1737 #ifdef HAVE_SYS_TIME_H
1738 #include <sys/time.h>
1739 #else
1740 #include <time.h>
1741 #endif
1742 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1743   emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1744 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1745 if test $emacs_cv_struct_timeval = yes; then
1746   AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by <sys/time.h>.])
1749 AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1750 AC_TRY_COMPILE([#include <math.h>],
1751 [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1752   emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1753 HAVE_EXCEPTION=$emacs_cv_struct_exception
1754 if test $emacs_cv_struct_exception != yes; then
1755   AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
1758 AC_CHECK_HEADERS(sys/socket.h)
1759 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
1760 #if HAVE_SYS_SOCKET_H
1761 #include <sys/socket.h>
1762 #endif])
1764 dnl checks for structure members
1765 AC_STRUCT_TM
1766 AC_STRUCT_TIMEZONE
1767 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
1768                 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
1769                            [Define to 1 if `tm_gmtoff' is member of `struct tm'.])],,
1770                 [#include <time.h>])
1771 AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr,
1772                   struct ifreq.ifr_netmask, struct ifreq.ifr_broadaddr,
1773                   struct ifreq.ifr_addr], , ,
1774                  [AC_INCLUDES_DEFAULT
1775 #if HAVE_SYS_SOCKET_H
1776 #include <sys/socket.h>
1777 #endif
1778 #if HAVE_NET_IF_H
1779 #include <net/if.h>
1780 #endif])
1782 dnl checks for compiler characteristics
1784 dnl Testing __STDC__ to determine prototype support isn't good enough.
1785 dnl DEC C, for instance, doesn't define it with default options, and
1786 dnl is used on 64-bit systems (OSF Alphas).  Similarly for volatile
1787 dnl and void *.
1788 AC_C_PROTOTYPES
1789 AC_C_VOLATILE
1790 AC_C_CONST
1791 dnl This isn't useful because we can't turn on use of `inline' unless
1792 dnl the compiler groks `extern inline'.
1793 dnl AC_C_INLINE
1794 AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1795   [AC_TRY_COMPILE(, [void * foo;],
1796                    emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1797 if test $emacs_cv_void_star = yes; then
1798   AC_DEFINE(POINTER_TYPE, void)
1799 else
1800   AC_DEFINE(POINTER_TYPE, char)
1802 AH_TEMPLATE(POINTER_TYPE,
1803             [Define as `void' if your compiler accepts `void *'; otherwise
1804              define as `char'.])dnl
1808 dnl This could be used for targets which can have both byte sexes.
1809 dnl We could presumably replace the hardwired WORDS_BIG_ENDIAN generally.
1810 dnl AC_C_BIGENDIAN
1812 dnl check for Make feature
1813 AC_PROG_MAKE_SET
1815 dnl checks for operating system services
1816 AC_SYS_LONG_FILE_NAMES
1818 #### Choose a window system.
1820 AC_PATH_X
1821 if test "$no_x" = yes; then
1822   window_system=none
1823 else
1824   window_system=x11
1827 if test "${x_libraries}" != NONE; then
1828   if test -n "${x_libraries}"; then
1829     LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1830     LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1831   fi
1832   x_default_search_path=""
1833   x_search_path=${x_libraries}
1834   if test -z "${x_search_path}"; then
1835     x_search_path=/usr/lib
1836   fi
1837   for x_library in `echo ${x_search_path}: | \
1838                     sed -e "s/:/ /g" -e p -e "s:/lib[[^ /]]* :/share :g"`; do
1839     x_search_path="\
1840 ${x_library}/X11/%L/%T/%N%C%S:\
1841 ${x_library}/X11/%l/%T/%N%C%S:\
1842 ${x_library}/X11/%T/%N%C%S:\
1843 ${x_library}/X11/%L/%T/%N%S:\
1844 ${x_library}/X11/%l/%T/%N%S:\
1845 ${x_library}/X11/%T/%N%S"
1846     if test x"${x_default_search_path}" = x; then
1847       x_default_search_path=${x_search_path}
1848     else
1849       x_default_search_path="${x_search_path}:${x_default_search_path}"
1850     fi
1851   done
1853 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1854   C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1857 if test x"${x_includes}" = x; then
1858   bitmapdir=/usr/include/X11/bitmaps
1859 else
1860   # accumulate include directories that have X11 bitmap subdirectories
1861   bmd_acc="dummyval"
1862   for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1863     if test -d "${bmd}/X11/bitmaps"; then
1864       bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1865     fi
1866     if test -d "${bmd}/bitmaps"; then
1867       bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1868     fi
1869   done
1870   if test ${bmd_acc} != "dummyval"; then
1871     bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1872   fi
1875 HAVE_CARBON=no
1876 if test "${with_carbon}" != no; then
1877   AC_CHECK_HEADER(Carbon/Carbon.h, HAVE_CARBON=yes)
1879 if test "${window_system}" = x11 && test "${HAVE_CARBON}" = yes; then
1880   if test "${with_carbon+set}" != set \
1881      && test "${carbon_appdir_x+set}" != set; then
1882     for var in with_x with_x_toolkit with_gtk with_xim \
1883                with_xpm with_jpeg with_tiff with_gif with_png; do
1884       if eval test \"\${$var+set}\" = set; then
1885         HAVE_CARBON=no
1886         break
1887       fi
1888     done
1889   fi
1891 if test "${HAVE_CARBON}" = yes; then
1892   window_system=mac
1895 case "${window_system}" in
1896   x11 )
1897     HAVE_X_WINDOWS=yes
1898     HAVE_X11=yes
1899     case "${with_x_toolkit}" in
1900       athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1901       motif ) USE_X_TOOLKIT=MOTIF ;;
1902       gtk ) with_gtk=yes
1903 dnl Dont set this for GTK.  A lot of tests below assumes Xt when
1904 dnl USE_X_TOOLKIT is set.
1905             USE_X_TOOLKIT=none ;;
1906       no ) USE_X_TOOLKIT=none ;;
1907 dnl If user did not say whether to use a toolkit, make this decision later:
1908 dnl use the toolkit if we have gtk, or X11R5 or newer.
1909       * )
1910           if test x"$with_gtk" = xyes; then
1911              USE_X_TOOLKIT=none
1912           else
1913              USE_X_TOOLKIT=maybe
1914           fi
1915           ;;
1916     esac
1917   ;;
1918   mac | none )
1919     HAVE_X_WINDOWS=no
1920     HAVE_X11=no
1921     USE_X_TOOLKIT=none
1922   ;;
1923 esac
1925 if test "$window_system" = none && test "X$with_x" != "Xno"; then
1926    AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
1927    if test "$HAVE_XSERVER" = true ||
1928       test -n "$DISPLAY" ||
1929       test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
1930         AC_MSG_ERROR([You seem to be running X, but no X development libraries
1931 were found.  You should install the relevant development files for X
1932 and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
1933 sure you have development files for image handling, i.e.
1934 tiff, gif, jpeg, png and xpm.
1935 If you are sure you want Emacs compiled without X window support, pass
1936   --without-x
1937 to configure.])
1938    fi
1941 ### If we're using X11, we should use the X menu package.
1942 HAVE_MENUS=no
1943 case ${HAVE_X11} in
1944   yes ) HAVE_MENUS=yes ;;
1945 esac
1947 if test "${opsys}" = "hpux9"; then
1948   case "${x_libraries}" in
1949     *X11R4* )
1950       opsysfile="s/hpux9-x11r4.h"
1951       ;;
1952   esac
1955 if test "${opsys}" = "hpux9shr"; then
1956   case "${x_libraries}" in
1957     *X11R4* )
1958       opsysfile="s/hpux9shxr4.h"
1959       ;;
1960   esac
1963 ### Compute the unexec source name from the object name.
1964 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1966 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1967 # Assume not, until told otherwise.
1968 GNU_MALLOC=yes
1969 doug_lea_malloc=yes
1970 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1971 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1972 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1973                emacs_cv_var___after_morecore_hook,
1974 [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1975   emacs_cv_var___after_morecore_hook=yes,
1976   emacs_cv_var___after_morecore_hook=no)])
1977 if test $emacs_cv_var___after_morecore_hook = no; then
1978   doug_lea_malloc=no
1980 if test "${system_malloc}" = "yes"; then
1981   GNU_MALLOC=no
1982   GNU_MALLOC_reason="
1983     (The GNU allocators don't work with this system configuration.)"
1985 if test "$doug_lea_malloc" = "yes" ; then
1986   if test "$GNU_MALLOC" = yes ; then
1987     GNU_MALLOC_reason="
1988       (Using Doug Lea's new malloc from the GNU C Library.)"
1989   fi
1990   AC_DEFINE(DOUG_LEA_MALLOC, 1,
1991             [Define to 1 if you are using the GNU C Library.])
1994 if test x"${REL_ALLOC}" = x; then
1995   REL_ALLOC=${GNU_MALLOC}
1998 dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
1999 dnl the system configuration file (s/*.h) to turn the use of mmap
2000 dnl in the relocating allocator on.
2002 AC_FUNC_MMAP
2003 if test $use_mmap_for_buffers = yes; then
2004   REL_ALLOC=no
2007 LIBS="$libsrc_libs $LIBS"
2009 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
2010 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
2011 AC_CHECK_LIB(dnet, dnet_ntoa)
2012 dnl This causes -lresolv to get used in subsequent tests,
2013 dnl which causes failures on some systems such as HPUX 9.
2014 dnl AC_CHECK_LIB(resolv, gethostbyname)
2016 dnl FIXME replace main with a function we actually want from this library.
2017 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
2019 AC_CHECK_LIB(pthreads, cma_open)
2021 AC_MSG_CHECKING(for XFree86 in /usr/X386)
2022 if test -d /usr/X386/include; then
2023   HAVE_XFREE386=yes
2024   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
2025 else
2026   HAVE_XFREE386=no
2028 AC_MSG_RESULT($HAVE_XFREE386)
2030 dnl Check for need for bigtoc support on IBM AIX
2032 case ${host_os} in
2033 aix*)
2034   AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
2035     case $GCC in
2036     yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
2037     *) gdb_cv_bigtoc=-bbigtoc ;;
2038     esac
2040     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
2041     AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
2042   ])
2043   ;;
2044 esac
2046 # Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets
2047 # used for the tests that follow.  We set them back to REAL_CFLAGS and
2048 # REAL_CPPFLAGS later on.
2050 REAL_CPPFLAGS="$CPPFLAGS"
2052 if test "${HAVE_X11}" = "yes"; then
2053   DEFS="$C_SWITCH_X_SITE $DEFS"
2054   LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
2055   LIBS="$LIBX $LIBS"
2056   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
2057   CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
2059   # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
2060   # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
2061   # but it's more convenient here to set LD_RUN_PATH
2062   # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
2063   if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
2064     LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
2065     export LD_RUN_PATH
2066   fi
2068   if test "${opsys}" = "gnu-linux"; then
2069     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
2070     AC_TRY_LINK([],
2071      [XOpenDisplay ("foo");],
2072      [xlinux_first_failure=no],
2073      [xlinux_first_failure=yes])
2074     if test "${xlinux_first_failure}" = "yes"; then
2075       OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
2076       OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
2077       OLD_CPPFLAGS="$CPPFLAGS"
2078       OLD_LIBS="$LIBS"
2079       LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
2080       C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
2081       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
2082       LIBS="$LIBS -b i486-linuxaout"
2083       AC_TRY_LINK([],
2084        [XOpenDisplay ("foo");],
2085        [xlinux_second_failure=no],
2086        [xlinux_second_failure=yes])
2087       if test "${xlinux_second_failure}" = "yes"; then
2088         # If we get the same failure with -b, there is no use adding -b.
2089         # So take it out.  This plays safe.
2090         LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
2091         C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
2092         CPPFLAGS="$OLD_CPPFLAGS"
2093         LIBS="$OLD_LIBS"
2094         AC_MSG_RESULT(no)
2095       else
2096         AC_MSG_RESULT(yes)
2097       fi
2098     else
2099       AC_MSG_RESULT(no)
2100     fi
2101   fi
2103   # Reportedly, some broken Solaris systems have XKBlib.h but are missing
2104   # header files included from there.
2105   AC_MSG_CHECKING(for Xkb)
2106   AC_TRY_LINK([#include <X11/Xlib.h>
2107 #include <X11/XKBlib.h>],
2108         [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
2109         emacs_xkb=yes, emacs_xkb=no)
2110   AC_MSG_RESULT($emacs_xkb)
2111   if test $emacs_xkb = yes; then
2112     AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
2113   fi
2115   AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
2116 XScreenNumberOfScreen XSetWMProtocols)
2119 if test "${window_system}" = "x11"; then
2120   AC_MSG_CHECKING(X11 version 6)
2121   AC_CACHE_VAL(emacs_cv_x11_version_6,
2122   [AC_TRY_LINK([#include <X11/Xlib.h>],
2123 [#if XlibSpecificationRelease < 6
2124 fail;
2125 #endif
2126 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
2127   if test $emacs_cv_x11_version_6 = yes; then
2128     AC_MSG_RESULT(6 or newer)
2129     AC_DEFINE(HAVE_X11R6, 1,
2130               [Define to 1 if you have the X11R6 or newer version of Xlib.])
2131   else
2132     AC_MSG_RESULT(before 6)
2133   fi
2137 ### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
2138 HAVE_RSVG=no
2139 if test "${HAVE_X11}" = "yes" || test "${HAVE_CARBON}" = "yes"; then
2140   if test "${with_rsvg}" != "no"; then
2141     dnl Check if `--with-pkg-config-prog' has been given.
2142     if test "X${with_pkg_config_prog}" != X; then
2143       PKG_CONFIG="${with_pkg_config_prog}"
2144     fi
2146     RSVG_REQUIRED=2.0.0
2147     RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
2149     PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, :, :)
2150     AC_SUBST(RSVG_CFLAGS)
2151     AC_SUBST(RSVG_LIBS)
2153     if test ".${RSVG_CFLAGS}" != "."; then
2154       HAVE_RSVG=yes
2155       AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])
2156       CFLAGS="$CFLAGS $RSVG_CFLAGS"
2157       LIBS="$RSVG_LIBS $LIBS"
2158     fi
2159   fi
2163 HAVE_GTK=no
2164 if test "${with_gtk}" = "yes" && test "$USE_X_TOOLKIT" = "gtk"; then
2165   USE_X_TOOLKIT=none
2167 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk" || \
2168  test "$USE_X_TOOLKIT" = "maybe"; then
2169   if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then
2170     AC_MSG_ERROR([Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}]);
2171   fi
2172   GLIB_REQUIRED=2.6
2173   GTK_REQUIRED=2.6
2174   GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
2176   dnl Check if --with-pkg-config-prog has been given.
2177   if test "X${with_pkg_config_prog}" != X; then
2178     PKG_CONFIG="${with_pkg_config_prog}"
2179   fi
2180   dnl Checks for libraries.
2181   PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
2182   if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
2183      AC_MSG_ERROR($GTK_PKG_ERRORS)
2184   fi
2188 if test x"$pkg_check_gtk" = xyes; then
2190   AC_SUBST(GTK_CFLAGS)
2191   AC_SUBST(GTK_LIBS)
2192   C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
2193   CFLAGS="$CFLAGS $GTK_CFLAGS"
2194   LIBS="$GTK_LIBS $LIBS"
2195   dnl Try to compile a simple GTK program.
2196   GTK_COMPILES=no
2197   AC_CHECK_FUNCS(gtk_main, GTK_COMPILES=yes)
2198   if test "${GTK_COMPILES}" != "yes"; then
2199     if test "$USE_X_TOOLKIT" != "maybe"; then
2200       AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
2201     fi
2202   else
2203     HAVE_GTK=yes
2204     AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
2205     USE_X_TOOLKIT=none
2206   fi
2211 if test "${HAVE_GTK}" = "yes"; then
2213   dnl  GTK scrollbars resemble toolkit scrollbars a lot, so to avoid
2214   dnl  a lot if #ifdef:s, say we have toolkit scrollbars.
2215   if test "$with_toolkit_scroll_bars" != no; then
2216     with_toolkit_scroll_bars=yes
2217   fi
2219   dnl  Check if we can use multiple displays with this GTK version.
2220   dnl  If gdk_display_open exists, assume all others are there also.
2221   HAVE_GTK_MULTIDISPLAY=no
2222   AC_CHECK_FUNCS(gdk_display_open, HAVE_GTK_MULTIDISPLAY=yes)
2223   if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
2224     AC_DEFINE(HAVE_GTK_MULTIDISPLAY, 1,
2225               [Define to 1 if GTK can handle more than one display.])
2226   fi
2228   dnl  Check if we have the old file selection dialog.
2229   dnl  If gdk_display_open exists, assume all others are there also.
2230   HAVE_GTK_FILE_SELECTION=no
2231   AC_CHECK_FUNCS(gtk_file_selection_new, HAVE_GTK_FILE_SELECTION=yes)
2233   dnl  Check if we have the new file chooser dialog
2234   dnl  If gdk_display_open exists, assume all others are there also.
2235   HAVE_GTK_FILE_CHOOSER=no
2236   AC_CHECK_FUNCS(gtk_file_chooser_dialog_new, HAVE_GTK_FILE_CHOOSER=yes)
2238   if test "$HAVE_GTK_FILE_SELECTION" = yes \
2239      && test "$HAVE_GTK_FILE_CHOOSER" = yes;  then
2240     AC_DEFINE(HAVE_GTK_FILE_BOTH, 1,
2241               [Define to 1 if GTK has both file selection and chooser dialog.])
2242   fi
2244   dnl Check if pthreads are available.  Emacs only needs this when using
2245   dnl gtk_file_chooser under Gnome.
2246   if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
2247     HAVE_GTK_AND_PTHREAD=no
2248     AC_CHECK_HEADERS(pthread.h)
2249     if test "$ac_cv_header_pthread_h"; then
2250       AC_CHECK_LIB(pthread, pthread_self, HAVE_GTK_AND_PTHREAD=yes)
2251     fi
2252     if test "$HAVE_GTK_AND_PTHREAD" = yes; then
2253       case "${canonical}" in
2254         *-hpux*) ;;
2255         *) GTK_LIBS="$GTK_LIBS -lpthread" ;;
2256       esac
2257       AC_DEFINE(HAVE_GTK_AND_PTHREAD, 1,
2258                [Define to 1 if you have GTK and pthread (-lpthread).])
2259     fi
2260   fi
2263 dnl D-Bus has been tested under GNU/Linux only.  Must be adapted for
2264 dnl other platforms.  Support for higher D-Bus versions but 1.0 is
2265 dnl also not configured.
2266 HAVE_DBUS=no
2267 if test "${with_dbus}" = "yes"; then
2268    PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
2269    if test "$HAVE_DBUS" = yes; then
2270       AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
2271    fi
2274 ### Link with -lXft if available to work around a bug.
2275 HAVE_XFT=maybe
2276 if test "${HAVE_GTK}" = "yes"; then
2277   dnl Check if --with-pkg-config-prog has been given.
2278   if test "X${with_pkg_config_prog}" != X; then
2279     PKG_CONFIG="${with_pkg_config_prog}"
2280   fi
2282   PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
2283   if test "$HAVE_XFT" != no; then
2284     OLD_CFLAGS="$CPPFLAGS"
2285     OLD_CPPFLAGS="$CFLAGS"
2286     OLD_LIBS="$LIBS"
2287     CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
2288     CFLAGS="$CFLAGS $XFT_CFLAGS"
2289     LIBS="$XFT_LIBS $LIBS"
2290     AC_CHECK_HEADER(X11/Xft/Xft.h,
2291       [AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)])
2293     if test "${HAVE_XFT}" = "yes"; then
2294       AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
2295       AC_SUBST(XFT_LIBS)
2296       C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
2297     else
2298       CFLAGS="$OLD_CPPFLAGS"
2299       CFLAGS="$OLD_CFLAGS"
2300       LIBS="$OLD_LIBS"
2301     fi
2302   fi
2305 dnl Do not put whitespace before the #include statements below.
2306 dnl Older compilers (eg sunos4 cc) choke on it.
2307 HAVE_XAW3D=no
2308 if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
2309   if test "$with_xaw3d" != no; then
2310     AC_MSG_CHECKING(for xaw3d)
2311     AC_CACHE_VAL(emacs_cv_xaw3d,
2312     [AC_TRY_LINK([
2313 #include <X11/Intrinsic.h>
2314 #include <X11/Xaw3d/Simple.h>],
2315       [],
2316       emacs_cv_xaw3d=yes,
2317       emacs_cv_xaw3d=no)])
2318   else
2319     emacs_cv_xaw3d=no
2320   fi
2321   if test $emacs_cv_xaw3d = yes; then
2322     AC_MSG_RESULT([yes; using Lucid toolkit])
2323     USE_X_TOOLKIT=LUCID
2324     HAVE_XAW3D=yes
2325     AC_DEFINE(HAVE_XAW3D, 1,
2326               [Define to 1 if you have the Xaw3d library (-lXaw3d).])
2327   else
2328     AC_MSG_RESULT(no)
2329     AC_MSG_CHECKING(for libXaw)
2330     AC_CACHE_VAL(emacs_cv_xaw,
2331     [AC_TRY_LINK([
2332 #include <X11/Intrinsic.h>
2333 #include <X11/Xaw/Simple.h>],
2334       [],
2335       emacs_cv_xaw=yes,
2336       emacs_cv_xaw=no)])
2337     if test $emacs_cv_xaw = yes; then
2338       AC_MSG_RESULT([yes; using Lucid toolkit])
2339       USE_X_TOOLKIT=LUCID
2340     elif test x"${USE_X_TOOLKIT}" = xLUCID; then
2341       AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
2342     else
2343       AC_MSG_RESULT([no; do not use toolkit by default])
2344       USE_X_TOOLKIT=none
2345     fi
2346   fi
2349 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
2351 if test "${USE_X_TOOLKIT}" != "none"; then
2352   AC_MSG_CHECKING(X11 toolkit version)
2353   AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
2354   [AC_TRY_LINK([#include <X11/Intrinsic.h>],
2355 [#if XtSpecificationRelease < 6
2356 fail;
2357 #endif
2358 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
2359   HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
2360   if test $emacs_cv_x11_toolkit_version_6 = yes; then
2361     AC_MSG_RESULT(6 or newer)
2362     AC_DEFINE(HAVE_X11XTR6, 1,
2363               [Define to 1 if you have the X11R6 or newer version of Xt.])
2364   else
2365     AC_MSG_RESULT(before 6)
2366   fi
2368 dnl If using toolkit, check whether libXmu.a exists.
2369 dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
2370   OLDLIBS="$LIBS"
2371   if test x$HAVE_X11XTR6 = xyes; then
2372     LIBS="-lXt -lSM -lICE $LIBS"
2373   else
2374     LIBS="-lXt $LIBS"
2375   fi
2376   AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
2377   test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
2380 # On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
2381 if test "${HAVE_X11}" = "yes"; then
2382   if test "${USE_X_TOOLKIT}" != "none"; then
2383     AC_CHECK_LIB(Xext, XShapeQueryExtension)
2384   fi
2387 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
2388   AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
2389   [AC_TRY_COMPILE([#include <Xm/Xm.h>],
2390     [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
2391 int x = 5;
2392 #else
2393 Motif version prior to 2.1.
2394 #endif],
2395     emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
2396   HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
2397   if test $emacs_cv_motif_version_2_1 = yes; then
2398     HAVE_LIBXP=no
2399     AC_DEFINE(HAVE_MOTIF_2_1, 1,
2400               [Define to 1 if you have Motif 2.1 or newer.])
2401     AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
2402     if test ${HAVE_LIBXP} = yes; then
2403       AC_DEFINE(HAVE_LIBXP, 1,
2404                 [Define to 1 if you have the Xp library (-lXp).])
2405     fi
2406   else
2407     AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
2408     # We put this in CFLAGS temporarily to precede other -I options
2409     # that might be in CFLAGS temporarily.
2410     # We put this in CPPFLAGS where it precedes the other -I options.
2411     OLD_CPPFLAGS=$CPPFLAGS
2412     OLD_CFLAGS=$CFLAGS
2413     CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
2414     CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
2415     [AC_TRY_COMPILE([#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>],
2416       [int x = 5;],
2417       emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
2418     if test $emacs_cv_lesstif = yes; then
2419       # Make sure this -I option remains in CPPFLAGS after it is set
2420       # back to REAL_CPPFLAGS.
2421       # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
2422       # have those other -I options anyway.  Ultimately, having this
2423       # directory ultimately in CPPFLAGS will be enough.
2424       REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
2425       LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
2426     else
2427       CFLAGS=$OLD_CFLAGS
2428       CPPFLAGS=$OLD_CPPFLAGS
2429     fi
2430   fi
2433 dnl Use toolkit scroll bars if configured for GTK or X toolkit and either
2434 dnl using Motif or Xaw3d is available, and unless
2435 dnl --with-toolkit-scroll-bars=no was specified.
2437 AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
2438             [Define to 1 if we should use toolkit scroll bars.])dnl
2439 USE_TOOLKIT_SCROLL_BARS=no
2440 if test "${with_toolkit_scroll_bars}" != "no"; then
2441   if test "${USE_X_TOOLKIT}" != "none"; then
2442     if test "${USE_X_TOOLKIT}" = "MOTIF"; then
2443       AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
2444       HAVE_XAW3D=no
2445       USE_TOOLKIT_SCROLL_BARS=yes
2446     elif test "${HAVE_XAW3D}" = "yes"; then
2447       AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
2448       USE_TOOLKIT_SCROLL_BARS=yes
2449     fi
2450   elif test "${HAVE_GTK}" = "yes"; then
2451     AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
2452     USE_TOOLKIT_SCROLL_BARS=yes
2453   elif test "${HAVE_CARBON}" = "yes"; then
2454     AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
2455     USE_TOOLKIT_SCROLL_BARS=yes
2456   fi
2459 dnl See if XIM is available.
2460 AC_TRY_COMPILE([
2461           #include <X11/Xlib.h>
2462           #include <X11/Xresource.h>],
2463          [XIMProc  callback;],
2464          [HAVE_XIM=yes
2465          AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])],
2466          HAVE_XIM=no)
2468 dnl `--with-xim' now controls only the initial value of use_xim at run time.
2470 if test "${with_xim}" != "no"; then
2471   AC_DEFINE(USE_XIM, 1,
2472             [Define to 1 if we should use XIM, if it is available.])
2476 if test "${HAVE_XIM}" != "no"; then
2477   late_CFLAGS=$CFLAGS
2478   if test "$GCC" = yes; then
2479     CFLAGS="$CFLAGS --pedantic-errors"
2480   fi
2481   AC_TRY_COMPILE([
2482 #include <X11/Xlib.h>
2483 #include <X11/Xresource.h>],
2484 [Display *display;
2485 XrmDatabase db;
2486 char *res_name;
2487 char *res_class;
2488 XIMProc  callback;
2489 XPointer *client_data;
2490 #ifndef __GNUC__
2491 /* If we're not using GCC, it's probably not XFree86, and this is
2492    probably right, but we can't use something like --pedantic-errors.  */
2493 extern Bool XRegisterIMInstantiateCallback(Display*, XrmDatabase, char*,
2494                                            char*, XIMProc, XPointer*);
2495 #endif
2496 (void)XRegisterIMInstantiateCallback(display, db, res_name, res_class, callback,
2497    client_data);],
2498     [emacs_cv_arg6_star=yes])
2499   AH_TEMPLATE(XRegisterIMInstantiateCallback_arg6,
2500          [Define to the type of the 6th arg of XRegisterIMInstantiateCallback,
2501 either XPointer or XPointer*.])dnl
2502   if test "$emacs_cv_arg6_star" = yes; then
2503     AC_DEFINE(XRegisterIMInstantiateCallback_arg6, [XPointer*])
2504   else
2505     AC_DEFINE(XRegisterIMInstantiateCallback_arg6, [XPointer])
2506   fi
2507   CFLAGS=$late_CFLAGS
2510 ### Use -lXpm if available, unless `--with-xpm=no'.
2511 HAVE_XPM=no
2512 if test "${HAVE_X11}" = "yes"; then
2513   if test "${with_xpm}" != "no"; then
2514     AC_CHECK_HEADER(X11/xpm.h,
2515       [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)])
2516     if test "${HAVE_XPM}" = "yes"; then
2517       AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
2518       AC_EGREP_CPP(no_return_alloc_pixels,
2519       [#include "X11/xpm.h"
2520 #ifndef XpmReturnAllocPixels
2521 no_return_alloc_pixels
2522 #endif
2523       ], HAVE_XPM=no, HAVE_XPM=yes)
2525       if test "${HAVE_XPM}" = "yes"; then
2526         AC_MSG_RESULT(yes)
2527       else
2528         AC_MSG_RESULT(no)
2529       fi
2530     fi
2531   fi
2533   if test "${HAVE_XPM}" = "yes"; then
2534     AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
2535   fi
2538 ### Use -ljpeg if available, unless `--with-jpeg=no'.
2539 HAVE_JPEG=no
2540 if test "${HAVE_X11}" = "yes"; then
2541   if test "${with_jpeg}" != "no"; then
2542     dnl Checking for jpeglib.h can lose because of a redefinition of
2543     dnl  HAVE_STDLIB_H.
2544     AC_CHECK_HEADER(jerror.h,
2545       [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2546   fi
2548   AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2549   if test "${HAVE_JPEG}" = "yes"; then
2550     AC_DEFINE(HAVE_JPEG)
2551     AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
2552         [#include <jpeglib.h>
2553          version=JPEG_LIB_VERSION
2555         [AC_DEFINE(HAVE_JPEG)],
2556         [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2557         HAVE_JPEG=no])
2558   fi
2561 ### Use -lpng if available, unless `--with-png=no'.
2562 HAVE_PNG=no
2563 if test "${HAVE_X11}" = "yes"; then
2564   if test "${with_png}" != "no"; then
2565     # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
2566     # in /usr/include/libpng.
2567     AC_CHECK_HEADERS(png.h libpng/png.h)
2568     if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
2569       AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm)
2570     fi
2571   fi
2573   if test "${HAVE_PNG}" = "yes"; then
2574     AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
2575   fi
2578 ### Use -ltiff if available, unless `--with-tiff=no'.
2579 HAVE_TIFF=no
2580 if test "${HAVE_X11}" = "yes"; then
2581   if test "${with_tiff}" != "no"; then
2582     AC_CHECK_HEADER(tiffio.h,
2583       [tifflibs="-lz -lm"
2584       # At least one tiff package requires the jpeg library.
2585       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
2586       AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs)])
2587   fi
2589   if test "${HAVE_TIFF}" = "yes"; then
2590     AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
2591   fi
2594 ### Use -lgif or -lungif if available, unless `--with-gif=no'.
2595 HAVE_GIF=no
2596 if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
2597   AC_CHECK_HEADER(gif_lib.h,
2598 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
2599 # Earlier versions can crash Emacs.
2600     [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, try_libungif=yes)])
2602   if test "$HAVE_GIF" = yes; then
2603       ac_gif_lib_name="-lgif"
2604   fi
2606 # If gif_lib.h but no libgif, try libungif.
2607   if test x"$try_libungif" = xyes; then
2608     AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)
2610     if test "$HAVE_GIF" = yes; then
2611       AC_DEFINE(LIBGIF, -lungif, [Compiler option to link with the gif library (if not -lgif).])
2612       ac_gif_lib_name="-lungif"
2613     fi
2614   fi
2616   if test "${HAVE_GIF}" = "yes"; then
2617     AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lgif; otherwise specify with LIBGIF).])
2618   fi
2621 dnl Check for required libraries.
2622 if test "${HAVE_X11}" = "yes"; then
2623   MISSING=""
2624   WITH_NO=""
2625   test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
2626     MISSING="libXpm" && WITH_NO="--with-xpm=no"
2627   test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
2628     MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
2629   test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
2630     MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
2631   test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
2632     MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
2633   test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
2634     MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
2636   if test "X${MISSING}" != X; then
2637     AC_MSG_ERROR([The following required libraries were not found:
2638     $MISSING
2639 Maybe some development libraries/packages are missing?
2640 If you don't want to link with them give
2641     $WITH_NO
2642 as options to configure])
2643   fi
2646 ### Use -lgpm if available, unless `--with-gpm=no'.
2647 HAVE_GPM=no
2648 if test "${with_gpm}" != "no"; then
2649   AC_CHECK_HEADER(gpm.h,
2650     [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
2653 if test "${HAVE_GPM}" = "yes"; then
2654   AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
2657 dnl Check for malloc/malloc.h on darwin
2658 AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])])
2660 ### Use Mac OS X Carbon API to implement GUI.
2661 if test "${HAVE_CARBON}" = "yes"; then
2662   AC_DEFINE(HAVE_CARBON, 1, [Define to 1 if you are using the Carbon API on Mac OS X.])
2663   ## Specify the install directory
2664   carbon_appdir=
2665   if test "${carbon_appdir_x}" != ""; then
2666     case ${carbon_appdir_x} in
2667       y | ye | yes)  carbon_appdir=/Applications ;;
2668       * ) carbon_appdir=${carbon_appdir_x} ;;
2669     esac
2670   fi
2671   # We also have mouse menus.
2672   HAVE_MENUS=yes
2675 ### Use session management (-lSM -lICE) if available
2676 HAVE_X_SM=no
2677 if test "${HAVE_X11}" = "yes"; then
2678   AC_CHECK_HEADER(X11/SM/SMlib.h,
2679     [AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)])
2681   if test "${HAVE_X_SM}" = "yes"; then
2682     AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
2683     case "$LIBS" in
2684       *-lSM*) ;;
2685       *)      LIBS="-lSM -lICE $LIBS" ;;
2686     esac
2687   fi
2690 # If netdb.h doesn't declare h_errno, we must declare it by hand.
2691 AC_CACHE_CHECK(whether netdb declares h_errno,
2692                emacs_cv_netdb_declares_h_errno,
2693 [AC_TRY_LINK([#include <netdb.h>],
2694   [return h_errno;],
2695   emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
2696 if test $emacs_cv_netdb_declares_h_errno = yes; then
2697   AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
2700 AC_FUNC_ALLOCA
2702 dnl src/alloca.c has been removed.  Could also check if $ALLOCA is set?
2703 dnl FIXME is there an autoconf test that does the right thing, without
2704 dnl needing to call A_M_E afterwards?
2705 if test x"$ac_cv_func_alloca_works" != xyes; then
2706    AC_MSG_ERROR( [a system implementation of alloca is required] )
2709 # fmod, logb, and frexp are found in -lm on most systems.
2710 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
2711 AC_CHECK_LIB(m, sqrt)
2713 # Check for mail-locking functions in a "mail" library.  Probably this should
2714 # have the same check as for liblockfile below.
2715 AC_CHECK_LIB(mail, maillock)
2716 dnl Debian, at least:
2717 AC_CHECK_LIB(lockfile, maillock)
2718 # If we have the shared liblockfile, assume we must use it for mail
2719 # locking (e.g. Debian).  If we couldn't link against liblockfile
2720 # (no liblockfile.a installed), ensure that we don't need to.
2721 if test "$ac_cv_lib_lockfile_maillock" = no; then
2722   dnl This works for files generally, not just executables.
2723   dnl Should we look elsewhere for it?  Maybe examine /etc/ld.so.conf?
2724   AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
2725                 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
2726   if test $ac_cv_prog_liblockfile = yes; then
2727     AC_MSG_ERROR([Shared liblockfile found but can't link against it.
2728 This probably means that movemail could lose mail.
2729 There may be a `development' package to install containing liblockfile.])
2730   else :
2731   fi
2733 AC_CHECK_FUNCS(touchlock)
2734 AC_CHECK_HEADERS(maillock.h)
2736 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
2737 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
2738 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
2739 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
2740 utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
2741 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
2742 sendto recvfrom getsockopt setsockopt getsockname getpeername \
2743 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
2744 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign)
2746 AC_CHECK_HEADERS(sys/un.h)
2748 AC_FUNC_MKTIME
2749 if test "$ac_cv_func_working_mktime" = no; then
2750   AC_DEFINE(BROKEN_MKTIME, 1, [Define to 1 if the mktime function is broken.])
2753 AC_FUNC_GETLOADAVG
2755 AC_FUNC_FSEEKO
2757 # Configure getopt.
2758 m4_include([m4/getopt.m4])
2759 gl_GETOPT_IFELSE([
2760   gl_GETOPT_SUBSTITUTE_HEADER
2761   gl_PREREQ_GETOPT
2762   GETOPTOBJS='getopt.o getopt1.o'
2764 AC_SUBST(GETOPTOBJS)
2766 AC_FUNC_GETPGRP
2768 AC_FUNC_STRFTIME
2770 # UNIX98 PTYs.
2771 AC_CHECK_FUNCS(grantpt)
2773 # PTY-related GNU extensions.
2774 AC_CHECK_FUNCS(getpt)
2776 # Check this now, so that we will NOT find the above functions in ncurses.
2777 # That is because we have not set up to link ncurses in lib-src.
2778 # It's better to believe a function is not available
2779 # than to expect to find it in ncurses.
2780 AC_CHECK_LIB(ncurses, tparm)
2782 # Do we have res_init, for detecting changes in /etc/resolv.conf?
2784 resolv=no
2785 AC_TRY_LINK([#include <netinet/in.h>
2786 #include <arpa/nameser.h>
2787 #include <resolv.h>],
2788     [return res_init();],
2789     have_res_init=yes, have_res_init=no)
2790 if test "$have_res_init" = no; then
2791   OLIBS="$LIBS"
2792   LIBS="$LIBS -lresolv"
2793   AC_MSG_CHECKING(for res_init with -lresolv)
2794   AC_TRY_LINK([#include <netinet/in.h>
2795 #include <arpa/nameser.h>
2796 #include <resolv.h>],
2797     [return res_init();],
2798     have_res_init=yes, have_res_init=no)
2799   AC_MSG_RESULT($have_res_init)
2800   if test "$have_res_init" = yes ; then
2801     resolv=yes
2802   fi
2803   LIBS="$OLIBS"
2806 if test "$have_res_init" = yes; then
2807   AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
2810 # Do we need the Hesiod library to provide the support routines?
2811 if test "$with_hesiod" = yes ; then
2812   # Don't set $LIBS here -- see comments above.
2813   AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2814      [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2815                   [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2816   if test "$resolv" = yes ; then
2817     RESOLVLIB=-lresolv
2818   else
2819     RESOLVLIB=
2820   fi
2821   AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
2822         [AC_DEFINE(HAVE_LIBHESIOD, 1,
2823                   [Define to 1 if you have the hesiod library (-lhesiod).])],
2824         :, $RESOLVLIB)])
2827 # Do we need libresolv (due to res_init or Hesiod)?
2828 if test "$resolv" = yes ; then
2829   AC_DEFINE(HAVE_LIBRESOLV, 1,
2830             [Define to 1 if you have the resolv library (-lresolv).])
2833 # These tell us which Kerberos-related libraries to use.
2834 if test "${with_kerberos+set}" = set; then
2835   AC_CHECK_LIB(com_err, com_err)
2836   AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2837   AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2838   AC_CHECK_LIB(krb5, krb5_init_context)
2839   if test "${with_kerberos5+set}" != set; then
2840     AC_CHECK_LIB(des425, des_cbc_encrypt,,
2841                  [AC_CHECK_LIB(des, des_cbc_encrypt)])
2842     AC_CHECK_LIB(krb4, krb_get_cred,,
2843                  [AC_CHECK_LIB(krb, krb_get_cred)])
2844   fi
2846   if test "${with_kerberos5+set}" = set; then
2847     AC_CHECK_HEADERS(krb5.h)
2848   else
2849     AC_CHECK_HEADERS(des.h,,
2850                      [AC_CHECK_HEADERS(kerberosIV/des.h,,
2851                                        [AC_CHECK_HEADERS(kerberos/des.h)])])
2852     AC_CHECK_HEADERS(krb.h,,
2853                      [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2854                                        [AC_CHECK_HEADERS(kerberos/krb.h)])])
2855   fi
2856   AC_CHECK_HEADERS(com_err.h)
2859 # Solaris requires -lintl if you want strerror (which calls dgettext)
2860 # to return localized messages.
2861 AC_CHECK_LIB(intl, dgettext)
2863 AC_MSG_CHECKING(whether localtime caches TZ)
2864 AC_CACHE_VAL(emacs_cv_localtime_cache,
2865 [if test x$ac_cv_func_tzset = xyes; then
2866 AC_TRY_RUN([#include <time.h>
2867 extern char **environ;
2868 unset_TZ ()
2870   char **from, **to;
2871   for (to = from = environ; (*to = *from); from++)
2872     if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2873       to++;
2875 char TZ_GMT0[] = "TZ=GMT0";
2876 char TZ_PST8[] = "TZ=PST8";
2877 main()
2879   time_t now = time ((time_t *) 0);
2880   int hour_GMT0, hour_unset;
2881   if (putenv (TZ_GMT0) != 0)
2882     exit (1);
2883   hour_GMT0 = localtime (&now)->tm_hour;
2884   unset_TZ ();
2885   hour_unset = localtime (&now)->tm_hour;
2886   if (putenv (TZ_PST8) != 0)
2887     exit (1);
2888   if (localtime (&now)->tm_hour == hour_GMT0)
2889     exit (1);
2890   unset_TZ ();
2891   if (localtime (&now)->tm_hour != hour_unset)
2892     exit (1);
2893   exit (0);
2894 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2895 [# If we have tzset, assume the worst when cross-compiling.
2896 emacs_cv_localtime_cache=yes])
2897 else
2898         # If we lack tzset, report that localtime does not cache TZ,
2899         # since we can't invalidate the cache if we don't have tzset.
2900         emacs_cv_localtime_cache=no
2901 fi])dnl
2902 AC_MSG_RESULT($emacs_cv_localtime_cache)
2903 if test $emacs_cv_localtime_cache = yes; then
2904   AC_DEFINE(LOCALTIME_CACHE, 1,
2905             [Define to 1 if localtime caches TZ.])
2908 if test "x$HAVE_TIMEVAL" = xyes; then
2909   AC_CHECK_FUNCS(gettimeofday)
2910   if test $ac_cv_func_gettimeofday = yes; then
2911     AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2912                    emacs_cv_gettimeofday_two_arguments,
2913     [AC_TRY_COMPILE([
2914 #ifdef TIME_WITH_SYS_TIME
2915 #include <sys/time.h>
2916 #include <time.h>
2917 #else
2918 #ifdef HAVE_SYS_TIME_H
2919 #include <sys/time.h>
2920 #else
2921 #include <time.h>
2922 #endif
2923 #endif],
2924       [struct timeval time;
2925        gettimeofday (&time, 0);],
2926       emacs_cv_gettimeofday_two_arguments=yes,
2927       emacs_cv_gettimeofday_two_arguments=no)])
2928     if test $emacs_cv_gettimeofday_two_arguments = no; then
2929       AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
2930                 [Define to 1 if gettimeofday accepts only one argument.])
2931     fi
2932   fi
2935 ok_so_far=yes
2936 AC_CHECK_FUNC(socket, , ok_so_far=no)
2937 if test $ok_so_far = yes; then
2938   AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
2940 if test $ok_so_far = yes; then
2941   AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
2943 if test $ok_so_far = yes; then
2944 dnl Fixme: Not used.  Should this be HAVE_SOCKETS?
2945   AC_DEFINE(HAVE_INET_SOCKETS, 1,
2946             [Define to 1 if you have inet sockets.])
2949 AC_CHECK_HEADERS(sys/ioctl.h)
2951 if test -f /usr/lpp/X11/bin/smt.exp; then
2952   AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
2953             [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
2956 AC_MSG_CHECKING(whether system supports dynamic ptys)
2957 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2958   AC_MSG_RESULT(yes)
2959   AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if dynamic ptys are supported.])
2960 else
2961   AC_MSG_RESULT(no)
2964 AC_FUNC_FORK
2966 dnl Adapted from Haible's version.
2967 AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
2968   [AC_TRY_LINK([#include <langinfo.h>],
2969     [char* cs = nl_langinfo(CODESET);],
2970     emacs_cv_langinfo_codeset=yes,
2971     emacs_cv_langinfo_codeset=no)
2972   ])
2973 if test $emacs_cv_langinfo_codeset = yes; then
2974   AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2975     [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2978 AC_CHECK_TYPES(size_t)
2980 AC_TYPE_MBSTATE_T
2982 dnl Restrict could probably be used effectively other than in regex.c.
2983 AC_CACHE_CHECK([for C restrict keyword], emacs_cv_c_restrict,
2984   [AC_TRY_COMPILE([void fred (int *restrict x);], [],
2985                   emacs_cv_c_restrict=yes,
2986                   [AC_TRY_COMPILE([void fred (int *__restrict x);], [],
2987                                   emacs_cv_c_restrict=__restrict,
2988                                   emacs_cv_c_restrict=no)])])
2989 case "$emacs_cv_c_restrict" in
2990   yes) emacs_restrict=restrict;;
2991   no) emacs_restrict="";;
2992   *) emacs_restrict="$emacs_cv_c_restrict";;
2993 esac
2994 if test "$emacs_restrict" != __restrict; then
2995   AC_DEFINE_UNQUOTED(__restrict, $emacs_restrict,
2996     [Define to compiler's equivalent of C99 restrict keyword.
2997      Don't define if equivalent is `__restrict'.])
3000 AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr,
3001   [AC_TRY_COMPILE([void fred (int x[__restrict]);], [],
3002                   emacs_cv_c_restrict_arr=yes, emacs_cv_c_restrict_arr=no)])
3003 if test "$emacs_cv_c_restrict_arr" = yes; then
3004   AC_DEFINE(__restrict_arr, __restrict,
3005     [Define to compiler's equivalent of C99 restrict keyword in array
3006      declarations.  Define as empty for no equivalent.])
3009 dnl Fixme: AC_SYS_POSIX_TERMIOS should probably be used, but it's not clear
3010 dnl how the tty code is related to POSIX and/or other versions of termios.
3011 dnl The following looks like a useful start.
3013 dnl AC_SYS_POSIX_TERMIOS
3014 dnl if test $ac_cv_sys_posix_termios = yes; then
3015 dnl    AC_DEFINE(HAVE_TERMIOS, 1, [Define to 1 if you have POSIX-style functions
3016 dnl                                and macros for terminal control.])
3017 dnl    AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.])
3018 dnl fi
3020 dnl Fixme: Use AC_FUNC_MEMCMP since memcmp is used.  (Needs libobj replacement.)
3022 # Set up the CFLAGS for real compilation, so we can substitute it.
3023 CFLAGS="$REAL_CFLAGS"
3024 CPPFLAGS="$REAL_CPPFLAGS"
3026 #### Find out which version of Emacs this is.
3027 [version=`grep 'defconst[        ]*emacs-version' ${srcdir}/lisp/version.el \
3028          | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
3029 if test x"${version}" = x; then
3030   AC_MSG_ERROR([can't find current emacs version in `${srcdir}/lisp/version.el'.])
3033 ### Specify what sort of things we'll be editing into Makefile and config.h.
3034 ### Use configuration here uncanonicalized to avoid exceeding size limits.
3035 AC_SUBST(version)
3036 AC_SUBST(configuration)
3037 AC_SUBST(canonical)
3038 AC_SUBST(srcdir)
3039 AC_SUBST(prefix)
3040 AC_SUBST(exec_prefix)
3041 AC_SUBST(bindir)
3042 AC_SUBST(datadir)
3043 AC_SUBST(sharedstatedir)
3044 AC_SUBST(libexecdir)
3045 AC_SUBST(mandir)
3046 AC_SUBST(infodir)
3047 AC_SUBST(lispdir)
3048 AC_SUBST(locallisppath)
3049 AC_SUBST(lisppath)
3050 AC_SUBST(x_default_search_path)
3051 AC_SUBST(etcdir)
3052 AC_SUBST(archlibdir)
3053 AC_SUBST(docdir)
3054 AC_SUBST(bitmapdir)
3055 AC_SUBST(gamedir)
3056 AC_SUBST(gameuser)
3057 AC_SUBST(c_switch_system)
3058 AC_SUBST(c_switch_machine)
3059 AC_SUBST(LD_SWITCH_X_SITE)
3060 AC_SUBST(LD_SWITCH_X_SITE_AUX)
3061 AC_SUBST(C_SWITCH_X_SITE)
3062 AC_SUBST(CFLAGS)
3063 AC_SUBST(X_TOOLKIT_TYPE)
3064 AC_SUBST(machfile)
3065 AC_SUBST(opsysfile)
3066 AC_SUBST(GETLOADAVG_LIBS)
3067 AC_SUBST(carbon_appdir)
3069 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}",
3070                    [Define to the canonical Emacs configuration name.])
3071 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
3072                    [Define to the options passed to configure.])
3073 AC_DEFINE_UNQUOTED(config_machfile,  "${machfile}",
3074                    [Define to the used machine dependent file.])
3075 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
3076                    [Define to the used os dependent file.])
3077 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
3078 [Define LD_SWITCH_X_SITE to contain any special flags your loader
3079  may need to deal with X Windows.  For instance, if you've defined
3080  HAVE_X_WINDOWS above and your X libraries aren't in a place that
3081  your loader can find on its own, you might want to add "-L/..." or
3082  something similar.])
3083 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
3084                    [Define LD_SWITCH_X_SITE_AUX with an -R option
3085                     in case it's needed (for Solaris, for example).])
3086 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE,  ${C_SWITCH_X_SITE},
3087 [Define C_SWITCH_X_SITE to contain any special flags your compiler
3088  may need to deal with X Windows.  For instance, if you've defined
3089  HAVE_X_WINDOWS above and your X include files aren't in a place
3090  that your compiler can find on its own, you might want to add
3091  "-I/..." or something similar.])
3092 AC_DEFINE_UNQUOTED(UNEXEC_SRC,       ${UNEXEC_SRC},
3093                    [Define to the unexec source file name.])
3095 if test "${HAVE_X_WINDOWS}" = "yes" ; then
3096   AC_DEFINE(HAVE_X_WINDOWS, 1,
3097             [Define to 1 if you want to use the X window system.])
3099 if test "${USE_X_TOOLKIT}" != "none" ; then
3100   AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
3102 if test "${HAVE_X11}" = "yes" ; then
3103   AC_DEFINE(HAVE_X11, 1,
3104             [Define to 1 if you want to use version 11 of X windows.
3105              Otherwise, Emacs expects to use version 10.])
3107 if test "${HAVE_XFREE386}" = "yes" ; then
3108   AC_DEFINE(HAVE_XFREE386, 1, [Define to 1 if you're using XFree386.])
3110 if test "${HAVE_MENUS}" = "yes" ; then
3111   AC_DEFINE(HAVE_MENUS, 1,
3112             [Define to 1 if you have mouse menus.
3113              (This is automatic if you use X, but the option to specify it remains.)
3114              It is also defined with other window systems that support xmenu.c.])
3116 if test "${GNU_MALLOC}" = "yes" ; then
3117   AC_DEFINE(GNU_MALLOC, 1,
3118             [Define to 1 if you want to use the GNU memory allocator.])
3120 if test "${REL_ALLOC}" = "yes" ; then
3121   AC_DEFINE(REL_ALLOC, 1,
3122             [Define REL_ALLOC if you want to use the relocating allocator for
3123              buffer space.])
3127 AH_TOP([/* GNU Emacs site configuration template file.
3128    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
3129              Free Software Foundation, Inc.
3131 This file is part of GNU Emacs.
3133 GNU Emacs is free software; you can redistribute it and/or modify
3134 it under the terms of the GNU General Public License as published by
3135 the Free Software Foundation; either version 3, or (at your option)
3136 any later version.
3138 GNU Emacs is distributed in the hope that it will be useful,
3139 but WITHOUT ANY WARRANTY; without even the implied warranty of
3140 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3141 GNU General Public License for more details.
3143 You should have received a copy of the GNU General Public License
3144 along with GNU Emacs; see the file COPYING.  If not, write to the
3145 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
3146 Boston, MA 02110-1301, USA.  */
3149 /* No code in Emacs #includes config.h twice, but some bits of code
3150    intended to work with other packages as well (like gmalloc.c)
3151    think they can include it as many times as they like.  */
3152 #ifndef EMACS_CONFIG_H
3153 #define EMACS_CONFIG_H
3154 ])dnl
3156 AH_BOTTOM([
3157 /* If we're using any sort of window system, define some consequences.  */
3158 #ifdef HAVE_X_WINDOWS
3159 #define HAVE_WINDOW_SYSTEM
3160 #define MULTI_KBOARD
3161 #define HAVE_MOUSE
3162 #endif
3164 /* Multi-tty support relies on MULTI_KBOARD.  It seems safe to turn it
3165    on unconditionally.  Note that src/s/darwin.h disables this at
3166    present.  */
3167 #ifndef MULTI_KBOARD
3168 #define MULTI_KBOARD
3169 #endif
3171 /* If we're using the Carbon API on Mac OS X, define a few more
3172    variables as well.  */
3173 #ifdef HAVE_CARBON
3174 #define HAVE_WINDOW_SYSTEM
3175 #define HAVE_MOUSE
3176 #endif
3178 /* Define USER_FULL_NAME to return a string
3179    that is the user's full name.
3180    It can assume that the variable `pw'
3181    points to the password file entry for this user.
3183    At some sites, the pw_gecos field contains
3184    the user's full name.  If neither this nor any other
3185    field contains the right thing, use pw_name,
3186    giving the user's login name, since that is better than nothing.  */
3187 #define USER_FULL_NAME pw->pw_gecos
3189 /* Define AMPERSAND_FULL_NAME if you use the convention
3190    that & in the full name stands for the login id.  */
3191 /* Turned on June 1996 supposing nobody will mind it.  */
3192 #define AMPERSAND_FULL_NAME
3194 /* We have blockinput.h.  */
3195 #define DO_BLOCK_INPUT
3197 /* Define HAVE_SOUND if we have sound support.  We know it works
3198    and compiles only on the specified platforms.   For others,
3199    it probably doesn't make sense to try.  */
3201 #if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
3202 #ifdef HAVE_MACHINE_SOUNDCARD_H
3203 #define HAVE_SOUND 1
3204 #endif
3205 #ifdef HAVE_SYS_SOUNDCARD_H
3206 #define HAVE_SOUND 1
3207 #endif
3208 #ifdef HAVE_SOUNDCARD_H
3209 #define HAVE_SOUND 1
3210 #endif
3211 #ifdef HAVE_ALSA
3212 #define HAVE_SOUND 1
3213 #endif
3214 #endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
3216 /* If using GNU, then support inline function declarations. */
3217 /* Don't try to switch on inline handling as detected by AC_C_INLINE
3218    generally, because even if non-gcc compilers accept `inline', they
3219    may reject `extern inline'.  */
3220 #if defined (__GNUC__) && defined (OPTIMIZE)
3221 #define INLINE __inline__
3222 #else
3223 #define INLINE
3224 #endif
3226 /* Include the os and machine dependent files.  */
3227 #include config_opsysfile
3228 #include config_machfile
3230 /* Load in the conversion definitions if this system
3231    needs them and the source file being compiled has not
3232    said to inhibit this.  There should be no need for you
3233    to alter these lines.  */
3235 #ifdef SHORTNAMES
3236 #ifndef NO_SHORTNAMES
3237 #include "../shortnames/remap.h"
3238 #endif /* not NO_SHORTNAMES */
3239 #endif /* SHORTNAMES */
3241 /* If no remapping takes place, static variables cannot be dumped as
3242    pure, so don't worry about the `static' keyword. */
3243 #ifdef NO_REMAP
3244 #undef static
3245 #endif
3247 /* Define `subprocesses' should be defined if you want to
3248    have code for asynchronous subprocesses
3249    (as used in M-x compile and M-x shell).
3250    These do not work for some USG systems yet;
3251    for the ones where they work, the s/SYSTEM.h file defines this flag.  */
3253 #ifndef VMS
3254 #ifndef USG
3255 /* #define subprocesses */
3256 #endif
3257 #endif
3259 /* SIGTYPE is the macro we actually use.  */
3260 #ifndef SIGTYPE
3261 #define SIGTYPE RETSIGTYPE
3262 #endif
3264 #ifdef emacs /* Don't do this for lib-src.  */
3265 /* Tell regex.c to use a type compatible with Emacs.  */
3266 #define RE_TRANSLATE_TYPE Lisp_Object
3267 #define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
3268 #ifdef make_number
3269 /* If make_number is a macro, use it.  */
3270 #define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0)))
3271 #else
3272 /* If make_number is a function, avoid it.  */
3273 #define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0))
3274 #endif
3275 #endif
3277 /* Avoid link-time collision with system mktime if we will use our own.  */
3278 #if ! HAVE_MKTIME || BROKEN_MKTIME
3279 #define mktime emacs_mktime
3280 #endif
3282 #define my_strftime nstrftime   /* for strftime.c */
3284 /* The rest of the code currently tests the CPP symbol BSTRING.
3285    Override any claims made by the system-description files.
3286    Note that on some SCO version it is possible to have bcopy and not bcmp.  */
3287 #undef BSTRING
3288 #if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
3289 #define BSTRING
3290 #endif
3292 /* Some of the files of Emacs which are intended for use with other
3293    programs assume that if you have a config.h file, you must declare
3294    the type of getenv.
3296    This declaration shouldn't appear when alloca.s or Makefile.in
3297    includes config.h.  */
3298 #ifndef NOT_C_CODE
3299 extern char *getenv ();
3300 #endif
3302 /* These default definitions are good for almost all machines.
3303    The exceptions override them in m/MACHINE.h.  */
3305 #ifndef BITS_PER_CHAR
3306 #define BITS_PER_CHAR 8
3307 #endif
3309 #ifndef BITS_PER_SHORT
3310 #define BITS_PER_SHORT 16
3311 #endif
3313 /* Note that lisp.h uses this in a preprocessor conditional, so it
3314    would not work to use sizeof.  That being so, we do all of them
3315    without sizeof, for uniformity's sake.  */
3316 #ifndef BITS_PER_INT
3317 #define BITS_PER_INT 32
3318 #endif
3320 #ifndef BITS_PER_LONG
3321 #ifdef _LP64
3322 #define BITS_PER_LONG 64
3323 #else
3324 #define BITS_PER_LONG 32
3325 #endif
3326 #endif
3328 /* Define if the compiler supports function prototypes.  It may do so
3329    but not define __STDC__ (e.g. DEC C by default) or may define it as
3330    zero.  */
3331 #undef PROTOTYPES
3332 /* For mktime.c:  */
3333 #ifndef __P
3334 # if defined PROTOTYPES
3335 #  define __P(args) args
3336 # else
3337 #  define __P(args) ()
3338 # endif  /* GCC.  */
3339 #endif /* __P */
3341 /* Don't include "string.h" or <stdlib.h> in non-C code.  */
3342 #ifndef NOT_C_CODE
3343 #ifdef HAVE_STRING_H
3344 #include "string.h"
3345 #endif
3346 #ifdef HAVE_STRINGS_H
3347 #include "strings.h"  /* May be needed for bcopy & al. */
3348 #endif
3349 #ifdef HAVE_STDLIB_H
3350 #include <stdlib.h>
3351 #endif
3352 #ifndef __GNUC__
3353 # ifdef HAVE_ALLOCA_H
3354 #  include <alloca.h>
3355 # else /* AIX files deal with #pragma.  */
3356 #  ifndef alloca /* predefined by HP cc +Olibcalls */
3357 char *alloca ();
3358 #  endif
3359 # endif /* HAVE_ALLOCA_H */
3360 #endif /* __GNUC__ */
3361 #ifndef HAVE_SIZE_T
3362 typedef unsigned size_t;
3363 #endif
3364 #endif /* NOT_C_CODE */
3366 /* Define HAVE_X_I18N if we have usable i18n support.  */
3368 #ifdef HAVE_X11R6
3369 #define HAVE_X_I18N
3370 #elif !defined X11R5_INHIBIT_I18N
3371 #define HAVE_X_I18N
3372 #endif
3374 /* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support.  */
3376 #if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
3377 #define HAVE_X11R6_XIM
3378 #endif
3380 /* Should we enable expensive run-time checking of data types?  */
3381 #undef ENABLE_CHECKING
3383 #if defined __GNUC__ && (__GNUC__ > 2 \
3384                          || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
3385 #define NO_RETURN       __attribute__ ((__noreturn__))
3386 #else
3387 #define NO_RETURN       /* nothing */
3388 #endif
3390 /* These won't be used automatically yet.  We also need to know, at least,
3391    that the stack is continuous.  */
3392 #ifdef __GNUC__
3393 #  ifndef GC_SETJMP_WORKS
3394   /* GC_SETJMP_WORKS is nearly always appropriate for GCC --
3395      see NON_SAVING_SETJMP in the target descriptions.  */
3396   /* Exceptions (see NON_SAVING_SETJMP in target description) are ns32k,
3397      SCO5 non-ELF (but Emacs specifies ELF) and SVR3 on x86.
3398      Fixme: Deal with ns32k, SVR3.  */
3399 #    define GC_SETJMP_WORKS 1
3400 #  endif
3401 #  ifndef GC_LISP_OBJECT_ALIGNMENT
3402 #    define GC_LISP_OBJECT_ALIGNMENT (__alignof__ (Lisp_Object))
3403 #  endif
3404 #endif
3406 #ifndef HAVE_BCOPY
3407 #define bcopy(a,b,s) memcpy (b,a,s)
3408 #endif
3409 #ifndef HAVE_BZERO
3410 #define bzero(a,s) memset (a,0,s)
3411 #endif
3412 #ifndef HAVE_BCMP
3413 #define BCMP memcmp
3414 #endif
3416 #endif /* EMACS_CONFIG_H */
3419 Local Variables:
3420 mode: c
3421 End:
3423 ])dnl
3425 #### Report on what we decided to do.
3426 #### Report GTK as a toolkit, even if it doesn't use Xt.
3427 #### It makes printing result more understandable as using GTK sets
3428 #### toolkit_scroll_bars to yes by default.
3429 if test "${HAVE_GTK}" = "yes"; then
3430   USE_X_TOOLKIT=GTK
3433 echo "
3434 Configured for \`${canonical}'.
3436   Where should the build process find the source code?    ${srcdir}
3437   What operating system and machine description files should Emacs use?
3438         \`${opsysfile}' and \`${machfile}'
3439   What compiler should emacs be built with?               ${CC} ${CFLAGS}
3440   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
3441   Should Emacs use a relocating allocator for buffers?    ${REL_ALLOC}
3442   Should Emacs use mmap(2) for buffer allocation?         $use_mmap_for_buffers
3443   What window system should Emacs use?                    ${window_system}
3444   What toolkit should Emacs use?                          ${USE_X_TOOLKIT}"
3446 if test -n "${x_includes}"; then
3447 echo "  Where do we find X Windows header files?                ${x_includes}"
3448 else
3449 echo "  Where do we find X Windows header files?                Standard dirs"
3451 if test -n "${x_libraries}"; then
3452 echo "  Where do we find X Windows libraries?                   ${x_libraries}"
3453 else
3454 echo "  Where do we find X Windows libraries?                   Standard dirs"
3457 echo "  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D}"
3458 echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
3459 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
3460 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
3461 echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $ac_gif_lib_name"
3462 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
3463 echo "  Does Emacs use -lrsvg-2?                                ${HAVE_RSVG}"
3464 echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
3465 echo "  Does Emacs use X toolkit scroll bars?                   ${USE_TOOLKIT_SCROLL_BARS}"
3466 echo
3468 if test $USE_XASSERTS = yes; then
3469    echo "  Compiling with asserts turned on."
3470    CPPFLAGS="$CPPFLAGS -DXASSERTS=1"
3471    echo
3474 if test "$USE_X_TOOLKIT" = GTK; then
3475   case "$canonical" in
3476   *cygwin*)
3477     echo "There are known problems with Emacs and Gtk+ on cygwin, so you
3478   will probably get a crash on startup.  If this happens, please use another
3479   toolkit for Emacs.  See etc/PROBLEMS for more information."
3480   ;;
3481   esac
3485 if test "$HAVE_CARBON" = "yes"; then
3486    echo
3487    echo "Warning: The Mac Carbon port is currently unsupported and has
3488 known problems.  It is not recommended for use by non-developers.
3489 Read the emacs-devel archives for more information."
3490    echo
3493 if test "$HAVE_DBUS" = yes && test "${opsys}" != "gnu-linux"; then
3494   echo "D-Bus integration has been tested for GNU/Linux only."
3495   echo
3499 # Remove any trailing slashes in these variables.
3500 [test "${prefix}" != NONE &&
3501   prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
3502 test "${exec_prefix}" != NONE &&
3503   exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`]
3505 ## Check if the C preprocessor will convert `..' to `. .'.  If so, set
3506 ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
3507 ## from Makefile.c can correctly provide the arg `-traditional' to the
3508 ## C preprocessor.
3510 AC_EGREP_CPP(yes..yes,
3511         [yes..yes],
3512         CPP_NEED_TRADITIONAL=no,
3513         CPP_NEED_TRADITIONAL=yes)
3515 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
3516         doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
3517         doc/lispref/Makefile src/Makefile.c:src/Makefile.in \
3518         lwlib/Makefile lisp/Makefile leim/Makefile, [
3520 ### Make the necessary directories, if they don't exist.
3521 for dir in etc lisp ; do
3522   test -d ${dir} || mkdir ${dir}
3523 done
3525 # Build src/Makefile from ${srcdir}/src/Makefile.c
3526 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
3527 # This must be done after src/config.h is built, since we rely on that file.
3529 # Now get this: Some word that is part of the ${srcdir} directory name
3530 # or the ${configuration} value might, just might, happen to be an
3531 # identifier like `sun4' or `i386' or something, and be predefined by
3532 # the C preprocessor to some helpful value like 1, or maybe the empty
3533 # string.  Needless to say consequent macro substitutions are less
3534 # than conducive to the makefile finding the correct directory.
3535 [undefs="`echo $top_srcdir $configuration $canonical |
3536 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/  *$//' \
3537     -e 's/  */ -U/g' -e 's/-U[0-9][^ ]*//g' \
3540 echo creating src/epaths.h
3541 ${MAKE-make} epaths-force
3543 # As of 2000-11-19, newest development versions of GNU cpp preprocess
3544 # `..' to `. .'  unless invoked with -traditional
3546 if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
3547   CPPFLAGS="$CPPFLAGS -traditional"
3550 echo creating lib-src/Makefile
3551 ( cd lib-src
3552   rm -f junk.c junk1.c junk2.c
3553   sed -e '/start of cpp stuff/q' \
3554       < Makefile.c > junk1.c
3555   sed -e '1,/start of cpp stuff/d'\
3556       -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
3557       < Makefile.c > junk.c
3558   $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
3559       sed -e 's/^ /     /' -e '/^#/d' -e '/^[   \f]*$/d' > junk2.c
3560   cat junk1.c junk2.c > Makefile.new
3561   rm -f junk.c junk1.c junk2.c
3562   chmod 444 Makefile.new
3563   mv -f Makefile.new Makefile
3566 echo creating src/Makefile
3567 ( cd src
3568   rm -f junk.c junk1.c junk2.c
3569   sed -e '/start of cpp stuff/q' \
3570       < Makefile.c > junk1.c
3571   sed -e '1,/start of cpp stuff/d'\
3572       -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
3573       < Makefile.c > junk.c
3574   $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
3575       sed -e 's/^ /     /' -e '/^#/d' -e '/^[   \f]*$/d' > junk2.c
3576   cat junk1.c junk2.c > Makefile.new
3577   rm -f junk.c junk1.c junk2.c
3578   chmod 444 Makefile.new
3579   mv -f Makefile.new Makefile
3582 if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
3583   echo creating src/.gdbinit
3584   echo source $srcdir/src/.gdbinit > src/.gdbinit
3587 # This is how we know whether to re-run configure in certain cases.
3588 touch src/config.stamp
3590 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])
3592 m4_if(dnl       Do not change this comment
3593    arch-tag: 156a4dd5-bddc-4d18-96ac-f37742cf6a5e
3594 )dnl