Added or corrected Commentary headers
[emacs.git] / configure1.in
bloba5f9098de10e7548574b2a7278f43a2979da8b87
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.
24 ### Shell script to edit files and make symlinks in preparation for
25 ### compiling Emacs.
26 ###
27 ### Usage: configure config_name
28 ###
29 ### If configure succeeds, it leaves its status in config.status.
30 ### If configure fails after disturbing the status quo,
31 ###     config.status is removed.
34 ### Remove any more than one leading "." element from the path name.
35 ### If we don't remove them, then another "./" will be prepended to
36 ### the file name each time we use config.status, and the program name
37 ### will get larger and larger.  This wouldn't be a problem, except
38 ### that since progname gets recorded in all the Makefiles this script
39 ### produces, move-if-change thinks they're different when they're
40 ### not.
41 ###
42 ### It would be nice if we could put the ./ in a \( \) group and then
43 ### apply the * operator to that, so we remove as many leading ./././'s
44 ### as are present, but some seds (like Ultrix's sed) don't allow you to
45 ### apply * to a \( \) group.  Bleah.
46 progname="`echo $0 | sed 's:^\./\./:\./:'`"
49 #### Usage messages.
51 short_usage="Type \`${progname} --usage' for more information about options."
53 long_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
55 Set compilation and installation parameters for GNU Emacs, and report.
56 CONFIGURATION specifies the machine and operating system to build for.
57 For example:
58         ${progname} sparc-sun-sunos4.1
59 configures Emacs to build on a Sun Sparc machine running SunOS 4.1, and 
60         ${progname} decstation
61 configures Emacs to run on a DECstation running Ultrix.  See \`etc/MACHINES'.
63 The --with-x, --with-x11 and --with-x10 options specify what window
64         system to use; if all are omitted, use X11 if present.  If you
65         don't want X, specify \`--with-x=no'.
67 The --with-gcc option says that the build process should use GCC to
68         compile Emacs.  If you have GCC but don't want to use it,
69         specify \`--with-gcc=no'.  \`configure' tries to guess whether
70         or not you have GCC by searching your executable path, but if
71         it guesses incorrectly, you may need to use this.
73 The --srcdir=DIR option specifies that the configuration and build
74         processes should look for the Emacs source code in DIR, when
75         DIR is not the current directory.  This option doesn't work yet.
77 If successful, ${progname} leaves its status in config.status.  If
78 unsuccessful after disturbing the status quo, it removes config.status."
81 #### Option processing.
83 ### These are the names of CPP symbols we want to define or leave undefined
84 ### in src/config.h; their values are given by the shell variables of the same
85 ### names.
86 config_h_opts=" \
87 HAVE_X_WINDOWS HAVE_X11 HAVE_X_MENU \
88 SIGTYPE GNU_MALLOC REL_ALLOC LISP_FLOAT_TYPE HAVE_CONST"
90 ### Record all the arguments, so we can save them in config.status.
91 arguments="$@"
93 while [ $# != 0 ]; do
94   arg="$1"
95   case "${arg}" in
97     ## Anything starting with a hyphen we assume is an option.
98     -* )
100       ## Separate the switch name from the value it's being given.
101       case "${arg}" in
102         -*=*)
103           opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'`
104           val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'`
105           valomitted=no
106         ;;
107         -*)
108           ## If FOO is a boolean argument, --FOO is equivalent to
109           ## --FOO=yes.  Otherwise, the value comes from the next
110           ## argument - see below.
111           opt=`echo ${arg} | sed 's:^-*\(.*\)$:\1:'`
112           val="yes"
113           valomitted=yes
114         ;;
115       esac
117       ## Change `-' in the option name to `_'.
118       opt="`echo ${opt} | tr - _`"
120       ## Process the option.
121       case "${opt}" in
123         ## Has the user specified which window systems they want to support?
124         "with_x" | "with_x11" | "with_x10" )
125           ## Make sure the value given was either "yes" or "no".
126           case "${val}" in
127             y | ye | yes )      val=yes ;;
128             n | no )            val=no  ;;
129             * )
130               (echo "${progname}: the \`--${opt}' option is supposed to have a boolean value.
131 Set it to either \`yes' or \`no'."
132                echo "${short_usage}") >&2
133               exit 1
134             ;;
135           esac
136           eval "${opt}=\"${val}\""
137         ;;
139         ## Has the user specified whether or not they want GCC?
140         "with_gcc" )
141           ## Make sure the value given was either "yes" or "no".
142           case "${val}" in
143             y | ye | yes )      val=yes ;;
144             n | no )            val=no  ;;
145             * )
146               (echo "${progname}: the \`--${opt}' option is supposed to have a boolean value.
147 Set it to either \`yes' or \`no'."
148                echo "${short_usage}") >&2
149               exit 1
150             ;;
151           esac
152           eval "${opt}=\"${val}\""
153         ;;
155         ## Has the user specified a source directory?
156         "srcdir" )
157           ## If the value was omitted, get it from the next argument.
158           if [ "${valomitted}" = "yes" ]; then
159             ## Get the next argument from the argument list, if there is one.
160             if [ $# = 1 ]; then
161               (echo "${progname}: You must give a value for the \`--${opt}' option, as in
162     \`--${opt}=FOO'."
163                echo "${short_usage}") >&2
164               exit 1
165             fi
166             shift; val="$1"
167           fi
168           srcdir="${val}"
170           echo "${progname}: Beware - the \`--srcdir' option doesn't work yet." >&2
171         ;;
173         ## Has the user asked for some help?
174         "usage" | "help" )
175           echo "${long_usage}" | more
176           exit
177         ;;
179         ## We ignore all other options silently.
180       esac
181     ;;
183     ## Anything not starting with a hyphen we assume is a
184     ## configuration name.
185     *)
186       configuration=${arg}
187     ;;
189   esac
190   shift
191 done
193 if [ "${configuration}" = "" ]; then
194   (echo "${progname}: You must specify a configuration name as an argument."
195    echo "${short_usage}") >&2
196   exit 1
200 #### Decide where the source is.
201 case "${srcdir}" in
203   ## If it's not specified, see if  `.' or `..' might work.
204   "" )
205     if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
206       srcdir=`pwd`
207     else
208       if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
209         srcdir=`(cd .. ; pwd)`
210       else
211         (echo "\
212 ${progname}: Neither the current directory nor its parent seem to
213 contain the Emacs sources.  If you do not want to build Emacs in its
214 source tree, you should run \`${progname}' in the directory in which
215 you wish to build Emacs, using its \`--srcdir' option to say where the
216 sources may be found."
217          echo "${short_usage}") >&2
218         exit 1
219       fi
220     fi
221   ;;
223   ## Otherwise, check if the directory they specified is okay.
224   * )
225     if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
226       (echo "\
227 ${progname}: The directory specified with the \`--srcdir' option,
228 \`${srcdir}', doesn't seem to contain the Emacs sources.  You should
229 either run the \`${progname}' script at the top of the Emacs source
230 tree, or use the \`--srcdir' option to specify where the Emacs sources
231 are."
232        echo "${short_usage}") >&2
233       exit 1
234     fi
235   ;;
237 esac
239 ### Make the necessary directories, if they don't exist.
240 if [ ! -d ./src ]; then
241   mkdir ./src
243 if [ ! -d ./lib-src ]; then
244   mkdir ./lib-src
246 if [ ! -d ./cpp ]; then
247   mkdir ./cpp
249 if [ ! -d ./oldXMenu ]; then
250   mkdir ./oldXMenu
254 #### Given the configuration name, set machfile and opsysfile to the
255 #### names of the m/*.h and s/*.h files we should use.
257 ### Canonicalize the configuration name.
258 echo "Checking the configuration name."
259 if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
260   exit $?
263 ### If you add support for a new configuration, add code to this
264 ### switch statement to recognize your configuration name and select
265 ### the appropriate operating system and machine description files.
267 ### You would hope that you could choose an m/*.h file pretty much
268 ### based on the machine portion of the configuration name, and an s-
269 ### file based on the operating system portion.  However, it turns out
270 ### that each m/*.h file is pretty manufacturer-specific - for
271 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
272 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
273 ### machines.  So we basically have to have a special case for each
274 ### configuration name.
276 ### As far as handling version numbers on operating systems is
277 ### concerned, make sure things will fail in a fixable way.  If
278 ### /etc/MACHINES doesn't say anything about version numbers, be
279 ### prepared to handle anything reasonably.  If version numbers
280 ### matter, be sure /etc/MACHINES says something about it.
282 ### Eric Raymond says we should accept strings like "sysvr4" to mean
283 ### "System V Release 4"; he writes, "The old convention encouraged
284 ### confusion between `system' and `release' levels'."
286 machine='' opsys='' unported='false'
287 case "${configuration}" in
289   ## Alliant machines
290   ## Strictly speaking, we need the version of the alliant operating
291   ## system to choose the right machine file, but currently the
292   ## configuration name doesn't tell us enough to choose the right
293   ## one; we need to give alliants their own operating system name to
294   ## do this right.  When someone cares, they can help us.
295   fx80-alliant-* )
296     machine=alliant4 opsys=bsd4-2
297   ;;
298   i860-alliant-* )
299     machine=alliant-2800 opsys=bsd4-3
300   ;;
302   ## Altos 3068
303   m68*-altos-sysv* )
304     machine=altos opsys=usg5-2
305   ;;
306     
307   ## Amdahl UTS
308   580-amdahl-sysv* )
309     machine=amdahl opsys=usg5-2-2
310   ;;
312   ## Appallings - I mean, Apollos - running Domain
313   m68*-apollo* )
314     machine=apollo opsysfile=bsd4-2.h
315   ;;
317   ## AT&T 3b2, 3b5, 3b15, 3b20
318   we32k-att-sysv* )
319     machine=att3b opsys=usg5-2-2
320   ;;
322   ## AT&T 3b1 - The Mighty Unix PC!
323   m68*-att-sysv* )
324     machine=7300 opsys=usg5-2-2
325   ;;
327   ## Bull sps7
328   m68*-bull-sysv* )
329     machine=sps7 opsys=usg5-2
330   ;;
332   ## CCI 5/32, 6/32 -- see "Tahoe".
334   ## Celerity
335   ## I don't know what configuration name to use for this; config.sub
336   ## doesn't seem to know anything about it.  Hey, Celerity users, get
337   ## in touch with us!
338   celerity-celerity-bsd* )
339     machine=celerity opsys=bsd4-2
340   ;;
342   ## Clipper
343   ## What operating systems does this chip run that Emacs has been
344   ## tested on?
345   clipper-* )
346     machine=clipper
347     ## We'll use the catch-all code at the bottom to guess the
348     ## operating system.
349   ;;
351   ## Convex
352   *-convex-bsd* )
353     machine=convex opsys=bsd4-3
354   ;;
356   ## Cubix QBx/386
357   i386-cubix-sysv* )
358     machine=intel386 opsys=usg5-3
359   ;;
361   ## Cydra 5
362   cydra*-cydrome-sysv* )
363     machine=cydra5 opsys=usg5-3
364   ;;
366   ## DECstations
367   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0 | mips-dec-bsd4.2 )
368     machine=pmax opsys=bsd4-2
369   ;;
370   mips-dec-ultrix* | mips-dec-bsd* )
371     machine=pmax opsys=bsd4-3
372   ;;
373   mips-dec-osf* )
374     machine=pmax opsys=osf1
375   ;;
377   ## Motorola Delta machines
378   m68*-motorola-sysv* )
379     machine=delta opsys=usg5-3
380   ;;
381   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
382     machine=delta88k opsys=usg5-3
383   ;;
385   ## Dual machines
386   m68*-dual-sysv* )
387     machine=dual opsys=usg5-2
388   ;;
389   m68*-dual-uniplus* )
390     machine=dual opsys=unipl5-2
391   ;;
393   ## Elxsi 6400
394   elxsi-elxsi-sysv* )
395     machine=elxsi opsys=usg5-2
396   ;;
398   ## Encore machines
399   ns16k-encore-bsd* )
400     machine=ns16000 opsys=umax
401   ;;
403   ## The GEC 93 - apparently, this port isn't really finished yet.
405   ## Gould Power Node and NP1
406   pn-gould-bsd4.2 )
407     machine=gould opsys=bsd4-2
408   ;;
409   pn-gould-bsd4.3 )
410     machine=gould opsys=bsd4-3
411   ;;
412   np1-gould-bsd* )
413     machine=gould-np1 opsys=bsd4-3
414   ;;
416   ## Honeywell XPS100
417   xps*-honeywell-sysv* )
418     machine=xps100 opsys=usg5-2
419   ;;
421   ## HP 9000 series 200 or 300
422   m68*-hp-bsd* )
423     machine=hp9000s300 opsys=bsd4-3
424   ;;
425   ## HP/UX 8 doesn't run on these machines, so use HP/UX 7.
426   m68*-hp-hpux* )
427     machine=hp9000s300 opsys=hpux
428   ;;
430   ## HP 9000 series 800, running HP/UX
431   hppa1.0-hp-hpux* )
432     machine=hp9000s800 opsys=hpux
433   ;;
435   ## Orion machines
436   orion-orion-bsd* )
437     machine=orion opsys=bsd4-2
438   ;;
439   clipper-orion-bsd* )
440     machine=orion105 opsys=bsd4-2
441   ;;
443   ## IBM machines
444   i386-ibm-aix1.1 )
445     machine=ibmps2-aix opsys=usg5-2-2
446   ;;
447   i386-ibm-aix1.2 )
448     machine=ibmps2-aix opsys=usg5-3
449   ;;
450   rs6000-ibm-aix3.1 )
451     machine=ibmrs6000 opsys=aix3-1
452   ;;
453   rs6000-ibm-aix3.2 | rs6000-ibm-aix* )
454     machine=ibmrs6000 opsys=aix3-2
455   ;;
456   romp-ibm-bsd* )
457     machine=ibmrt opsys=bsd4-2
458   ;;
459   romp-ibm-aix* )
460     machine=ibmrt-aix opsys=usg5-2-2
461   ;;
463   ## Integrated Solutions `Optimum V'
464   m68*-isi-bsd4.2 )
465     machine=isi-ov opsys=bsd4-2
466   ;;
467   m68*-isi-bsd4.3 )
468     machine=isi-ov opsys=bsd4-3
469   ;;
471   ## Intel 386 machines where we do care about the manufacturer
472   i[34]86-intsys-sysv* )
473     machine=is386 opsys=usg5-2-2
474   ;;
475   ## Intel 386 machines where we don't care about the manufacturer
476   i[34]86-* )
477     machine=intel386
478     case "${configuration}" in
479       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
480       *-isc2.2 )                opsys=isc2-2 ;;
481       *-isc* )                  opsys=isc3-0 ;;
482       *-esix* )                 opsys=esix ;;
483       *-xenix* )                opsys=xenix ;;
484       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
485     esac
486   ;;
488   ## Silicon Graphics machines
489   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
490   m68*-sgi-iris3.5 )
491     machine=irist opsys=iris3-5
492   ;;
493   m68*-sgi-iris3.6 | m68*-sgi-iris*)
494     machine=irist opsys=iris3-6
495   ;;
496   ## Iris 4D
497   mips-sgi-irix3.* )
498     machine=iris4d opsys=irix3-3
499   ;;
500   mips-sgi-irix4.* | mips-sgi-irix* )
501     machine=iris4d opsys=irix4-0
502   ;;
504   ## Masscomp machines
505   m68*-masscomp-rtu )
506     machine=masscomp opsys=rtu
507   ;;
509   ## Megatest machines
510   m68*-megatest-bsd* )
511     machine=mega68 opsys=bsd4-2
512   ;;
514   ## Workstations sold by MIPS
515   ## This is not necessarily all workstations using the MIPS processor -
516   ## Irises are produced by SGI, and DECstations by DEC.
518   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
519   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
520   ## it gives for choosing between the alternatives seems to be "Use
521   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
522   ## the BSD world."  I'll assume that these are instructions for
523   ## handling two odd situations, and that every other situation
524   ## should use mips.h and usg5-2-2, they being listed first.
525   mips-mips-riscos4* )
526     machine=mips4 opsys=usg5-2-2
527   ;;
528   mips-mips-bsd* )
529     machine=mips opsys=bsd4-3
530   ;;
531   mips-mips-* )
532     machine=mips opsys=usg5-2-2
533   ;;
535   ## The complete machine from National Semiconductor
536   ns32k-ns-genix* )
537     machine=ns32000 opsys=usg5-2
538   ;;
540   ## NCR machines
541   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
542     machine=tower32 opsys=usg5-2-2
543   ;;
544   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
545     machine=tower32v3 opsys=usg5-3
546   ;;
548   ## Nixdorf Targon 31
549   m68*-nixdorf-sysv* )
550     machine=targon31 opsys=usg5-2-2
551   ;;
553   ## Nu (TI or LMI)
554   m68*-nu-sysv* )
555     machine=nu opsys=usg5-2
556   ;;
558   ## Plexus
559   m68*-plexus-sysv* )
560     machine=plexus opsys=usg5-2
561   ;;
563   ## Prime EXL
564   i386-prime-sysv* )
565     machine=i386 opsys=usg5-3
566   ;;
568   ## Pyramid machines
569   ## I don't really have any idea what sort of processor the Pyramid has,
570   ## so I'm assuming it is its own architecture.
571   pyramid-pyramid-bsd* )
572     machine=pyramid opsys=bsd4-2
573   ;;
575   ## Sequent Balance
576   ns32k-sequent-bsd4.2 )
577     machine=sequent opsys=bsd4-2
578   ;;
579   ns32k-sequent-bsd4.3 )
580     machine=sequent opsys=bsd4-3
581   ;;
582   ## Sequent Symmetry
583   i386-sequent-bsd* )
584     machine=symmetry opsys=bsd4-3
585   ;;
587   ## SONY machines
588   m68*-sony-bsd4.2 )
589     machine=news opsys=bsd4-2
590   ;;
591   m68*-sony-bsd4.3 )
592     machine=news opsys=bsd4-3
593   ;;
594   mips-sony-bsd* )
595     machine=news-risc opsys=bsd4-3
596   ;;
598   ## Stride
599   m68*-stride-sysv* )
600     machine=stride opsys=usg5-2
601   ;;
603   ## Suns
604   *-sun-sunos* | *-sun-bsd* )
605     case "${configuration}" in
606       m68*-sunos1* )    machine=sun1 ;;
607       m68*-sunos2* )    machine=sun2 ;;
608       m68* )            machine=sun3 ;;
609       i[34]86* )        machine=sun386 ;;
610       sparc* )          machine=sparc ;;
611       * )               unported=true ;;
612     esac
613     case "${configuration}" in
614       *-sunos4.0*         ) opsys=sunos4-0 ;;
615       *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
616       *                   ) opsys=bsd4-2   ;;
617     esac
618   ;;
620   ## Tadpole 68k
621   m68*-tadpole-sysv* )
622     machine=tad68k opsys=usg5-3
623   ;;
625   ## Tahoe machines
626   tahoe-tahoe-bsd4.2 )
627     machine=tahoe opsys=bsd4-2
628   ;;
629   tahoe-tahoe-bsd4.3 )
630     machine=tahoe opsys=bsd4-3
631   ;;
633   ## Tandem Integrity S2
634   mips-tandem-sysv* )
635     machine=tandem-s2 opsys=usg5-3
636   ;;
638   ## Tektronix 16000 box (6130?)
639   ns16k-tektronix-bsd* )
640     machine=ns16000 opsys=bsd4-2
641   ;;
642   ## Tektronix 4300
643   ## src/m/tek4300.h hints that this is a m68k machine.
644   m68*-tektronix-bsd* )
645     machine=tex4300 opsys=bsd4-3
646   ;;
648   ## Titan P2 or P3
649   ## We seem to have lost the machine-description file titan.h!
650   titan-titan-sysv* )
651     machine=titan opsys=usg5-3
652   ;;
653   
654   ## Ustation E30 (SS5E)
655   m68*-unisys-uniplus* )
656     machine=ustation opsystem=unipl5-2
657   ;;
659   ## Vaxen.
660   vax-dec-* )
661     machine=vax
662     case "${configuration}" in
663       *-bsd4.1 )                                        opsys=bsd4-1 ;;
664       *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 )        opsys=bsd4-2 ;;
665       *-bsd4.3 | *-ultrix* )                            opsys=bsd4-3 ;;
666       *-sysv[01]* | *-sysvr[01]* )                      opsys=usg5-0 ;;
667       *-sysv2* | *-sysvr2* )                            opsys=usg5-2 ;;
668       *-vms* )                                          opsys=vms ;;
669       * )                                               unported=true
670     esac
671   ;;
673   ## Whitechapel MG1
674   ns16k-whitechapel-* )
675     machine=mg1
676     ## We don't know what sort of OS runs on these; we'll let the
677     ## operating system guessing code below try.
678   ;;
680   ## Wicat
681   m68*-wicat-sysv* )
682     machine=wicat opsys=usg5-2
683   ;;
685   * )
686     unported=true
687   ;;
688 esac
690 ### If the code above didn't choose an operating system, just choose
691 ### an operating system based on the configuration name.  You really
692 ### only want to use this when you have no idea what the right
693 ### operating system is; if you know what operating systems a machine
694 ### runs, it's cleaner to make it explicit in the case statement
695 ### above.
696 if [ ! "${opsys}" ]; then
697   case "${configuration}" in
698     *-bsd4.[01] )       opsys=bsd4-1 ;;
699     *-bsd4.2 )          opsys=bsd4-2 ;;
700     *-bsd4.3 )          opsys=bsd4-3 ;;
701     *-sysv0 | *-sysvr0 )                opsys=usg5-0 ;;
702     *-sysv2 | *-sysvr2 )                opsys=usg5-2 ;;
703     *-sysv2.2 | *-sysvr2.2 )            opsys=usg5-2-2 ;;
704     *-sysv3 | *-sysvr3 )                opsys=usg5-3 ;;
705     *-sysv4 | *-sysvr4 )                opsys=usg5-4 ;;
706     * )
707       unported=true
708     ;;
709   esac
712 if $unported ; then
713   (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
714    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
715   ) >&2
716   exit 1
719 machfile="m/${machine}.h"
720 opsysfile="s/${opsys}.h"
723 #### Choose a window system.
724 echo "Checking window system."
725 window_system=''
726 case "${with_x}" in
727   yes )
728     window_system=${window_system}x11
729   ;;
730   no )
731     window_system=${window_system}none
732 esac
733 case "${with_x11}" in
734   yes )
735     window_system=${window_system}x11
736   ;;
737 esac
738 case "${with_x10}" in
739   yes )
740     window_system=${window_system}x10
741   ;;
742 esac
744 case "${window_system}" in
745   "none" | "x11" | "x10" ) ;;
746   "" )
747     echo "  No window system specifed.  Looking for X Windows."
748     window_system=none
749     if [ -r /usr/lib/libX11.a -o -d /usr/include/X11 ]; then
750       window_system=x11
751     fi
752   ;;
753   * )
754     echo "Don\'t specify the window system more than once." >&2
755     exit 1
756   ;;
757 esac
759 case "${window_system}" in
760   x11 )
761     HAVE_X_WINDOWS=yes
762     HAVE_X11=yes
763     echo "  Using X11."
764   ;;
765   x10 )
766     HAVE_X_WINDOWS=yes
767     HAVE_X11=no
768     echo "  Using X10."
769   ;;
770   none )
771     HAVE_X_WINDOWS=no
772     HAVE_X11=no
773     echo "  Using no window system."
774   ;;
775 esac
777 ### If we're using X11, we should use the X menu package.
778 HAVE_X_MENU=no
779 case ${HAVE_X11} in
780   yes )
781     HAVE_X_MENU=yes
782   ;;
783 esac
786 #### Choose a compiler.
787 echo "Checking compilers."
788 if [ "${with_gcc}" = "" ]; then
789   echo "  Searching load path for GCC."
790   temppath=`echo $PATH | sed 's/^:/.:/
791                               s/::/:.:/g
792                               s/:$/:./
793                               s/:/ /g'`
794   default_cc=`(
795     for dir in ${temppath}; do
796       if [ -f ${dir}/gcc ]; then echo gcc; exit 0; fi
797     done
798     echo cc
799   )`
800 else
801   case ${with_gcc} in
802     "yes" ) default_cc="gcc" ;;
803     "no"  ) default_cc="cc"  ;;
804   esac
807 case "${default_cc}" in
808   "gcc" )
809     echo "  Using GCC."
810     default_cflags='-g -O'
811   ;;
812   * )
813     echo "  Using the system's CC."
814     default_cflags='-g'
815   ;;
816 esac
819 #### Does this compiler support the `const' keyword?
820 #### The code for this test was adapted from autoconf's test.
821 echo "Checking if the compiler supports \`const'."
822 rm -f conftest*
823 compile='${default_cc} conftest.c -o conftest >/dev/null 2>&1'
824 echo "
825 main() { exit(0); } t() { /* Ultrix mips cc rejects this.  */
826 typedef int charset[2]; const charset x;
827 /* SunOS 4.1.1 cc rejects this. */
828 char const *const *p;
829 char **p2;
830 /* HPUX 7.0 cc rejects these. */
831 ++p;
832 p2 = (char const* const*) p;
833  }" > conftest.c
834 if eval $compile; then
835   echo "  It seems to."
836   HAVE_CONST=yes
837 else
838   echo "  It doesn't seem to."
839   HAVE_CONST=no
841 rm -f conftest*
843 #### What is the return type of a signal handler?
845 ### We run /usr/include/signal.h through cpp and grep for the
846 ### declaration of the signal function.  Yuck.
847 echo "Looking for return type of signal handler functions."
848 signal_h_file=''
849 if [ -r /usr/include/signal.h ]; then
850   signal_h_file=/usr/include/signal.h
851 elif [ -r /usr/include/sys/signal.h ]; then
852   signal_h_file=/usr/include/sys/signal.h
854 SIGTYPE=void
855 if [ "${signal_h_file}" ]; then
856   sigpattern='[         ]*([    ]*\*[   ]*signal[       ]*('
858   ## We make a copy whose name ends in .c, so the compiler
859   ## won't complain about having only been given a .h file.
860   tempcname="configure.tmp.$$.c"
861   cp ${signal_h_file}  ${tempcname}
862   if ${default_cc} -E ${tempcname} | grep "int${sigpattern}" > /dev/null; then
863     SIGTYPE=int
864   fi
865   rm -f ${tempcname}
867 echo "  Guessing that signals return \`${SIGTYPE}'."
870 #### Extract some information from the operating system and machine files.
872 echo "Examining the machine- and system-dependent files to find out"
873 echo " - which libraries the lib-src programs will want, and"
874 echo " - whether the GNU malloc routines are usable."
875 tempcname="configure.tmp.$$.c"
876 echo '
877 #include "'${srcdir}'/src/'${opsysfile}'"
878 #include "'${srcdir}'/src/'${machfile}'"
879 #ifndef LIBS_MACHINE
880 #define LIBS_MACHINE
881 #endif
882 #ifndef LIBS_SYSTEM
883 #define LIBS_SYSTEM
884 #endif
885 @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
886 #ifdef SYSTEM_MALLOC
887 @configure@ system_malloc=yes
888 #else
889 @configure@ system_malloc=no
890 #endif
891 ' > ${tempcname}
892 eval `${default_cc} -E ${tempcname} \
893       | grep '@configure@' \
894       | sed -e 's/^@configure@//'`
895 rm ${tempcname}
897 # Do the opsystem or machine files prohibit the use of the GNU malloc?
898 # Assume not, until told otherwise.
899 GNU_MALLOC=yes
900 if [ "${system_malloc}" = "yes" ]; then
901   GNU_MALLOC=no
902   GNU_MALLOC_reason="
903   (The GNU allocators don't work with this system configuration.)"
906 if [ ! "${REL_ALLOC}" ]; then
907   REL_ALLOC=${GNU_MALLOC}
910 LISP_FLOAT_TYPE=yes
913 #### Find out which version of Emacs this is.
914 version=`grep 'defconst[         ]*emacs-version' ${srcdir}/lisp/version.el \
915          | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
916 if [ ! "${version}" ]; then
917   echo "${progname}: can't find current emacs version in
918         \`${srcdir}/lisp/version.el'." >&2
919   exit 1
923 #### Make the proper settings in `src/config.h'.
924 rm -f config.status
925 set -e
927 echo "Making \`./src/config.h' from \`${srcdir}/src/config.h.in'."
928 sed_flags="-e 's:@machine@:${machfile}:' -e 's:@opsystem@:${opsysfile}:'"
930 for flag in ${config_h_opts}; do
931   val=`eval echo '$'${flag}`
932   case ${val} in
933     no | "")
934       f="-e 's:.*#define ${flag}.*:/\\* #define ${flag} \\*/:'"
935     ;;
936     yes)
937       f="-e 's:.*#define ${flag}.*:#define ${flag}:'"
938     ;;
939     *)
940       f="-e 's:.*#define ${flag}.*:#define ${flag} ${val}:'"
941     ;;
942   esac
943   sed_flags="${sed_flags} ${f}"
944 done
946 rm -f ./src/config.h.tmp
947 (echo "/* This file is generated by \`${progname}' from"
948  echo "   \`${srcdir}/src/config.h.in'."
949  echo "   If you are thinking about editing it, you should seriously consider"
950  echo "   running \`${progname} instead, or editing"
951  echo "   \`${srcdir}/src/config.h.in' itself." 
952  eval '/bin/sed '${sed_flags}' < "${srcdir}/src/config.h.in"'
953 ) > src/config.h.tmp
954 ${srcdir}/move-if-change src/config.h.tmp src/config.h
955 ### Remind people not to edit this.
956 chmod -w src/config.h
959 #### Modify the parameters in the top-level Makefile.
960 echo "Producing \`Makefile' from \`${srcdir}/Makefile.in'."
961 rm -f Makefile.tmp
962 (echo "\
963 # This file is generated by \`${progname}' from
964 # \`${srcdir}/Makefile.in'.
965 # If you are thinking about editing it, you should seriously consider
966 # running \`${progname}' instead, or editing
967 # \`${srcdir}/Makefile.in' itself."
968  /bin/sed < ${srcdir}/Makefile.in                               \
969  -e 's|^configname *=.*$|configname='"${configuration}"'|'      \
970  -e 's|^version *=.*$|version='"${version}"'|'          \
971  -e 's|^srcdir *=.*$|srcdir='"${srcdir}"'|'                     \
972  -e 's|^CC *=.*$|CC='"${default_cc}"'|'                 \
973  -e 's|^CONFIG_CFLAGS *=.*$|CONFIG_CFLAGS='"${default_cflags}"'|'       \
974  -e 's|^LOADLIBES *=.*$|LOADLIBES='"${libsrc_libs}"'|'  \
975  -e '/^# DIST: /d') > Makefile.tmp
976 ${srcdir}/move-if-change Makefile.tmp Makefile
978 ### I'm commenting out this section until I bring the `build-install' script
979 ### into line with the rest of the configuration stuff.
981 ### # Modify the parameters in the `build-install' script.
982 ### echo "Producing \`./build-install' from \`${srcdir}/build-install.in'."
983 ### rm -f ./build-install.tmp
984 ### (echo "\
985 ### # This file is generated by \`${progname}' from \`${srcdir}/build-install.in'.
986 ### # If you are thinking about editing it, you should seriously consider
987 ### # editing \`./build-install.in' itself, or running \`${progname}' instead."
988 ###  /bin/sed < ${srcdir}/build-install.in                      \
989 ###  -e 's;^\(prefix=\).*$;\1'"${prefix};"                      \
990 ###  -e 's;^\(bindir=\).*$;\1'"${bindir};"                      \
991 ###  -e 's;^\(lisppath=\).*$;\1'"${lisppath};"          \
992 ###  -e 's;^\(datadir=\).*$;\1'"${datadir};"            \
993 ###  -e 's;^\(lockdir=\).*$;\1'"${lockdir};"            \
994 ###  -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install.tmp
995 ### ${srcdir}/move-if-change build-install.tmp build-install
996 ### # Remind people not to edit this.
997 ### chmod -w build-install
998 ### chmod +x build-install
1001 #### Describe the results.
1003 ### Create a verbal description of what we have done.
1004 message="Configured for \`${configuration}'.
1006   What operating system and machine description files should Emacs use?
1007         \`${opsysfile}' and \`${machfile}'
1008   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
1009   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
1010   What window system should Emacs use?                    ${window_system}
1011   What compiler should emacs be built with?               ${default_cc}
1012   Should the compilation use \`-g' and/or \`-O'?            ${default_cflags-neither}"
1014 ### Write config.status, documenting the damage we have done.
1016 (echo "\
1017 #!/bin/sh
1018 ### This file is generated by \`${progname}.'
1019 ### If you are thinking about editing it, you should seriously consider
1020 ### running \`${progname}' instead.
1022  echo "${message}" | sed -e 's/^/# /'
1023  echo "exec '${progname}' ${arguments} "'$@') > config.status
1025 ### Remind people not to edit this.
1026 chmod -w config.status
1027 chmod +x config.status
1029 ### Print the description.
1030 echo
1031 echo "${message}"
1033 exit 0