All fsets changed to defaliases.
[emacs.git] / configure1.in
blobd02306cc8c9ae3d479b1a02134764b62dded995e
2 ### The above line is deliberately left blank.  If it starts with a #,
3 ### some CSH's will think this is a csh script.
5 #### Configuration script for GNU Emacs
6 #### Copyright (C) 1992 Free Software Foundation, Inc.
8 ### This file is part of GNU Emacs.
10 ### GNU Emacs is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 1, or (at your option)
13 ### any later version.
15 ### GNU Emacs is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ### GNU General Public License for more details.
20 ### You should have received a copy of the GNU General Public License
21 ### along with GNU Emacs; see the file COPYING.  If not, write to
22 ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 ### Since Emacs has configuration requirements that autoconf can't
26 ### meet, this file is an unholy marriage of custom-baked
27 ### configuration code and autoconf macros.  New versions of autoconf
28 ### could very well break this arrangement.
29 ###
30 ### We omit the invocation of autoconf's initialization function,
31 ### because it produces Bourne shell code to parse arguments, but we
32 ### need to parse our own arguments.
33 ###
34 ### We use the m4 quoting characters [ ] (as established by the
35 ### autoconf system) to include large sections of raw sewage - Oops, I
36 ### mean, shell code - in the final configuration script.
37 ###
38 ### Usage: configure config_name
39 ###
40 ### If configure succeeds, it leaves its status in config.status.
41 ### If configure fails after disturbing the status quo,
42 ###     config.status is removed.
45 ### Remove any more than one leading "." element from the path name.
46 ### If we don't remove them, then another "./" will be prepended to
47 ### the file name each time we use config.status, and the program name
48 ### will get larger and larger.  This wouldn't be a problem, except
49 ### that since progname gets recorded in all the Makefiles this script
50 ### produces, move-if-change thinks they're different when they're
51 ### not.
52 ###
53 ### It would be nice if we could put the ./ in a \( \) group and then
54 ### apply the * operator to that, so we remove as many leading ./././'s
55 ### as are present, but some seds (like Ultrix's sed) don't allow you to
56 ### apply * to a \( \) group.  Bleah.
57 progname="`echo $0 | sed 's:^\./\./:\./:'`"
60 #### Usage messages.
62 short_usage="Type \`${progname} --usage' for more information about options."
64 long_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
66 Set compilation and installation parameters for GNU Emacs, and report.
67 CONFIGURATION specifies the machine and operating system to build for.
68 For example:
69         ${progname} sparc-sun-sunos4.1
70 configures Emacs to build on a Sun Sparc machine running SunOS 4.1, and 
71         ${progname} decstation
72 configures Emacs to run on a DECstation running Ultrix.  See \`etc/MACHINES'.
74 The --with-x, --with-x11 and --with-x10 options specify what window
75         system to use; if all are omitted, use X11 if present.  If you
76         don't want X, specify \`--with-x=no'.
78 The --x-includes=DIR option tells the build process where to search
79         for the X Windows header files.  DIR should have a
80         subdirectory called \`X11' which contains \`X.h', \`Xlib.h', and
81         the rest of the header files; DIR should not contain \`X11'
82         itself.  If this option is omitted, the build process assumes
83         they exist in a directory the compiler checks by default.
85 The --x-libraries=DIR option tells the build process where to look for
86         the X windows libraries.  If this option is omitted, the build
87         process assumes they are in a directory the compiler checks by
88         default.
90 The --with-gcc option says that the build process should use GCC to
91         compile Emacs.  If you have GCC but don't want to use it,
92         specify \`--with-gcc=no'.  \`configure' tries to guess whether
93         or not you have GCC by searching your executable path, but if
94         it guesses incorrectly, you may need to use this.
96 The --srcdir=DIR option specifies that the configuration and build
97         processes should look for the Emacs source code in DIR, when
98         DIR is not the current directory.  This option doesn't work yet.
100 If successful, ${progname} leaves its status in config.status.  If
101 unsuccessful after disturbing the status quo, it removes config.status."
104 #### Option processing.
106 ### Record all the arguments, so we can save them in config.status.
107 arguments="$@"
109 while [ $# != 0 ]; do
110   arg="$1"
111   case "${arg}" in
113     ## Anything starting with a hyphen we assume is an option.
114     -* )
116       ## Separate the switch name from the value it's being given.
117       case "${arg}" in
118         -*=*)
119           opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'`
120           val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'`
121           valomitted=no
122         ;;
123         -*)
124           ## If FOO is a boolean argument, --FOO is equivalent to
125           ## --FOO=yes.  Otherwise, the value comes from the next
126           ## argument - see below.
127           opt=`echo ${arg} | sed 's:^-*\(.*\)$:\1:'`
128           val="yes"
129           valomitted=yes
130         ;;
131       esac
133       ## Change `-' in the option name to `_'.
134       optname="${opt}"
135       opt="`echo ${opt} | tr - _`"
137       ## Process the option.
138       case "${opt}" in
140         ## Has the user specified which window systems they want to support?
141         "with_x" | "with_x11" | "with_x10" )
142           ## Make sure the value given was either "yes" or "no".
143           case "${val}" in
144             y | ye | yes )      val=yes ;;
145             n | no )            val=no  ;;
146             * )
147               (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
148 Set it to either \`yes' or \`no'."
149                echo "${short_usage}") >&2
150               exit 1
151             ;;
152           esac
153           eval "${opt}=\"${val}\""
154         ;;
156         ## Has the user specified whether or not they want GCC?
157         "with_gcc" )
158           ## Make sure the value given was either "yes" or "no".
159           case "${val}" in
160             y | ye | yes )      val=yes ;;
161             n | no )            val=no  ;;
162             * )
163               (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
164 Set it to either \`yes' or \`no'."
165                echo "${short_usage}") >&2
166               exit 1
167             ;;
168           esac
169           eval "${opt}=\"${val}\""
170         ;;
172         ## Has the user specified a source directory?
173         "srcdir" )
174           ## If the value was omitted, get it from the next argument.
175           if [ "${valomitted}" = "yes" ]; then
176             ## Get the next argument from the argument list, if there is one.
177             if [ $# = 1 ]; then
178               (echo "${progname}: You must give a value for the \`--${optname}' option, as in
179     \`--${optname}=FOO'."
180                echo "${short_usage}") >&2
181               exit 1
182             fi
183             shift; val="$1"
184           fi
185           srcdir="${val}"
187           echo "${progname}: Beware - the \`--srcdir' option doesn't work yet." >&2
188         ;;
190         ## Has the user tried to tell us where the X files are?
191         ## I think these are dopey, but no less than three alpha
192         ## testers, at large sites, have said they have their X files
193         ## installed in odd places.
194         "x_includes" )
195           ## If the value was omitted, get it from the next argument.
196           if [ "${valomitted}" = "yes" ]; then
197             ## Get the next argument from the argument list, if there is one.
198             if [ $# = 1 ]; then
199               (echo "${progname}: You must give a value for the \`--${optname}' option, as in
200     \`--${optname}=FOO'."
201                echo "${short_usage}") >&2
202               exit 1
203             fi
204             shift; val="$1"
205           fi
206           x_includes="${val}"
207           C_SWITCH_X_SITE="-I${x_includes}"
208         ;;
209         "x_libraries" )
210           ## If the value was omitted, get it from the next argument.
211           if [ "${valomitted}" = "yes" ]; then
212             ## Get the next argument from the argument list, if there is one.
213             if [ $# = 1 ]; then
214               (echo "${progname}: You must give a value for the \`--${optname}' option, as in
215     \`--${optname}=FOO'."
216                echo "${short_usage}") >&2
217               exit 1
218             fi
219             shift; val="$1"
220           fi
221           x_libraries="${val}"
222           LD_SWITCH_X_SITE="-L${x_libraries}"
223         ;;
225         ## Has the user asked for some help?
226         "usage" | "help" )
227           echo "${long_usage}" | more
228           exit
229         ;;
231         ## We ignore all other options silently.
232       esac
233     ;;
235     ## Anything not starting with a hyphen we assume is a
236     ## configuration name.
237     *)
238       configuration=${arg}
239     ;;
241   esac
242   shift
243 done
245 if [ "${configuration}" = "" ]; then
246   (echo "${progname}: You must specify a configuration name as an argument."
247    echo "${short_usage}") >&2
248   exit 1
252 #### Decide where the source is.
253 case "${srcdir}" in
255   ## If it's not specified, see if  `.' or `..' might work.
256   "" )
257     if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
258       srcdir=`pwd`
259     else
260       if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
261         srcdir=`(cd .. ; pwd)`
262       else
263         (echo "\
264 ${progname}: Neither the current directory nor its parent seem to
265 contain the Emacs sources.  If you do not want to build Emacs in its
266 source tree, you should run \`${progname}' in the directory in which
267 you wish to build Emacs, using its \`--srcdir' option to say where the
268 sources may be found."
269          echo "${short_usage}") >&2
270         exit 1
271       fi
272     fi
273   ;;
275   ## Otherwise, check if the directory they specified is okay.
276   * )
277     if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
278       (echo "\
279 ${progname}: The directory specified with the \`--srcdir' option,
280 \`${srcdir}', doesn't seem to contain the Emacs sources.  You should
281 either run the \`${progname}' script at the top of the Emacs source
282 tree, or use the \`--srcdir' option to specify where the Emacs sources
283 are."
284        echo "${short_usage}") >&2
285       exit 1
286     fi
287   ;;
289 esac
291 ### Make the necessary directories, if they don't exist.
292 if [ ! -d ./src ]; then
293   mkdir ./src
295 if [ ! -d ./lib-src ]; then
296   mkdir ./lib-src
298 if [ ! -d ./cpp ]; then
299   mkdir ./cpp
301 if [ ! -d ./oldXMenu ]; then
302   mkdir ./oldXMenu
306 #### Given the configuration name, set machfile and opsysfile to the
307 #### names of the m/*.h and s/*.h files we should use.
309 ### Canonicalize the configuration name.
310 echo "Checking the configuration name."
311 if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
312   exit $?
315 ### If you add support for a new configuration, add code to this
316 ### switch statement to recognize your configuration name and select
317 ### the appropriate operating system and machine description files.
319 ### You would hope that you could choose an m/*.h file pretty much
320 ### based on the machine portion of the configuration name, and an s-
321 ### file based on the operating system portion.  However, it turns out
322 ### that each m/*.h file is pretty manufacturer-specific - for
323 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
324 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
325 ### machines.  So we basically have to have a special case for each
326 ### configuration name.
328 ### As far as handling version numbers on operating systems is
329 ### concerned, make sure things will fail in a fixable way.  If
330 ### /etc/MACHINES doesn't say anything about version numbers, be
331 ### prepared to handle anything reasonably.  If version numbers
332 ### matter, be sure /etc/MACHINES says something about it.
334 ### Eric Raymond says we should accept strings like "sysvr4" to mean
335 ### "System V Release 4"; he writes, "The old convention encouraged
336 ### confusion between `system' and `release' levels'."
338 machine='' opsys='' unported='false'
339 case "${configuration}" in
341   ## Alliant machines
342   ## Strictly speaking, we need the version of the alliant operating
343   ## system to choose the right machine file, but currently the
344   ## configuration name doesn't tell us enough to choose the right
345   ## one; we need to give alliants their own operating system name to
346   ## do this right.  When someone cares, they can help us.
347   fx80-alliant-* )
348     machine=alliant4 opsys=bsd4-2
349   ;;
350   i860-alliant-* )
351     machine=alliant-2800 opsys=bsd4-3
352   ;;
354   ## Altos 3068
355   m68*-altos-sysv* )
356     machine=altos opsys=usg5-2
357   ;;
358     
359   ## Amdahl UTS
360   580-amdahl-sysv* )
361     machine=amdahl opsys=usg5-2-2
362   ;;
364   ## Appallings - I mean, Apollos - running Domain
365   m68*-apollo* )
366     machine=apollo opsysfile=bsd4-2.h
367   ;;
369   ## AT&T 3b2, 3b5, 3b15, 3b20
370   we32k-att-sysv* )
371     machine=att3b opsys=usg5-2-2
372   ;;
374   ## AT&T 3b1 - The Mighty Unix PC!
375   m68*-att-sysv* )
376     machine=7300 opsys=usg5-2-2
377   ;;
379   ## Bull sps7
380   m68*-bull-sysv* )
381     machine=sps7 opsys=usg5-2
382   ;;
384   ## CCI 5/32, 6/32 -- see "Tahoe".
386   ## Celerity
387   ## I don't know what configuration name to use for this; config.sub
388   ## doesn't seem to know anything about it.  Hey, Celerity users, get
389   ## in touch with us!
390   celerity-celerity-bsd* )
391     machine=celerity opsys=bsd4-2
392   ;;
394   ## Clipper
395   ## What operating systems does this chip run that Emacs has been
396   ## tested on?
397   clipper-* )
398     machine=clipper
399     ## We'll use the catch-all code at the bottom to guess the
400     ## operating system.
401   ;;
403   ## Convex
404   *-convex-bsd* )
405     machine=convex opsys=bsd4-3
406   ;;
408   ## Cubix QBx/386
409   i386-cubix-sysv* )
410     machine=intel386 opsys=usg5-3
411   ;;
413   ## Cydra 5
414   cydra*-cydrome-sysv* )
415     machine=cydra5 opsys=usg5-3
416   ;;
418   ## DECstations
419   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0 | mips-dec-bsd4.2 )
420     machine=pmax opsys=bsd4-2
421   ;;
422   mips-dec-ultrix* | mips-dec-bsd* )
423     machine=pmax opsys=bsd4-3
424   ;;
425   mips-dec-osf* )
426     machine=pmax opsys=osf1
427   ;;
429   ## Motorola Delta machines
430   m68*-motorola-sysv* )
431     machine=delta opsys=usg5-3
432   ;;
433   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
434     machine=delta88k opsys=usg5-3
435   ;;
437   ## Dual machines
438   m68*-dual-sysv* )
439     machine=dual opsys=usg5-2
440   ;;
441   m68*-dual-uniplus* )
442     machine=dual opsys=unipl5-2
443   ;;
445   ## Elxsi 6400
446   elxsi-elxsi-sysv* )
447     machine=elxsi opsys=usg5-2
448   ;;
450   ## Encore machines
451   ns16k-encore-bsd* )
452     machine=ns16000 opsys=umax
453   ;;
455   ## The GEC 93 - apparently, this port isn't really finished yet.
457   ## Gould Power Node and NP1
458   pn-gould-bsd4.2 )
459     machine=gould opsys=bsd4-2
460   ;;
461   pn-gould-bsd4.3 )
462     machine=gould opsys=bsd4-3
463   ;;
464   np1-gould-bsd* )
465     machine=gould-np1 opsys=bsd4-3
466   ;;
468   ## Honeywell XPS100
469   xps*-honeywell-sysv* )
470     machine=xps100 opsys=usg5-2
471   ;;
473   ## HP 9000 series 200 or 300
474   m68*-hp-bsd* )
475     machine=hp9000s300 opsys=bsd4-3
476   ;;
477   ## HP/UX 8 doesn't run on these machines, so use HP/UX 7.
478   m68*-hp-hpux* )
479     machine=hp9000s300 opsys=hpux
480   ;;
482   ## HP 9000 series 800, running HP/UX
483   hppa1.0-hp-hpux* )
484     machine=hp9000s800 opsys=hpux
485   ;;
487   ## Orion machines
488   orion-orion-bsd* )
489     machine=orion opsys=bsd4-2
490   ;;
491   clipper-orion-bsd* )
492     machine=orion105 opsys=bsd4-2
493   ;;
495   ## IBM machines
496   i386-ibm-aix1.1 )
497     machine=ibmps2-aix opsys=usg5-2-2
498   ;;
499   i386-ibm-aix1.2 )
500     machine=ibmps2-aix opsys=usg5-3
501   ;;
502   rs6000-ibm-aix3.1 )
503     machine=ibmrs6000 opsys=aix3-1
504   ;;
505   rs6000-ibm-aix3.2 | rs6000-ibm-aix* )
506     machine=ibmrs6000 opsys=aix3-2
507   ;;
508   romp-ibm-bsd* )
509     machine=ibmrt opsys=bsd4-2
510   ;;
511   romp-ibm-aix* )
512     machine=ibmrt-aix opsys=usg5-2-2
513   ;;
515   ## Integrated Solutions `Optimum V'
516   m68*-isi-bsd4.2 )
517     machine=isi-ov opsys=bsd4-2
518   ;;
519   m68*-isi-bsd4.3 )
520     machine=isi-ov opsys=bsd4-3
521   ;;
523   ## Intel 386 machines where we do care about the manufacturer
524   i[34]86-intsys-sysv* )
525     machine=is386 opsys=usg5-2-2
526   ;;
527   ## Intel 386 machines where we don't care about the manufacturer
528   i[34]86-* )
529     machine=intel386
530     case "${configuration}" in
531       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
532       *-isc2.2 )                opsys=isc2-2 ;;
533       *-isc* )                  opsys=isc3-0 ;;
534       *-esix* )                 opsys=esix ;;
535       *-xenix* )                opsys=xenix ;;
536       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
537     esac
538   ;;
540   ## Silicon Graphics machines
541   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
542   m68*-sgi-iris3.5 )
543     machine=irist opsys=iris3-5
544   ;;
545   m68*-sgi-iris3.6 | m68*-sgi-iris*)
546     machine=irist opsys=iris3-6
547   ;;
548   ## Iris 4D
549   mips-sgi-irix3.* )
550     machine=iris4d opsys=irix3-3
551   ;;
552   mips-sgi-irix4.* | mips-sgi-irix* )
553     machine=iris4d opsys=irix4-0
554   ;;
556   ## Masscomp machines
557   m68*-masscomp-rtu )
558     machine=masscomp opsys=rtu
559   ;;
561   ## Megatest machines
562   m68*-megatest-bsd* )
563     machine=mega68 opsys=bsd4-2
564   ;;
566   ## Workstations sold by MIPS
567   ## This is not necessarily all workstations using the MIPS processor -
568   ## Irises are produced by SGI, and DECstations by DEC.
570   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
571   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
572   ## it gives for choosing between the alternatives seems to be "Use
573   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
574   ## the BSD world."  I'll assume that these are instructions for
575   ## handling two odd situations, and that every other situation
576   ## should use mips.h and usg5-2-2, they being listed first.
577   mips-mips-riscos4* )
578     machine=mips4 opsys=usg5-2-2
579   ;;
580   mips-mips-bsd* )
581     machine=mips opsys=bsd4-3
582   ;;
583   mips-mips-* )
584     machine=mips opsys=usg5-2-2
585   ;;
587   ## The complete machine from National Semiconductor
588   ns32k-ns-genix* )
589     machine=ns32000 opsys=usg5-2
590   ;;
592   ## NCR machines
593   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
594     machine=tower32 opsys=usg5-2-2
595   ;;
596   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
597     machine=tower32v3 opsys=usg5-3
598   ;;
600   ## Nixdorf Targon 31
601   m68*-nixdorf-sysv* )
602     machine=targon31 opsys=usg5-2-2
603   ;;
605   ## Nu (TI or LMI)
606   m68*-nu-sysv* )
607     machine=nu opsys=usg5-2
608   ;;
610   ## Plexus
611   m68*-plexus-sysv* )
612     machine=plexus opsys=usg5-2
613   ;;
615   ## Prime EXL
616   i386-prime-sysv* )
617     machine=i386 opsys=usg5-3
618   ;;
620   ## Pyramid machines
621   ## I don't really have any idea what sort of processor the Pyramid has,
622   ## so I'm assuming it is its own architecture.
623   pyramid-pyramid-bsd* )
624     machine=pyramid opsys=bsd4-2
625   ;;
627   ## Sequent Balance
628   ns32k-sequent-bsd4.2 )
629     machine=sequent opsys=bsd4-2
630   ;;
631   ns32k-sequent-bsd4.3 )
632     machine=sequent opsys=bsd4-3
633   ;;
634   ## Sequent Symmetry
635   i386-sequent-bsd* )
636     machine=symmetry opsys=bsd4-3
637   ;;
639   ## SONY machines
640   m68*-sony-bsd4.2 )
641     machine=news opsys=bsd4-2
642   ;;
643   m68*-sony-bsd4.3 )
644     machine=news opsys=bsd4-3
645   ;;
646   mips-sony-bsd* )
647     machine=news-risc opsys=bsd4-3
648   ;;
650   ## Stride
651   m68*-stride-sysv* )
652     machine=stride opsys=usg5-2
653   ;;
655   ## Suns
656   *-sun-sunos* | *-sun-bsd* )
657     case "${configuration}" in
658       m68*-sunos1* )    machine=sun1 ;;
659       m68*-sunos2* )    machine=sun2 ;;
660       m68* )            machine=sun3 ;;
661       i[34]86* )        machine=sun386 ;;
662       sparc* )          machine=sparc ;;
663       * )               unported=true ;;
664     esac
665     case "${configuration}" in
666       *-sunos4.0*         ) opsys=sunos4-0 ;;
667       *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
668       *                   ) opsys=bsd4-2   ;;
669     esac
670   ;;
672   ## Tadpole 68k
673   m68*-tadpole-sysv* )
674     machine=tad68k opsys=usg5-3
675   ;;
677   ## Tahoe machines
678   tahoe-tahoe-bsd4.2 )
679     machine=tahoe opsys=bsd4-2
680   ;;
681   tahoe-tahoe-bsd4.3 )
682     machine=tahoe opsys=bsd4-3
683   ;;
685   ## Tandem Integrity S2
686   mips-tandem-sysv* )
687     machine=tandem-s2 opsys=usg5-3
688   ;;
690   ## Tektronix 16000 box (6130?)
691   ns16k-tektronix-bsd* )
692     machine=ns16000 opsys=bsd4-2
693   ;;
694   ## Tektronix 4300
695   ## src/m/tek4300.h hints that this is a m68k machine.
696   m68*-tektronix-bsd* )
697     machine=tex4300 opsys=bsd4-3
698   ;;
700   ## Titan P2 or P3
701   ## We seem to have lost the machine-description file titan.h!
702   titan-titan-sysv* )
703     machine=titan opsys=usg5-3
704   ;;
705   
706   ## Ustation E30 (SS5E)
707   m68*-unisys-uniplus* )
708     machine=ustation opsystem=unipl5-2
709   ;;
711   ## Vaxen.
712   vax-dec-* )
713     machine=vax
714     case "${configuration}" in
715       *-bsd4.1 )                                        opsys=bsd4-1 ;;
716       *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 )        opsys=bsd4-2 ;;
717       *-bsd4.3 | *-ultrix* )                            opsys=bsd4-3 ;;
718       *-sysv[01]* | *-sysvr[01]* )                      opsys=usg5-0 ;;
719       *-sysv2* | *-sysvr2* )                            opsys=usg5-2 ;;
720       *-vms* )                                          opsys=vms ;;
721       * )                                               unported=true
722     esac
723   ;;
725   ## Whitechapel MG1
726   ns16k-whitechapel-* )
727     machine=mg1
728     ## We don't know what sort of OS runs on these; we'll let the
729     ## operating system guessing code below try.
730   ;;
732   ## Wicat
733   m68*-wicat-sysv* )
734     machine=wicat opsys=usg5-2
735   ;;
737   * )
738     unported=true
739   ;;
740 esac
742 ### If the code above didn't choose an operating system, just choose
743 ### an operating system based on the configuration name.  You really
744 ### only want to use this when you have no idea what the right
745 ### operating system is; if you know what operating systems a machine
746 ### runs, it's cleaner to make it explicit in the case statement
747 ### above.
748 if [ ! "${opsys}" ]; then
749   case "${configuration}" in
750     *-bsd4.[01] )       opsys=bsd4-1 ;;
751     *-bsd4.2 )          opsys=bsd4-2 ;;
752     *-bsd4.3 )          opsys=bsd4-3 ;;
753     *-sysv0 | *-sysvr0 )                opsys=usg5-0 ;;
754     *-sysv2 | *-sysvr2 )                opsys=usg5-2 ;;
755     *-sysv2.2 | *-sysvr2.2 )            opsys=usg5-2-2 ;;
756     *-sysv3 | *-sysvr3 )                opsys=usg5-3 ;;
757     *-sysv4 | *-sysvr4 )                opsys=usg5-4 ;;
758     * )
759       unported=true
760     ;;
761   esac
764 if $unported ; then
765   (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
766    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
767   ) >&2
768   exit 1
771 machfile="m/${machine}.h"
772 opsysfile="s/${opsys}.h"
774 #### Set some things up for the autoconf macros.
775 trap 'rm -f conftest* core; exit 1' 1 3 15
777 rm -f conftest*
778 compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
781 #### Choose a compiler.
782 DEFS=-g
783 case ${with_gcc} in
784   "yes" ) CC="gcc" GCC=1 ;;
785   "no"  ) CC="cc"        ;;
786   * )
788 AC_PROG_CC
790 esac
792 if [ "${GCC}" != "" ]; then
793   DEFS="${DEFS} -O"
797 #### Some other nice autoconf tests.
799 AC_CONST
800 AC_RETSIGTYPE
801 AC_HAVE_FUNCS(gettimeofday)
805 #### Choose a window system.
806 echo "Checking window system."
807 window_system=''
808 case "${with_x}" in
809   yes )
810     window_system=${window_system}x11
811   ;;
812   no )
813     window_system=${window_system}none
814 esac
815 case "${with_x11}" in
816   yes )
817     window_system=${window_system}x11
818   ;;
819 esac
820 case "${with_x10}" in
821   yes )
822     window_system=${window_system}x10
823   ;;
824 esac
826 case "${window_system}" in
827   "none" | "x11" | "x10" ) ;;
828   "" )
829     echo "  No window system specifed.  Looking for X Windows."
830     window_system=none
831     if [ -r /usr/lib/libX11.a \
832          -o -d /usr/include/X11 \
833          -o -d /usr/X386/include \
834          -o -d ${x_includes}/X11 ]; then
835       window_system=x11
836     fi
837   ;;
838   * )
839     echo "Don\'t specify the window system more than once." >&2
840     exit 1
841   ;;
842 esac
844 case "${window_system}" in
845   x11 )
846     HAVE_X_WINDOWS=yes
847     HAVE_X11=yes
848     echo "  Using X11."
849   ;;
850   x10 )
851     HAVE_X_WINDOWS=yes
852     HAVE_X11=no
853     echo "  Using X10."
854   ;;
855   none )
856     HAVE_X_WINDOWS=no
857     HAVE_X11=no
858     echo "  Using no window system."
859   ;;
860 esac
862 ### If we're using X11, we should use the X menu package.
863 HAVE_X_MENU=no
864 case ${HAVE_X11} in
865   yes )
866     HAVE_X_MENU=yes
867   ;;
868 esac
870 ### Check for XFree386.  It needs special hacks.
871 case ${window_system} in
872   x11 )
873     if [ -d /usr/X386/include ]; then
874       HAVE_XFREE386=yes
875       if [ "${C_SWITCH_X_SITE}" = "" ]; then
876         C_SWITCH_X_SITE="-I/usr/X386/include"
877       fi
878     fi
879   ;;
880 esac
882 #### Extract some information from the operating system and machine files.
884 echo "Examining the machine- and system-dependent files to find out"
885 echo " - which libraries the lib-src programs will want, and"
886 echo " - whether the GNU malloc routines are usable."
887 tempcname="configure.tmp.$$.c"
888 echo '
889 #include "'${srcdir}'/src/'${opsysfile}'"
890 #include "'${srcdir}'/src/'${machfile}'"
891 #ifndef LIBS_MACHINE
892 #define LIBS_MACHINE
893 #endif
894 #ifndef LIBS_SYSTEM
895 #define LIBS_SYSTEM
896 #endif
897 #ifndef C_SWITCH_SYSTEM
898 #define C_SWITCH_SYSTEM
899 #endif
900 @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
901 @configure@ c_switch_system=C_SWITCH_SYSTEM
902 #ifdef SYSTEM_MALLOC
903 @configure@ system_malloc=yes
904 #else
905 @configure@ system_malloc=no
906 #endif
907 ' > ${tempcname}
908 eval `${CC} -E ${tempcname} \
909        | grep '@configure@' \
910        | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'`
911 rm ${tempcname}
914 # Do the opsystem or machine files prohibit the use of the GNU malloc?
915 # Assume not, until told otherwise.
916 GNU_MALLOC=yes
917 if [ "${system_malloc}" = "yes" ]; then
918   GNU_MALLOC=no
919   GNU_MALLOC_reason="
920   (The GNU allocators don't work with this system configuration.)"
923 if [ ! "${REL_ALLOC}" ]; then
924   REL_ALLOC=${GNU_MALLOC}
927 LISP_FLOAT_TYPE=yes
930 #### Find out which version of Emacs this is.
931 version=`grep 'defconst[         ]*emacs-version' ${srcdir}/lisp/version.el \
932          | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
933 if [ ! "${version}" ]; then
934   echo "${progname}: can't find current emacs version in
935         \`${srcdir}/lisp/version.el'." >&2
936   exit 1
940 #### Specify what sort of things we'll be editing into our Makefiles.
942 AC_SUBST(configuration)
943 AC_SUBST(version)
944 AC_SUBST(srcdir)
945 AC_SUBST(c_switch_system)
946 AC_SUBST(libsrc_libs)
947 AC_SUBST(machfile)
948 AC_SUBST(opsysfile)
949 AC_SUBST(LD_SWITCH_X_SITE)
950 AC_SUBST(C_SWITCH_X_SITE)
952 if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
953   ] AC_DEFINE(HAVE_X_WINDOWS) [
955 if [ "${HAVE_X11}" = "yes" ] ; then
956   ] AC_DEFINE(HAVE_X11) [
958 if [ "${HAVE_XFREE386}" = "yes" ] ; then
959   ] AC_DEFINE(HAVE_XFREE386) [
961 if [ "${HAVE_X_MENU}" = "yes" ] ; then
962   ] AC_DEFINE(HAVE_X_MENU) [
964 if [ "${GNU_MALLOC}" = "yes" ] ; then
965   ] AC_DEFINE(GNU_MALLOC) [
967 if [ "${REL_ALLOC}" = "yes" ] ; then
968   ] AC_DEFINE(REL_ALLOC) [
970 if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
971   ] AC_DEFINE(LISP_FLOAT_TYPE) [
975 #### Report on what we decided to do.
976 echo "
978 Configured for \`${configuration}'.
980   What operating system and machine description files should Emacs use?
981         \`${opsysfile}' and \`${machfile}'
982   What compiler should emacs be built with?               ${CC} -g
983   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
984   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
985   What window system should Emacs use?                    ${window_system}${x_includes+
986   Where do we find X Windows header files?                }${x_includes}${x_libraries+
987   Where do we find X Windows libraries?                   }${x_libraries}
991 ### Restore the arguments to this script, so autoconf can record them
992 ### in the config.status file.
993 set - ${arguments}
995 AC_OUTPUT(Makefile src/config.h)
998 ### Autoconf likes to add a Makefile comment to the top of
999 ### src/config.h.  Do you have a better idea?
1000 (cd src
1001  sed < config.h > conftemp.$$ '1d'
1002  mv conftemp.$$ config.h)