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