Added library headers.
[emacs.git] / configure1.in
blob20f65f98244b23d82a9e06576fa071de98d7fb2c
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-aix* )
451     machine=ibmrs6000 opsys=aix3-1
452   ;;
453   romp-ibm-bsd* )
454     machine=ibmrt opsys=bsd4-2
455   ;;
456   romp-ibm-aix* )
457     machine=ibmrt-aix opsys=usg5-2-2
458   ;;
460   ## Integrated Solutions `Optimum V'
461   m68*-isi-bsd4.2 )
462     machine=isi-ov opsys=bsd4-2
463   ;;
464   m68*-isi-bsd4.3 )
465     machine=isi-ov opsys=bsd4-3
466   ;;
468   ## Intel 386 machines where we do care about the manufacturer
469   i[34]86-intsys-sysv* )
470     machine=is386 opsys=usg5-2-2
471   ;;
472   ## Intel 386 machines where we don't care about the manufacturer
473   i[34]86-* )
474     machine=intel386
475     case "${configuration}" in
476       *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
477       *-isc2.2 )                opsys=isc2-2 ;;
478       *-isc* )                  opsys=isc3-0 ;;
479       *-esix* )                 opsys=esix ;;
480       *-xenix* )                opsys=xenix ;;
481       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
482     esac
483   ;;
485   ## Silicon Graphics machines
486   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
487   m68*-sgi-iris3.5 )
488     machine=irist opsys=iris3-5
489   ;;
490   m68*-sgi-iris3.6 | m68*-sgi-iris*)
491     machine=irist opsys=iris3-6
492   ;;
493   ## Iris 4D
494   mips-sgi-irix3.* )
495     machine=iris4d opsys=irix3-3
496   ;;
497   mips-sgi-irix4.* | mips-sgi-irix* )
498     machine=iris4d opsys=irix4-0
499   ;;
501   ## Masscomp machines
502   m68*-masscomp-rtu )
503     machine=masscomp opsys=rtu
504   ;;
506   ## Megatest machines
507   m68*-megatest-bsd* )
508     machine=mega68 opsys=bsd4-2
509   ;;
511   ## Workstations sold by MIPS
512   ## This is not necessarily all workstations using the MIPS processor -
513   ## Irises are produced by SGI, and DECstations by DEC.
515   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
516   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
517   ## it gives for choosing between the alternatives seems to be "Use
518   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
519   ## the BSD world."  I'll assume that these are instructions for
520   ## handling two odd situations, and that every other situation
521   ## should use mips.h and usg5-2-2, they being listed first.
522   mips-mips-riscos4* )
523     machine=mips4 opsys=usg5-2-2
524   ;;
525   mips-mips-bsd* )
526     machine=mips opsys=bsd4-3
527   ;;
528   mips-mips-* )
529     machine=mips opsys=usg5-2-2
530   ;;
532   ## The complete machine from National Semiconductor
533   ns32k-ns-genix* )
534     machine=ns32000 opsys=usg5-2
535   ;;
537   ## NCR machines
538   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
539     machine=tower32 opsys=usg5-2-2
540   ;;
541   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
542     machine=tower32v3 opsys=usg5-3
543   ;;
545   ## Nixdorf Targon 31
546   m68*-nixdorf-sysv* )
547     machine=targon31 opsys=usg5-2-2
548   ;;
550   ## Nu (TI or LMI)
551   m68*-nu-sysv* )
552     machine=nu opsys=usg5-2
553   ;;
555   ## Plexus
556   m68*-plexus-sysv* )
557     machine=plexus opsys=usg5-2
558   ;;
560   ## Prime EXL
561   i386-prime-sysv* )
562     machine=i386 opsys=usg5-3
563   ;;
565   ## Pyramid machines
566   ## I don't really have any idea what sort of processor the Pyramid has,
567   ## so I'm assuming it is its own architecture.
568   pyramid-pyramid-bsd* )
569     machine=pyramid opsys=bsd4-2
570   ;;
572   ## Sequent Balance
573   ns32k-sequent-bsd4.2 )
574     machine=sequent opsys=bsd4-2
575   ;;
576   ns32k-sequent-bsd4.3 )
577     machine=sequent opsys=bsd4-3
578   ;;
579   ## Sequent Symmetry
580   i386-sequent-bsd* )
581     machine=symmetry opsys=bsd4-3
582   ;;
584   ## SONY machines
585   m68*-sony-bsd4.2 )
586     machine=news opsys=bsd4-2
587   ;;
588   m68*-sony-bsd4.3 )
589     machine=news opsys=bsd4-3
590   ;;
591   mips-sony-bsd* )
592     machine=news-risc opsys=bsd4-3
593   ;;
595   ## Stride
596   m68*-stride-sysv* )
597     machine=stride opsys=usg5-2
598   ;;
600   ## Suns
601   *-sun-sunos* | *-sun-bsd* )
602     case "${configuration}" in
603       m68*-sunos1* )    machine=sun1 ;;
604       m68*-sunos2* )    machine=sun2 ;;
605       m68* )            machine=sun3 ;;
606       i[34]86* )        machine=sun386 ;;
607       sparc* )          machine=sparc ;;
608       * )               unported=true ;;
609     esac
610     case "${configuration}" in
611       *-sunos4.0*         ) opsys=sunos4-0 ;;
612       *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
613       *                   ) opsys=bsd4-2   ;;
614     esac
615   ;;
617   ## Tadpole 68k
618   m68*-tadpole-sysv* )
619     machine=tad68k opsys=usg5-3
620   ;;
622   ## Tahoe machines
623   tahoe-tahoe-bsd4.2 )
624     machine=tahoe opsys=bsd4-2
625   ;;
626   tahoe-tahoe-bsd4.3 )
627     machine=tahoe opsys=bsd4-3
628   ;;
630   ## Tandem Integrity S2
631   mips-tandem-sysv* )
632     machine=tandem-s2 opsys=usg5-3
633   ;;
635   ## Tektronix 16000 box (6130?)
636   ns16k-tektronix-bsd* )
637     machine=ns16000 opsys=bsd4-2
638   ;;
639   ## Tektronix 4300
640   ## src/m/tek4300.h hints that this is a m68k machine.
641   m68*-tektronix-bsd* )
642     machine=tex4300 opsys=bsd4-3
643   ;;
645   ## Titan P2 or P3
646   ## We seem to have lost the machine-description file titan.h!
647   titan-titan-sysv* )
648     machine=titan opsys=usg5-3
649   ;;
650   
651   ## Ustation E30 (SS5E)
652   m68*-unisys-uniplus* )
653     machine=ustation opsystem=unipl5-2
654   ;;
656   ## Vaxen.
657   vax-dec-* )
658     machine=vax
659     case "${configuration}" in
660       *-bsd4.1 )                                        opsys=bsd4-1 ;;
661       *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 )        opsys=bsd4-2 ;;
662       *-bsd4.3 | *-ultrix* )                            opsys=bsd4-3 ;;
663       *-sysv[01]* | *-sysvr[01]* )                      opsys=usg5-0 ;;
664       *-sysv2* | *-sysvr2* )                            opsys=usg5-2 ;;
665       *-vms* )                                          opsys=vms ;;
666       * )                                               unported=true
667     esac
668   ;;
670   ## Whitechapel MG1
671   ns16k-whitechapel-* )
672     machine=mg1
673     ## We don't know what sort of OS runs on these; we'll let the
674     ## operating system guessing code below try.
675   ;;
677   ## Wicat
678   m68*-wicat-sysv* )
679     machine=wicat opsys=usg5-2
680   ;;
682   * )
683     unported=true
684   ;;
685 esac
687 ### If the code above didn't choose an operating system, just choose
688 ### an operating system based on the configuration name.  You really
689 ### only want to use this when you have no idea what the right
690 ### operating system is; if you know what operating systems a machine
691 ### runs, it's cleaner to make it explicit in the case statement
692 ### above.
693 if [ ! "${opsys}" ]; then
694   case "${configuration}" in
695     *-bsd4.[01] )       opsys=bsd4-1 ;;
696     *-bsd4.2 )          opsys=bsd4-2 ;;
697     *-bsd4.3 )          opsys=bsd4-3 ;;
698     *-sysv0 | *-sysvr0 )                opsys=usg5-0 ;;
699     *-sysv2 | *-sysvr2 )                opsys=usg5-2 ;;
700     *-sysv2.2 | *-sysvr2.2 )            opsys=usg5-2-2 ;;
701     *-sysv3 | *-sysvr3 )                opsys=usg5-3 ;;
702     *-sysv4 | *-sysvr4 )                opsys=usg5-4 ;;
703     * )
704       unported=true
705     ;;
706   esac
709 if $unported ; then
710   (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
711    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
712   ) >&2
713   exit 1
716 machfile="m/${machine}.h"
717 opsysfile="s/${opsys}.h"
720 #### Choose a window system.
721 echo "Checking window system."
722 window_system=''
723 case "${with_x}" in
724   yes )
725     window_system=${window_system}x11
726   ;;
727   no )
728     window_system=${window_system}none
729 esac
730 case "${with_x11}" in
731   yes )
732     window_system=${window_system}x11
733   ;;
734 esac
735 case "${with_x10}" in
736   yes )
737     window_system=${window_system}x10
738   ;;
739 esac
741 case "${window_system}" in
742   "none" | "x11" | "x10" ) ;;
743   "" )
744     echo "  No window system specifed.  Looking for X Windows."
745     window_system=none
746     if [ -r /usr/lib/libX11.a -o -d /usr/include/X11 ]; then
747       window_system=x11
748     fi
749   ;;
750   * )
751     echo "Don\'t specify the window system more than once." >&2
752     exit 1
753   ;;
754 esac
756 case "${window_system}" in
757   x11 )
758     HAVE_X_WINDOWS=yes
759     HAVE_X11=yes
760     echo "  Using X11."
761   ;;
762   x10 )
763     HAVE_X_WINDOWS=yes
764     HAVE_X11=no
765     echo "  Using X10."
766   ;;
767   none )
768     HAVE_X_WINDOWS=no
769     HAVE_X11=no
770     echo "  Using no window system."
771   ;;
772 esac
774 ### If we're using X11, we should use the X menu package.
775 HAVE_X_MENU=no
776 case ${HAVE_X11} in
777   yes )
778     HAVE_X_MENU=yes
779   ;;
780 esac
783 #### Choose a compiler.
784 echo "Checking compilers."
785 if [ "${with_gcc}" = "" ]; then
786   echo "  Searching load path for GCC."
787   temppath=`echo $PATH | sed 's/^:/.:/
788                               s/::/:.:/g
789                               s/:$/:./
790                               s/:/ /g'`
791   default_cc=`(
792     for dir in ${temppath}; do
793       if [ -f ${dir}/gcc ]; then echo gcc; exit 0; fi
794     done
795     echo cc
796   )`
797 else
798   case ${with_gcc} in
799     "yes" ) default_cc="gcc" ;;
800     "no"  ) default_cc="cc"  ;;
801   esac
804 case "${default_cc}" in
805   "gcc" )
806     echo "  Using GCC."
807     default_cflags='-g -O'
808   ;;
809   * )
810     echo "  Using the system's CC."
811     default_cflags='-g'
812   ;;
813 esac
816 #### Does this compiler support the `const' keyword?
817 #### The code for this test was adapted from autoconf's test.
818 echo "Checking if the compiler supports \`const'."
819 rm -f conftest*
820 compile='${default_cc} conftest.c -o conftest >/dev/null 2>&1'
821 echo "
822 main() { exit(0); } t() { /* Ultrix mips cc rejects this.  */
823 typedef int charset[2]; const charset x;
824 /* SunOS 4.1.1 cc rejects this. */
825 char const *const *p;
826 char **p2;
827 /* HPUX 7.0 cc rejects these. */
828 ++p;
829 p2 = (char const* const*) p;
830  }" > conftest.c
831 if eval $compile; then
832   echo "  It seems to."
833   HAVE_CONST=yes
834 else
835   echo "  It doesn't seem to."
836   HAVE_CONST=no
838 rm -f conftest*
840 #### What is the return type of a signal handler?
842 ### We run /usr/include/signal.h through cpp and grep for the
843 ### declaration of the signal function.  Yuck.
844 echo "Looking for return type of signal handler functions."
845 signal_h_file=''
846 if [ -r /usr/include/signal.h ]; then
847   signal_h_file=/usr/include/signal.h
848 elif [ -r /usr/include/sys/signal.h ]; then
849   signal_h_file=/usr/include/sys/signal.h
851 SIGTYPE=void
852 if [ "${signal_h_file}" ]; then
853   sigpattern='[         ]*([    ]*\*[   ]*signal[       ]*('
855   ## We make a copy whose name ends in .c, so the compiler
856   ## won't complain about having only been given a .h file.
857   tempcname="configure.tmp.$$.c"
858   cp ${signal_h_file}  ${tempcname}
859   if ${default_cc} -E ${tempcname} | grep "int${sigpattern}" > /dev/null; then
860     SIGTYPE=int
861   fi
862   rm -f ${tempcname}
864 echo "  Guessing that signals return \`${SIGTYPE}'."
867 #### Extract some information from the operating system and machine files.
869 echo "Examining the machine- and system-dependent files to find out"
870 echo " - which libraries the lib-src programs will want, and"
871 echo " - whether the GNU malloc routines are usable."
872 tempcname="configure.tmp.$$.c"
873 echo '
874 #include "'${srcdir}'/src/'${opsysfile}'"
875 #include "'${srcdir}'/src/'${machfile}'"
876 #ifndef LIBS_MACHINE
877 #define LIBS_MACHINE
878 #endif
879 #ifndef LIBS_SYSTEM
880 #define LIBS_SYSTEM
881 #endif
882 @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
883 #ifdef SYSTEM_MALLOC
884 @configure@ system_malloc=yes
885 #else
886 @configure@ system_malloc=no
887 #endif
888 ' > ${tempcname}
889 eval `${default_cc} -E ${tempcname} \
890       | grep '@configure@' \
891       | sed -e 's/^@configure@//'`
892 rm ${tempcname}
894 # Do the opsystem or machine files prohibit the use of the GNU malloc?
895 # Assume not, until told otherwise.
896 GNU_MALLOC=yes
897 if [ "${system_malloc}" = "yes" ]; then
898   GNU_MALLOC=no
899   GNU_MALLOC_reason="
900   (The GNU allocators don't work with this system configuration.)"
903 if [ ! "${REL_ALLOC}" ]; then
904   REL_ALLOC=${GNU_MALLOC}
907 LISP_FLOAT_TYPE=yes
910 #### Find out which version of Emacs this is.
911 version=`grep 'defconst[         ]*emacs-version' ${srcdir}/lisp/version.el \
912          | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
913 if [ ! "${version}" ]; then
914   echo "${progname}: can't find current emacs version in
915         \`${srcdir}/lisp/version.el'." >&2
916   exit 1
920 #### Make the proper settings in `src/config.h'.
921 rm -f config.status
922 set -e
924 echo "Making \`./src/config.h' from \`${srcdir}/src/config.h.in'."
925 sed_flags="-e 's:@machine@:${machfile}:' -e 's:@opsystem@:${opsysfile}:'"
927 for flag in ${config_h_opts}; do
928   val=`eval echo '$'${flag}`
929   case ${val} in
930     no | "")
931       f="-e 's:.*#define ${flag}.*:/\\* #define ${flag} \\*/:'"
932     ;;
933     yes)
934       f="-e 's:.*#define ${flag}.*:#define ${flag}:'"
935     ;;
936     *)
937       f="-e 's:.*#define ${flag}.*:#define ${flag} ${val}:'"
938     ;;
939   esac
940   sed_flags="${sed_flags} ${f}"
941 done
943 rm -f ./src/config.h.tmp
944 (echo "/* This file is generated by \`${progname}' from"
945  echo "   \`${srcdir}/src/config.h.in'."
946  echo "   If you are thinking about editing it, you should seriously consider"
947  echo "   running \`${progname} instead, or editing"
948  echo "   \`${srcdir}/src/config.h.in' itself." 
949  eval '/bin/sed '${sed_flags}' < "${srcdir}/src/config.h.in"'
950 ) > src/config.h.tmp
951 ${srcdir}/move-if-change src/config.h.tmp src/config.h
952 ### Remind people not to edit this.
953 chmod -w src/config.h
956 #### Modify the parameters in the top-level Makefile.
957 echo "Producing \`Makefile' from \`${srcdir}/Makefile.in'."
958 rm -f Makefile.tmp
959 (echo "\
960 # This file is generated by \`${progname}' from
961 # \`${srcdir}/Makefile.in'.
962 # If you are thinking about editing it, you should seriously consider
963 # running \`${progname}' instead, or editing
964 # \`${srcdir}/Makefile.in' itself."
965  /bin/sed < ${srcdir}/Makefile.in                               \
966  -e 's|^configname *=.*$|configname='"${configuration}"'|'      \
967  -e 's|^version *=.*$|version='"${version}"'|'          \
968  -e 's|^srcdir *=.*$|srcdir='"${srcdir}"'|'                     \
969  -e 's|^CC *=.*$|CC='"${default_cc}"'|'                 \
970  -e 's|^CONFIG_CFLAGS *=.*$|CONFIG_CFLAGS='"${default_cflags}"'|'       \
971  -e 's|^LOADLIBES *=.*$|LOADLIBES='"${libsrc_libs}"'|'  \
972  -e '/^# DIST: /d') > Makefile.tmp
973 ${srcdir}/move-if-change Makefile.tmp Makefile
975 ### I'm commenting out this section until I bring the `build-install' script
976 ### into line with the rest of the configuration stuff.
978 ### # Modify the parameters in the `build-install' script.
979 ### echo "Producing \`./build-install' from \`${srcdir}/build-install.in'."
980 ### rm -f ./build-install.tmp
981 ### (echo "\
982 ### # This file is generated by \`${progname}' from \`${srcdir}/build-install.in'.
983 ### # If you are thinking about editing it, you should seriously consider
984 ### # editing \`./build-install.in' itself, or running \`${progname}' instead."
985 ###  /bin/sed < ${srcdir}/build-install.in                      \
986 ###  -e 's;^\(prefix=\).*$;\1'"${prefix};"                      \
987 ###  -e 's;^\(bindir=\).*$;\1'"${bindir};"                      \
988 ###  -e 's;^\(lisppath=\).*$;\1'"${lisppath};"          \
989 ###  -e 's;^\(datadir=\).*$;\1'"${datadir};"            \
990 ###  -e 's;^\(lockdir=\).*$;\1'"${lockdir};"            \
991 ###  -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install.tmp
992 ### ${srcdir}/move-if-change build-install.tmp build-install
993 ### # Remind people not to edit this.
994 ### chmod -w build-install
995 ### chmod +x build-install
998 #### Describe the results.
1000 ### Create a verbal description of what we have done.
1001 message="Configured for \`${configuration}'.
1003   What operating system and machine description files should Emacs use?
1004         \`${opsysfile}' and \`${machfile}'
1005   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
1006   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
1007   What window system should Emacs use?                    ${window_system}
1008   What compiler should emacs be built with?               ${default_cc}
1009   Should the compilation use \`-g' and/or \`-O'?            ${default_cflags-neither}"
1011 ### Write config.status, documenting the damage we have done.
1013 (echo "\
1014 #!/bin/sh
1015 ### This file is generated by \`${progname}.'
1016 ### If you are thinking about editing it, you should seriously consider
1017 ### running \`${progname}' instead.
1019  echo "${message}" | sed -e 's/^/# /'
1020  echo "exec '${progname}' ${arguments} "'$@') > config.status
1022 ### Remind people not to edit this.
1023 chmod -w config.status
1024 chmod +x config.status
1026 ### Print the description.
1027 echo
1028 echo "${message}"
1030 exit 0