Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
[bpt/emacs.git] / configure.in
CommitLineData
6e502e37 1dnl Autoconf script for GNU Emacs
9ec10b2f
DM
2dnl To rebuild the `configure' script from this, execute the command
3dnl autoconf
4dnl in the directory containing this script.
6e502e37 5dnl
6a22cdf4 6dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002
ad4ac636 7dnl Free Software Foundation, Inc.
552dfe31 8dnl
6e502e37 9dnl This file is part of GNU Emacs.
552dfe31 10dnl
6e502e37
RS
11dnl GNU Emacs is free software; you can redistribute it and/or modify
12dnl it under the terms of the GNU General Public License as published by
13dnl the Free Software Foundation; either version 2, or (at your option)
14dnl any later version.
552dfe31 15dnl
6e502e37
RS
16dnl GNU Emacs is distributed in the hope that it will be useful,
17dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
18dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19dnl GNU General Public License for more details.
20dnl
21dnl You should have received a copy of the GNU General Public License
1fb87c77
KH
22dnl along with GNU Emacs; see the file COPYING. If not, write to the
23dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24dnl Boston, MA 02111-1307, USA.
6e502e37 25
5a129faf 26AC_PREREQ(2.51)dnl
9ec10b2f 27AC_INIT(src/lisp.h)
5f8c8f00 28AC_CONFIG_HEADER(src/config.h:src/config.in)
9ec10b2f 29
a4663fed
PJ
30dnl Support for --program-prefix, --program-suffix and
31dnl --program-transform-name options
32AC_ARG_PROGRAM
33
9ec10b2f 34lispdir='${datadir}/emacs/${version}/lisp'
4be21f66 35locallisppath='${datadir}/emacs/${version}/site-lisp:'\
684f4cb3 36'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
9ec10b2f
DM
37lisppath='${locallisppath}:${lispdir}'
38etcdir='${datadir}/emacs/${version}/etc'
60c3568d 39archlibdir='${libexecdir}/emacs/${version}/${configuration}'
9ec10b2f 40docdir='${datadir}/emacs/${version}/etc'
93c05c18
CW
41gamedir=yes
42
43AC_ARG_WITH(game-dir,
44[ --with-game-dir use a shared game directory if possible],
45 [if test "$withval" = yes; then
46 gamedir="${localstatedir}/games/emacs"
47 else
48 if test "$withval" = no; then
49 gamedir=no
50 else
51 gamedir="$withval"
52 fi
53 fi
54])
55
56gameuser=games
57AC_ARG_WITH(game-user,
6ef02752 58[ --with-game-user use specified user for game directory],
93c05c18 59 [gameuser="$withval"])
9ec10b2f 60
39a7c455 61AC_ARG_WITH(gcc,
6fa064b6 62[ --without-gcc don't use GCC to compile Emacs if GCC is found])
4f734bde 63AC_ARG_WITH(pop,
6fa064b6
DL
64[ --without-pop don't support POP mail retrieval with movemail],
65[if test "$withval" = yes; then
66 AC_DEFINE(MAIL_USE_POP)
67else :
3d9fec71
DL
68fi],
69AC_DEFINE(MAIL_USE_POP))
5e7d772d 70AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
a21616bd
KR
71AC_ARG_WITH(kerberos,
72[ --with-kerberos support Kerberos-authenticated POP],
73[AC_DEFINE(KERBEROS)])
5e7d772d
AS
74AH_TEMPLATE(KERBEROS,
75 [Define to support Kerberos-authenticated POP mail retrieval.])dnl
a21616bd 76AC_ARG_WITH(kerberos5,
4d6e16b3 77[ --with-kerberos5 support Kerberos version 5 authenticated POP],
a21616bd
KR
78[if test "${with_kerberos5+set}" = set; then
79 if test "${with_kerberos+set}" != set; then
80 with_kerberos=yes
81 AC_DEFINE(KERBEROS)
82 fi
83fi
5e7d772d 84AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])])
4f734bde
DM
85AC_ARG_WITH(hesiod,
86[ --with-hesiod support Hesiod to get the POP server host],
5e7d772d 87[AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])])
3d9830e5
PJ
88
89AC_ARG_WITH(sound,
90[ --without-sound don't compile with sound support])
91
4f734bde
DM
92dnl This should be the last --with option, because --with-x is
93dnl added later on when we find the path of X, and it's best to
94dnl keep them together visually.
9ec10b2f 95AC_ARG_WITH(x-toolkit,
f7894e88 96[ --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)],
9ec10b2f
DM
97[ case "${withval}" in
98 y | ye | yes ) val=athena ;;
99 n | no ) val=no ;;
100 l | lu | luc | luci | lucid ) val=lucid ;;
84c5c823 101 a | at | ath | athe | athen | athena ) val=athena ;;
3cd69289 102 m | mo | mot | moti | motif ) val=motif ;;
2e71ec17 103dnl These don't currently work.
2e71ec17
DM
104dnl o | op | ope | open | open- | open-l | open-lo \
105dnl | open-loo | open-look ) val=open-look ;;
9ec10b2f 106 * )
2e71ec17
DM
107dnl AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
108dnl which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.])
90b777c5
RS
109AC_MSG_ERROR([\`--with-x-toolkit=$withval' is invalid\;
110this option's value should be \`yes', \`no', \`lucid', \`athena', or \`motif'.
9ec10b2f
DM
111Currently, \`yes', \`athena' and \`lucid' are synonyms.])
112 ;;
113 esac
114 with_x_toolkit=$val
115])
b412189c
GM
116AC_ARG_WITH(xpm,
117[ --with-xpm use -lXpm for displaying XPM images])
118AC_ARG_WITH(jpeg,
119[ --with-jpeg use -ljpeg for displaying JPEG images])
120AC_ARG_WITH(tiff,
495ccc04 121[ --with-tiff use -ltiff for displaying TIFF images])
b412189c
GM
122AC_ARG_WITH(gif,
123[ --with-gif use -lungif for displaying GIF images])
124AC_ARG_WITH(png,
125[ --with-png use -lpng for displaying PNG images])
20c1822e 126AC_ARG_WITH(toolkit-scroll-bars,
4d6e16b3 127[ --without-toolkit-scroll-bars
1c7a4f72 128 don't use Motif or Xaw3d scroll bars])
c6f7dae8 129AC_ARG_WITH(xim,
1c7a4f72 130[ --without-xim don't use X11 XIM])
e0f712ba
AC
131AC_ARG_WITH(carbon,
132[ --without-carbon don't use Carbon GUI on Mac OS X])
9ec10b2f
DM
133
134#### Make srcdir absolute, if it isn't already. It's important to
36969de6 135#### avoid running the path through pwd unnecessarily, since pwd can
069df4bf
DM
136#### give you automounter prefixes, which can go away. We do all this
137#### so Emacs can find its files when run uninstalled.
36969de6
GM
138## Make sure CDPATH doesn't affect cd (in case PWD is relative).
139unset CDPATH
9ec10b2f
DM
140case "${srcdir}" in
141 /* ) ;;
142 . )
143 ## We may be able to use the $PWD environment variable to make this
144 ## absolute. But sometimes PWD is inaccurate.
b83e4a77
RS
145 ## Note: we used to use ${PWD} at the end instead of `pwd`,
146 ## but that tested only for a well-formed and valid PWD,
147 ## it did not object when PWD was well-formed and valid but just wrong.
148 if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
9ec10b2f
DM
149 then
150 srcdir="$PWD"
151 else
152 srcdir="`(cd ${srcdir}; pwd)`"
153 fi
154 ;;
155 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
156esac
157
158#### Check if the source directory already has a configured system in it.
159if test `pwd` != `(cd ${srcdir} && pwd)` \
160 && test -f "${srcdir}/src/config.h" ; then
161 AC_MSG_WARN([The directory tree \`${srcdir}' is being used
162 as a build directory right now; it has been configured in its own
163 right. To configure in another directory as well, you MUST
164 use GNU make. If you do not have GNU make, then you must
165 now do \`make distclean' in ${srcdir},
166 and then run $0 again.])
167
2d73167a 168changequote(, )dnl
9ec10b2f 169 extrasub='/^VPATH[ ]*=/c\
2d73167a 170changequote([, ])dnl
9ec10b2f
DM
171vpath %.c $(srcdir)\
172vpath %.h $(srcdir)\
173vpath %.y $(srcdir)\
174vpath %.l $(srcdir)\
175vpath %.s $(srcdir)\
5ac83f86
RS
176vpath %.in $(srcdir)\
177vpath %.texi $(srcdir)'
9ec10b2f
DM
178fi
179
180#### Given the configuration name, set machfile and opsysfile to the
181#### names of the m/*.h and s/*.h files we should use.
182
183### Canonicalize the configuration name.
184
185AC_CANONICAL_HOST
186canonical=$host
fcb04b6e 187configuration=${host_alias-$host}
9ec10b2f
DM
188
189changequote(, )dnl
190
191### If you add support for a new configuration, add code to this
192### switch statement to recognize your configuration name and select
193### the appropriate operating system and machine description files.
194
195### You would hope that you could choose an m/*.h file pretty much
196### based on the machine portion of the configuration name, and an s-
197### file based on the operating system portion. However, it turns out
198### that each m/*.h file is pretty manufacturer-specific - for
199### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
200### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
201### machines. So we basically have to have a special case for each
202### configuration name.
203###
204### As far as handling version numbers on operating systems is
205### concerned, make sure things will fail in a fixable way. If
206### /etc/MACHINES doesn't say anything about version numbers, be
207### prepared to handle anything reasonably. If version numbers
208### matter, be sure /etc/MACHINES says something about it.
209###
210### Eric Raymond says we should accept strings like "sysvr4" to mean
211### "System V Release 4"; he writes, "The old convention encouraged
212### confusion between `system' and `release' levels'."
213
214machine='' opsys='' unported=no
215case "${canonical}" in
216
ba45dae0
GM
217 ## FreeBSD ports
218 *-*-freebsd* )
219 opsys=freebsd
220 case "${canonical}" in
221 alpha*-*-freebsd*) machine=alpha ;;
222 i[3456]86-*-freebsd*) machine=intel386 ;;
223 esac
224 ;;
225
9ec10b2f
DM
226 ## NetBSD ports
227 *-*-netbsd* )
228 opsys=netbsd
229 case "${canonical}" in
98bbf2a1 230 alpha*-*-netbsd*) machine=alpha ;;
5ac83f86 231 i[3456]86-*-netbsd*) machine=intel386 ;;
9ec10b2f
DM
232 m68k-*-netbsd*)
233 # This is somewhat bogus.
234 machine=hp9000s300 ;;
ca568b47 235 powerpc-apple-netbsd*) machine=macppc ;;
9ec10b2f 236 mips-*-netbsd*) machine=pmax ;;
69d5a2fa 237 mipsel-*-netbsd*) machine=pmax ;;
9ec10b2f 238 ns32k-*-netbsd*) machine=ns32000 ;;
b52425f4 239 powerpc-*-netbsd*) machine=macppc ;;
1ecefa7a 240 sparc*-*-netbsd*) machine=sparc ;;
b336ddd3 241 vax-*-netbsd*) machine=vax ;;
69d5a2fa 242 arm-*-netbsd*) machine=arm ;;
9ec10b2f
DM
243 esac
244 ;;
245
e3ac1b7f
RS
246 ## OpenBSD ports
247 *-*-openbsd* )
248 opsys=openbsd
249 case "${canonical}" in
98bbf2a1 250 alpha*-*-openbsd*) machine=alpha ;;
e3ac1b7f 251 i386-*-openbsd*) machine=intel386 ;;
6239880d
RS
252 m68k-*-openbsd*) machine=hp9000s300 ;;
253 mipsel-*-openbsd*) machine=pmax ;;
e3ac1b7f
RS
254 ns32k-*-openbsd*) machine=ns32000 ;;
255 sparc-*-openbsd*) machine=sparc ;;
ca568b47 256 vax-*-openbsd*) machine=vax ;;
e3ac1b7f
RS
257 esac
258 ;;
259
3cd69289
DM
260 ## Acorn RISCiX:
261 arm-acorn-riscix1.1* )
262 machine=acorn opsys=riscix1-1
263 ;;
264 arm-acorn-riscix1.2* | arm-acorn-riscix )
aac2257c
RS
265 ## This name is riscix12 instead of riscix1.2
266 ## to avoid a file name conflict on MSDOS.
267 machine=acorn opsys=riscix12
3cd69289
DM
268 ;;
269
2c4f7ce7
RS
270 ## BSDI ports
271 *-*-bsdi* )
272 opsys=bsdi
273 case "${canonical}" in
274 i[345]86-*-bsdi*) machine=intel386 ;;
275 sparc-*-bsdi*) machine=sparc ;;
393032d2 276 powerpc-*-bsdi*) machine=macppc ;;
2c4f7ce7
RS
277 esac
278 case "${canonical}" in
279 *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
280 *-*-bsdi2.0* ) opsys=bsdos2 ;;
281 *-*-bsdi2* ) opsys=bsdos2-1 ;;
282 *-*-bsdi3* ) opsys=bsdos3 ;;
1d06fc82 283 *-*-bsdi[45]* ) opsys=bsdos4 ;;
2c4f7ce7
RS
284 esac
285 ;;
286
9ec10b2f
DM
287 ## Alliant machines
288 ## Strictly speaking, we need the version of the alliant operating
289 ## system to choose the right machine file, but currently the
290 ## configuration name doesn't tell us enough to choose the right
291 ## one; we need to give alliants their own operating system name to
292 ## do this right. When someone cares, they can help us.
293 fx80-alliant-* )
294 machine=alliant4 opsys=bsd4-2
295 ;;
296 i860-alliant-* )
297 machine=alliant-2800 opsys=bsd4-3
298 ;;
299
30457b4f 300 ## Alpha (DEC) machines.
98bbf2a1 301 alpha*-dec-osf* )
3cd69289 302 machine=alpha opsys=osf1
f528522b 303 # This is needed to find X11R6.1 libraries for certain tests.
1bc5a004
RS
304 NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
305 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
557dcfd7
DL
306 # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile
307 # due to non-traditional preprocessing with the current compiler
308 # defaults. OSF 4 can also have that compiler version, and there
309 # seems always to have been a usable /usr/bin/cpp.
310 NON_GNU_CPP=/usr/bin/cpp
71c72a72 311 case "${canonical}" in
d5c898bb 312 alpha*-dec-osf[5-9]*)
f8340326 313 opsys=osf5-0 ;;
e57196a0 314 esac
3cd69289
DM
315 ;;
316
98bbf2a1 317 alpha*-*-linux-gnu* )
5ac83f86 318 machine=alpha opsys=gnu-linux
4e90a7d5
RS
319 ;;
320
d506e713
GM
321 arm*-*-linux-gnu* )
322 machine=arm opsys=gnu-linux
323 ;;
324
325 ppc-*-linux | \
326 powerpc-*-linux* )
393032d2 327 machine=macppc opsys=gnu-linux
d506e713
GM
328 ;;
329
9ec10b2f
DM
330 ## Altos 3068
331 m68*-altos-sysv* )
332 machine=altos opsys=usg5-2
333 ;;
c7f493fd 334
9ec10b2f
DM
335 ## Amdahl UTS
336 580-amdahl-sysv* )
337 machine=amdahl opsys=usg5-2-2
338 ;;
339
acd04c87
RS
340 ## Apollo, Domain/OS
341 m68*-apollo-* )
342 machine=apollo opsys=bsd4-3
9ec10b2f
DM
343 ;;
344
345 ## AT&T 3b2, 3b5, 3b15, 3b20
346 we32k-att-sysv* )
347 machine=att3b opsys=usg5-2-2
348 ;;
349
350 ## AT&T 3b1 - The Mighty Unix PC!
351 m68*-att-sysv* )
352 machine=7300 opsys=usg5-2-2
353 ;;
354
355 ## Bull dpx20
356 rs6000-bull-bosx* )
357 machine=ibmrs6000 opsys=aix3-2
358 ;;
359
360 ## Bull dpx2
361 m68*-bull-sysv3* )
362 machine=dpx2 opsys=usg5-3
363 ;;
364
365 ## Bull sps7
366 m68*-bull-sysv2* )
367 machine=sps7 opsys=usg5-2
368 ;;
369
370 ## CCI 5/32, 6/32 -- see "Tahoe".
371
372 ## Celerity
373 ## I don't know what configuration name to use for this; config.sub
374 ## doesn't seem to know anything about it. Hey, Celerity users, get
375 ## in touch with us!
376 celerity-celerity-bsd* )
377 machine=celerity opsys=bsd4-2
378 ;;
379
380 ## Clipper
381 ## What operating systems does this chip run that Emacs has been
382 ## tested on?
383 clipper-* )
384 machine=clipper
385 ## We'll use the catch-all code at the bottom to guess the
386 ## operating system.
387 ;;
388
b83e4a77
RS
389 ## Compaq Nonstop
390 mips-compaq-nonstopux* )
391 machine=nonstopux opsys=nonstopux
392 ;;
393
9ec10b2f
DM
394 ## Convex
395 *-convex-bsd* | *-convex-convexos* )
396 machine=convex opsys=bsd4-3
908ff139 397 ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov
9ec10b2f
DM
398 NON_GNU_CPP="cc -E -P"
399 ;;
400
401 ## Cubix QBx/386
5ac83f86 402 i[3456]86-cubix-sysv* )
9ec10b2f
DM
403 machine=intel386 opsys=usg5-3
404 ;;
405
406 ## Cydra 5
407 cydra*-cydrome-sysv* )
408 machine=cydra5 opsys=usg5-3
409 ;;
410
411 ## Data General AViiON Machines
651fc2d2
RS
412 ## DG changed naming conventions with the release of 5.4.4.10, they
413 ## dropped the initial 5.4 but left the intervening R. Because of the
414 ## R this shouldn't conflict with older versions of the OS (which I
f4afda69
KH
415 ## think were named like dgux4.*). In addition, DG new AViiONs series
416 ## uses either Motorola M88k or Intel Pentium CPUs.
9ae70ffe 417 m88k-dg-dguxR4.* | m88k-dg-dgux4* )
651fc2d2
RS
418 machine=aviion opsys=dgux4
419 ;;
9ec10b2f 420 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
aac2257c
RS
421 ## This name is dgux5-4-3 instead of dgux5-4r3
422 ## to avoid a file name conflict on MSDOS.
423 machine=aviion opsys=dgux5-4-3
9ec10b2f
DM
424 ;;
425 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
426 machine=aviion opsys=dgux5-4r2
427 ;;
428 m88k-dg-dgux* )
429 machine=aviion opsys=dgux
430 ;;
431
4e746fa8
KH
432 ## Data General AViiON Intel (x86) Machines
433 ## Exists from 5.4.3 (current i586-dg-dguxR4.11)
434 ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il
9ae70ffe 435 i[345]86-dg-dguxR4* )
4e746fa8
KH
436 machine=aviion-intel opsys=dgux4
437 ;;
438
9ec10b2f
DM
439 ## DECstations
440 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
441 machine=pmax opsys=bsd4-2
442 ;;
3bbe016c 443 mips-dec-ultrix4.[12]* | mips-dec-bsd* )
9ec10b2f
DM
444 machine=pmax opsys=bsd4-3
445 ;;
3bbe016c
KH
446 mips-dec-ultrix* )
447 machine=pmax opsys=ultrix4-3
448 ;;
9ec10b2f
DM
449 mips-dec-osf* )
450 machine=pmax opsys=osf1
451 ;;
b95c8e7e
RS
452 mips-dec-mach_bsd4.3* )
453 machine=pmax opsys=mach-bsd4-3
454 ;;
9ec10b2f
DM
455
456 ## Motorola Delta machines
457 m68k-motorola-sysv* | m68000-motorola-sysv* )
458 machine=delta opsys=usg5-3
459 if test -z "`type gnucc | grep 'not found'`"
018427ee
RS
460 then
461 if test -s /etc/167config
462 then CC="gnucc -m68040"
463 else CC="gnucc -m68881"
c7f493fd 464 fi
9ec10b2f
DM
465 else
466 if test -z "`type gcc | grep 'not found'`"
467 then CC=gcc
468 else CC=cc
469 fi
470 fi
471 ;;
472 m88k-motorola-sysv4* )
63c1d3f2
RS
473 # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
474 # needs POSIX_SIGNALS and therefore needs usg5-4-2.
475 # I hope there are not other 4.0 versions for this machine
476 # which really need usg5-4 instead.
477 machine=delta88k opsys=usg5-4-2
9ec10b2f
DM
478 ;;
479 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
480 machine=delta88k opsys=usg5-3
481 ;;
482
483 ## Dual machines
484 m68*-dual-sysv* )
485 machine=dual opsys=usg5-2
486 ;;
487 m68*-dual-uniplus* )
488 machine=dual opsys=unipl5-2
489 ;;
490
491 ## Elxsi 6400
492 elxsi-elxsi-sysv* )
493 machine=elxsi opsys=usg5-2
494 ;;
495
496 ## Encore machines
497 ns16k-encore-bsd* )
498 machine=ns16000 opsys=umax
499 ;;
500
2ce723a5
DL
501 ## The GEC 63 - apparently, this port isn't really finished yet.
502 # I'm sure we finished off the last of the machines, though. -- fx
9ec10b2f
DM
503
504 ## Gould Power Node and NP1
505 pn-gould-bsd4.2* )
506 machine=gould opsys=bsd4-2
507 ;;
508 pn-gould-bsd4.3* )
509 machine=gould opsys=bsd4-3
510 ;;
511 np1-gould-bsd* )
512 machine=gould-np1 opsys=bsd4-3
513 ;;
514
515 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
516 ## as far as Emacs is concerned).
517 m88k-harris-cxux* )
518 # Build needs to be different on 7.0 and later releases
519 case "`uname -r`" in
520 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
521 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
522 esac
3d68df05 523 NON_GNU_CPP="/lib/cpp"
9ec10b2f
DM
524 ;;
525 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
526 m68k-harris-cxux* )
527 machine=nh3000 opsys=cxux
528 ;;
3d68df05
KH
529 ## Harris power pc NightHawk running Power UNIX (Series 6000)
530 powerpc-harris-powerunix )
531 machine=nh6000 opsys=powerunix
532 NON_GNU_CPP="cc -Xo -E -P"
533 ;;
0e5f305e
RS
534 ## SR2001/SR2201 running HI-UX/MPP
535 hppa1.1-hitachi-hiuxmpp* )
536 machine=sr2k opsys=hiuxmpp
537 ;;
2d0bcbcc
EZ
538 hppa1.1-hitachi-hiuxwe2* )
539 machine=sr2k opsys=hiuxwe2
540 ;;
9ec10b2f
DM
541 ## Honeywell XPS100
542 xps*-honeywell-sysv* )
543 machine=xps100 opsys=usg5-2
544 ;;
545
546 ## HP 9000 series 200 or 300
547 m68*-hp-bsd* )
548 machine=hp9000s300 opsys=bsd4-3
549 ;;
42c3a7f7 550 ## HP/UX 7, 8, 9, and 10 are supported on these machines.
9ec10b2f
DM
551 m68*-hp-hpux* )
552 case "`uname -r`" in
553 ## Someone's system reports A.B8.05 for this.
554 ## I wonder what other possibilities there are.
555 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
556 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
557 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
88a806e9 558 *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
9ec10b2f
DM
559 *) machine=hp9000s300 opsys=hpux ;;
560 esac
561 ;;
562
563 ## HP 9000 series 700 and 800, running HP/UX
564 hppa*-hp-hpux7* )
565 machine=hp800 opsys=hpux
566 ;;
567 hppa*-hp-hpux8* )
568 machine=hp800 opsys=hpux8
569 ;;
570 hppa*-hp-hpux9shr* )
571 machine=hp800 opsys=hpux9shr
572 ;;
573 hppa*-hp-hpux9* )
574 machine=hp800 opsys=hpux9
575 ;;
4f4d6b17 576 hppa*-hp-hpux10* )
12760c02 577 machine=hp800 opsys=hpux10
42c3a7f7 578 ;;
4f4d6b17
EZ
579 hppa*-hp-hpux1[1-9]* )
580 machine=hp800 opsys=hpux11
581 ;;
9ec10b2f 582
6fa6525f
RS
583 hppa*-*-linux-gnu* )
584 machine=hp800 opsys=gnu-linux
585 ;;
586
9ec10b2f
DM
587 ## HP 9000 series 700 and 800, running HP/UX
588 hppa*-hp-hpux* )
589 ## Cross-compilation? Nah!
590 case "`uname -r`" in
591 ## Someone's system reports A.B8.05 for this.
592 ## I wonder what other possibilities there are.
593 *.B8.* ) machine=hp800 opsys=hpux8 ;;
594 *.08.* ) machine=hp800 opsys=hpux8 ;;
595 *.09.* ) machine=hp800 opsys=hpux9 ;;
842f8692 596 *) machine=hp800 opsys=hpux10 ;;
9ec10b2f
DM
597 esac
598 ;;
da945421 599 hppa*-*-nextstep* )
4be21f66
KH
600 machine=hp800 opsys=nextstep
601 ;;
9ec10b2f
DM
602
603 ## Orion machines
604 orion-orion-bsd* )
605 machine=orion opsys=bsd4-2
606 ;;
607 clipper-orion-bsd* )
608 machine=orion105 opsys=bsd4-2
609 ;;
610
611 ## IBM machines
5ac83f86 612 i[3456]86-ibm-aix1.1* )
9ec10b2f
DM
613 machine=ibmps2-aix opsys=usg5-2-2
614 ;;
5ac83f86 615 i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
9ec10b2f
DM
616 machine=ibmps2-aix opsys=usg5-3
617 ;;
618 i370-ibm-aix*)
619 machine=ibm370aix opsys=usg5-3
620 ;;
f4c2acb3
EZ
621 s390-*-linux-gnu)
622 machine=ibms390 opsys=gnu-linux
623 ;;
046545ec 624 rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
9ec10b2f
DM
625 machine=ibmrs6000 opsys=aix3-1
626 ;;
046545ec 627 rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
9ec10b2f
DM
628 machine=ibmrs6000 opsys=aix3-2-5
629 ;;
b63df577
RS
630 rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* )
631 machine=ibmrs6000 opsys=aix4-1
632 ;;
a8958813
RS
633 rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
634 machine=ibmrs6000 opsys=aix4-2
635 ;;
1ef1ef96
EZ
636 rs6000-ibm-aix5.1* | powerpc-ibm-aix5.1* )
637 machine=ibmrs6000 opsys=aix4-2
638 ;;
a8958813 639 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
b63df577
RS
640 machine=ibmrs6000 opsys=aix4
641 ;;
a8958813
RS
642 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
643 machine=ibmrs6000 opsys=aix4-1
644 ;;
046545ec 645 rs6000-ibm-aix* | powerpc-ibm-aix* )
9ec10b2f
DM
646 machine=ibmrs6000 opsys=aix3-2
647 ;;
648 romp-ibm-bsd4.3* )
649 machine=ibmrt opsys=bsd4-3
c7f493fd 650 ;;
9ec10b2f
DM
651 romp-ibm-bsd4.2* )
652 machine=ibmrt opsys=bsd4-2
653 ;;
654 romp-ibm-aos4.3* )
655 machine=ibmrt opsys=bsd4-3
c7f493fd 656 ;;
9ec10b2f
DM
657 romp-ibm-aos4.2* )
658 machine=ibmrt opsys=bsd4-2
659 ;;
660 romp-ibm-aos* )
661 machine=ibmrt opsys=bsd4-3
662 ;;
663 romp-ibm-bsd* )
664 machine=ibmrt opsys=bsd4-3
665 ;;
666 romp-ibm-aix* )
667 machine=ibmrt-aix opsys=usg5-2-2
668 ;;
669
670 ## Integrated Solutions `Optimum V'
671 m68*-isi-bsd4.2* )
672 machine=isi-ov opsys=bsd4-2
673 ;;
674 m68*-isi-bsd4.3* )
675 machine=isi-ov opsys=bsd4-3
676 ;;
677
678 ## Intel 386 machines where we do care about the manufacturer
5ac83f86 679 i[3456]86-intsys-sysv* )
9ec10b2f
DM
680 machine=is386 opsys=usg5-2-2
681 ;;
682
683 ## Prime EXL
5ac83f86 684 i[3456]86-prime-sysv* )
9ec10b2f
DM
685 machine=i386 opsys=usg5-3
686 ;;
687
3cd69289 688 ## Sequent Symmetry running Dynix
5ac83f86 689 i[3456]86-sequent-bsd* )
9ec10b2f
DM
690 machine=symmetry opsys=bsd4-3
691 ;;
692
86d6f6ee
RS
693 ## Sequent Symmetry running ptx 4, which is a modified SVR4.
694 i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
695 machine=sequent-ptx opsys=ptx4
0dcdc912 696 NON_GNU_CPP=/lib/cpp
86d6f6ee
RS
697 ;;
698
3cd69289
DM
699 ## Sequent Symmetry running DYNIX/ptx
700 ## Use the old cpp rather than the newer ANSI one.
5ac83f86 701 i[3456]86-sequent-ptx* )
3cd69289
DM
702 machine=sequent-ptx opsys=ptx
703 NON_GNU_CPP="/lib/cpp"
704 ;;
705
cd837fee
KH
706 ## ncr machine running svr4.3.
707 i[3456]86-ncr-sysv4.3 )
708 machine=ncr386 opsys=usg5-4-3
709 ;;
710
9ec10b2f
DM
711 ## Unspecified sysv on an ncr machine defaults to svr4.2.
712 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
5ac83f86 713 i[3456]86-ncr-sysv* )
b0f36760 714 machine=ncr386 opsys=usg5-4-2
9ec10b2f
DM
715 ;;
716
cbce363f
RS
717 ## Intel Paragon OSF/1
718 i860-intel-osf1* )
719 machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
720 ;;
721
9ec10b2f
DM
722 ## Intel 860
723 i860-*-sysv4* )
724 machine=i860 opsys=usg5-4
725 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
726 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
727 ;;
728
3ad6e32b
GM
729 ## Macintosh PowerPC
730 powerpc*-*-linux-gnu* )
731 machine=macppc opsys=gnu-linux
732 ;;
733
9ec10b2f
DM
734 ## Masscomp machines
735 m68*-masscomp-rtu* )
736 machine=masscomp opsys=rtu
737 ;;
738
739 ## Megatest machines
740 m68*-megatest-bsd* )
741 machine=mega68 opsys=bsd4-2
742 ;;
743
744 ## Workstations sold by MIPS
745 ## This is not necessarily all workstations using the MIPS processor -
746 ## Irises are produced by SGI, and DECstations by DEC.
747
748 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
749 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
750 ## it gives for choosing between the alternatives seems to be "Use
751 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
752 ## the BSD world." I'll assume that these are instructions for
753 ## handling two odd situations, and that every other situation
754 ## should use mips.h and usg5-2-2, they being listed first.
755 mips-mips-usg* )
756 machine=mips4
757 ## Fall through to the general code at the bottom to decide on the OS.
758 ;;
759 mips-mips-riscos4* )
760 machine=mips4 opsys=bsd4-3
761 NON_GNU_CC="cc -systype bsd43"
762 NON_GNU_CPP="cc -systype bsd43 -E"
763 ;;
b95c8e7e
RS
764 mips-mips-riscos5* )
765 machine=mips4 opsys=riscos5
766 NON_GNU_CC="cc -systype bsd43"
767 NON_GNU_CPP="cc -systype bsd43 -E"
768 ;;
9ec10b2f
DM
769 mips-mips-bsd* )
770 machine=mips opsys=bsd4-3
771 ;;
772 mips-mips-* )
773 machine=mips opsys=usg5-2-2
774 ;;
775
776 ## NeXT
5ab52d42
RS
777 m68*-next-* | m68k-*-nextstep* )
778 machine=m68k opsys=nextstep
9ec10b2f
DM
779 ;;
780
781 ## The complete machine from National Semiconductor
782 ns32k-ns-genix* )
783 machine=ns32000 opsys=usg5-2
784 ;;
785
786 ## NCR machines
787 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
788 machine=tower32 opsys=usg5-2-2
789 ;;
790 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
791 machine=tower32v3 opsys=usg5-3
792 ;;
793
b4ea3111
KH
794 ## NEC EWS4800
795 mips-nec-sysv4*)
796 machine=ews4800 opsys=ux4800
797 ;;
798
9ec10b2f
DM
799 ## Nixdorf Targon 31
800 m68*-nixdorf-sysv* )
801 machine=targon31 opsys=usg5-2-2
802 ;;
803
804 ## Nu (TI or LMI)
805 m68*-nu-sysv* )
806 machine=nu opsys=usg5-2
807 ;;
808
809 ## Plexus
810 m68*-plexus-sysv* )
811 machine=plexus opsys=usg5-2
812 ;;
813
42326ef0
RS
814 ## PowerPC reference platform
815 powerpcle-*-solaris2* )
816 machine=prep
817 opsys=sol2-5
818 ;;
819
9ec10b2f
DM
820 ## Pyramid machines
821 ## I don't really have any idea what sort of processor the Pyramid has,
822 ## so I'm assuming it is its own architecture.
823 pyramid-pyramid-bsd* )
824 machine=pyramid opsys=bsd4-2
825 ;;
826
827 ## Sequent Balance
828 ns32k-sequent-bsd4.2* )
829 machine=sequent opsys=bsd4-2
830 ;;
831 ns32k-sequent-bsd4.3* )
832 machine=sequent opsys=bsd4-3
833 ;;
834
835 ## Siemens Nixdorf
7cba3845 836 mips-siemens-sysv* | mips-sni-sysv*)
9ec10b2f
DM
837 machine=mips-siemens opsys=usg5-4
838 NON_GNU_CC=/usr/ccs/bin/cc
839 NON_GNU_CPP=/usr/ccs/lib/cpp
840 ;;
841
842 ## Silicon Graphics machines
843 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
844 m68*-sgi-iris3.5* )
845 machine=irist opsys=iris3-5
846 ;;
847 m68*-sgi-iris3.6* | m68*-sgi-iris*)
848 machine=irist opsys=iris3-6
849 ;;
850 ## Iris 4D
851 mips-sgi-irix3* )
852 machine=iris4d opsys=irix3-3
853 ;;
4ab83697
RS
854 mips-sgi-irix4* )
855 machine=iris4d opsys=irix4-0
856 ;;
a187fb80
KH
857 mips-sgi-irix6.5 )
858 machine=iris4d opsys=irix6-5
91193697
DL
859 # Without defining _LANGUAGE_C, things get masked out in the headers
860 # so that, for instance, grepping for `free' in stdlib.h fails and
861 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
862 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
63c59d1e 863 NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
a187fb80 864 ;;
546fa279 865 mips-sgi-irix6* )
309daad2 866 machine=iris4d opsys=irix6-0
d9b5c990 867 # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
91193697
DL
868 # but presumably it does no harm.
869 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
63c59d1e 870 # -32 probably isn't necessary in later v.6s -- anyone know which?
309daad2 871 NON_GCC_TEST_OPTIONS=-32
546fa279 872 ;;
4ab83697 873 mips-sgi-irix5.[01]* )
9ec10b2f
DM
874 machine=iris4d opsys=irix5-0
875 ;;
4ab83697
RS
876 mips-sgi-irix5* | mips-sgi-irix* )
877 machine=iris4d opsys=irix5-2
9ec10b2f
DM
878 ;;
879
880 ## SONY machines
881 m68*-sony-bsd4.2* )
882 machine=news opsys=bsd4-2
883 ;;
884 m68*-sony-bsd4.3* )
885 machine=news opsys=bsd4-3
886 ;;
3d102c59 887 m68*-sony-newsos3* | m68*-sony-news3*)
9ec10b2f
DM
888 machine=news opsys=bsd4-3
889 ;;
3d102c59 890 mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
9ec10b2f
DM
891 machine=news-risc opsys=bsd4-3
892 ;;
423ef6e8 893 mips-sony-newsos6* )
b48e4aeb 894 machine=news-r6 opsys=newsos6
423ef6e8 895 ;;
3d102c59 896 mips-sony-news* )
9ec10b2f
DM
897 machine=news-risc opsys=newsos5
898 ;;
899
900 ## Stride
901 m68*-stride-sysv* )
902 machine=stride opsys=usg5-2
903 ;;
904
905 ## Suns
b5b193a7 906 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
5ac83f86 907 machine=sparc opsys=gnu-linux
28d9bc0e
KH
908 ;;
909
f4027958 910 *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
5ac83f86 911 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
c42b1767 912 | rs6000-*-solaris2*)
9ec10b2f
DM
913 case "${canonical}" in
914 m68*-sunos1* ) machine=sun1 ;;
915 m68*-sunos2* ) machine=sun2 ;;
916 m68* ) machine=sun3 ;;
5ac83f86
RS
917 i[3456]86-sun-sunos[34]* ) machine=sun386 ;;
918 i[3456]86-*-* ) machine=intel386 ;;
42326ef0 919 powerpcle* ) machine=powerpcle ;;
f7894e88 920 powerpc* | rs6000* ) machine=ibmrs6000 ;;
9ec10b2f
DM
921 sparc* ) machine=sparc ;;
922 * ) unported=yes ;;
923 esac
924 case "${canonical}" in
925 ## The Sun386 didn't get past 4.0.
5ac83f86 926 i[3456]86-*-sunos4 ) opsys=sunos4-0 ;;
9ec10b2f 927 *-sunos4.0* ) opsys=sunos4-0 ;;
0ff0179d 928 *-sunos4.1.[3-9]*noshare )
aac2257c
RS
929 ## This name is sunos413 instead of sunos4-1-3
930 ## to avoid a file name conflict on MSDOS.
931 opsys=sunos413
3d68df05
KH
932 NON_GNU_CPP=/usr/lib/cpp
933 NON_GCC_TEST_OPTIONS=-Bstatic
934 GCC_TEST_OPTIONS=-static
935 ;;
3e23af40
RS
936 *-sunos4.1.[3-9]* | *-sunos4shr*)
937 opsys=sunos4shr
938 NON_GNU_CPP=/usr/lib/cpp
939 ;;
3d68df05
KH
940 *-sunos4* | *-sunos )
941 opsys=sunos4-1
9ec10b2f
DM
942 NON_GCC_TEST_OPTIONS=-Bstatic
943 GCC_TEST_OPTIONS=-static
944 ;;
945 *-sunos5.3* | *-solaris2.3* )
946 opsys=sol2-3
947 NON_GNU_CPP=/usr/ccs/lib/cpp
948 ;;
949 *-sunos5.4* | *-solaris2.4* )
950 opsys=sol2-4
951 NON_GNU_CPP=/usr/ccs/lib/cpp
30457b4f 952 RANLIB="ar -ts"
9ec10b2f 953 ;;
2e567bad
KH
954 *-sunos5.5* | *-solaris2.5* )
955 opsys=sol2-5
956 NON_GNU_CPP=/usr/ccs/lib/cpp
30457b4f 957 RANLIB="ar -ts"
2e567bad 958 ;;
9ec10b2f 959 *-sunos5* | *-solaris* )
348e3a08 960 opsys=sol2-5
9ec10b2f
DM
961 NON_GNU_CPP=/usr/ccs/lib/cpp
962 ;;
963 * ) opsys=bsd4-2 ;;
964 esac
6e502e37
RS
965 ## Watch out for a compiler that we know will not work.
966 case "${canonical}" in
967 *-solaris* | *-sunos5* )
968 if [ "x$CC" = x/usr/ucb/cc ]; then
969 ## /usr/ucb/cc doesn't work;
970 ## we should find some other compiler that does work.
971 unset CC
972 fi
973 ;;
974 *) ;;
975 esac
9ec10b2f 976 ;;
5ab52d42 977 sparc-*-nextstep* )
19e45036 978 machine=sparc opsys=nextstep
5ab52d42 979 ;;
9ec10b2f
DM
980
981 ## Tadpole 68k
982 m68*-tadpole-sysv* )
983 machine=tad68k opsys=usg5-3
984 ;;
985
986 ## Tahoe machines
987 tahoe-tahoe-bsd4.2* )
988 machine=tahoe opsys=bsd4-2
989 ;;
990 tahoe-tahoe-bsd4.3* )
991 machine=tahoe opsys=bsd4-3
992 ;;
993
994 ## Tandem Integrity S2
995 mips-tandem-sysv* )
996 machine=tandem-s2 opsys=usg5-3
997 ;;
998
999 ## Tektronix XD88
1000 m88k-tektronix-sysv3* )
1001 machine=tekxd88 opsys=usg5-3
1002 ;;
1003
1004 ## Tektronix 16000 box (6130?)
1005 ns16k-tektronix-bsd* )
1006 machine=ns16000 opsys=bsd4-2
1007 ;;
1008 ## Tektronix 4300
1009 ## src/m/tek4300.h hints that this is a m68k machine.
1010 m68*-tektronix-bsd* )
1011 machine=tek4300 opsys=bsd4-3
1012 ;;
1013
1014 ## Titan P2 or P3
1015 ## We seem to have lost the machine-description file titan.h!
1016 titan-titan-sysv* )
1017 machine=titan opsys=usg5-3
1018 ;;
c7f493fd 1019
9ec10b2f
DM
1020 ## Ustation E30 (SS5E)
1021 m68*-unisys-uniplus* )
1022 machine=ustation opsystem=unipl5-2
1023 ;;
1024
1025 ## Vaxen.
1026 vax-dec-* )
1027 machine=vax
1028 case "${canonical}" in
1029 *-bsd4.1* ) opsys=bsd4-1 ;;
1030 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
1031 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
9ec10b2f
DM
1032 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
1033 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
1034 *-vms* ) opsys=vms ;;
1035 * ) unported=yes
1036 esac
1037 ;;
1038
1039 ## Whitechapel MG1
1040 ns16k-whitechapel-* )
1041 machine=mg1
1042 ## We don't know what sort of OS runs on these; we'll let the
1043 ## operating system guessing code below try.
1044 ;;
1045
1046 ## Wicat
1047 m68*-wicat-sysv* )
1048 machine=wicat opsys=usg5-2
1049 ;;
1050
2d23c8cc
GM
1051 ## IA-64
1052 ia64*-*-linux* )
1053 machine=ia64 opsys=gnu-linux
1054 ;;
1055
9ec10b2f 1056 ## Intel 386 machines where we don't care about the manufacturer
5ac83f86 1057 i[3456]86-*-* )
9ec10b2f
DM
1058 machine=intel386
1059 case "${canonical}" in
9f25f6fb 1060 *-lynxos* ) opsys=lynxos ;;
9ec10b2f
DM
1061 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1062 *-isc2.2* ) opsys=isc2-2 ;;
1063 *-isc4.0* ) opsys=isc4-0 ;;
135c9ca6
RS
1064 *-isc4.* ) opsys=isc4-1
1065 GCC_TEST_OPTIONS=-posix
1066 NON_GCC_TEST_OPTIONS=-Xp
1067 ;;
9ec10b2f
DM
1068 *-isc* ) opsys=isc3-0 ;;
1069 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1070 *-esix* ) opsys=esix ;;
1071 *-xenix* ) opsys=xenix ;;
5ac83f86 1072 *-linux-gnu* ) opsys=gnu-linux ;;
9ec10b2f 1073 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
5ac83f86
RS
1074 *-sco3.2v5* ) opsys=sco5
1075 NON_GNU_CPP=/lib/cpp
1076 # Prevent -belf from being passed to $CPP.
1077 # /lib/cpp does not accept it.
1e60bcf8 1078 OVERRIDE_CPPFLAGS=" "
5ac83f86 1079 ;;
0e6d70d5 1080 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
9ec10b2f 1081 *-386bsd* ) opsys=386bsd ;;
5ab52d42 1082 *-nextstep* ) opsys=nextstep ;;
9ec10b2f
DM
1083 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1084 esac
1085 ;;
1086
287f502c 1087 ## m68k Linux-based GNU system
5ac83f86
RS
1088 m68k-*-linux-gnu* )
1089 machine=m68k opsys=gnu-linux
e1fd57e3
RS
1090 ;;
1091
287f502c
RS
1092 ## Mips Linux-based GNU system
1093 mips-*-linux-gnu* )
1094 machine=mips opsys=gnu-linux
1095 ;;
1096
eded5b68
RS
1097 ## UXP/DS
1098 sparc-fujitsu-sysv4* )
1099 machine=sparc opsys=uxpds
1100 NON_GNU_CPP=/usr/ccs/lib/cpp
1101 RANLIB="ar -ts"
1102 ;;
1103
5dbb45f2
KH
1104 ## UXP/V
1105 f301-fujitsu-uxpv4.1)
1106 machine=f301 opsys=uxpv
1107 ;;
1108
e0f712ba
AC
1109 ## Darwin / Mac OS X
1110 powerpc-apple-darwin* )
1111 machine=powermac opsys=darwin
1112 # Define CPP as follows to make autoconf work correctly.
1113 CPP="cc -E -traditional-cpp"
1114 ;;
1115
9ec10b2f
DM
1116 * )
1117 unported=yes
1118 ;;
1119esac
1120
1121### If the code above didn't choose an operating system, just choose
1122### an operating system based on the configuration name. You really
1123### only want to use this when you have no idea what the right
1124### operating system is; if you know what operating systems a machine
1125### runs, it's cleaner to make it explicit in the case statement
1126### above.
1127if test x"${opsys}" = x; then
1128 case "${canonical}" in
1129 *-gnu* ) opsys=gnu ;;
1130 *-bsd4.[01] ) opsys=bsd4-1 ;;
1131 *-bsd4.2 ) opsys=bsd4-2 ;;
1132 *-bsd4.3 ) opsys=bsd4-3 ;;
1133 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1134 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1135 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
5ab52d42 1136 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
66a96cff 1137 *-sysv4.2uw* ) opsys=unixware ;;
5ab52d42 1138 *-sysv4.1* | *-sysvr4.1* )
9ec10b2f
DM
1139 NON_GNU_CPP=/usr/lib/cpp
1140 opsys=usg5-4 ;;
5ab52d42 1141 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
b63df577 1142 if [ x$NON_GNU_CPP = x ]; then
16831d8c
RS
1143 if [ -f /usr/ccs/lib/cpp ]; then
1144 NON_GNU_CPP=/usr/ccs/lib/cpp
1145 else
1146 NON_GNU_CPP=/lib/cpp
1147 fi
b63df577
RS
1148 fi
1149 opsys=usg5-4-2 ;;
5ab52d42 1150 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
9ec10b2f
DM
1151 * )
1152 unported=yes
1153 ;;
1154 esac
1155fi
1156
1157changequote([, ])dnl
1158
1159if test $unported = yes; then
1160 AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
1161Check \`etc/MACHINES' for recognized configuration names.])
1162fi
1163
1164machfile="m/${machine}.h"
1165opsysfile="s/${opsys}.h"
1166
1167
1168#### Choose a compiler.
1169test -n "$CC" && cc_specified=yes
1170
5ab52d42
RS
1171# Save the value of CFLAGS that the user specified.
1172SPECIFIED_CFLAGS="$CFLAGS"
1173
9ec10b2f
DM
1174case ${with_gcc} in
1175 "yes" ) CC="gcc" GCC=yes ;;
6e0dc84a 1176 "no" ) : ${CC=cc} ;;
e9b2a022 1177 * )
9ec10b2f 1178esac
e9b2a022 1179AC_PROG_CC
9ec10b2f
DM
1180
1181# On Suns, sometimes $CPP names a directory.
1182if test -n "$CPP" && test -d "$CPP"; then
1183 CPP=
1184fi
1185
1186#### Some systems specify a CPP to use unless we are using GCC.
1187#### Now that we know whether we are using GCC, we can decide whether
1188#### to use that one.
1189if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1190then
1191 CPP="$NON_GNU_CPP"
1192fi
1193
1194#### Some systems specify a CC to use unless we are using GCC.
1195#### Now that we know whether we are using GCC, we can decide whether
1196#### to use that one.
1197if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1198 test x$cc_specified != xyes
1199then
1200 CC="$NON_GNU_CC"
1201fi
1202
1203if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1204then
1205 CC="$CC $GCC_TEST_OPTIONS"
c7f493fd 1206fi
9ec10b2f
DM
1207
1208if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1209then
1210 CC="$CC $NON_GCC_TEST_OPTIONS"
c7f493fd 1211fi
9ec10b2f 1212
1bc5a004
RS
1213if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1214then
1215 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1216fi
1217
1218if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1219then
1220 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1221fi
1222
9ec10b2f
DM
1223#### Some other nice autoconf tests. If you add a test here which
1224#### should make an entry in src/config.h, don't forget to add an
1225#### #undef clause to src/config.h.in for autoconf to modify.
1226
1227dnl checks for programs
6e0dc84a 1228AC_PROG_LN_S
9ec10b2f
DM
1229AC_PROG_CPP
1230AC_PROG_INSTALL
1231AC_PROG_YACC
3f5b097c
DL
1232if test "x$RANLIB" = x; then
1233 AC_PROG_RANLIB
1234fi
9ec10b2f 1235
3cd69289
DM
1236dnl checks for Unix variants
1237AC_AIX
1238
4428e268
DL
1239#### Extract some information from the operating system and machine files.
1240
1241AC_CHECKING([the machine- and system-dependent files to find out
1242 - which libraries the lib-src programs will want, and
1243 - whether the GNU malloc routines are usable])
1244
1245### First figure out CFLAGS (which we use for running the compiler here)
1246### and REAL_CFLAGS (which we use for real compilation).
1247### The two are the same except on a few systems, where they are made
1248### different to work around various lossages. For example,
1249### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
1250### as implying static linking.
1251
1252### If the CFLAGS env var is specified, we use that value
1253### instead of the default.
1254
1255### It's not important that this name contain the PID; you can't run
1256### two configures in the same directory and have anything work
1257### anyway.
1258tempcname="conftest.c"
1259
1260echo '
1261#include "'${srcdir}'/src/'${opsysfile}'"
1262#include "'${srcdir}'/src/'${machfile}'"
1263#ifndef LIBS_MACHINE
1264#define LIBS_MACHINE
1265#endif
1266#ifndef LIBS_SYSTEM
1267#define LIBS_SYSTEM
1268#endif
1269#ifndef C_SWITCH_SYSTEM
1270#define C_SWITCH_SYSTEM
1271#endif
1272#ifndef C_SWITCH_MACHINE
1273#define C_SWITCH_MACHINE
1274#endif
1275configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1276configure___ c_switch_system=C_SWITCH_SYSTEM
1277configure___ c_switch_machine=C_SWITCH_MACHINE
1278
1279#ifndef LIB_X11_LIB
1280#define LIB_X11_LIB -lX11
1281#endif
1282
1283#ifndef LIBX11_MACHINE
1284#define LIBX11_MACHINE
1285#endif
1286
1287#ifndef LIBX11_SYSTEM
1288#define LIBX11_SYSTEM
1289#endif
1290configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1291
1292#ifdef UNEXEC
1293configure___ unexec=UNEXEC
1294#else
1295configure___ unexec=unexec.o
1296#endif
1297
1298#ifdef SYSTEM_MALLOC
1299configure___ system_malloc=yes
1300#else
1301configure___ system_malloc=no
1302#endif
1303
e32fac2a
GM
1304#ifdef USE_MMAP_FOR_BUFFERS
1305configure___ use_mmap_for_buffers=yes
b1b4ce06 1306#else
e32fac2a 1307configure___ use_mmap_for_buffers=no
b1b4ce06
GM
1308#endif
1309
4428e268
DL
1310#ifndef C_DEBUG_SWITCH
1311#define C_DEBUG_SWITCH -g
1312#endif
1313
1314#ifndef C_OPTIMIZE_SWITCH
1315#ifdef __GNUC__
1316#define C_OPTIMIZE_SWITCH -O2
1317#else
1318#define C_OPTIMIZE_SWITCH -O
1319#endif
1320#endif
1321
1322#ifndef LD_SWITCH_MACHINE
1323#define LD_SWITCH_MACHINE
1324#endif
1325
1326#ifndef LD_SWITCH_SYSTEM
1327#define LD_SWITCH_SYSTEM
1328#endif
1329
1330#ifndef LD_SWITCH_X_SITE_AUX
1331#define LD_SWITCH_X_SITE_AUX
1332#endif
1333
1334configure___ ld_switch_system=LD_SWITCH_SYSTEM
1335configure___ ld_switch_machine=LD_SWITCH_MACHINE
1336
1337#ifdef THIS_IS_CONFIGURE
1338
1339/* Get the CFLAGS for tests in configure. */
1340#ifdef __GNUC__
1341configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1342#else
1343configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1344#endif
1345
1346#else /* not THIS_IS_CONFIGURE */
1347
1348/* Get the CFLAGS for real compilation. */
1349#ifdef __GNUC__
1350configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1351#else
1352configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1353#endif
1354
1355#endif /* not THIS_IS_CONFIGURE */
1356' > ${tempcname}
1357
1358# The value of CPP is a quoted variable reference, so we need to do this
1359# to get its actual value...
1360CPP=`eval "echo $CPP"`
1361changequote(, )dnl
1362eval `${CPP} -Isrc ${tempcname} \
1363 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1364if test "x$SPECIFIED_CFLAGS" = x; then
1365 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1366 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1367else
1368 REAL_CFLAGS="$CFLAGS"
1369fi
1370changequote([, ])dnl
1371rm ${tempcname}
1372
1373ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1374
1375### Make sure subsequent tests use flags consistent with the build flags.
1376
1377if test x"${OVERRIDE_CPPFLAGS}" != x; then
1378 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1379else
1380 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1381fi
1382
48989ead
DL
1383dnl Do this early because it can frob feature test macros for Unix-98 &c.
1384AC_SYS_LARGEFILE
1385
3d9830e5
PJ
1386if test "${with_sound}" != "no"; then
1387 # Sound support for GNU/Linux and the free BSDs.
1388 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1389 # Emulation library used on NetBSD.
1390 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1391 AC_SUBST(LIBSOUND)
1392fi
b412189c 1393
9ec10b2f 1394dnl checks for header files
1113b624
PE
1395AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1396 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
149c0cdc 1397 termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h)
6e0dc84a
DM
1398AC_HEADER_STDC
1399AC_HEADER_TIME
1400AC_DECL_SYS_SIGLIST
2ce723a5 1401AC_HEADER_SYS_WAIT
9ec10b2f 1402
3cd69289 1403dnl Some systems have utime.h but don't declare the struct anyplace.
fd0a060b 1404AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
3cd69289
DM
1405AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1406#include <sys/time.h>
1407#include <time.h>
1408#else
1409#ifdef HAVE_SYS_TIME_H
1410#include <sys/time.h>
1411#else
1412#include <time.h>
1413#endif
1414#endif
1415#ifdef HAVE_UTIME_H
1416#include <utime.h>
1417#endif], [static struct utimbuf x; x.actime = x.modtime;],
fd0a060b
AS
1418 emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1419if test $emacs_cv_struct_utimbuf = yes; then
5e7d772d 1420 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
fd0a060b 1421fi
3cd69289 1422
9ec10b2f 1423dnl checks for typedefs
6e0dc84a 1424AC_TYPE_SIGNAL
9ec10b2f 1425
25abcaf1
GM
1426dnl Check for speed_t typedef.
1427AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1428AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
e9b2a022 1429 emacs_cv_speed_t=yes, emacs_cv_speed_t=no))
25abcaf1 1430if test $emacs_cv_speed_t = yes; then
5e7d772d 1431 AC_DEFINE(HAVE_SPEED_T, 1, [Define to 1 if `speed_t' is declared by <termios.h>.])
25abcaf1
GM
1432fi
1433
fd0a060b 1434AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
3cd69289
DM
1435AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1436#include <sys/time.h>
1437#include <time.h>
1438#else
1439#ifdef HAVE_SYS_TIME_H
1440#include <sys/time.h>
1441#else
1442#include <time.h>
1443#endif
1444#endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
fd0a060b
AS
1445 emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1446HAVE_TIMEVAL=$emacs_cv_struct_timeval
1447if test $emacs_cv_struct_timeval = yes; then
5e7d772d 1448 AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by <sys/time.h>.])
fd0a060b 1449fi
3cd69289 1450
63c59d1e
DL
1451AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1452AC_TRY_COMPILE([#include <math.h>],
1453[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1454 emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1455HAVE_EXCEPTION=$emacs_cv_struct_exception
1456if test $emacs_cv_struct_exception != yes; then
5e7d772d 1457 AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
63c59d1e
DL
1458fi
1459
9ec10b2f
DM
1460dnl checks for structure members
1461AC_STRUCT_TM
6e0dc84a 1462AC_STRUCT_TIMEZONE
5e7d772d
AS
1463AC_CHECK_MEMBER(struct tm.tm_gmtoff,
1464 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
1465 [Define to 1 if `tm_gmtoff' is member of `struct tm'.])],,
1466 [#include <time.h>])
9ec10b2f
DM
1467
1468dnl checks for compiler characteristics
3f5b097c
DL
1469
1470dnl Testing __STDC__ to determine prototype support isn't good enough.
1471dnl DEC C, for instance, doesn't define it with default options, and
1472dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile
1473dnl and void *.
1474AC_C_PROTOTYPES
1475AC_C_VOLATILE
6e0dc84a 1476AC_C_CONST
3f5b097c
DL
1477dnl This isn't useful because we can't turn on use of `inline' unless
1478dnl the compiler groks `extern inline'.
1479dnl AC_C_INLINE
1480AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1481 [AC_TRY_COMPILE(, [void * foo;],
1482 emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1483if test $emacs_cv_void_star = yes; then
1484 AC_DEFINE(POINTER_TYPE, void)
1485else
1486 AC_DEFINE(POINTER_TYPE, char)
1487fi
5e7d772d
AS
1488AH_TEMPLATE(POINTER_TYPE,
1489 [Define as `void' if your compiler accepts `void *'; otherwise
1490 define as `char'.])dnl
9ec10b2f
DM
1491
1492dnl check for Make feature
6e0dc84a 1493AC_PROG_MAKE_SET
9ec10b2f
DM
1494
1495dnl checks for operating system services
6e0dc84a 1496AC_SYS_LONG_FILE_NAMES
9ec10b2f 1497
93c05c18
CW
1498if test "$gamedir" = no; then :
1499else
1500 AC_MSG_CHECKING([for access to game group "$gameuser"])
1501 rm -f conf$$chown.file
1502 touch conf$$chown.file
1503 dnl If we can't chown a file to group games, then the users
1504 dnl can't share scores.
1505 if chown "$gameuser" conf$$chown.file 1>/dev/null 2>&1; then
1506 AC_MSG_RESULT([yes])
1507 if test "$gamedir" = "yes"; then
1508 gamedir="${localstatedir}/games/emacs"
1509 fi
5e7d772d
AS
1510 eval tgamedir=\"$gamedir\"
1511 AC_DEFINE_UNQUOTED(HAVE_SHARED_GAME_DIR, "$tgamedir",
1512 [Define to the name of the shared game directory.])
93c05c18
CW
1513 else
1514 AC_MSG_RESULT([no])
1515 gamedir=no
1516 fi
1517fi
9ec10b2f 1518#### Choose a window system.
9ec10b2f 1519
6e0dc84a 1520AC_PATH_X
530ce502
DM
1521if test "$no_x" = yes; then
1522 window_system=none
1523else
1524 window_system=x11
1525fi
9ec10b2f 1526
ea199426 1527if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
00ac3ffc
KH
1528 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1529 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
66d736a9
RS
1530 x_default_search_path=""
1531 for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
c8d4d4cc
KH
1532 x_search_path="\
1533${x_library}/X11/%L/%T/%N%C%S:\
1534${x_library}/X11/%l/%T/%N%C%S:\
1535${x_library}/X11/%T/%N%C%S:\
1536${x_library}/X11/%L/%T/%N%S:\
1537${x_library}/X11/%l/%T/%N%S:\
1538${x_library}/X11/%T/%N%S"
66d736a9
RS
1539 if test x"${x_default_search_path}" = x; then
1540 x_default_search_path=${x_search_path}
1541 else
1542 x_default_search_path="${x_search_path}:${x_default_search_path}"
1543 fi
1544 done
ea199426
DM
1545fi
1546if test "${x_includes}" != NONE && test -n "${x_includes}"; then
cc6476f6 1547 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
ea199426 1548fi
9ec10b2f 1549
8dbeb353
DM
1550if test x"${x_includes}" = x; then
1551 bitmapdir=/usr/include/X11/bitmaps
3cd69289 1552else
908ff139 1553 # accumulate include directories that have X11 bitmap subdirectories
cc6476f6
KH
1554 bmd_acc="dummyval"
1555 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1556 if test -d "${bmd}/X11/bitmaps"; then
1557 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
4f6f5dab
GM
1558 fi
1559 if test -d "${bmd}/bitmaps"; then
cc6476f6
KH
1560 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1561 fi
1562 done
1563 if test ${bmd_acc} != "dummyval"; then
1564 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1565 fi
3cd69289
DM
1566fi
1567
9ec10b2f
DM
1568case "${window_system}" in
1569 x11 )
1570 HAVE_X_WINDOWS=yes
1571 HAVE_X11=yes
1572 case "${with_x_toolkit}" in
c7f493fd
RM
1573 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1574 motif ) USE_X_TOOLKIT=MOTIF ;;
1575dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
4be21f66
KH
1576 no ) USE_X_TOOLKIT=none ;;
1577dnl If user did not say whether to use a toolkit,
1578dnl make this decision later: use the toolkit if we have X11R5 or newer.
1579 * ) USE_X_TOOLKIT=maybe ;;
9ec10b2f
DM
1580 esac
1581 ;;
9ec10b2f
DM
1582 none )
1583 HAVE_X_WINDOWS=no
1584 HAVE_X11=no
1585 USE_X_TOOLKIT=none
1586 ;;
1587esac
9ec10b2f
DM
1588
1589### If we're using X11, we should use the X menu package.
08741ba9 1590HAVE_MENUS=no
9ec10b2f 1591case ${HAVE_X11} in
08741ba9 1592 yes ) HAVE_MENUS=yes ;;
9ec10b2f 1593esac
b412189c 1594
b95c8e7e
RS
1595if test "${opsys}" = "hpux9"; then
1596 case "${x_libraries}" in
1597 *X11R4* )
1598 opsysfile="s/hpux9-x11r4.h"
1599 ;;
1600 esac
1601fi
1602
1603if test "${opsys}" = "hpux9shr"; then
1604 case "${x_libraries}" in
1605 *X11R4* )
1606 opsysfile="s/hpux9shxr4.h"
1607 ;;
1608 esac
1609fi
1610
9ec10b2f
DM
1611### Compute the unexec source name from the object name.
1612UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1613
1614# Do the opsystem or machine files prohibit the use of the GNU malloc?
1615# Assume not, until told otherwise.
1616GNU_MALLOC=yes
b05a95cb
RS
1617doug_lea_malloc=yes
1618AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1619AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
fd0a060b
AS
1620AC_CACHE_CHECK(whether __after_morecore_hook exists,
1621 emacs_cv_var___after_morecore_hook,
e9b2a022 1622[AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
fd0a060b 1623 emacs_cv_var___after_morecore_hook=yes,
e9b2a022 1624 emacs_cv_var___after_morecore_hook=no)])
fd0a060b
AS
1625if test $emacs_cv_var___after_morecore_hook = no; then
1626 doug_lea_malloc=no
1627fi
8cd88038 1628if test "${system_malloc}" = "yes"; then
9ec10b2f
DM
1629 GNU_MALLOC=no
1630 GNU_MALLOC_reason="
b05a95cb 1631 (The GNU allocators don't work with this system configuration.)"
9ec10b2f 1632fi
8cd88038
RS
1633if test "$doug_lea_malloc" = "yes" ; then
1634 if test "$GNU_MALLOC" = yes ; then
1635 GNU_MALLOC_reason="
0855015c 1636 (Using Doug Lea's new malloc from the GNU C Library.)"
8cd88038 1637 fi
5e7d772d
AS
1638 AC_DEFINE(DOUG_LEA_MALLOC, 1,
1639 [Define to 1 if you are using the GNU C Library.])
8cd88038 1640fi
9ec10b2f
DM
1641
1642if test x"${REL_ALLOC}" = x; then
1643 REL_ALLOC=${GNU_MALLOC}
1644fi
1645
e32fac2a 1646dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
69c40632 1647dnl the system configuration file (s/*.h) to turn the use of mmap
53c94d4d 1648dnl in the relocating allocator on.
b1b4ce06
GM
1649
1650AC_FUNC_MMAP
e32fac2a
GM
1651if test $use_mmap_for_buffers = yes; then
1652 REL_ALLOC=no
b1b4ce06
GM
1653fi
1654
52c76122 1655LIBS="$libsrc_libs $LIBS"
9ec10b2f
DM
1656
1657dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1658dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1659AC_CHECK_LIB(dnet, dnet_ntoa)
1660dnl This causes -lresolv to get used in subsequent tests,
1661dnl which causes failures on some systems such as HPUX 9.
1662dnl AC_CHECK_LIB(resolv, gethostbyname)
1663
1664dnl FIXME replace main with a function we actually want from this library.
1665AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1666
027dae63 1667AC_CHECK_LIB(pthreads, cma_open)
1d94ee28 1668
5d4245a6 1669AC_MSG_CHECKING(for XFree86 in /usr/X386)
9ec10b2f 1670if test -d /usr/X386/include; then
9ec10b2f 1671 HAVE_XFREE386=yes
6e0dc84a 1672 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
9ec10b2f 1673else
6e0dc84a 1674 HAVE_XFREE386=no
9ec10b2f 1675fi
6e0dc84a 1676AC_MSG_RESULT($HAVE_XFREE386)
9ec10b2f 1677
509fccc3
RS
1678# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1679# for the tests that follow. We set it back to REAL_CFLAGS later on.
9ec10b2f 1680
5a9bf171
KR
1681REAL_CPPFLAGS="$CPPFLAGS"
1682
9ec10b2f
DM
1683if test "${HAVE_X11}" = "yes"; then
1684 DEFS="$C_SWITCH_X_SITE $DEFS"
96c20358
RS
1685 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1686 LIBS="$LIBX $LIBS"
9ec10b2f 1687 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
5a9bf171 1688 CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
509fccc3 1689
617a496c
RS
1690 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1691 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1692 # but it's more convenient here to set LD_RUN_PATH
1693 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1694 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1695 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1696 export LD_RUN_PATH
1697 fi
1698
5ac83f86 1699 if test "${opsys}" = "gnu-linux"; then
3bbe016c 1700 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
509fccc3
RS
1701 AC_TRY_LINK([],
1702 [XOpenDisplay ("foo");],
3bbe016c
KH
1703 [xlinux_first_failure=no],
1704 [xlinux_first_failure=yes])
1705 if test "${xlinux_first_failure}" = "yes"; then
509fccc3
RS
1706 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1707 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1708 OLD_CPPFLAGS="$CPPFLAGS"
1709 OLD_LIBS="$LIBS"
1710 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1711 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1712 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1713 LIBS="$LIBS -b i486-linuxaout"
1714 AC_TRY_LINK([],
1715 [XOpenDisplay ("foo");],
3bbe016c
KH
1716 [xlinux_second_failure=no],
1717 [xlinux_second_failure=yes])
1718 if test "${xlinux_second_failure}" = "yes"; then
509fccc3
RS
1719 # If we get the same failure with -b, there is no use adding -b.
1720 # So take it out. This plays safe.
1721 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1722 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1723 CPPFLAGS="$OLD_CPPFLAGS"
1724 LIBS="$OLD_LIBS"
1725 AC_MSG_RESULT(no)
1726 else
1727 AC_MSG_RESULT(yes)
1728 fi
1729 else
1730 AC_MSG_RESULT(no)
1731 fi
1732 fi
1733
9ca4be21
GM
1734 # Reportedly, some broken Solaris systems have XKBlib.h but are missing
1735 # header files included from there.
1736 AC_MSG_CHECKING(for Xkb)
1737 AC_TRY_LINK([#include <X11/Xlib.h>
1738#include <X11/XKBlib.h>],
1739 [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
1740 emacs_xkb=yes, emacs_xkb=no)
ad4ac636 1741 AC_MSG_RESULT($emacs_xkb)
9ca4be21 1742 if test $emacs_xkb = yes; then
5e7d772d 1743 AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
9ca4be21
GM
1744 fi
1745
6e0dc84a 1746 AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
9ca4be21 1747XScreenNumberOfScreen XSetWMProtocols)
9ec10b2f
DM
1748fi
1749
08741ba9 1750if test "${window_system}" = "x11"; then
4be21f66 1751 AC_MSG_CHECKING(X11 version 6)
fd0a060b 1752 AC_CACHE_VAL(emacs_cv_x11_version_6,
e9b2a022 1753 [AC_TRY_LINK([#include <X11/Xlib.h>],
08741ba9
RS
1754[#if XlibSpecificationRelease < 6
1755fail;
1756#endif
e9b2a022 1757], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
fd0a060b
AS
1758 if test $emacs_cv_x11_version_6 = yes; then
1759 AC_MSG_RESULT(6 or newer)
5e7d772d
AS
1760 AC_DEFINE(HAVE_X11R6, 1,
1761 [Define to 1 if you have the X11R6 or newer version of Xlib.])
fd0a060b
AS
1762 else
1763 AC_MSG_RESULT(before 6)
1764 fi
08741ba9
RS
1765fi
1766
f7894e88 1767if test "${window_system}" = "x11"; then
4be21f66 1768 AC_MSG_CHECKING(X11 version 5)
fd0a060b 1769 AC_CACHE_VAL(emacs_cv_x11_version_5,
e9b2a022 1770 [AC_TRY_LINK([#include <X11/Xlib.h>],
4be21f66
KH
1771[#if XlibSpecificationRelease < 5
1772fail;
1773#endif
e9b2a022 1774], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no)])
fd0a060b
AS
1775 if test $emacs_cv_x11_version_5 = yes; then
1776 AC_MSG_RESULT(5 or newer)
f7894e88 1777 HAVE_X11R5=yes
5e7d772d
AS
1778 AC_DEFINE(HAVE_X11R5, 1,
1779 [Define to 1 if you have the X11R5 or newer version of Xlib.])
fd0a060b 1780 else
f7894e88 1781 HAVE_X11R5=no
fd0a060b
AS
1782 AC_MSG_RESULT(before 5)
1783 fi
f7894e88
RS
1784fi
1785
bce97856
RS
1786dnl Do not put whitespace before the #include statements below.
1787dnl Older compilers (eg sunos4 cc) choke on it.
f7894e88
RS
1788if test x"${USE_X_TOOLKIT}" = xmaybe; then
1789 if test x"${HAVE_X11R5}" = xyes; then
1790 AC_MSG_CHECKING(X11 version 5 with Xaw)
fd0a060b 1791 AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
e9b2a022 1792 [AC_TRY_LINK([
bce97856
RS
1793#include <X11/Intrinsic.h>
1794#include <X11/Xaw/Simple.h>],
f7894e88 1795 [],
fd0a060b 1796 emacs_cv_x11_version_5_with_xaw=yes,
e9b2a022 1797 emacs_cv_x11_version_5_with_xaw=no)])
fd0a060b
AS
1798 if test $emacs_cv_x11_version_5_with_xaw = yes; then
1799 AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
1800 USE_X_TOOLKIT=LUCID
1801 else
1802 AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
1803 USE_X_TOOLKIT=none
1804 fi
f7894e88
RS
1805 else
1806 USE_X_TOOLKIT=none
1807 fi
4be21f66
KH
1808fi
1809
1810X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1811
9ec10b2f
DM
1812if test "${USE_X_TOOLKIT}" != "none"; then
1813 AC_MSG_CHECKING(X11 toolkit version)
fd0a060b 1814 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
e9b2a022 1815 [AC_TRY_LINK([#include <X11/Intrinsic.h>],
9ec10b2f
DM
1816[#if XtSpecificationRelease < 6
1817fail;
1818#endif
e9b2a022 1819], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
fd0a060b
AS
1820 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1821 if test $emacs_cv_x11_toolkit_version_6 = yes; then
1822 AC_MSG_RESULT(6 or newer)
5e7d772d
AS
1823 AC_DEFINE(HAVE_X11XTR6, 1,
1824 [Define to 1 if you have the X11R6 or newer version of Xt.])
fd0a060b
AS
1825 else
1826 AC_MSG_RESULT(before 6)
1827 fi
6aad10e4
RS
1828
1829dnl If using toolkit, check whether libXmu.a exists.
1830dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
1831 OLDLIBS="$LIBS"
fcc303f4
RS
1832 if test x$HAVE_X11XTR6 = xyes; then
1833 LIBS="-lXt -lSM -lICE $LIBS"
1834 else
1835 LIBS="-lXt $LIBS"
1836 fi
6aad10e4 1837 AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
ad4ac636
GM
1838 test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
1839fi
1840
1841# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
1842if test "${HAVE_X11}" = "yes"; then
1843 if test "${USE_X_TOOLKIT}" != "none"; then
1844 AC_CHECK_LIB(Xext, XShapeQueryExtension)
1845 fi
9ec10b2f
DM
1846fi
1847
66d736a9 1848if test "${USE_X_TOOLKIT}" = "MOTIF"; then
fd0a060b 1849 AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
e9b2a022 1850 [AC_TRY_COMPILE([#include <Xm/Xm.h>],
66d736a9
RS
1851 [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
1852int x = 5;
1853#else
1854Motif version prior to 2.1.
1855#endif],
e9b2a022 1856 emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
fd0a060b
AS
1857 HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
1858 if test $emacs_cv_motif_version_2_1 = yes; then
d96a4de3 1859 HAVE_LIBXP=no
5e7d772d
AS
1860 AC_DEFINE(HAVE_MOTIF_2_1, 1,
1861 [Define to 1 if you have Motif 2.1 or newer.])
ad4ac636 1862 AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
72d9b5b3 1863 if test ${HAVE_LIBXP} = yes; then
5e7d772d
AS
1864 AC_DEFINE(HAVE_LIBXP, 1,
1865 [Define to 1 if you have the Xp library (-lXp).])
72d9b5b3 1866 fi
fd0a060b 1867 fi
66d736a9
RS
1868fi
1869
620fdfdf
RS
1870### Is -lXaw3d available?
1871HAVE_XAW3D=no
1872if test "${HAVE_X11}" = "yes"; then
1873 if test "${USE_X_TOOLKIT}" != "none"; then
620fdfdf 1874 AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
ad4ac636 1875 AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes))
620fdfdf 1876 if test "${HAVE_XAW3D}" = "yes"; then
5e7d772d
AS
1877 AC_DEFINE(HAVE_XAW3D, 1,
1878 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
620fdfdf
RS
1879 fi
1880 fi
1881fi
1882
0be97a72
GM
1883dnl Use toolkit scroll bars if configured for X toolkit and either
1884dnl using Motif or Xaw3d is available, and unless
1885dnl --with-toolkit-scroll-bars=no was specified.
1886
5e7d772d
AS
1887AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
1888 [Define to 1 if we should use toolkit scroll bars.])dnl
0be97a72
GM
1889USE_TOOLKIT_SCROLL_BARS=no
1890if test "${with_toolkit_scroll_bars}" != "no"; then
1891 if test "${USE_X_TOOLKIT}" != "none"; then
1892 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1893 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1894 HAVE_XAW3D=no
1895 USE_TOOLKIT_SCROLL_BARS=yes
1896 elif test "${HAVE_XAW3D}" = "yes"; then
1897 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1898 USE_TOOLKIT_SCROLL_BARS=yes
1899 fi
1900 fi
1901fi
1902
c6f7dae8
GM
1903dnl Don't use X11 input methods if user specifies he doesn't want it
1904dnl with `--with-xim=no'.
1905
1906if test "${with_xim}" != "no"; then
5e7d772d
AS
1907 AC_DEFINE(USE_XIM, 1,
1908 [Define to 1 if we should use XIM, if it is available.])
c6f7dae8
GM
1909fi
1910
620fdfdf
RS
1911### Use -lXpm if available, unless `--with-xpm=no'.
1912HAVE_XPM=no
1913if test "${HAVE_X11}" = "yes"; then
1914 if test "${with_xpm}" != "no"; then
620fdfdf 1915 AC_CHECK_HEADER(X11/xpm.h,
7960d0bd
GM
1916 AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
1917 if test "${HAVE_XPM}" = "yes"; then
29c1b68e
GM
1918 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
1919 AC_EGREP_CPP(no_return_alloc_pixels,
1920 [#include "X11/xpm.h"
7960d0bd
GM
1921#ifndef XpmReturnAllocPixels
1922no_return_alloc_pixels
1923#endif
29c1b68e
GM
1924 ], HAVE_XPM=no, HAVE_XPM=yes)
1925
1926 if test "${HAVE_XPM}" = "yes"; then
1927 AC_MSG_RESULT(yes)
1928 else
1929 AC_MSG_RESULT(no)
1930 fi
1890c0c4 1931 fi
620fdfdf
RS
1932 fi
1933
1934 if test "${HAVE_XPM}" = "yes"; then
5e7d772d 1935 AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
620fdfdf
RS
1936 fi
1937fi
1938
1939### Use -ljpeg if available, unless `--with-jpeg=no'.
1940HAVE_JPEG=no
1941if test "${HAVE_X11}" = "yes"; then
1942 if test "${with_jpeg}" != "no"; then
3cc9d384
DL
1943 dnl Checking for jpeglib.h can lose becsue of a redefinition of
1944 dnl HAVE_STDLIB_H.
1945 AC_CHECK_HEADER(jerror.h,
ad4ac636 1946 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
620fdfdf
RS
1947 fi
1948
5e7d772d 1949 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
620fdfdf
RS
1950 if test "${HAVE_JPEG}" = "yes"; then
1951 AC_DEFINE(HAVE_JPEG)
4d766b59
RS
1952 AC_EGREP_CPP(
1953changequote({, })dnl avoid leadingspace on the next line
1954{version= *(6[2-9]|[7-9][0-9])},
1955changequote([, ])dnl
1956 [#include <jpeglib.h>
1957 version=JPEG_LIB_VERSION
1958],
1959 AC_DEFINE(HAVE_JPEG),
1960 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
1961 HAVE_JPEG=no])
620fdfdf
RS
1962 fi
1963fi
1964
1965### Use -lpng if available, unless `--with-png=no'.
1966HAVE_PNG=no
1967if test "${HAVE_X11}" = "yes"; then
1968 if test "${with_png}" != "no"; then
620fdfdf 1969 AC_CHECK_HEADER(png.h,
ad4ac636 1970 AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm))
620fdfdf
RS
1971 fi
1972
1973 if test "${HAVE_PNG}" = "yes"; then
5e7d772d 1974 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
620fdfdf
RS
1975 fi
1976fi
1977
1978### Use -ltiff if available, unless `--with-tiff=no'.
1979HAVE_TIFF=no
1980if test "${HAVE_X11}" = "yes"; then
1981 if test "${with_tiff}" != "no"; then
620fdfdf 1982 AC_CHECK_HEADER(tiffio.h,
ad4ac636 1983 tifflibs="-lz -lm"
3b3cc4a4
KR
1984 # At least one tiff package requires the jpeg library.
1985 if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
1986 AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs))
620fdfdf
RS
1987 fi
1988
1989 if test "${HAVE_TIFF}" = "yes"; then
5e7d772d 1990 AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
620fdfdf
RS
1991 fi
1992fi
1993
1994### Use -lgif if available, unless `--with-gif=no'.
1995HAVE_GIF=no
1996if test "${HAVE_X11}" = "yes"; then
1997 if test "${with_gif}" != "no"; then
620fdfdf 1998 AC_CHECK_HEADER(gif_lib.h,
4d766b59
RS
1999# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
2000# Earlier versions can crash Emacs.
2001 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
620fdfdf
RS
2002 fi
2003
2004 if test "${HAVE_GIF}" = "yes"; then
5e7d772d 2005 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have the ungif library (-lungif).])
620fdfdf
RS
2006 fi
2007fi
2008
e0f712ba
AC
2009### Use Mac OS X Carbon API to implement GUI.
2010HAVE_CARBON=no
2011if test "${with_carbon}" != "no"; then
2012 AC_CHECK_HEADER(Carbon/Carbon.h, HAVE_CARBON=yes)
2013fi
2014
2015if test "${HAVE_CARBON}" = "yes"; then
2016 AC_DEFINE(HAVE_CARBON)
2017fi
2018
f21fadcc
JD
2019### Use session management (-lSM -lICE) if available
2020HAVE_X_SM=no
2021if test "${HAVE_X11}" = "yes"; then
2022 AC_CHECK_HEADER(X11/SM/SMlib.h,
2023 AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, -lICE))
2024
2025 if test "${HAVE_X_SM}" = "yes"; then
5e7d772d 2026 AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
f21fadcc
JD
2027 case "$LIBS" in
2028 *-lSM*) ;;
2029 *) LIBS="-lSM -lICE $LIBS" ;;
2030 esac
2031 fi
2032fi
2033
9ec10b2f 2034# If netdb.h doesn't declare h_errno, we must declare it by hand.
fd0a060b
AS
2035AC_CACHE_CHECK(whether netdb declares h_errno,
2036 emacs_cv_netdb_declares_h_errno,
e9b2a022 2037[AC_TRY_LINK([#include <netdb.h>],
01345308 2038 [return h_errno;],
e9b2a022 2039 emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
fd0a060b 2040if test $emacs_cv_netdb_declares_h_errno = yes; then
5e7d772d 2041 AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
fd0a060b 2042fi
9ec10b2f 2043
6e0dc84a 2044AC_FUNC_ALLOCA
9ec10b2f 2045
f6e8adea 2046# fmod, logb, and frexp are found in -lm on most systems.
e468fb38 2047# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
e6fd9047 2048AC_CHECK_LIB(m, sqrt)
e6fd9047 2049
4e4db900 2050# Check for mail-locking functions in a "mail" library
5ad9ac92
DL
2051AC_CHECK_LIB(mail, maillock)
2052dnl Debian, at least:
2053dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)])
2054AC_CHECK_LIB(lockfile, maillock)
2055# If we have the shared liblockfile, assume we must use it for mail
2056# locking (e.g. Debian). If we couldn't link against liblockfile
2057# (no liblockfile.a installed), ensure that we don't need to.
2058if test "$ac_cv_lib_lockfile_maillock" = no; then
2059 dnl This works for files generally, not just executables.
2060 dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
2061 AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
2062 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
2063 if test $ac_cv_prog_liblockfile = yes; then
2064 AC_MSG_ERROR([Shared liblockfile found but can't link against it.
2065This probably means that movemail could lose mail.
2066There may be a \`development' package to install containing liblockfile.])
5e7d772d 2067 else AC_DEFINE(LIBMAIL, -llockfile, [Define to -llockfile if it is usable.])
5ad9ac92
DL
2068 fi
2069 else :
2070fi
2071AC_CHECK_FUNCS(touchlock)
2072AC_CHECK_HEADERS(maillock.h)
4e4db900 2073
66abe596 2074AC_CHECK_FUNCS(gethostname getdomainname dup2 \
1effc2cb 2075rename closedir mkdir rmdir sysinfo \
fd4bc671 2076random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
85ea1a28 2077strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
290c1191 2078utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
ec406751 2079__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
66abe596 2080sendto recvfrom getsockopt setsockopt getsockname getpeername \
93c05c18 2081gai_strerror mkstemp getline getdelim)
38c44a91 2082
66abe596
KS
2083AC_CHECK_HEADERS(sys/un.h)
2084
38c44a91
DL
2085AC_FUNC_MKTIME
2086if test "$ac_cv_func_working_mktime" = no; then
5e7d772d 2087 AC_DEFINE(BROKEN_MKTIME, 1, [Define to 1 if the mktime function is broken.])
38c44a91
DL
2088fi
2089
1ca2077a
DL
2090AC_FUNC_GETLOADAVG
2091
64a04a42 2092AC_FUNC_FSEEKO
63c59d1e 2093
64a04a42 2094# UNIX98 PTYs.
40ccc4c7
GM
2095AC_CHECK_FUNCS(grantpt)
2096
2097# PTY-related GNU extensions.
2098AC_CHECK_FUNCS(getpt)
2099
16831d8c
RS
2100# Check this now, so that we will NOT find the above functions in ncurses.
2101# That is because we have not set up to link ncurses in lib-src.
2102# It's better to believe a function is not available
2103# than to expect to find it in ncurses.
2104AC_CHECK_LIB(ncurses, tparm)
0c565a0a 2105
84e70f78
KR
2106# Do we need the Hesiod library to provide the support routines?
2107if test "$with_hesiod" = yes ; then
2108 # Don't set $LIBS here -- see comments above.
2109 resolv=no
2110 AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2111 [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2112 [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2113 if test "$resolv" = yes ; then
2114 RESOLVLIB=-lresolv
5e7d772d
AS
2115 AC_DEFINE(HAVE_LIBRESOLV, 1,
2116 [Define to 1 if you have the resolv library (-lresolv).])
84e70f78
KR
2117 else
2118 RESOLVLIB=
2119 fi
2120 AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
5e7d772d
AS
2121 AC_DEFINE(HAVE_LIBHESIOD, 1,
2122 [Define to 1 if you have the hesiod library (-lhesiod).]),
2123 :, $RESOLVLIB)])
84e70f78
KR
2124fi
2125
a21616bd
KR
2126# These tell us which Kerberos-related libraries to use.
2127if test "${with_kerberos+set}" = set; then
2128 AC_CHECK_LIB(com_err, com_err)
2129 AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2130 AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2131 AC_CHECK_LIB(krb5, krb5_init_context)
2132 if test "${with_kerberos5+set}" != set; then
2133 AC_CHECK_LIB(des425, des_cbc_encrypt,,
2134 AC_CHECK_LIB(des, des_cbc_encrypt))
2135 AC_CHECK_LIB(krb4, krb_get_cred,,
2136 AC_CHECK_LIB(krb, krb_get_cred))
2137 fi
2138
2139 if test "${with_kerberos5+set}" = set; then
2140 AC_CHECK_HEADERS(krb5.h)
2141 else
2142 AC_CHECK_HEADERS(des.h,,
5a129faf
PE
2143 [AC_CHECK_HEADERS(kerberosIV/des.h,,
2144 [AC_CHECK_HEADERS(kerberos/des.h)])])
a21616bd 2145 AC_CHECK_HEADERS(krb.h,,
5a129faf
PE
2146 [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2147 [AC_CHECK_HEADERS(kerberos/krb.h)])])
a21616bd
KR
2148 fi
2149 AC_CHECK_HEADERS(com_err.h)
2150fi
2151
c4510052
PE
2152# Solaris requires -lintl if you want strerror (which calls dgettext)
2153# to return localized messages.
2154AC_CHECK_LIB(intl, dgettext)
2155
0c565a0a
RS
2156AC_MSG_CHECKING(whether localtime caches TZ)
2157AC_CACHE_VAL(emacs_cv_localtime_cache,
fcc303f4 2158[if test x$ac_cv_func_tzset = xyes; then
0c565a0a 2159AC_TRY_RUN([#include <time.h>
22cc077c
RS
2160extern char **environ;
2161unset_TZ ()
2162{
2163 char **from, **to;
2164 for (to = from = environ; (*to = *from); from++)
2165 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2166 to++;
2167}
98ab445d
RS
2168char TZ_GMT0[] = "TZ=GMT0";
2169char TZ_PST8[] = "TZ=PST8";
0c565a0a
RS
2170main()
2171{
2172 time_t now = time ((time_t *) 0);
22cc077c 2173 int hour_GMT0, hour_unset;
98ab445d 2174 if (putenv (TZ_GMT0) != 0)
0c565a0a 2175 exit (1);
22cc077c
RS
2176 hour_GMT0 = localtime (&now)->tm_hour;
2177 unset_TZ ();
2178 hour_unset = localtime (&now)->tm_hour;
98ab445d 2179 if (putenv (TZ_PST8) != 0)
0c565a0a 2180 exit (1);
22cc077c
RS
2181 if (localtime (&now)->tm_hour == hour_GMT0)
2182 exit (1);
2183 unset_TZ ();
2184 if (localtime (&now)->tm_hour != hour_unset)
2185 exit (1);
2186 exit (0);
0c565a0a
RS
2187}], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2188[# If we have tzset, assume the worst when cross-compiling.
2189emacs_cv_localtime_cache=yes])
2190else
2191 # If we lack tzset, report that localtime does not cache TZ,
2192 # since we can't invalidate the cache if we don't have tzset.
2193 emacs_cv_localtime_cache=no
2194fi])dnl
2195AC_MSG_RESULT($emacs_cv_localtime_cache)
2196if test $emacs_cv_localtime_cache = yes; then
5e7d772d
AS
2197 AC_DEFINE(LOCALTIME_CACHE, 1,
2198 [Define to 1 if localtime caches TZ.])
0c565a0a 2199fi
9ec10b2f 2200
3d68df05 2201if test "x$HAVE_TIMEVAL" = xyes; then
8a2c2328 2202 AC_CHECK_FUNCS(gettimeofday)
5e7d772d
AS
2203 if test $ac_cv_func_gettimeofday = yes; then
2204 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2205 emacs_cv_gettimeofday_two_arguments,
2206 [AC_TRY_COMPILE([
5ab52d42
RS
2207#ifdef TIME_WITH_SYS_TIME
2208#include <sys/time.h>
2209#include <time.h>
2210#else
2211#ifdef HAVE_SYS_TIME_H
2212#include <sys/time.h>
2213#else
2214#include <time.h>
2215#endif
290c1191 2216#endif],
5e7d772d
AS
2217 [struct timeval time;
2218 gettimeofday (&time, 0);],
2219 emacs_cv_gettimeofday_two_arguments=yes,
2220 emacs_cv_gettimeofday_two_arguments=no)])
2221 if test $emacs_cv_gettimeofday_two_arguments = no; then
2222 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
2223 [Define to 1 if gettimeofday accepts only one argument.])
2224 fi
fd0a060b 2225 fi
5ab52d42
RS
2226fi
2227
8a2c2328
DL
2228dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect.
2229if test "$ac_cv_func_gettimeofday" = yes; then
2230 AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone,
2231 [AC_TRY_COMPILE([#include <sys/time.h>],
2232 [struct timezone tz;],
2233 dnl It may be that we can't call gettimeofday with a non-null pointer,
2234 dnl even though we have struct timezone (e.g. HPUX). In that case
2235 dnl we'll lie about struct timezone.
2236 [AC_TRY_RUN([
2237#ifdef TIME_WITH_SYS_TIME
2238#include <sys/time.h>
2239#include <time.h>
2240#else
2241#ifdef HAVE_SYS_TIME_H
2242#include <sys/time.h>
2243#else
2244#include <time.h>
2245#endif
2246#endif
2247main () {
2248 struct timeval time;
2249 struct timezone dummy;
2250 exit (gettimeofday (&time, &dummy));
2251}],
2252 emacs_cv_struct_timezone=yes,
2253 emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)],
2254 emacs_cv_struct_timezone=no)])
2255fi
2256
9ec10b2f 2257ok_so_far=yes
6e0dc84a 2258AC_CHECK_FUNC(socket, , ok_so_far=no)
9ec10b2f 2259if test $ok_so_far = yes; then
6e0dc84a 2260 AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
9ec10b2f
DM
2261fi
2262if test $ok_so_far = yes; then
6e0dc84a 2263 AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
9ec10b2f
DM
2264fi
2265if test $ok_so_far = yes; then
5e7d772d
AS
2266 AC_DEFINE(HAVE_INET_SOCKETS, 1,
2267 [Define to 1 if you have inet sockets.])
9ec10b2f
DM
2268fi
2269
7bbbba31 2270if test -f /usr/lpp/X11/bin/smt.exp; then
5e7d772d
AS
2271 AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
2272 [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
7bbbba31
DM
2273fi
2274
27b07953
GM
2275AC_MSG_CHECKING(whether system supports dynamic ptys)
2276if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2277 AC_MSG_RESULT(yes)
5e7d772d 2278 AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if dynamic ptys are supported.])
27b07953
GM
2279else
2280 AC_MSG_RESULT(no)
2281fi
2282
5a129faf 2283AC_FUNC_FORK
79e12078 2284
8170f46b
DL
2285# Fixme: This should be replaced when we have autoconf 2.14.
2286AC_SIZE_T
2287
9ec10b2f
DM
2288# Set up the CFLAGS for real compilation, so we can substitute it.
2289CFLAGS="$REAL_CFLAGS"
5a9bf171 2290CPPFLAGS="$REAL_CPPFLAGS"
9ec10b2f
DM
2291
2292changequote(, )dnl
2293#### Find out which version of Emacs this is.
2294version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
2295 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
2296changequote([, ])dnl
2297if test x"${version}" = x; then
2298 AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
2299fi
2300
9ec10b2f
DM
2301### Specify what sort of things we'll be editing into Makefile and config.h.
2302### Use configuration here uncanonicalized to avoid exceeding size limits.
2303AC_SUBST(version)
2304AC_SUBST(configuration)
3cd69289 2305AC_SUBST(canonical)
9ec10b2f
DM
2306AC_SUBST(srcdir)
2307AC_SUBST(prefix)
2308AC_SUBST(exec_prefix)
2309AC_SUBST(bindir)
2310AC_SUBST(datadir)
3cd69289
DM
2311AC_SUBST(sharedstatedir)
2312AC_SUBST(libexecdir)
9ec10b2f
DM
2313AC_SUBST(mandir)
2314AC_SUBST(infodir)
2315AC_SUBST(lispdir)
2316AC_SUBST(locallisppath)
2317AC_SUBST(lisppath)
66d736a9 2318AC_SUBST(x_default_search_path)
9ec10b2f 2319AC_SUBST(etcdir)
9ec10b2f
DM
2320AC_SUBST(archlibdir)
2321AC_SUBST(docdir)
3cd69289 2322AC_SUBST(bitmapdir)
93c05c18
CW
2323AC_SUBST(gamedir)
2324AC_SUBST(gameuser)
9ec10b2f
DM
2325AC_SUBST(c_switch_system)
2326AC_SUBST(c_switch_machine)
2327AC_SUBST(LD_SWITCH_X_SITE)
2328AC_SUBST(LD_SWITCH_X_SITE_AUX)
2329AC_SUBST(C_SWITCH_X_SITE)
2330AC_SUBST(CFLAGS)
2331AC_SUBST(X_TOOLKIT_TYPE)
2332AC_SUBST(machfile)
2333AC_SUBST(opsysfile)
1ca2077a 2334AC_SUBST(GETLOADAVG_LIBS)
9ec10b2f 2335
5e7d772d
AS
2336AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
2337 [Define to the canonical Emacs configuration name.])
2338AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
2339 [Define to the options passed to configure.])
2340AC_DEFINE_UNQUOTED(config_machfile, "${machfile}",
2341 [Define to the used machine dependent file.])
2342AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
2343 [Define to the used os dependent file.])
2344AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
2345[Define LD_SWITCH_X_SITE to contain any special flags your loader
2346 may need to deal with X Windows. For instance, if you've defined
2347 HAVE_X_WINDOWS above and your X libraries aren't in a place that
2348 your loader can find on its own, you might want to add "-L/..." or
2349 something similar.])
2350AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
2351 [Define LD_SWITCH_X_SITE_AUX with an -R option
2352 in case it's needed (for Solaris, for example).])
2353AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE},
2354[Define C_SWITCH_X_SITE to contain any special flags your compiler
2355 may need to deal with X Windows. For instance, if you've defined
2356 HAVE_X_WINDOWS above and your X include files aren't in a place
2357 that your compiler can find on its own, you might want to add
2358 "-I/..." or something similar.])
2359AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC},
2360 [Define to the unexec source file name.])
9ec10b2f
DM
2361
2362if test "${HAVE_X_WINDOWS}" = "yes" ; then
5e7d772d
AS
2363 AC_DEFINE(HAVE_X_WINDOWS, 1,
2364 [Define to 1 if you want to use the X window system.])
9ec10b2f
DM
2365fi
2366if test "${USE_X_TOOLKIT}" != "none" ; then
5e7d772d 2367 AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
9ec10b2f
DM
2368fi
2369if test "${HAVE_X11}" = "yes" ; then
5e7d772d
AS
2370 AC_DEFINE(HAVE_X11, 1,
2371 [Define to 1 if you want to use version 11 of X windows.
2372 Otherwise, Emacs expects to use version 10.])
9ec10b2f
DM
2373fi
2374if test "${HAVE_XFREE386}" = "yes" ; then
5e7d772d 2375 AC_DEFINE(HAVE_XFREE386, 1, [Define to 1 if you're using XFree386.])
9ec10b2f 2376fi
08741ba9 2377if test "${HAVE_MENUS}" = "yes" ; then
5e7d772d
AS
2378 AC_DEFINE(HAVE_MENUS, 1,
2379 [Define to 1 if you have mouse menus.
2380 (This is automatic if you use X, but the option to specify it remains.)
2381 It is also defined with other window systems that support xmenu.c.])
9ec10b2f
DM
2382fi
2383if test "${GNU_MALLOC}" = "yes" ; then
5e7d772d
AS
2384 AC_DEFINE(GNU_MALLOC, 1,
2385 [Define to 1 if you want to use the GNU memory allocator.])
9ec10b2f
DM
2386fi
2387if test "${REL_ALLOC}" = "yes" ; then
5e7d772d
AS
2388 AC_DEFINE(REL_ALLOC, 1,
2389 [Define REL_ALLOC if you want to use the relocating allocator for
2390 buffer space.])
9ec10b2f 2391fi
9ec10b2f 2392
f0f2756d 2393AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1,
5e7d772d
AS
2394 [Define to 1 if you have <nlist.h>.])])
2395
2396AH_TOP([/* GNU Emacs site configuration template file. -*- C -*-
2397 Copyright (C) 1988, 1993, 1994, 1999, 2000 Free Software Foundation, Inc.
2398
2399This file is part of GNU Emacs.
2400
2401GNU Emacs is free software; you can redistribute it and/or modify
2402it under the terms of the GNU General Public License as published by
2403the Free Software Foundation; either version 2, or (at your option)
2404any later version.
2405
2406GNU Emacs is distributed in the hope that it will be useful,
2407but WITHOUT ANY WARRANTY; without even the implied warranty of
2408MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2409GNU General Public License for more details.
2410
2411You should have received a copy of the GNU General Public License
2412along with GNU Emacs; see the file COPYING. If not, write to the
2413Free Software Foundation, Inc., 59 Temple Place - Suite 330,
2414Boston, MA 02111-1307, USA. */
2415
2416
2417/* No code in Emacs #includes config.h twice, but some of the code
2418 intended to work with other packages as well (like gmalloc.c)
2419 think they can include it as many times as they like. */
2420#ifndef EMACS_CONFIG_H
2421#define EMACS_CONFIG_H
2422])dnl
2423
2424AH_BOTTOM([
2425/* If we're using any sort of window system, define some consequences. */
2426#ifdef HAVE_X_WINDOWS
2427#define HAVE_WINDOW_SYSTEM
2428#define MULTI_KBOARD
2429#define HAVE_MOUSE
2430#endif
2431
2432/* Define USER_FULL_NAME to return a string
2433 that is the user's full name.
2434 It can assume that the variable `pw'
2435 points to the password file entry for this user.
2436
2437 At some sites, the pw_gecos field contains
2438 the user's full name. If neither this nor any other
2439 field contains the right thing, use pw_name,
2440 giving the user's login name, since that is better than nothing. */
2441#define USER_FULL_NAME pw->pw_gecos
2442
2443/* Define AMPERSAND_FULL_NAME if you use the convention
2444 that & in the full name stands for the login id. */
2445/* Turned on June 1996 supposing nobody will mind it. */
2446#define AMPERSAND_FULL_NAME
2447
2448/* Define HAVE_SOUND if we have sound support. We know it works
2449 and compiles only on the specified platforms. For others,
2450 it probably doesn't make sense to try. */
2451
2452#if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
2453#ifdef HAVE_MACHINE_SOUNDCARD_H
2454#define HAVE_SOUND 1
2455#endif
2456#ifdef HAVE_SYS_SOUNDCARD_H
2457#define HAVE_SOUND 1
2458#endif
2459#ifdef HAVE_SOUNDCARD_H
2460#define HAVE_SOUND 1
2461#endif
2462#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
2463
2464/* If using GNU, then support inline function declarations. */
2465/* Don't try to switch on inline handling as detected by AC_C_INLINE
2466 generally, because even if non-gcc compilers accept `inline', they
2467 may reject `extern inline'. */
2468#ifdef __GNUC__
2469#define INLINE __inline__
2470#else
2471#define INLINE
2472#endif
2473
2474/* Include the os and machine dependent files. */
2475#include config_opsysfile
2476#include config_machfile
2477
2478/* Load in the conversion definitions if this system
2479 needs them and the source file being compiled has not
2480 said to inhibit this. There should be no need for you
2481 to alter these lines. */
2482
2483#ifdef SHORTNAMES
2484#ifndef NO_SHORTNAMES
2485#include "../shortnames/remap.h"
2486#endif /* not NO_SHORTNAMES */
2487#endif /* SHORTNAMES */
2488
2489/* If no remapping takes place, static variables cannot be dumped as
2490 pure, so don't worry about the `static' keyword. */
2491#ifdef NO_REMAP
2492#undef static
2493#endif
2494
2495/* Define `subprocesses' should be defined if you want to
2496 have code for asynchronous subprocesses
2497 (as used in M-x compile and M-x shell).
2498 These do not work for some USG systems yet;
2499 for the ones where they work, the s/SYSTEM.h file defines this flag. */
2500
2501#ifndef VMS
2502#ifndef USG
2503/* #define subprocesses */
2504#endif
2505#endif
2506
2507/* SIGTYPE is the macro we actually use. */
2508#ifndef SIGTYPE
2509#define SIGTYPE RETSIGTYPE
2510#endif
2511
2512#ifdef emacs /* Don't do this for lib-src. */
2513/* Tell regex.c to use a type compatible with Emacs. */
2514#define RE_TRANSLATE_TYPE Lisp_Object
2515#define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
2516#define RE_TRANSLATE_P(TBL) (XFASTINT (TBL) != 0)
2517#endif
2518
2519/* Avoid link-time collision with system mktime if we will use our own. */
2520#if ! HAVE_MKTIME || BROKEN_MKTIME
2521#define mktime emacs_mktime
2522#endif
2523
2524/* The rest of the code currently tests the CPP symbol BSTRING.
2525 Override any claims made by the system-description files.
2526 Note that on some SCO version it is possible to have bcopy and not bcmp. */
2527#undef BSTRING
2528#if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
2529#define BSTRING
2530#endif
2531
2532/* Some of the files of Emacs which are intended for use with other
2533 programs assume that if you have a config.h file, you must declare
2534 the type of getenv.
2535
2536 This declaration shouldn't appear when alloca.s or Makefile.in
2537 includes config.h. */
2538#ifndef NOT_C_CODE
2539extern char *getenv ();
2540#endif
2541
2542#endif /* EMACS_CONFIG_H */
2543
2544/* These default definitions are good for almost all machines.
2545 The exceptions override them in m/MACHINE.h. */
2546
2547#ifndef BITS_PER_CHAR
2548#define BITS_PER_CHAR 8
2549#endif
2550
2551#ifndef BITS_PER_SHORT
2552#define BITS_PER_SHORT 16
2553#endif
2554
2555/* Note that lisp.h uses this in a preprocessor conditional, so it
2556 would not work to use sizeof. That being so, we do all of them
2557 without sizeof, for uniformity's sake. */
2558#ifndef BITS_PER_INT
2559#define BITS_PER_INT 32
2560#endif
2561
2562#ifndef BITS_PER_LONG
2563#ifdef _LP64
2564#define BITS_PER_LONG 64
2565#else
2566#define BITS_PER_LONG 32
2567#endif
2568#endif
2569
2570/* Define if the compiler supports function prototypes. It may do so
2571 but not define __STDC__ (e.g. DEC C by default) or may define it as
2572 zero. */
2573#undef PROTOTYPES
2574/* For mktime.c: */
2575#ifndef __P
2576# if defined PROTOTYPES
2577# define __P(args) args
2578# else
2579# define __P(args) ()
2580# endif /* GCC. */
2581#endif /* __P */
2582
2583
2584/* Don't include "string.h" or <stdlib.h> in non-C code. */
2585#ifndef NOT_C_CODE
2586#ifdef HAVE_STRING_H
2587#include "string.h"
2588#endif
2589#ifdef HAVE_STDLIB_H
2590#include <stdlib.h>
2591#endif
2592#endif
2593
2594/* Define HAVE_X_I18N if we have usable i18n support. */
2595
2596#ifdef HAVE_X11R6
2597#define HAVE_X_I18N
2598#elif defined HAVE_X11R5 && !defined X11R5_INHIBIT_I18N
2599#define HAVE_X_I18N
2600#endif
2601
2602/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
2603
2604#if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
2605#define HAVE_X11R6_XIM
2606#endif
2607
2608/* Should we enable expensive run-time checking of data types? */
2609#undef ENABLE_CHECKING
2610
2611#if defined __GNUC__ && (__GNUC__ > 2 \
2612 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
2613#define NO_RETURN __attribute__ ((__noreturn__))
2614#else
2615#define NO_RETURN /* nothing */
2616#endif
2617])dnl
f0f2756d 2618
9ec10b2f
DM
2619#### Report on what we decided to do.
2620echo "
9ec10b2f
DM
2621Configured for \`${canonical}'.
2622
2623 Where should the build process find the source code? ${srcdir}
2624 What operating system and machine description files should Emacs use?
2625 \`${opsysfile}' and \`${machfile}'
2626 What compiler should emacs be built with? ${CC} ${CFLAGS}
2627 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
b1b4ce06 2628 Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
e32fac2a 2629 Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
9ec10b2f 2630 What window system should Emacs use? ${window_system}
93c05c18
CW
2631 What toolkit should Emacs use? ${USE_X_TOOLKIT}
2632 Should Emacs use a shared game state directory? ${gamedir}"
509fccc3
RS
2633
2634if test -n "${x_includes}"; then
2635echo " Where do we find X Windows header files? ${x_includes}"
2636else
2637echo " Where do we find X Windows header files? Standard dirs"
2638fi
2639if test -n "${x_libraries}"; then
2640echo " Where do we find X Windows libraries? ${x_libraries}"
2641else
2642echo " Where do we find X Windows libraries? Standard dirs"
2643fi
9ec10b2f 2644
b412189c
GM
2645echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
2646echo " Does Emacs use -lXpm? ${HAVE_XPM}"
2647echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
495ccc04 2648echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
b412189c
GM
2649echo " Does Emacs use -lungif? ${HAVE_GIF}"
2650echo " Does Emacs use -lpng? ${HAVE_PNG}"
20c1822e 2651echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
509fccc3 2652echo
9ec10b2f
DM
2653
2654# Remove any trailing slashes in these variables.
2655changequote(, )dnl
2656test "${prefix}" != NONE &&
2657 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
2658test "${exec_prefix}" != NONE &&
2659 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
2660changequote([, ])dnl
2661
3aa40e0e
GM
2662## Check if the C preprocessor will convert `..' to `. .'. If so, set
2663## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
2664## from Makefile.c can correctly provide the arg `-traditional' to the
2665## C preprocessor.
2666
2667AC_EGREP_CPP(yes..yes,
2668 [yes..yes],
2669 CPP_NEED_TRADITIONAL=no,
2670 CPP_NEED_TRADITIONAL=yes)
2671
5f8c8f00 2672AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
66a96cff 2673 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
56a0a075 2674 lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [
7bbbba31 2675
b63df577 2676### Make the necessary directories, if they don't exist.
e0a3686b 2677for dir in etc lisp ; do
b3947967 2678 test -d ${dir} || mkdir ${dir}
9ec10b2f
DM
2679done
2680
5f8c8f00
RS
2681# Build src/Makefile from ${srcdir}/src/Makefile.c
2682# and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
2683# This must be done after src/config.h is built, since we rely on that file.
9ec10b2f 2684
2d73167a 2685changequote(, )dnl The horror, the horror.
9ec10b2f
DM
2686# Now get this: Some word that is part of the ${srcdir} directory name
2687# or the ${configuration} value might, just might, happen to be an
2688# identifier like `sun4' or `i386' or something, and be predefined by
2689# the C preprocessor to some helpful value like 1, or maybe the empty
2690# string. Needless to say consequent macro substitutions are less
2691# than conducive to the makefile finding the correct directory.
2692undefs="`echo $top_srcdir $configuration $canonical |
2693sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
2694 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
2695`"
2d73167a 2696changequote([, ])dnl
9ec10b2f 2697
6a4bb05d 2698echo creating src/epaths.h
f8f7ab54 2699${MAKE-make} epaths-force
ab85d355 2700
c776f30b
GM
2701# As of 2000-11-19, newest development versions of GNU cpp preprocess
2702# `..' to `. .' unless invoked with -traditional
2703
3aa40e0e 2704if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
c776f30b
GM
2705 CPPFLAGS="$CPPFLAGS -traditional"
2706fi
2707
9ec10b2f
DM
2708echo creating lib-src/Makefile
2709( cd lib-src
2710 rm -f junk.c junk1.c junk2.c
2711 sed -e '/start of cpp stuff/q' \
5f8c8f00 2712 < Makefile.c > junk1.c
9ec10b2f 2713 sed -e '1,/start of cpp stuff/d'\
3b74127d 2714 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
5f8c8f00 2715 < Makefile.c > junk.c
e9b2a022 2716 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
9ec10b2f
DM
2717 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
2718 cat junk1.c junk2.c > Makefile.new
2719 rm -f junk.c junk1.c junk2.c
2720 chmod 444 Makefile.new
2721 mv -f Makefile.new Makefile
2722)
2723
2724echo creating src/Makefile
2725( cd src
2726 rm -f junk.c junk1.c junk2.c
2727 sed -e '/start of cpp stuff/q' \
5f8c8f00 2728 < Makefile.c > junk1.c
9ec10b2f 2729 sed -e '1,/start of cpp stuff/d'\
3b74127d 2730 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
5f8c8f00 2731 < Makefile.c > junk.c
e9b2a022 2732 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
9ec10b2f
DM
2733 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
2734 cat junk1.c junk2.c > Makefile.new
2735 rm -f junk.c junk1.c junk2.c
2736 chmod 444 Makefile.new
2737 mv -f Makefile.new Makefile
2738)
8b66759a 2739
e9b2a022 2740if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
8b66759a 2741 echo creating src/.gdbinit
e9b2a022 2742 echo source $srcdir/src/.gdbinit > src/.gdbinit
8b66759a
DM
2743fi
2744
66a96cff
RS
2745# This is how we know whether to re-run configure in certain cases.
2746touch src/config.stamp
2747
3aa40e0e 2748], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])
464c7d2d 2749