Comment change.
[bpt/emacs.git] / configure1.in
CommitLineData
fa97f756 1dnl This is an autoconf script.
8fc40e80
JB
2dnl To rebuild the `configure' script from this, execute the command
3dnl autoconf
4dnl in the directory containing this script. You must have autoconf
4703b679 5dnl version 1.8 or later.
8fc40e80
JB
6dnl
7dnl The following text appears in the resulting `configure' script,
8dnl explaining how to rebuild it.
de5d70c1 9[#!/bin/sh
0c22fbca 10#### Configuration script for GNU Emacs
5dd53b99 11#### Copyright (C) 1992, 1994 Free Software Foundation, Inc.
0c22fbca 12
8fc40e80
JB
13### Don't edit this script!
14### This script was automatically generated by the `autoconf' program
15### from the file `./configure.in'.
16### To rebuild it, execute the command
17### autoconf
d317463c 18### in the this directory. You must have autoconf version 1.7 or later.
8fc40e80 19
0c22fbca
JB
20### This file is part of GNU Emacs.
21
22### GNU Emacs is free software; you can redistribute it and/or modify
23### it under the terms of the GNU General Public License as published by
5dd53b99 24### the Free Software Foundation; either version 2, or (at your option)
0c22fbca
JB
25### any later version.
26
27### GNU Emacs is distributed in the hope that it will be useful,
28### but WITHOUT ANY WARRANTY; without even the implied warranty of
29### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30### GNU General Public License for more details.
31
32### You should have received a copy of the GNU General Public License
33### along with GNU Emacs; see the file COPYING. If not, write to
34### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
35
7d99494c
JB
36### Since Emacs has configuration requirements that autoconf can't
37### meet, this file is an unholy marriage of custom-baked
44ee550f 38### configuration code and autoconf macros.
7d99494c
JB
39###
40### We use the m4 quoting characters [ ] (as established by the
41### autoconf system) to include large sections of raw sewage - Oops, I
42### mean, shell code - in the final configuration script.
0c22fbca
JB
43###
44### Usage: configure config_name
45###
46### If configure succeeds, it leaves its status in config.status.
47### If configure fails after disturbing the status quo,
48### config.status is removed.
0c22fbca 49
3647c171
JB
50### Remove any more than one leading "." element from the path name.
51### If we don't remove them, then another "./" will be prepended to
52### the file name each time we use config.status, and the program name
53### will get larger and larger. This wouldn't be a problem, except
54### that since progname gets recorded in all the Makefiles this script
55### produces, move-if-change thinks they're different when they're
56### not.
0c22fbca
JB
57###
58### It would be nice if we could put the ./ in a \( \) group and then
59### apply the * operator to that, so we remove as many leading ./././'s
60### as are present, but some seds (like Ultrix's sed) don't allow you to
61### apply * to a \( \) group. Bleah.
3647c171 62progname="`echo $0 | sed 's:^\./\./:\./:'`"
ca1d1d23 63
ca1d1d23 64
cedb6c1b
BF
65### Establish some default values.
66run_in_place=
67single_tree=
68prefix='/usr/local'
69exec_prefix='${prefix}'
70bindir='${exec_prefix}/bin'
71datadir='${prefix}/lib'
72statedir='${prefix}/lib'
73libdir='${exec_prefix}/lib'
74mandir='${prefix}/man/man1'
75infodir='${prefix}/info'
76lispdir='${datadir}/emacs/${version}/lisp'
77locallisppath='${datadir}/emacs/site-lisp'
78lisppath='${locallisppath}:${lispdir}'
79etcdir='${datadir}/emacs/${version}/etc'
80lockdir='${statedir}/emacs/lock'
81archlibdir='${libdir}/emacs/${version}/${configuration}'
080d8166 82docdir='${datadir}/emacs/${version}/etc'
cedb6c1b 83
1c4ce111
RS
84# On Sun systems, people sometimes set up the variable CPP
85# with a value that is a directory, not an executable at all.
86# Detect that case, and ignore that value.
87if [ "x$CPP" != x ] && [ -d "$CPP" ];
88then
89 CPP=
90fi
91
cedb6c1b
BF
92# We cannot use this variable in the case statement below, because many
93# /bin/sh's have broken semantics for "case". Unfortunately, you must
94# actually edit the clause itself.
95# path_options="prefix | exec_prefix | bindir | libdir | etcdir | datadir"
96# path_options="$path_options | archlibdir | statedir | mandir | infodir"
97# path_options="$path_options | lispdir | lockdir | lisppath | locallisppath"
98
0c22fbca
JB
99#### Usage messages.
100
ae6756a2 101short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
8509d50c 102
ca1d1d23 103Set compilation and installation parameters for GNU Emacs, and report.
8509d50c 104CONFIGURATION specifies the machine and operating system to build for.
ae6756a2 105--with-x Support the X Window System.
b735d4b3 106--with-x=no Don't support X.
1c4ce111
RS
107--with-x-toolkit Use an X toolkit.
108--with-x-toolkit=no Don't use an X toolkit.
ae6756a2
JB
109--with-gcc Use GCC to compile Emacs.
110--with-gcc=no Don't use GCC to compile Emacs.
1c4ce111
RS
111--x-includes=DIR Search for X header files in DIR.
112--x-libraries=DIR Search for X libraries in DIR.
ae6756a2
JB
113--run-in-place Use libraries and data files directly out of the
114 source tree.
cedb6c1b
BF
115--single-tree=DIR Has the effect of creating a directory tree at DIR
116 which looks like:
117 .../DIR/bin/CONFIGNAME (emacs, etags, etc.)
118 .../DIR/bin/CONFIGNAME/etc (movemail, etc.)
119 .../DIR/common/lisp (emacs' lisp files)
120 .../DIR/common/site-lisp (local lisp files)
121 .../DIR/common/lib (DOC, TUTORIAL, etc.)
122 .../DIR/common/lock (lockfiles)
123--srcdir=DIR Look for the Emacs source files in DIR.
124--prefix=DIR Install files below DIR. Defaults to \`${prefix}'.
125
126You may also specify any of the \`path' variables found in Makefile.in,
127including --bindir, --libdir, --etcdir, --infodir, and so on. This allows
128you to override a single default location when configuring.
0c22fbca 129
ca1d1d23 130If successful, ${progname} leaves its status in config.status. If
0c22fbca
JB
131unsuccessful after disturbing the status quo, it removes config.status."
132
133
134#### Option processing.
ca1d1d23 135
0c22fbca 136### Record all the arguments, so we can save them in config.status.
20d9a863 137arguments="$@"
e065a56e 138
6703f6cd
BF
139### Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date,
140### in order to get the arguments back in $@, we have to do an
141### `eval set x "$quoted_arguments"; shift'.
142quoted_arguments=
143for i in "$@"; do
144 quoted_arguments="$quoted_arguments '$i'"
145done
146
3517b2e9
JB
147### Don't use shift -- that destroys the argument list, which autoconf needs
148### to produce config.status. It turns out that "set - ${arguments}" doesn't
149### work portably.
6703f6cd
BF
150### However, it also turns out that many shells cannot expand ${10} at all.
151### So using an index variable doesn't work either. It is possible to use
152### some shell magic to make 'set x "$arguments"; shift' work portably.
153while [ $# != 0 ]; do
154 arg="$1"; shift
ca1d1d23 155 case "${arg}" in
0c22fbca
JB
156
157 ## Anything starting with a hyphen we assume is an option.
158 -* )
0c22fbca 159 ## Separate the switch name from the value it's being given.
ca1d1d23 160 case "${arg}" in
2c44309a 161 -*=*)
20d9a863 162 opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'`
2c44309a 163 val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'`
ca1d1d23
JB
164 valomitted=no
165 ;;
2c44309a 166 -*)
0c22fbca
JB
167 ## If FOO is a boolean argument, --FOO is equivalent to
168 ## --FOO=yes. Otherwise, the value comes from the next
169 ## argument - see below.
20d9a863 170 opt=`echo ${arg} | sed 's:^-*\(.*\)$:\1:'`
ca1d1d23
JB
171 val="yes"
172 valomitted=yes
173 ;;
174 esac
175
0c22fbca 176 ## Change `-' in the option name to `_'.
b0209e18 177 optname="${opt}"
20d9a863
JB
178 opt="`echo ${opt} | tr - _`"
179
0c22fbca
JB
180 ## Process the option.
181 case "${opt}" in
ca1d1d23 182
0c22fbca
JB
183 ## Has the user specified which window systems they want to support?
184 "with_x" | "with_x11" | "with_x10" )
185 ## Make sure the value given was either "yes" or "no".
ca1d1d23
JB
186 case "${val}" in
187 y | ye | yes ) val=yes ;;
188 n | no ) val=no ;;
189 * )
b0209e18 190 (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
0c22fbca
JB
191Set it to either \`yes' or \`no'."
192 echo "${short_usage}") >&2
ca1d1d23
JB
193 exit 1
194 ;;
195 esac
0c22fbca 196 eval "${opt}=\"${val}\""
ca1d1d23 197 ;;
0c22fbca 198
1c4ce111
RS
199 ## Has the user specified which toolkit they want to support?
200 "with_x_toolkit" )
1c4ce111
RS
201 case "${val}" in
202 y | ye | yes ) val=athena ;;
203 n | no ) val=no ;;
204 l | lu | luc | luci | lucid ) val=lucid ;;
205 a | at | ath | athe | athena ) val=athena ;;
0de5246d
RS
206# These don't currently work.
207# m | mo | mot | moti | motif ) val=motif ;;
208# o | op | ope | open | open- | open-l | open-lo \
209# | open-loo | open-look ) val=open-look ;;
1c4ce111 210 * )
0de5246d
RS
211 (
212#echo "${progname}: the \`--${optname}' option is supposed to have a value
213#which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'."
214echo "${progname}: the \`--${optname}' option is supposed to have a value
d2ebfa8c 215which is \`yes', \`no', \`lucid', or \`athena'."
1c4ce111
RS
216 echo "${short_usage}") >&2
217 exit 1
218 ;;
219 esac
220 eval "${opt}=\"${val}\""
221 ;;
222
1bba56f6 223 ## Has the user specified whether or not they want GCC?
b735d4b3 224 "with_gcc" | "with_gnu_cc" )
1bba56f6
JB
225 ## Make sure the value given was either "yes" or "no".
226 case "${val}" in
227 y | ye | yes ) val=yes ;;
228 n | no ) val=no ;;
229 * )
b0209e18 230 (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
1bba56f6
JB
231Set it to either \`yes' or \`no'."
232 echo "${short_usage}") >&2
233 exit 1
234 ;;
235 esac
236 eval "${opt}=\"${val}\""
237 ;;
238
0c22fbca
JB
239 ## Has the user specified a source directory?
240 "srcdir" )
241 ## If the value was omitted, get it from the next argument.
ca1d1d23 242 if [ "${valomitted}" = "yes" ]; then
0c22fbca 243 ## Get the next argument from the argument list, if there is one.
6703f6cd 244 if [ $# = 0 ]; then
b0209e18
JB
245 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
246 \`--${optname}=FOO'."
0c22fbca 247 echo "${short_usage}") >&2
4746118a
JB
248 exit 1
249 fi
1052acbf 250 val="$1"; shift
ca1d1d23 251 fi
0c22fbca
JB
252 srcdir="${val}"
253 ;;
254
9c7a7556
JB
255 ## Has the user tried to tell us where the X files are?
256 ## I think these are dopey, but no less than three alpha
257 ## testers, at large sites, have said they have their X files
258 ## installed in odd places.
b0209e18 259 "x_includes" )
9c7a7556
JB
260 ## If the value was omitted, get it from the next argument.
261 if [ "${valomitted}" = "yes" ]; then
262 ## Get the next argument from the argument list, if there is one.
6703f6cd 263 if [ $# = 0 ]; then
b0209e18 264 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
cedb6c1b 265 \`--${optname}=/usr/local/X11/include'."
9c7a7556
JB
266 echo "${short_usage}") >&2
267 exit 1
268 fi
6703f6cd 269 val="$1"; shift
9c7a7556
JB
270 fi
271 x_includes="${val}"
9c7a7556 272 ;;
b0209e18 273 "x_libraries" )
9c7a7556
JB
274 ## If the value was omitted, get it from the next argument.
275 if [ "${valomitted}" = "yes" ]; then
276 ## Get the next argument from the argument list, if there is one.
6703f6cd 277 if [ $# = 0 ]; then
b0209e18 278 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
cedb6c1b 279 \`--${optname}=/usr/local/X11/lib'."
9c7a7556
JB
280 echo "${short_usage}") >&2
281 exit 1
282 fi
6703f6cd 283 val="$1"; shift
9c7a7556
JB
284 fi
285 x_libraries="${val}"
9c7a7556
JB
286 ;;
287
c5f67786
JB
288 ## Should this use the "development configuration"?
289 "run_in_place" )
cedb6c1b
BF
290 single_tree=
291 run_in_place=1
c5f67786
JB
292 ;;
293
1052acbf
BF
294 ## Should this use the "single tree" configuration?
295 "single_tree" )
296 run_in_place=
297 single_tree=1
298 ;;
299
cedb6c1b
BF
300 ## Has the user specified one of the path options?
301 prefix | exec_prefix | bindir | libdir | etcdir | datadir | \
302 archlibdir | statedir | mandir | infodir | lispdir | lockdir | \
109ebdd4 303 lisppath | locallisppath | docdir )
cedb6c1b
BF
304 ## If the value was omitted, get it from the next argument.
305 if [ "${valomitted}" = "yes" ]; then
6703f6cd 306 if [ $# = 0 ]; then
cedb6c1b
BF
307 (echo \
308"$progname: You must give a value for the \`--${optname}' option,";
309 echo \
310"as in \`--${optname}=`eval echo '$'$optname`.'"
311 echo "$short_usage") >&2
312 exit 1
313 fi
6703f6cd 314 val="$1"; shift
cedb6c1b 315 fi
6703f6cd
BF
316 eval "${opt}=\"${val}\""
317 eval "${opt}_specified=1"
cedb6c1b 318 ;;
86ddcc58 319
d02e05d1
JB
320 ## Verbose flag, tested by autoconf macros.
321 "verbose" )
322 verbose=yes
323 ;;
324
0c22fbca
JB
325 ## Has the user asked for some help?
326 "usage" | "help" )
1c0feb67
RS
327 if [ "x$PAGER" = x ]
328 then
329 echo "${short_usage}" | more
330 else
331 echo "${short_usage}" | $PAGER
332 fi
0c22fbca
JB
333 exit
334 ;;
ca1d1d23 335
0c22fbca
JB
336 ## We ignore all other options silently.
337 esac
ca1d1d23 338 ;;
0c22fbca
JB
339
340 ## Anything not starting with a hyphen we assume is a
341 ## configuration name.
ca1d1d23 342 *)
8509d50c 343 configuration=${arg}
ca1d1d23 344 ;;
0c22fbca 345
ca1d1d23
JB
346 esac
347done
348
6703f6cd
BF
349### Get the arguments back. See the diatribe on Shell Magic above.
350eval set x "$quoted_arguments"; shift
351
8509d50c 352if [ "${configuration}" = "" ]; then
334e7c23
JB
353 echo '- You did not tell me what kind of host system you want to configure.
354- I will attempt to guess the kind of system this is.' 1>&2
355 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
356 if configuration=`${guesssys}` ; then
357 echo "- Looks like this is a ${configuration}" 1>&2
358 else
359 echo '- Failed to guess the system type. You need to tell me.' 1>&2
8428ef44 360 echo "${short_usage}" >&2
334e7c23
JB
361 exit 1
362 fi
0c22fbca
JB
363fi
364
0c22fbca
JB
365#### Decide where the source is.
366case "${srcdir}" in
367
e94740ce 368 ## If it's not specified, see if `.' or `..' might work.
0c22fbca 369 "" )
2e694846
JB
370 confdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
371 if [ -f $confdir/src/lisp.h -a -f $confdir/lisp/version.el ]; then
0871bc22 372 srcdir="${confdir}"
e94740ce 373 else
2e694846 374 if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
426460bf 375 srcdir='.'
e94740ce 376 else
2e694846 377 if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
426460bf 378 srcdir='..'
2e694846
JB
379 else
380 (echo "\
e94740ce
JB
381${progname}: Neither the current directory nor its parent seem to
382contain the Emacs sources. If you do not want to build Emacs in its
383source tree, you should run \`${progname}' in the directory in which
384you wish to build Emacs, using its \`--srcdir' option to say where the
385sources may be found."
2e694846
JB
386 echo "${short_usage}") >&2
387 exit 1
388 fi
e94740ce
JB
389 fi
390 fi
0c22fbca
JB
391 ;;
392
e94740ce 393 ## Otherwise, check if the directory they specified is okay.
0c22fbca 394 * )
e94740ce
JB
395 if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
396 (echo "\
397${progname}: The directory specified with the \`--srcdir' option,
398\`${srcdir}', doesn't seem to contain the Emacs sources. You should
399either run the \`${progname}' script at the top of the Emacs source
400tree, or use the \`--srcdir' option to specify where the Emacs sources
401are."
0c22fbca
JB
402 echo "${short_usage}") >&2
403 exit 1
404 fi
405 ;;
0871bc22 406esac
0c22fbca 407
0871bc22
JB
408#### Make srcdir absolute, if it isn't already. It's important to
409#### avoid running the path through pwd unnecessary, since pwd can
410#### give you automounter prefixes, which can go away.
411case "${srcdir}" in
412 /* ) ;;
c9ed10f6
JB
413 . )
414 ## We may be able to use the $PWD environment variable to make this
415 ## absolute. But sometimes PWD is inaccurate.
dce3d8a9 416 if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ] ; then
c9ed10f6
JB
417 srcdir="$PWD"
418 else
419 srcdir="`(cd ${srcdir}; pwd)`"
1d488950 420 fi
c9ed10f6 421 ;;
0871bc22 422 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
0c22fbca
JB
423esac
424
acd399a1
RM
425#### Check if the source directory already has a configured system in it.
426if [ `pwd` != `(cd ${srcdir} && pwd)` ] \
427 && [ -f "${srcdir}/src/config.h" ] ; then
428 (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used"
429 echo " as a build directory right now; it has been configured in its own"
430 echo " right. To configure in another directory as well, you MUST"
431 echo " use GNU make. If you do not have GNU make, then you must"
432 echo " now do \`make distclean' in ${srcdir},"
433 echo " and then run ${progname} again.") >&2
91675811
RM
434 extrasub='/^VPATH[ ]*=/c\
435vpath %.c $(srcdir)\
436vpath %.h $(srcdir)\
eb8a344d
RM
437vpath %.y $(srcdir)\
438vpath %.l $(srcdir)\
439vpath %.s $(srcdir)\
91675811 440vpath %.in $(srcdir)'
acd399a1 441fi
acd399a1 442
0c22fbca 443### Make the necessary directories, if they don't exist.
1c4ce111 444for dir in ./src ./lib-src ./cpp ./oldXMenu ./lwlib ./etc ; do
30945baf
JB
445 if [ ! -d ${dir} ]; then
446 mkdir ${dir}
447 fi
448done
0c22fbca
JB
449
450#### Given the configuration name, set machfile and opsysfile to the
451#### names of the m/*.h and s/*.h files we should use.
452
453### Canonicalize the configuration name.
8509d50c 454echo "Checking the configuration name."
279271ba 455if canonical=`${srcdir}/config.sub "${configuration}"` ; then : ; else
8509d50c
JB
456 exit $?
457fi
20d9a863 458
3647c171
JB
459### If you add support for a new configuration, add code to this
460### switch statement to recognize your configuration name and select
461### the appropriate operating system and machine description files.
462
8509d50c
JB
463### You would hope that you could choose an m/*.h file pretty much
464### based on the machine portion of the configuration name, and an s-
465### file based on the operating system portion. However, it turns out
466### that each m/*.h file is pretty manufacturer-specific - for
467### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
468### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
469### machines. So we basically have to have a special case for each
470### configuration name.
3647c171 471###
8509d50c
JB
472### As far as handling version numbers on operating systems is
473### concerned, make sure things will fail in a fixable way. If
474### /etc/MACHINES doesn't say anything about version numbers, be
475### prepared to handle anything reasonably. If version numbers
476### matter, be sure /etc/MACHINES says something about it.
3647c171
JB
477###
478### Eric Raymond says we should accept strings like "sysvr4" to mean
479### "System V Release 4"; he writes, "The old convention encouraged
480### confusion between `system' and `release' levels'."
481
8509d50c 482machine='' opsys='' unported='false'
279271ba 483case "${canonical}" in
8509d50c
JB
484
485 ## Alliant machines
20d9a863
JB
486 ## Strictly speaking, we need the version of the alliant operating
487 ## system to choose the right machine file, but currently the
488 ## configuration name doesn't tell us enough to choose the right
489 ## one; we need to give alliants their own operating system name to
490 ## do this right. When someone cares, they can help us.
491 fx80-alliant-* )
8509d50c 492 machine=alliant4 opsys=bsd4-2
20d9a863
JB
493 ;;
494 i860-alliant-* )
8509d50c 495 machine=alliant-2800 opsys=bsd4-3
20d9a863 496 ;;
ca1d1d23 497
8509d50c
JB
498 ## Altos 3068
499 m68*-altos-sysv* )
500 machine=altos opsys=usg5-2
20d9a863 501 ;;
8509d50c
JB
502
503 ## Amdahl UTS
504 580-amdahl-sysv* )
505 machine=amdahl opsys=usg5-2-2
20d9a863 506 ;;
ca1d1d23 507
8509d50c
JB
508 ## Appallings - I mean, Apollos - running Domain
509 m68*-apollo* )
e4474817 510 machine=apollo opsys=bsd4-2
20d9a863 511 ;;
8509d50c
JB
512
513 ## AT&T 3b2, 3b5, 3b15, 3b20
514 we32k-att-sysv* )
515 machine=att3b opsys=usg5-2-2
516 ;;
517
518 ## AT&T 3b1 - The Mighty Unix PC!
519 m68*-att-sysv* )
520 machine=7300 opsys=usg5-2-2
521 ;;
522
f9b9f71b
FP
523 ## Bull dpx20
524 rs6000-bull-bosx* )
525 machine=ibmrs6000 opsys=aix3-2
526 ;;
527
6ec1f458
JB
528 ## Bull dpx2
529 m68*-bull-sysv3* )
530 machine=dpx2 opsys=usg5-3
531 ;;
532
8509d50c 533 ## Bull sps7
6ec1f458 534 m68*-bull-sysv2* )
8509d50c 535 machine=sps7 opsys=usg5-2
20d9a863 536 ;;
8509d50c
JB
537
538 ## CCI 5/32, 6/32 -- see "Tahoe".
539
540 ## Celerity
541 ## I don't know what configuration name to use for this; config.sub
542 ## doesn't seem to know anything about it. Hey, Celerity users, get
543 ## in touch with us!
544 celerity-celerity-bsd* )
545 machine=celerity opsys=bsd4-2
546 ;;
547
548 ## Clipper
549 ## What operating systems does this chip run that Emacs has been
550 ## tested on?
551 clipper-* )
552 machine=clipper
553 ## We'll use the catch-all code at the bottom to guess the
554 ## operating system.
555 ;;
556
557 ## Convex
558 *-convex-bsd* )
559 machine=convex opsys=bsd4-3
560 ;;
561
562 ## Cubix QBx/386
563 i386-cubix-sysv* )
564 machine=intel386 opsys=usg5-3
565 ;;
566
567 ## Cydra 5
568 cydra*-cydrome-sysv* )
569 machine=cydra5 opsys=usg5-3
570 ;;
571
b86d694e
JB
572 ## Data General AViiON Machines
573 m88k-dg-dgux* )
574 machine=aviion opsys=dgux
575 ;;
576
8509d50c 577 ## DECstations
1c0feb67 578 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
8509d50c
JB
579 machine=pmax opsys=bsd4-2
580 ;;
581 mips-dec-ultrix* | mips-dec-bsd* )
582 machine=pmax opsys=bsd4-3
583 ;;
584 mips-dec-osf* )
585 machine=pmax opsys=osf1
586 ;;
587
588 ## Motorola Delta machines
98f5cfc3 589 m68k-motorola-sysv* | m68000-motorola-sysv* )
8509d50c 590 machine=delta opsys=usg5-3
764b979b
RS
591 if [ -z "`type gnucc | grep 'not found'`" ]
592 then CC=gnucc
593 else
594 if [ -z "`type gcc | grep 'not found'`" ]
595 then CC=gcc
596 else CC=cc
597 fi
598 fi
8509d50c 599 ;;
ac0e6f3b
JB
600 m88k-motorola-sysv4* )
601 machine=delta88k opsys=usg5-4
602 ;;
8509d50c
JB
603 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
604 machine=delta88k opsys=usg5-3
605 ;;
606
607 ## Dual machines
608 m68*-dual-sysv* )
609 machine=dual opsys=usg5-2
610 ;;
611 m68*-dual-uniplus* )
612 machine=dual opsys=unipl5-2
613 ;;
614
615 ## Elxsi 6400
616 elxsi-elxsi-sysv* )
617 machine=elxsi opsys=usg5-2
618 ;;
619
620 ## Encore machines
621 ns16k-encore-bsd* )
622 machine=ns16000 opsys=umax
623 ;;
624
625 ## The GEC 93 - apparently, this port isn't really finished yet.
626
627 ## Gould Power Node and NP1
1c0feb67 628 pn-gould-bsd4.2* )
8509d50c
JB
629 machine=gould opsys=bsd4-2
630 ;;
1c0feb67 631 pn-gould-bsd4.3* )
8509d50c
JB
632 machine=gould opsys=bsd4-3
633 ;;
634 np1-gould-bsd* )
635 machine=gould-np1 opsys=bsd4-3
636 ;;
637
d8e16cd2
RS
638 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
639 ## as far as Emacs is concerned).
640 m88k-harris-cxux* )
641 # Build needs to be different on 7.0 and later releases
642 case "`uname -r`" in
643 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
644 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
645 esac
646 ;;
647 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
648 m68k-harris-cxux* )
649 machine=nh3000 opsys=cxux
650 ;;
651
8509d50c
JB
652 ## Honeywell XPS100
653 xps*-honeywell-sysv* )
654 machine=xps100 opsys=usg5-2
655 ;;
656
657 ## HP 9000 series 200 or 300
658 m68*-hp-bsd* )
659 machine=hp9000s300 opsys=bsd4-3
660 ;;
dbf6ad3d
RM
661 m68*-hp-netbsd* )
662 machine=hp9000s300 opsys=netbsd
663 ;;
d69d8d1e 664 ## HP/UX 7, 8 and 9 are supported on these machines.
20d9a863 665 m68*-hp-hpux* )
d69d8d1e 666 case "`uname -r`" in
1c0feb67
RS
667 ## Someone's system reports A.B8.05 for this.
668 ## I wonder what other possibilities there are.
669 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
d69d8d1e
JB
670 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
671 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
672 *) machine=hp9000s300 opsys=hpux ;;
673 esac
20d9a863 674 ;;
ca1d1d23 675
c55f453b 676 ## HP 9000 series 700 and 800, running HP/UX
ea2c2e02 677 hppa*-hp-hpux7* )
602dc898 678 machine=hp9000s800 opsys=hpux
c55f453b 679 ;;
ea2c2e02 680 hppa*-hp-hpux8* )
602dc898 681 machine=hp9000s800 opsys=hpux8
c55f453b 682 ;;
ea2c2e02 683 hppa*-hp-hpux9* )
602dc898 684 machine=hp9000s800 opsys=hpux9
ea2c2e02
JB
685 ;;
686
687 ## HP 9000 series 700 and 800, running HP/UX
c55f453b
JB
688 hppa*-hp-hpux* )
689 ## Cross-compilation? Nah!
252c8b3b 690 case "`uname -r`" in
1c0feb67
RS
691 ## Someone's system reports A.B8.05 for this.
692 ## I wonder what other possibilities there are.
693 *.B8.* ) machine=hp9000s800 opsys=hpux8 ;;
ea2c2e02
JB
694 *.08.* ) machine=hp9000s800 opsys=hpux8 ;;
695 *.09.* ) machine=hp9000s800 opsys=hpux9 ;;
252c8b3b 696 *) machine=hp9000s800 opsys=hpux ;;
c55f453b 697 esac
8509d50c
JB
698 ;;
699
700 ## Orion machines
701 orion-orion-bsd* )
702 machine=orion opsys=bsd4-2
703 ;;
704 clipper-orion-bsd* )
705 machine=orion105 opsys=bsd4-2
706 ;;
707
708 ## IBM machines
1c0feb67 709 i386-ibm-aix1.1* )
8509d50c
JB
710 machine=ibmps2-aix opsys=usg5-2-2
711 ;;
1c0feb67 712 i386-ibm-aix1.[23]* | i386-ibm-aix* )
8509d50c
JB
713 machine=ibmps2-aix opsys=usg5-3
714 ;;
d5aac16a
RS
715 i370-ibm-aix*)
716 machine=ibm370aix opsys=usg5-3
717 ;;
1c0feb67 718 rs6000-ibm-aix3.1* )
8509d50c
JB
719 machine=ibmrs6000 opsys=aix3-1
720 ;;
a69c774b
KH
721 rs6000-ibm-aix3.2.5)
722 machine=ibmrs6000 opsys=aix3-2-5
723 ;;
1c0feb67 724 rs6000-ibm-aix3.2* | rs6000-ibm-aix* )
17a624d1
JB
725 machine=ibmrs6000 opsys=aix3-2
726 ;;
1c0feb67 727 romp-ibm-bsd4.3* )
d20c62bf
RS
728 machine=ibmrt opsys=bsd4-3
729 ;;
1c0feb67 730 romp-ibm-bsd4.2* )
d20c62bf
RS
731 machine=ibmrt opsys=bsd4-2
732 ;;
1c0feb67 733 romp-ibm-aos4.3* )
d20c62bf
RS
734 machine=ibmrt opsys=bsd4-3
735 ;;
1c0feb67 736 romp-ibm-aos4.2* )
8509d50c
JB
737 machine=ibmrt opsys=bsd4-2
738 ;;
d20c62bf
RS
739 romp-ibm-aos* )
740 machine=ibmrt opsys=bsd4-3
741 ;;
742 romp-ibm-bsd* )
743 machine=ibmrt opsys=bsd4-3
744 ;;
8509d50c
JB
745 romp-ibm-aix* )
746 machine=ibmrt-aix opsys=usg5-2-2
747 ;;
748
749 ## Integrated Solutions `Optimum V'
1c0feb67 750 m68*-isi-bsd4.2* )
8509d50c
JB
751 machine=isi-ov opsys=bsd4-2
752 ;;
1c0feb67 753 m68*-isi-bsd4.3* )
8509d50c
JB
754 machine=isi-ov opsys=bsd4-3
755 ;;
756
757 ## Intel 386 machines where we do care about the manufacturer
758 i[34]86-intsys-sysv* )
759 machine=is386 opsys=usg5-2-2
760 ;;
6992e6b7
RS
761
762 ## Prime EXL
763 i386-prime-sysv* )
764 machine=i386 opsys=usg5-3
765 ;;
766
767 ## Sequent Symmetry
768 i386-sequent-bsd* )
769 machine=symmetry opsys=bsd4-3
770 ;;
771
4acc6824
RS
772 ## Unspecified sysv on an ncr machine defaults to svr4.2.
773 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
14442cbf 774 i[34]86-ncr-sysv* )
4acc6824 775 machine=intel386 opsys=usg5-4-2
14442cbf
RS
776 ;;
777
df4da582 778 ## Intel 860
9c34bd79 779 i860-*-sysv4* )
df4da582
JB
780 machine=i860 opsys=usg5-4
781 ;;
782
8509d50c
JB
783 ## Silicon Graphics machines
784 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
1c0feb67 785 m68*-sgi-iris3.5* )
8509d50c
JB
786 machine=irist opsys=iris3-5
787 ;;
1c0feb67 788 m68*-sgi-iris3.6* | m68*-sgi-iris*)
8509d50c
JB
789 machine=irist opsys=iris3-6
790 ;;
791 ## Iris 4D
792 mips-sgi-irix3.* )
793 machine=iris4d opsys=irix3-3
794 ;;
1c0feb67
RS
795 mips-sgi-irix5.* )
796 machine=iris4d opsys=irix5-0
797 ;;
8509d50c
JB
798 mips-sgi-irix4.* | mips-sgi-irix* )
799 machine=iris4d opsys=irix4-0
20d9a863
JB
800 ;;
801
8509d50c 802 ## Masscomp machines
1c0feb67 803 m68*-masscomp-rtu* )
8509d50c
JB
804 machine=masscomp opsys=rtu
805 ;;
806
807 ## Megatest machines
808 m68*-megatest-bsd* )
809 machine=mega68 opsys=bsd4-2
810 ;;
811
812 ## Workstations sold by MIPS
813 ## This is not necessarily all workstations using the MIPS processor -
814 ## Irises are produced by SGI, and DECstations by DEC.
815
816 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
817 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
818 ## it gives for choosing between the alternatives seems to be "Use
819 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
820 ## the BSD world." I'll assume that these are instructions for
821 ## handling two odd situations, and that every other situation
822 ## should use mips.h and usg5-2-2, they being listed first.
60e1b37f
JB
823 mips-mips-usg* )
824 machine=mips4
825 ## Fall through to the general code at the bottom to decide on the OS.
826 ;;
8509d50c 827 mips-mips-riscos4* )
cc40a99e 828 machine=mips4 opsys=bsd4-3
9c34bd79 829 NON_GNU_CC="cc -systype bsd43"
781ce8e8 830 NON_GNU_CPP="cc -systype bsd43 -E"
8509d50c
JB
831 ;;
832 mips-mips-bsd* )
833 machine=mips opsys=bsd4-3
834 ;;
835 mips-mips-* )
836 machine=mips opsys=usg5-2-2
837 ;;
838
c5f67786 839 ## NeXT
624e2ec3 840 m68*-next-* )
c5f67786
JB
841 machine=next opsys=mach2
842 ;;
843
8509d50c
JB
844 ## The complete machine from National Semiconductor
845 ns32k-ns-genix* )
846 machine=ns32000 opsys=usg5-2
847 ;;
848
849 ## NCR machines
3647c171 850 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
8509d50c
JB
851 machine=tower32 opsys=usg5-2-2
852 ;;
3647c171 853 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
8509d50c
JB
854 machine=tower32v3 opsys=usg5-3
855 ;;
856
857 ## Nixdorf Targon 31
858 m68*-nixdorf-sysv* )
859 machine=targon31 opsys=usg5-2-2
860 ;;
861
862 ## Nu (TI or LMI)
863 m68*-nu-sysv* )
864 machine=nu opsys=usg5-2
865 ;;
866
867 ## Plexus
868 m68*-plexus-sysv* )
869 machine=plexus opsys=usg5-2
870 ;;
871
8509d50c
JB
872 ## Pyramid machines
873 ## I don't really have any idea what sort of processor the Pyramid has,
874 ## so I'm assuming it is its own architecture.
875 pyramid-pyramid-bsd* )
876 machine=pyramid opsys=bsd4-2
877 ;;
878
879 ## Sequent Balance
1c0feb67 880 ns32k-sequent-bsd4.2* )
8509d50c
JB
881 machine=sequent opsys=bsd4-2
882 ;;
1c0feb67 883 ns32k-sequent-bsd4.3* )
8509d50c 884 machine=sequent opsys=bsd4-3
8509d50c
JB
885 ;;
886
887 ## SONY machines
1c0feb67 888 m68*-sony-bsd4.2* )
8509d50c
JB
889 machine=news opsys=bsd4-2
890 ;;
1c0feb67
RS
891 m68*-sony-bsd4.3* )
892 machine=news opsys=bsd4-3
893 ;;
894 m68*-sony-newsos3*)
8509d50c
JB
895 machine=news opsys=bsd4-3
896 ;;
897 mips-sony-bsd* )
898 machine=news-risc opsys=bsd4-3
899 ;;
eaa2dcbd
RS
900 mips-sony-newsos* )
901 machine=mips opsys=newsos5
902 ;;
8509d50c
JB
903
904 ## Stride
905 m68*-stride-sysv* )
906 machine=stride opsys=usg5-2
907 ;;
908
909 ## Suns
ddb73021 910 *-sun-sunos* | *-sun-bsd* | *-sun-solaris* )
279271ba 911 case "${canonical}" in
8509d50c
JB
912 m68*-sunos1* ) machine=sun1 ;;
913 m68*-sunos2* ) machine=sun2 ;;
914 m68* ) machine=sun3 ;;
915 i[34]86* ) machine=sun386 ;;
916 sparc* ) machine=sparc ;;
917 * ) unported=true ;;
918 esac
279271ba 919 case "${canonical}" in
34207774
RS
920 ## The Sun386 didn't get past 4.0.
921 i386-*-sunos4 ) opsys=sunos4-0 ;;
8509d50c 922 *-sunos4.0* ) opsys=sunos4-0 ;;
7498a871 923 *-sunos4.1.3* ) opsys=sunos4-1-3 ;;
b2c3b7ff 924 *-sunos4shr* ) opsys=sunos4shr ;;
8509d50c 925 *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
9c34bd79
RS
926 *-sunos5.3* | *-solaris2.3* )
927 opsys=sol2-3
928 NON_GNU_CPP=/usr/ccs/lib/cpp
929 ;;
930 *-sunos5* | *-solaris* )
931 opsys=sol2
932 NON_GNU_CPP=/usr/ccs/lib/cpp
933 ;;
8509d50c 934 * ) opsys=bsd4-2 ;;
20d9a863 935 esac
8509d50c
JB
936 ;;
937
938 ## Tadpole 68k
939 m68*-tadpole-sysv* )
940 machine=tad68k opsys=usg5-3
941 ;;
942
943 ## Tahoe machines
1c0feb67 944 tahoe-tahoe-bsd4.2* )
8509d50c
JB
945 machine=tahoe opsys=bsd4-2
946 ;;
1c0feb67 947 tahoe-tahoe-bsd4.3* )
8509d50c
JB
948 machine=tahoe opsys=bsd4-3
949 ;;
950
951 ## Tandem Integrity S2
952 mips-tandem-sysv* )
953 machine=tandem-s2 opsys=usg5-3
954 ;;
955
26f186c2 956 ## Tektronix XD88
0d33a690
RS
957 m88k-tektronix-sysv3* )
958 machine=tekxd88 opsys=usg5-3
26f186c2
JB
959 ;;
960
8509d50c
JB
961 ## Tektronix 16000 box (6130?)
962 ns16k-tektronix-bsd* )
963 machine=ns16000 opsys=bsd4-2
964 ;;
965 ## Tektronix 4300
966 ## src/m/tek4300.h hints that this is a m68k machine.
967 m68*-tektronix-bsd* )
1c0feb67 968 machine=tek4300 opsys=bsd4-3
8509d50c
JB
969 ;;
970
971 ## Titan P2 or P3
972 ## We seem to have lost the machine-description file titan.h!
973 titan-titan-sysv* )
974 machine=titan opsys=usg5-3
975 ;;
976
977 ## Ustation E30 (SS5E)
978 m68*-unisys-uniplus* )
979 machine=ustation opsystem=unipl5-2
980 ;;
981
982 ## Vaxen.
983 vax-dec-* )
984 machine=vax
279271ba 985 case "${canonical}" in
1c0feb67
RS
986 *-bsd4.1* ) opsys=bsd4-1 ;;
987 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
988 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
989 *-bsd386* ) opsys=bsd386 ;;
3647c171
JB
990 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
991 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
992 *-vms* ) opsys=vms ;;
993 * ) unported=true
20d9a863
JB
994 esac
995 ;;
996
8509d50c
JB
997 ## Whitechapel MG1
998 ns16k-whitechapel-* )
999 machine=mg1
1000 ## We don't know what sort of OS runs on these; we'll let the
1001 ## operating system guessing code below try.
1002 ;;
1003
1004 ## Wicat
1005 m68*-wicat-sysv* )
1006 machine=wicat opsys=usg5-2
1007 ;;
1008
b3fb7fc3
JB
1009 ## Intel 386 machines where we don't care about the manufacturer
1010 i[34]86-*-* )
1011 machine=intel386
279271ba 1012 case "${canonical}" in
b3fb7fc3 1013 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1c0feb67 1014 *-isc2.2* ) opsys=isc2-2 ;;
e5f1d6a0 1015 *-isc4.0* ) opsys=isc4-0 ;;
b3fb7fc3 1016 *-isc* ) opsys=isc3-0 ;;
dc6ace12 1017 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
b3fb7fc3
JB
1018 *-esix* ) opsys=esix ;;
1019 *-xenix* ) opsys=xenix ;;
1020 *-linux* ) opsys=linux ;;
1021 *-sco3.2v4* ) opsys=sco4 ;;
1022 *-bsd386* ) opsys=bsd386 ;;
1c0feb67 1023 *-386bsd* ) opsys=386bsd ;;
a117e51e 1024 *-freebsd* ) opsys=freebsd ;;
dbf6ad3d 1025 *-netbsd* ) opsys=netbsd ;;
91d39bf0 1026 *-nextstep* ) opsys=mach2 ;;
b3fb7fc3
JB
1027 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1028 esac
1029 ;;
1030
20d9a863 1031 * )
8509d50c 1032 unported=true
20d9a863 1033 ;;
20d9a863 1034esac
ca1d1d23 1035
8509d50c
JB
1036### If the code above didn't choose an operating system, just choose
1037### an operating system based on the configuration name. You really
1038### only want to use this when you have no idea what the right
1039### operating system is; if you know what operating systems a machine
1040### runs, it's cleaner to make it explicit in the case statement
1041### above.
87a6b538 1042if [ x"${opsys}" = x ]; then
279271ba 1043 case "${canonical}" in
8509d50c
JB
1044 *-bsd4.[01] ) opsys=bsd4-1 ;;
1045 *-bsd4.2 ) opsys=bsd4-2 ;;
1046 *-bsd4.3 ) opsys=bsd4-3 ;;
3647c171
JB
1047 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1048 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1049 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
1050 *-sysv3 | *-sysvr3 ) opsys=usg5-3 ;;
1051 *-sysv4 | *-sysvr4 ) opsys=usg5-4 ;;
effdbe0d
RS
1052 *-sysv4.1 | *-sysvr4.1 )
1053 NON_GNU_CPP=/usr/lib/cpp
1054 opsys=usg5-4 ;;
7846ef2c 1055 *-sysv4.2 | *-sysvr4.2 ) opsys=usg5-4-2 ;;
8509d50c
JB
1056 * )
1057 unported=true
1058 ;;
1059 esac
1060fi
1061
1062if $unported ; then
279271ba 1063 (echo "${progname}: Emacs hasn't been ported to \`${canonical}' systems."
8509d50c
JB
1064 echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
1065 ) >&2
1066 exit 1
1067fi
1068
1069machfile="m/${machine}.h"
1070opsysfile="s/${opsys}.h"
1071
c5f67786
JB
1072]
1073AC_PREPARE(lisp)
61ef9d86 1074ifdef([AC_LANG_C], AC_LANG_C)dnl
e4474817 1075AC_CONFIG_HEADER(src/config.h)
c5f67786 1076[
7d99494c
JB
1077
1078#### Choose a compiler.
63041661 1079if [ "x$CC" = x ]
c78f294b
RS
1080then true
1081else cc_specified=1
63041661
RS
1082fi
1083
7d99494c 1084case ${with_gcc} in
8ba83d88 1085 "yes" ) CC="gcc" GCC=1 ;;
63041661
RS
1086 "no" )
1087 if [ "x$CC" = x ]
c78f294b
RS
1088 then CC=cc;
1089 else true;
63041661
RS
1090 fi
1091 ;;
7d99494c 1092 * )
e4474817 1093 ] AC_PROG_CC [
7d99494c
JB
1094esac
1095
9c34bd79
RS
1096#### Some systems specify a CPP to use unless we are using GCC.
1097#### Now that we know whether we are using GCC, we can decide whether
1098#### to use that one.
63041661 1099if [ "x$NON_GNU_CPP" = x ] || [ x$GCC = x1 ] || [ "x$CPP" = x ]
9c34bd79
RS
1100then true
1101else
990a7421 1102 CPP="$NON_GNU_CPP"
9c34bd79
RS
1103fi
1104
1105#### Some systems specify a CC to use unless we are using GCC.
1106#### Now that we know whether we are using GCC, we can decide whether
1107#### to use that one.
63041661 1108if [ "x$NON_GNU_CC" = x ] || [ x$GCC = x1 ] || [ x$cc_specified = x1 ]
9c34bd79
RS
1109then true
1110else
63041661 1111 CC="$NON_GNU_CC"
9c34bd79
RS
1112fi
1113
00c564b5
JB
1114#### Some other nice autoconf tests. If you add a test here which
1115#### should make an entry in src/config.h, don't forget to add an
1116#### #undef clause to src/config.h.in for autoconf to modify.
7d99494c 1117]
00c564b5 1118dnl checks for programs
e4474817 1119AC_LN_S
c5f67786 1120AC_PROG_CPP
86ddcc58 1121AC_PROG_INSTALL
4b5a51c1 1122AC_PROG_YACC
00c564b5
JB
1123
1124dnl checks for UNIX variants that set `DEFS'
1125
1126dnl checks for header files
1052acbf 1127AC_HAVE_HEADERS(sys/timeb.h sys/time.h unistd.h)
d855a603 1128AC_STDC_HEADERS
9397d456 1129AC_TIME_WITH_SYS_TIME
764b979b
RS
1130dnl In Autoconf 1.8 use AC_SYS_SIGLIST_DECLARED instead of this.
1131AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h,
1132 [#include <signal.h>
1133/* NetBSD declares sys_siglist in <unistd.h>. */
1134#ifdef HAVE_UNISTD_H
1135#include <unistd.h>
1136#endif], [char *msg = *(sys_siglist + 1);],
1137 AC_DEFINE(SYS_SIGLIST_DECLARED))
00c564b5
JB
1138
1139dnl checks for typedefs
7d99494c 1140AC_RETSIGTYPE
00c564b5 1141
00c564b5 1142dnl checks for structure members
a6eb6797 1143AC_STRUCT_TM
d52c5f58 1144AC_TIMEZONE
00c564b5
JB
1145
1146dnl checks for compiler characteristics
c5f67786 1147AC_CONST
00c564b5 1148
4703b679
RS
1149dnl check for Make feature
1150AC_SET_MAKE
1151
00c564b5 1152dnl checks for operating system services
fe5de478 1153AC_LONG_FILE_NAMES
00c564b5
JB
1154
1155dnl other checks for UNIX variants
7d99494c
JB
1156[
1157
0c22fbca 1158#### Choose a window system.
46947372 1159echo "Checking window system."
c5f67786 1160
8509d50c 1161window_system=''
20d9a863 1162case "${with_x}" in
2c44309a
RS
1163 yes )
1164 window_system=${window_system}x11
20d9a863
JB
1165 ;;
1166 no )
1167 window_system=${window_system}none
2c44309a 1168esac
20d9a863 1169case "${with_x11}" in
2c44309a
RS
1170 yes )
1171 window_system=${window_system}x11
20d9a863 1172 ;;
2c44309a
RS
1173esac
1174case "${with_x10}" in
1175 yes )
1176 window_system=${window_system}x10
20d9a863 1177 ;;
2c44309a
RS
1178esac
1179
ca1d1d23
JB
1180case "${window_system}" in
1181 "none" | "x11" | "x10" ) ;;
ca1d1d23 1182 "" )
825e4ec2
JB
1183 # --x-includes or --x-libraries implies --with-x11.
1184 if [ -n "${x_includes}" ] || [ -n "${x_libraries}" ]; then
1185 window_system=x11
1186 else
1187 echo " No window system specified. Looking for X11."
1188 # If the user didn't specify a window system and we found X11, use it.
1189 if [ -r /usr/lib/libX11.a \
5d9aefc7 1190 -o -d /usr/include/X11 \
7d99494c
JB
1191 -o -d /usr/X386/include \
1192 -o -d ${x_includes}/X11 ]; then
825e4ec2
JB
1193 window_system=x11
1194 fi
46947372 1195 fi
ca1d1d23
JB
1196 ;;
1197 * )
825e4ec2 1198 echo "Don't specify a window system more than once." >&2
ca1d1d23
JB
1199 exit 1
1200 ;;
1201esac
1202
825e4ec2
JB
1203[ -z "${window_system}" ] && window_system=none
1204
1205[ -n "${x_libraries}" ] && LD_SWITCH_X_SITE="-L${x_libraries}"
5b46c383 1206[ -n "${x_libraries}" ] && LD_SWITCH_X_SITE_AUX="-R${x_libraries}"
825e4ec2
JB
1207[ -n "${x_includes}" ] && C_SWITCH_X_SITE="-I${x_includes}"
1208
7a5e0891
BF
1209# Avoid forcing the search of /usr/include before fixed include files.
1210if [ "$C_SWITCH_X_SITE" = "-I/usr/include" ]; then
1211 C_SWITCH_X_SITE=" "
1212fi
1213
ca1d1d23
JB
1214case "${window_system}" in
1215 x11 )
0c22fbca
JB
1216 HAVE_X_WINDOWS=yes
1217 HAVE_X11=yes
8509d50c 1218 echo " Using X11."
1c4ce111 1219 case "${with_x_toolkit}" in
c6a9d251 1220 athena | lucid )
1c4ce111 1221 USE_X_TOOLKIT=LUCID
c6a9d251 1222 echo " Using Xt toolkit."
1c4ce111
RS
1223 ;;
1224 motif )
1225 USE_X_TOOLKIT=MOTIF
1226 echo " Using Motif toolkit."
1227 ;;
1228 open-look )
1229 USE_X_TOOLKIT=OPEN_LOOK
1230 echo " Using Open-Look toolkit."
1231 ;;
1232 * )
78a0e199 1233 USE_X_TOOLKIT=none
1c4ce111
RS
1234 echo " Using Xlib directly."
1235 ;;
1236 esac
ca1d1d23
JB
1237 ;;
1238 x10 )
0c22fbca
JB
1239 HAVE_X_WINDOWS=yes
1240 HAVE_X11=no
78a0e199 1241 USE_X_TOOLKIT=none
8509d50c 1242 echo " Using X10."
ca1d1d23
JB
1243 ;;
1244 none )
0c22fbca
JB
1245 HAVE_X_WINDOWS=no
1246 HAVE_X11=no
78a0e199 1247 USE_X_TOOLKIT=none
8509d50c 1248 echo " Using no window system."
ca1d1d23
JB
1249 ;;
1250esac
1c4ce111 1251X_TOOLKIT_TYPE=$USE_X_TOOLKIT
ca1d1d23 1252
0c22fbca
JB
1253### If we're using X11, we should use the X menu package.
1254HAVE_X_MENU=no
1255case ${HAVE_X11} in
20d9a863 1256 yes )
0c22fbca 1257 HAVE_X_MENU=yes
ca1d1d23
JB
1258 ;;
1259esac
1260
0c22fbca 1261#### Extract some information from the operating system and machine files.
4746118a 1262
46947372
JB
1263echo "Examining the machine- and system-dependent files to find out"
1264echo " - which libraries the lib-src programs will want, and"
1265echo " - whether the GNU malloc routines are usable."
c5f67786
JB
1266
1267### It's not important that this name contain the PID; you can't run
1268### two configures in the same directory and have anything work
1269### anyway.
1270tempcname="conftest.c"
1271
e94740ce
JB
1272echo '
1273#include "'${srcdir}'/src/'${opsysfile}'"
1274#include "'${srcdir}'/src/'${machfile}'"
ca1d1d23
JB
1275#ifndef LIBS_MACHINE
1276#define LIBS_MACHINE
1277#endif
1278#ifndef LIBS_SYSTEM
1279#define LIBS_SYSTEM
1280#endif
80afd15e
JB
1281#ifndef C_SWITCH_SYSTEM
1282#define C_SWITCH_SYSTEM
f071c05a 1283#endif
1e39d86d
RS
1284#ifndef C_SWITCH_MACHINE
1285#define C_SWITCH_MACHINE
1286#endif
0028bd66
RS
1287configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1288configure___ c_switch_system=C_SWITCH_SYSTEM
1e39d86d 1289configure___ c_switch_machine=C_SWITCH_MACHINE
ac384e4f 1290
825e4ec2 1291#ifndef LIB_X11_LIB
1c0feb67 1292#define LIB_X11_LIB -lX11
825e4ec2
JB
1293#endif
1294
1295#ifndef LIBX11_MACHINE
1296#define LIBX11_MACHINE
1297#endif
1298
1299#ifndef LIBX11_SYSTEM
1300#define LIBX11_SYSTEM
1301#endif
0028bd66 1302configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
825e4ec2 1303
ac384e4f 1304#ifdef UNEXEC
0028bd66 1305configure___ unexec=UNEXEC
ac384e4f 1306#else
0028bd66 1307configure___ unexec=unexec.o
ac384e4f
JB
1308#endif
1309
46947372 1310#ifdef SYSTEM_MALLOC
0028bd66 1311configure___ system_malloc=yes
46947372 1312#else
0028bd66 1313configure___ system_malloc=no
46947372 1314#endif
4ed216b3
JB
1315
1316#ifndef C_DEBUG_SWITCH
1317#define C_DEBUG_SWITCH -g
1318#endif
1319
1320#ifndef C_OPTIMIZE_SWITCH
1321#define C_OPTIMIZE_SWITCH -O
1322#endif
1323
1324#ifdef __GNUC__
a84cd140 1325configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
4ed216b3 1326#else
a84cd140 1327configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
4ed216b3 1328#endif
46947372 1329' > ${tempcname}
a6eb6797
JB
1330# The value of CPP is a quoted variable reference, so we need to do this
1331# to get its actual value...
b73fe839
JB
1332CPP=`eval "echo $CPP"`
1333eval `${CPP} -Isrc ${tempcname} \
0028bd66
RS
1334 | grep 'configure___' \
1335 | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'`
46947372
JB
1336rm ${tempcname}
1337
ac384e4f
JB
1338### Compute the unexec source name from the object name.
1339UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
7d99494c 1340
46947372 1341# Do the opsystem or machine files prohibit the use of the GNU malloc?
e94740ce
JB
1342# Assume not, until told otherwise.
1343GNU_MALLOC=yes
46947372 1344if [ "${system_malloc}" = "yes" ]; then
0c22fbca
JB
1345 GNU_MALLOC=no
1346 GNU_MALLOC_reason="
8509d50c 1347 (The GNU allocators don't work with this system configuration.)"
46947372
JB
1348fi
1349
87a6b538 1350if [ x"${REL_ALLOC}" = x ]; then
0c22fbca 1351 REL_ALLOC=${GNU_MALLOC}
46947372 1352fi
ca1d1d23 1353
0c22fbca
JB
1354LISP_FLOAT_TYPE=yes
1355
e94740ce 1356
825e4ec2
JB
1357#### Add the libraries to LIBS and check for some functions.
1358
30945baf 1359]
1e39d86d 1360DEFS="$c_switch_system $c_switch_machine $DEFS"
825e4ec2
JB
1361LIBS="$libsrc_libs"
1362
1363dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1364dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1365AC_HAVE_LIBRARY(-ldnet)
30945baf 1366
dbf6ad3d
RM
1367AC_HAVE_LIBRARY(-lXbsd, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1368
1369echo checking for XFree86
1370if test -d /usr/X386/include; then
1371 HAVE_XFREE386=yes
1372 test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include"
1373fi
30945baf 1374
825e4ec2
JB
1375if test "${HAVE_X11}" = "yes"; then
1376 DEFS="$C_SWITCH_X_SITE $DEFS"
1377 LIBS="$LD_SWITCH_X_SITE $LIBX $LIBS"
5725490b
RM
1378 AC_HAVE_FUNCS(XrmSetDatabase XScreenResourceString \
1379XScreenNumberOfScreen XSetWMProtocols)
825e4ec2
JB
1380fi
1381
1382AC_ALLOCA
3f469c2e
RM
1383
1384# logb and frexp are found in -lm on most systems.
1385AC_HAVE_LIBRARY(-lm)
5dd53b99 1386AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
5725490b
RM
1387random bcopy bcmp logb frexp fmod drem ftime res_init setsid strerror \
1388fpathconf)
825e4ec2
JB
1389
1390ok_so_far=true
1391AC_FUNC_CHECK(socket, , ok_so_far=)
1392if test -n "$ok_so_far"; then
1393 AC_HEADER_CHECK(netinet/in.h, , ok_so_far=)
1394fi
1395if test -n "$ok_so_far"; then
1396 AC_HEADER_CHECK(arpa/inet.h, , ok_so_far=)
1397fi
1398if test -n "$ok_so_far"; then
1399 AC_DEFINE(HAVE_INET_SOCKETS)
1400fi
1401[
e94740ce
JB
1402#### Find out which version of Emacs this is.
1403version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
e773d20a 1404 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)[."].*$/\1/'`
87a6b538 1405if [ x"${version}" = x ]; then
e94740ce
JB
1406 echo "${progname}: can't find current emacs version in
1407 \`${srcdir}/lisp/version.el'." >&2
1408 exit 1
1409fi
1410
8686888e
JB
1411if [ -f /usr/lpp/X11/bin/smt.exp ]; then
1412 ]
1413 AC_DEFINE(HAVE_AIX_SMT_EXP)
1414 [
1415fi
1416
e4474817 1417#### Specify what sort of things we'll be editing into Makefile and config.h.
279271ba 1418### Use configuration here uncanonicalized to avoid exceeding size limits.
7d99494c
JB
1419]
1420AC_SUBST(configuration)
1421AC_SUBST(version)
1422AC_SUBST(srcdir)
cedb6c1b
BF
1423AC_SUBST(prefix)
1424AC_SUBST(exec_prefix)
1425AC_SUBST(bindir)
1426AC_SUBST(datadir)
1427AC_SUBST(statedir)
1428AC_SUBST(libdir)
1429AC_SUBST(mandir)
1430AC_SUBST(infodir)
1431AC_SUBST(lispdir)
1432AC_SUBST(locallisppath)
1433AC_SUBST(lisppath)
1434AC_SUBST(etcdir)
1435AC_SUBST(lockdir)
1436AC_SUBST(archlibdir)
109ebdd4 1437AC_SUBST(docdir)
7d99494c 1438AC_SUBST(c_switch_system)
1e39d86d 1439AC_SUBST(c_switch_machine)
7d99494c 1440AC_SUBST(LD_SWITCH_X_SITE)
5b46c383 1441AC_SUBST(LD_SWITCH_X_SITE_AUX)
7d99494c 1442AC_SUBST(C_SWITCH_X_SITE)
e4474817 1443AC_SUBST(CFLAGS)
1c4ce111 1444AC_SUBST(X_TOOLKIT_TYPE)
e4474817 1445
9361e005
JB
1446AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"")
1447AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"")
1448AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
382d3536 1449AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
9361e005 1450AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE})
ac384e4f 1451AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC})
9361e005 1452
7d99494c
JB
1453[
1454if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
1455 ] AC_DEFINE(HAVE_X_WINDOWS) [
1456fi
78a0e199 1457if [ "${USE_X_TOOLKIT}" != "none" ] ; then
1c4ce111
RS
1458 ] AC_DEFINE(USE_X_TOOLKIT) [
1459fi
7d99494c
JB
1460if [ "${HAVE_X11}" = "yes" ] ; then
1461 ] AC_DEFINE(HAVE_X11) [
1462fi
1463if [ "${HAVE_XFREE386}" = "yes" ] ; then
1464 ] AC_DEFINE(HAVE_XFREE386) [
1465fi
1466if [ "${HAVE_X_MENU}" = "yes" ] ; then
1467 ] AC_DEFINE(HAVE_X_MENU) [
1468fi
1469if [ "${GNU_MALLOC}" = "yes" ] ; then
1470 ] AC_DEFINE(GNU_MALLOC) [
1471fi
1472if [ "${REL_ALLOC}" = "yes" ] ; then
1473 ] AC_DEFINE(REL_ALLOC) [
1474fi
1475if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
1476 ] AC_DEFINE(LISP_FLOAT_TYPE) [
1477fi
ca1d1d23 1478
cedb6c1b
BF
1479# ====================== Developer's configuration =======================
1480
1481# The following assignments make sense if you're running Emacs on a single
1482# machine, one version at a time, and you want changes to the lisp and etc
1483# directories in the source tree to show up immediately in your working
1484# environment. It saves a great deal of disk space by not duplicating the
1485# lisp and etc directories.
1486
1487if [ "$run_in_place" = "1" ]; then
1488 lispdir='${srcdir}/lisp'
7f291b64 1489 locallisppath='${srcdir}/site-lisp'
cedb6c1b
BF
1490 etcdir='${srcdir}/etc'
1491 lockdir='${srcdir}/lock'
82d1475f 1492 archlibdir=`(cd lib-src && pwd)`
080d8166 1493 docdir=`(cd etc && pwd)`
cedb6c1b
BF
1494 infodir='${srcdir}/info'
1495elif [ "$single_tree" = "1" ]; then
1496 if [ "$exec_prefix_specified" = "" ]; then
1497 exec_prefix='${prefix}'
1498 fi
1499 if [ "$bindir_specified" = "" ]; then
1500 bindir='${exec_prefix}/bin/${configuration}'
1501 fi
1502 if [ "$datadir_specified" = "" ]; then
1503 datadir='${prefix}/common'
1504 fi
1505 if [ "$statedir_specified" = "" ]; then
1506 statedir='${prefix}/common'
1507 fi
1508 if [ "$libdir_specified" = "" ]; then
1509 libdir='${bindir}'
1510 fi
1511 if [ "$lispdir_specified" = "" ]; then
1512 lispdir='${prefix}/common/lisp'
1513 fi
1514 if [ "$locallisppath_specified" = "" ]; then
1515 locallisppath='${prefix}/common/site-lisp'
1516 fi
1517 if [ "$lockdir_specified" = "" ]; then
1518 lockdir='${prefix}/common/lock'
1519 fi
1520 if [ "$archlibdir_specified" = "" ]; then
1521 archlibdir='${libdir}/etc'
1522 fi
1523 if [ "$etcdir_specified" = "" ]; then
1524 etcdir='${prefix}/common/data'
1525 fi
109ebdd4
KH
1526 if [ "$docdir_specified" = "" ]; then
1527 docdir='${prefix}/common/data'
1528 fi
cedb6c1b 1529fi
f6766fff 1530
7d99494c
JB
1531#### Report on what we decided to do.
1532echo "
f6766fff 1533
279271ba 1534Configured for \`${canonical}'.
8509d50c 1535
c9ed10f6 1536 Where should the build process find the source code? ${srcdir}
8509d50c
JB
1537 What operating system and machine description files should Emacs use?
1538 \`${opsysfile}' and \`${machfile}'
e4474817 1539 What compiler should emacs be built with? ${CC} ${CFLAGS}
0c22fbca
JB
1540 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
1541 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
78a0e199
RS
1542 What window system should Emacs use? ${window_system}
1543 What toolkit should Emacs use? ${USE_X_TOOLKIT}${x_includes+
9c7a7556 1544 Where do we find X Windows header files? }${x_includes}${x_libraries+
7d99494c 1545 Where do we find X Windows libraries? }${x_libraries}
8c0e7b73 1546
e94740ce 1547"
825e4ec2
JB
1548
1549# Remove any trailing slashes in these variables.
1550test -n "${prefix}" &&
1551 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
1552test -n "${exec_prefix}" &&
1553 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
7d99494c 1554]
4acc6824 1555AC_OUTPUT(Makefile lib-src/Makefile.in oldXMenu/Makefile lwlib/Makefile src/Makefile.in, [
6e4b48e2 1556
cedb6c1b 1557# Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done
47241a65
RM
1558# after src/config.h is built, since we rely on that file.
1559
1560changequote(,)dnl The horror, the horror.
764b979b
RS
1561# Now get this: Some word that is part of the ${srcdir} directory name
1562# or the ${configuration} value might, just might, happen to be an
1563# identifier like `sun4' or `i386' or something, and be predefined by
1564# the C preprocessor to some helpful value like 1, or maybe the empty
1565# string. Needless to say consequent macro substitutions are less
1566# than conducive to the makefile finding the correct directory.
1567undefs="`echo $top_srcdir $configuration |
47241a65
RM
1568sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/ */ -U/g' \
1569 -e 's/ -U$//' -e 's/^[^ ]/-U/' \
dace61c1 1570 -e 's/-U[0-9][^ ]*//g' \
47241a65
RM
1571`"
1572changequote([,])dnl
1573
4acc6824
RS
1574echo creating lib-src/Makefile
1575( cd lib-src
1576 rm -f junk.c
1577 sed -e 's@^# \(Generated.*\)$@/* \1 */@' \
1578 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
1579 < Makefile.in > junk.c
1580 $CPP $undefs -I. -I$top_srcdir/lib-src $CPPFLAGS junk.c |
1581 sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > Makefile.new
1582 rm -f junk.c
1583 chmod 444 Makefile.new;
1584 mv -f Makefile.new Makefile;
1585)
1586
47241a65
RM
1587echo creating src/Makefile
1588( cd src
1589 rm -f junk.c
1590 sed -e 's@^# \(Generated.*\)$@/* \1 */@' \
1591 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
1592 < Makefile.in > junk.c
764b979b
RS
1593 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c |
1594 sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > Makefile.new
47241a65
RM
1595 rm -f junk.c
1596 chmod 444 Makefile.new;
1597 mv -f Makefile.new Makefile;
1598)])