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