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