(event-basic-type): New function.
[bpt/emacs.git] / configure1.in
1
2 ### The above line is deliberately left blank. If it starts with a #,
3 ### some CSH's will think this is a csh script.
4
5 #### Configuration script for GNU Emacs
6 #### Copyright (C) 1992 Free Software Foundation, Inc.
7
8 ### This file is part of GNU Emacs.
9
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.
14
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.
19
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.
23
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.
32 ###
33
34
35 ### Remove any leading "." elements from the path name. If we don't
36 ### remove them, then another "./" will be prepended to the file name
37 ### each time we use config.status, and the program name will get larger
38 ### and larger. This wouldn't be a problem, except that since progname
39 ### gets recorded in all the Makefiles this script produces,
40 ### move-if-change thinks they're different when they're 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:^\./::'`"
47
48
49 #### Usage messages.
50
51 short_usage="Type \`${progname} --usage' for more information about options."
52
53 long_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
54
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'.
62
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'.
66
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.
72
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.
76
77 If successful, ${progname} leaves its status in config.status. If
78 unsuccessful after disturbing the status quo, it removes config.status."
79
80
81 #### Option processing.
82
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"
89
90 ### Record all the arguments, so we can save them in config.status.
91 arguments="$@"
92
93 while [ $# != 0 ]; do
94 arg="$1"
95 case "${arg}" in
96
97 ## Anything starting with a hyphen we assume is an option.
98 -* )
99
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
116
117 ## Change `-' in the option name to `_'.
118 opt="`echo ${opt} | tr - _`"
119
120 ## Process the option.
121 case "${opt}" in
122
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 ;;
138
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 ;;
154
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}"
169
170 echo "${progname}: Beware - the \`--srcdir' option doesn't work yet." >&2
171 ;;
172
173 ## Has the user asked for some help?
174 "usage" | "help" )
175 echo "${long_usage}" | more
176 exit
177 ;;
178
179 ## We ignore all other options silently.
180 esac
181 ;;
182
183 ## Anything not starting with a hyphen we assume is a
184 ## configuration name.
185 *)
186 configuration=${arg}
187 ;;
188
189 esac
190 shift
191 done
192
193 if [ "${configuration}" = "" ]; then
194 (echo "${progname}: You must specify a configuration name as an argument."
195 echo "${short_usage}") >&2
196 exit 1
197 fi
198
199
200 #### Decide where the source is.
201 case "${srcdir}" in
202
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 ;;
222
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 ;;
236
237 esac
238
239 ### Make the necessary directories, if they don't exist.
240 if [ ! -d ./src ]; then
241 mkdir ./src
242 fi
243 if [ ! -d ./lib-src ]; then
244 mkdir ./lib-src
245 fi
246 if [ ! -d ./cpp ]; then
247 mkdir ./cpp
248 fi
249 if [ ! -d ./oldXMenu ]; then
250 mkdir ./oldXMenu
251 fi
252
253
254 #### Given the configuration name, set machfile and opsysfile to the
255 #### names of the m/*.h and s/*.h files we should use.
256
257 ### Canonicalize the configuration name.
258 echo "Checking the configuration name."
259 if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
260 exit $?
261 fi
262
263 ### You would hope that you could choose an m/*.h file pretty much
264 ### based on the machine portion of the configuration name, and an s-
265 ### file based on the operating system portion. However, it turns out
266 ### that each m/*.h file is pretty manufacturer-specific - for
267 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
268 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
269 ### machines. So we basically have to have a special case for each
270 ### configuration name.
271
272 ### As far as handling version numbers on operating systems is
273 ### concerned, make sure things will fail in a fixable way. If
274 ### /etc/MACHINES doesn't say anything about version numbers, be
275 ### prepared to handle anything reasonably. If version numbers
276 ### matter, be sure /etc/MACHINES says something about it.
277 machine='' opsys='' unported='false'
278 case "${configuration}" in
279
280 ## Alliant machines
281 ## Strictly speaking, we need the version of the alliant operating
282 ## system to choose the right machine file, but currently the
283 ## configuration name doesn't tell us enough to choose the right
284 ## one; we need to give alliants their own operating system name to
285 ## do this right. When someone cares, they can help us.
286 fx80-alliant-* )
287 machine=alliant4 opsys=bsd4-2
288 ;;
289 i860-alliant-* )
290 machine=alliant-2800 opsys=bsd4-3
291 ;;
292
293 ## Altos 3068
294 m68*-altos-sysv* )
295 machine=altos opsys=usg5-2
296 ;;
297
298 ## Amdahl UTS
299 580-amdahl-sysv* )
300 machine=amdahl opsys=usg5-2-2
301 ;;
302
303 ## Appallings - I mean, Apollos - running Domain
304 m68*-apollo* )
305 machine=apollo opsysfile=bsd4-2.h
306 ;;
307
308 ## AT&T 3b2, 3b5, 3b15, 3b20
309 we32k-att-sysv* )
310 machine=att3b opsys=usg5-2-2
311 ;;
312
313 ## AT&T 3b1 - The Mighty Unix PC!
314 m68*-att-sysv* )
315 machine=7300 opsys=usg5-2-2
316 ;;
317
318 ## Bull sps7
319 m68*-bull-sysv* )
320 machine=sps7 opsys=usg5-2
321 ;;
322
323 ## CCI 5/32, 6/32 -- see "Tahoe".
324
325 ## Celerity
326 ## I don't know what configuration name to use for this; config.sub
327 ## doesn't seem to know anything about it. Hey, Celerity users, get
328 ## in touch with us!
329 celerity-celerity-bsd* )
330 machine=celerity opsys=bsd4-2
331 ;;
332
333 ## Clipper
334 ## What operating systems does this chip run that Emacs has been
335 ## tested on?
336 clipper-* )
337 machine=clipper
338 ## We'll use the catch-all code at the bottom to guess the
339 ## operating system.
340 ;;
341
342 ## Convex
343 *-convex-bsd* )
344 machine=convex opsys=bsd4-3
345 ;;
346
347 ## Cubix QBx/386
348 i386-cubix-sysv* )
349 machine=intel386 opsys=usg5-3
350 ;;
351
352 ## Cydra 5
353 cydra*-cydrome-sysv* )
354 machine=cydra5 opsys=usg5-3
355 ;;
356
357 ## DECstations
358 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0 | mips-dec-bsd4.2 )
359 machine=pmax opsys=bsd4-2
360 ;;
361 mips-dec-ultrix* | mips-dec-bsd* )
362 machine=pmax opsys=bsd4-3
363 ;;
364 mips-dec-osf* )
365 machine=pmax opsys=osf1
366 ;;
367
368 ## Motorola Delta machines
369 m68*-motorola-sysv* )
370 machine=delta opsys=usg5-3
371 ;;
372 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
373 machine=delta88k opsys=usg5-3
374 ;;
375
376 ## Dual machines
377 m68*-dual-sysv* )
378 machine=dual opsys=usg5-2
379 ;;
380 m68*-dual-uniplus* )
381 machine=dual opsys=unipl5-2
382 ;;
383
384 ## Elxsi 6400
385 elxsi-elxsi-sysv* )
386 machine=elxsi opsys=usg5-2
387 ;;
388
389 ## Encore machines
390 ns16k-encore-bsd* )
391 machine=ns16000 opsys=umax
392 ;;
393
394 ## The GEC 93 - apparently, this port isn't really finished yet.
395
396 ## Gould Power Node and NP1
397 pn-gould-bsd4.2 )
398 machine=gould opsys=bsd4-2
399 ;;
400 pn-gould-bsd4.3 )
401 machine=gould opsys=bsd4-3
402 ;;
403 np1-gould-bsd* )
404 machine=gould-np1 opsys=bsd4-3
405 ;;
406
407 ## Honeywell XPS100
408 xps*-honeywell-sysv* )
409 machine=xps100 opsys=usg5-2
410 ;;
411
412 ## HP 9000 series 200 or 300
413 m68*-hp-bsd* )
414 machine=hp9000s300 opsys=bsd4-3
415 ;;
416 ## HP/UX 8 doesn't run on these machines, so use HP/UX 7.
417 m68*-hp-hpux* )
418 machine=hp9000s300 opsys=hpux
419 ;;
420
421 ## HP 9000 series 800, running HP/UX
422 hppa1.0-hp-hpux* )
423 machine=hp9000s800 opsys=hpux
424 ;;
425
426 ## Orion machines
427 orion-orion-bsd* )
428 machine=orion opsys=bsd4-2
429 ;;
430 clipper-orion-bsd* )
431 machine=orion105 opsys=bsd4-2
432 ;;
433
434 ## IBM machines
435 i386-ibm-aix1.1 )
436 machine=ibmps2-aix opsys=usg5-2-2
437 ;;
438 i386-ibm-aix1.2 )
439 machine=ibmps2-aix opsys=usg5-3
440 ;;
441 rs6000-ibm-aix* )
442 machine=ibmrs6000 opsys=aix3-1
443 ;;
444 romp-ibm-bsd* )
445 machine=ibmrt opsys=bsd4-2
446 ;;
447 romp-ibm-aix* )
448 machine=ibmrt-aix opsys=usg5-2-2
449 ;;
450
451 ## Integrated Solutions `Optimum V'
452 m68*-isi-bsd4.2 )
453 machine=isi-ov opsys=bsd4-2
454 ;;
455 m68*-isi-bsd4.3 )
456 machine=isi-ov opsys=bsd4-3
457 ;;
458
459 ## Intel 386 machines where we do care about the manufacturer
460 i[34]86-intsys-sysv* )
461 machine=is386 opsys=usg5-2-2
462 ;;
463 ## Intel 386 machines where we don't care about the manufacturer
464 i[34]86-* )
465 machine=intel386
466 case "${configuration}" in
467 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
468 *-isc2.2 ) opsys=isc2-2 ;;
469 *-isc* ) opsys=isc3-0 ;;
470 *-esix* ) opsys=esix ;;
471 *-xenix* ) opsys=xenix ;;
472 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
473 esac
474 ;;
475
476 ## Silicon Graphics machines
477 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
478 m68*-sgi-iris3.5 )
479 machine=irist opsys=iris3-5
480 ;;
481 m68*-sgi-iris3.6 | m68*-sgi-iris*)
482 machine=irist opsys=iris3-6
483 ;;
484 ## Iris 4D
485 mips-sgi-irix3.* )
486 machine=iris4d opsys=irix3-3
487 ;;
488 mips-sgi-irix4.* | mips-sgi-irix* )
489 machine=iris4d opsys=irix4-0
490 ;;
491
492 ## Masscomp machines
493 m68*-masscomp-rtu )
494 machine=masscomp opsys=rtu
495 ;;
496
497 ## Megatest machines
498 m68*-megatest-bsd* )
499 machine=mega68 opsys=bsd4-2
500 ;;
501
502 ## Workstations sold by MIPS
503 ## This is not necessarily all workstations using the MIPS processor -
504 ## Irises are produced by SGI, and DECstations by DEC.
505
506 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
507 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
508 ## it gives for choosing between the alternatives seems to be "Use
509 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
510 ## the BSD world." I'll assume that these are instructions for
511 ## handling two odd situations, and that every other situation
512 ## should use mips.h and usg5-2-2, they being listed first.
513 mips-mips-riscos4* )
514 machine=mips4 opsys=usg5-2-2
515 ;;
516 mips-mips-bsd* )
517 machine=mips opsys=bsd4-3
518 ;;
519 mips-mips-* )
520 machine=mips opsys=usg5-2-2
521 ;;
522
523 ## The complete machine from National Semiconductor
524 ns32k-ns-genix* )
525 machine=ns32000 opsys=usg5-2
526 ;;
527
528 ## NCR machines
529 m68*-ncr-sysv2* )
530 machine=tower32 opsys=usg5-2-2
531 ;;
532 m68*-ncr-sysv3* )
533 machine=tower32v3 opsys=usg5-3
534 ;;
535
536 ## Nixdorf Targon 31
537 m68*-nixdorf-sysv* )
538 machine=targon31 opsys=usg5-2-2
539 ;;
540
541 ## Nu (TI or LMI)
542 m68*-nu-sysv* )
543 machine=nu opsys=usg5-2
544 ;;
545
546 ## Plexus
547 m68*-plexus-sysv* )
548 machine=plexus opsys=usg5-2
549 ;;
550
551 ## Prime EXL
552 i386-prime-sysv* )
553 machine=i386 opsys=usg5-3
554 ;;
555
556 ## Pyramid machines
557 ## I don't really have any idea what sort of processor the Pyramid has,
558 ## so I'm assuming it is its own architecture.
559 pyramid-pyramid-bsd* )
560 machine=pyramid opsys=bsd4-2
561 ;;
562
563 ## Sequent Balance
564 ns32k-sequent-bsd4.2 )
565 machine=sequent opsys=bsd4-2
566 ;;
567 ns32k-sequent-bsd4.3 )
568 machine=sequent opsys=bsd4-3
569 ;;
570 ## Sequent Symmetry
571 i386-sequent-bsd* )
572 machine=symmetry opsys=bsd4-3
573 ;;
574
575 ## SONY machines
576 m68*-sony-bsd4.2 )
577 machine=news opsys=bsd4-2
578 ;;
579 m68*-sony-bsd4.3 )
580 machine=news opsys=bsd4-3
581 ;;
582 mips-sony-bsd* )
583 machine=news-risc opsys=bsd4-3
584 ;;
585
586 ## Stride
587 m68*-stride-sysv* )
588 machine=stride opsys=usg5-2
589 ;;
590
591 ## Suns
592 *-sun-sunos* | *-sun-bsd* )
593 case "${configuration}" in
594 m68*-sunos1* ) machine=sun1 ;;
595 m68*-sunos2* ) machine=sun2 ;;
596 m68* ) machine=sun3 ;;
597 i[34]86* ) machine=sun386 ;;
598 sparc* ) machine=sparc ;;
599 * ) unported=true ;;
600 esac
601 case "${configuration}" in
602 *-sunos4.0* ) opsys=sunos4-0 ;;
603 *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
604 * ) opsys=bsd4-2 ;;
605 esac
606 ;;
607
608 ## Tadpole 68k
609 m68*-tadpole-sysv* )
610 machine=tad68k opsys=usg5-3
611 ;;
612
613 ## Tahoe machines
614 tahoe-tahoe-bsd4.2 )
615 machine=tahoe opsys=bsd4-2
616 ;;
617 tahoe-tahoe-bsd4.3 )
618 machine=tahoe opsys=bsd4-3
619 ;;
620
621 ## Tandem Integrity S2
622 mips-tandem-sysv* )
623 machine=tandem-s2 opsys=usg5-3
624 ;;
625
626 ## Tektronix 16000 box (6130?)
627 ns16k-tektronix-bsd* )
628 machine=ns16000 opsys=bsd4-2
629 ;;
630 ## Tektronix 4300
631 ## src/m/tek4300.h hints that this is a m68k machine.
632 m68*-tektronix-bsd* )
633 machine=tex4300 opsys=bsd4-3
634 ;;
635
636 ## Titan P2 or P3
637 ## We seem to have lost the machine-description file titan.h!
638 titan-titan-sysv* )
639 machine=titan opsys=usg5-3
640 ;;
641
642 ## Ustation E30 (SS5E)
643 m68*-unisys-uniplus* )
644 machine=ustation opsystem=unipl5-2
645 ;;
646
647 ## Vaxen.
648 vax-dec-* )
649 machine=vax
650 case "${configuration}" in
651 *-bsd4.1 ) opsys=bsd4-1 ;;
652 *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 ) opsys=bsd4-2 ;;
653 *-bsd4.3 | *-ultrix* ) opsys=bsd4-3 ;;
654 *-sysv[01]* ) opsys=usg5-0 ;;
655 *-sysv2* ) opsys=usg5-2 ;;
656 *-vms* ) opsys=vms ;;
657 * ) unported=true
658 esac
659 ;;
660
661 ## Whitechapel MG1
662 ns16k-whitechapel-* )
663 machine=mg1
664 ## We don't know what sort of OS runs on these; we'll let the
665 ## operating system guessing code below try.
666 ;;
667
668 ## Wicat
669 m68*-wicat-sysv* )
670 machine=wicat opsys=usg5-2
671 ;;
672
673 * )
674 unported=true
675 ;;
676 esac
677
678 ### If the code above didn't choose an operating system, just choose
679 ### an operating system based on the configuration name. You really
680 ### only want to use this when you have no idea what the right
681 ### operating system is; if you know what operating systems a machine
682 ### runs, it's cleaner to make it explicit in the case statement
683 ### above.
684 if [ ! "${opsys}" ]; then
685 case "${configuration}" in
686 *-bsd4.[01] ) opsys=bsd4-1 ;;
687 *-bsd4.2 ) opsys=bsd4-2 ;;
688 *-bsd4.3 ) opsys=bsd4-3 ;;
689 *-sysv0 ) opsys=usg5-0 ;;
690 *-sysv2 ) opsys=usg5-2 ;;
691 *-sysv2.2 ) opsys=usg5-2-2 ;;
692 *-sysv3 ) opsys=usg5-3 ;;
693 *-sysv4 ) opsys=usg5-4 ;;
694 * )
695 unported=true
696 ;;
697 esac
698 fi
699
700 if $unported ; then
701 (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
702 echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
703 ) >&2
704 exit 1
705 fi
706
707 machfile="m/${machine}.h"
708 opsysfile="s/${opsys}.h"
709
710
711 #### Choose a window system.
712 echo "Checking window system."
713 window_system=''
714 case "${with_x}" in
715 yes )
716 window_system=${window_system}x11
717 ;;
718 no )
719 window_system=${window_system}none
720 esac
721 case "${with_x11}" in
722 yes )
723 window_system=${window_system}x11
724 ;;
725 esac
726 case "${with_x10}" in
727 yes )
728 window_system=${window_system}x10
729 ;;
730 esac
731
732 case "${window_system}" in
733 "none" | "x11" | "x10" ) ;;
734 "" )
735 echo " No window system specifed. Looking for X Windows."
736 window_system=none
737 if [ -r /usr/lib/libX11.a -o -d /usr/include/X11 ]; then
738 window_system=x11
739 fi
740 ;;
741 * )
742 echo "Don\'t specify the window system more than once." >&2
743 exit 1
744 ;;
745 esac
746
747 case "${window_system}" in
748 x11 )
749 HAVE_X_WINDOWS=yes
750 HAVE_X11=yes
751 echo " Using X11."
752 ;;
753 x10 )
754 HAVE_X_WINDOWS=yes
755 HAVE_X11=no
756 echo " Using X10."
757 ;;
758 none )
759 HAVE_X_WINDOWS=no
760 HAVE_X11=no
761 echo " Using no window system."
762 ;;
763 esac
764
765 ### If we're using X11, we should use the X menu package.
766 HAVE_X_MENU=no
767 case ${HAVE_X11} in
768 yes )
769 HAVE_X_MENU=yes
770 ;;
771 esac
772
773
774 #### Choose a compiler.
775 echo "Checking compilers."
776 if [ "${with_gcc}" = "" ]; then
777 echo " Searching load path for GCC."
778 temppath=`echo $PATH | sed 's/^:/.:/
779 s/::/:.:/g
780 s/:$/:./
781 s/:/ /g'`
782 default_cc=`(
783 for dir in ${temppath}; do
784 if [ -f ${dir}/gcc ]; then echo gcc; exit 0; fi
785 done
786 echo cc
787 )`
788 else
789 case ${with_gcc} in
790 "yes" ) default_cc="gcc" ;;
791 "no" ) default_cc="cc" ;;
792 esac
793 fi
794
795 case "${default_cc}" in
796 "gcc" )
797 echo " Using GCC."
798 default_cflags='-g -O'
799 ;;
800 * )
801 echo " Using the system's CC."
802 default_cflags='-g'
803 ;;
804 esac
805
806
807 #### Does this compiler support the `const' keyword?
808 #### The code for this test was adapted from autoconf's test.
809 echo "Checking if the compiler supports \`const'."
810 rm -f conftest*
811 compile='${default_cc} conftest.c -o conftest >/dev/null 2>&1'
812 echo "
813 main() { exit(0); } t() { /* Ultrix mips cc rejects this. */
814 typedef int charset[2]; const charset x;
815 /* SunOS 4.1.1 cc rejects this. */
816 char const *const *p;
817 char **p2;
818 /* HPUX 7.0 cc rejects these. */
819 ++p;
820 p2 = (char const* const*) p;
821 }" > conftest.c
822 if eval $compile; then
823 echo " It seems to."
824 HAVE_CONST=yes
825 else
826 echo " It doesn't seem to."
827 HAVE_CONST=no
828 fi
829 rm -f conftest*
830
831 #### What is the return type of a signal handler?
832
833 ### We run /usr/include/signal.h through cpp and grep for the
834 ### declaration of the signal function. Yuck.
835 echo "Looking for return type of signal handler functions."
836 signal_h_file=''
837 if [ -r /usr/include/signal.h ]; then
838 signal_h_file=/usr/include/signal.h
839 elif [ -r /usr/include/sys/signal.h ]; then
840 signal_h_file=/usr/include/sys/signal.h
841 fi
842 SIGTYPE=void
843 if [ "${signal_h_file}" ]; then
844 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*('
845
846 ## We make a copy whose name ends in .c, so the compiler
847 ## won't complain about having only been given a .h file.
848 tempcname="configure.tmp.$$.c"
849 cp ${signal_h_file} ${tempcname}
850 if ${default_cc} -E ${tempcname} | grep "int${sigpattern}" > /dev/null; then
851 SIGTYPE=int
852 fi
853 rm -f ${tempcname}
854 fi
855 echo " Guessing that signals return \`${SIGTYPE}'."
856
857
858 #### Extract some information from the operating system and machine files.
859
860 echo "Examining the machine- and system-dependent files to find out"
861 echo " - which libraries the lib-src programs will want, and"
862 echo " - whether the GNU malloc routines are usable."
863 tempcname="configure.tmp.$$.c"
864 echo '
865 #include "'${srcdir}'/src/'${opsysfile}'"
866 #include "'${srcdir}'/src/'${machfile}'"
867 #ifndef LIBS_MACHINE
868 #define LIBS_MACHINE
869 #endif
870 #ifndef LIBS_SYSTEM
871 #define LIBS_SYSTEM
872 #endif
873 @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
874 #ifdef SYSTEM_MALLOC
875 @configure@ system_malloc=yes
876 #else
877 @configure@ system_malloc=no
878 #endif
879 ' > ${tempcname}
880 eval `${default_cc} -E ${tempcname} \
881 | grep '@configure@' \
882 | sed -e 's/^@configure@//'`
883 rm ${tempcname}
884
885 # Do the opsystem or machine files prohibit the use of the GNU malloc?
886 # Assume not, until told otherwise.
887 GNU_MALLOC=yes
888 if [ "${system_malloc}" = "yes" ]; then
889 GNU_MALLOC=no
890 GNU_MALLOC_reason="
891 (The GNU allocators don't work with this system configuration.)"
892 fi
893
894 if [ ! "${REL_ALLOC}" ]; then
895 REL_ALLOC=${GNU_MALLOC}
896 fi
897
898 LISP_FLOAT_TYPE=yes
899
900
901 #### Find out which version of Emacs this is.
902 version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
903 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
904 if [ ! "${version}" ]; then
905 echo "${progname}: can't find current emacs version in
906 \`${srcdir}/lisp/version.el'." >&2
907 exit 1
908 fi
909
910
911 #### Make the proper settings in `src/config.h'.
912 rm -f config.status
913 set -e
914
915 echo "Making \`./src/config.h' from \`${srcdir}/src/config.h.in'."
916 sed_flags="-e 's:@machine@:${machfile}:' -e 's:@opsystem@:${opsysfile}:'"
917
918 for flag in ${config_h_opts}; do
919 val=`eval echo '$'${flag}`
920 case ${val} in
921 no | "")
922 f="-e 's:.*#define ${flag}.*:/\\* #define ${flag} \\*/:'"
923 ;;
924 yes)
925 f="-e 's:.*#define ${flag}.*:#define ${flag}:'"
926 ;;
927 *)
928 f="-e 's:.*#define ${flag}.*:#define ${flag} ${val}:'"
929 ;;
930 esac
931 sed_flags="${sed_flags} ${f}"
932 done
933
934 rm -f ./src/config.h.tmp
935 (echo "/* This file is generated by \`${progname}' from"
936 echo " \`${srcdir}/src/config.h.in'."
937 echo " If you are thinking about editing it, you should seriously consider"
938 echo " running \`${progname} instead, or editing"
939 echo " \`${srcdir}/src/config.h.in' itself."
940 eval '/bin/sed '${sed_flags}' < "${srcdir}/src/config.h.in"'
941 ) > src/config.h.tmp
942 ${srcdir}/move-if-change src/config.h.tmp src/config.h
943 ### Remind people not to edit this.
944 chmod -w src/config.h
945
946
947 #### Modify the parameters in the top-level Makefile.
948 echo "Producing \`Makefile' from \`${srcdir}/Makefile.in'."
949 rm -f Makefile.tmp
950 (echo "\
951 # This file is generated by \`${progname}' from
952 # \`${srcdir}/Makefile.in'.
953 # If you are thinking about editing it, you should seriously consider
954 # running \`${progname}' instead, or editing
955 # \`${srcdir}/Makefile.in' itself."
956 /bin/sed < ${srcdir}/Makefile.in \
957 -e 's|^configname *=.*$|configname='"${configuration}"'|' \
958 -e 's|^version *=.*$|version='"${version}"'|' \
959 -e 's|^srcdir *=.*$|srcdir='"${srcdir}"'|' \
960 -e 's|^CC *=.*$|CC='"${default_cc}"'|' \
961 -e 's|^CONFIG_CFLAGS *=.*$|CONFIG_CFLAGS='"${default_cflags}"'|' \
962 -e 's|^LOADLIBES *=.*$|LOADLIBES='"${libsrc_libs}"'|' \
963 -e '/^# DIST: /d') > Makefile.tmp
964 ${srcdir}/move-if-change Makefile.tmp Makefile
965
966 ### I'm commenting out this section until I bring the `build-install' script
967 ### into line with the rest of the configuration stuff.
968
969 ### # Modify the parameters in the `build-install' script.
970 ### echo "Producing \`./build-install' from \`${srcdir}/build-install.in'."
971 ### rm -f ./build-install.tmp
972 ### (echo "\
973 ### # This file is generated by \`${progname}' from \`${srcdir}/build-install.in'.
974 ### # If you are thinking about editing it, you should seriously consider
975 ### # editing \`./build-install.in' itself, or running \`${progname}' instead."
976 ### /bin/sed < ${srcdir}/build-install.in \
977 ### -e 's;^\(prefix=\).*$;\1'"${prefix};" \
978 ### -e 's;^\(bindir=\).*$;\1'"${bindir};" \
979 ### -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \
980 ### -e 's;^\(datadir=\).*$;\1'"${datadir};" \
981 ### -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \
982 ### -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install.tmp
983 ### ${srcdir}/move-if-change build-install.tmp build-install
984 ### # Remind people not to edit this.
985 ### chmod -w build-install
986 ### chmod +x build-install
987
988
989 #### Describe the results.
990
991 ### Create a verbal description of what we have done.
992 message="Configured for \`${configuration}'.
993
994 What operating system and machine description files should Emacs use?
995 \`${opsysfile}' and \`${machfile}'
996 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
997 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
998 What window system should Emacs use? ${window_system}
999 What compiler should emacs be built with? ${default_cc}
1000 Should the compilation use \`-g' and/or \`-O'? ${default_cflags-neither}"
1001
1002 ### Write config.status, documenting the damage we have done.
1003
1004 (echo "\
1005 #!/bin/sh
1006 ### This file is generated by \`${progname}.'
1007 ### If you are thinking about editing it, you should seriously consider
1008 ### running \`${progname}' instead.
1009 "
1010 echo "${message}" | sed -e 's/^/# /'
1011 echo "exec '${progname}' ${arguments} "'$@') > config.status
1012
1013 ### Remind people not to edit this.
1014 chmod -w config.status
1015 chmod +x config.status
1016
1017 ### Print the description.
1018 echo
1019 echo "${message}"
1020
1021 exit 0