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