]> code.delx.au - gnu-emacs/blob - configure1.in
* bytecomp.el (byte-compile-from-buffer): Put buffer containing
[gnu-emacs] / 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 ### 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:^\./\./:\./:'`"
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 ### 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.
266
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.
275 ###
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.
281 ###
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'."
285
286 machine='' opsys='' unported='false'
287 case "${configuration}" in
288
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 ;;
301
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 ;;
311
312 ## Appallings - I mean, Apollos - running Domain
313 m68*-apollo* )
314 machine=apollo opsysfile=bsd4-2.h
315 ;;
316
317 ## AT&T 3b2, 3b5, 3b15, 3b20
318 we32k-att-sysv* )
319 machine=att3b opsys=usg5-2-2
320 ;;
321
322 ## AT&T 3b1 - The Mighty Unix PC!
323 m68*-att-sysv* )
324 machine=7300 opsys=usg5-2-2
325 ;;
326
327 ## Bull sps7
328 m68*-bull-sysv* )
329 machine=sps7 opsys=usg5-2
330 ;;
331
332 ## CCI 5/32, 6/32 -- see "Tahoe".
333
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 ;;
341
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 ;;
350
351 ## Convex
352 *-convex-bsd* )
353 machine=convex opsys=bsd4-3
354 ;;
355
356 ## Cubix QBx/386
357 i386-cubix-sysv* )
358 machine=intel386 opsys=usg5-3
359 ;;
360
361 ## Cydra 5
362 cydra*-cydrome-sysv* )
363 machine=cydra5 opsys=usg5-3
364 ;;
365
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 ;;
376
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 ;;
384
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 ;;
392
393 ## Elxsi 6400
394 elxsi-elxsi-sysv* )
395 machine=elxsi opsys=usg5-2
396 ;;
397
398 ## Encore machines
399 ns16k-encore-bsd* )
400 machine=ns16000 opsys=umax
401 ;;
402
403 ## The GEC 93 - apparently, this port isn't really finished yet.
404
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 ;;
415
416 ## Honeywell XPS100
417 xps*-honeywell-sysv* )
418 machine=xps100 opsys=usg5-2
419 ;;
420
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 ;;
429
430 ## HP 9000 series 800, running HP/UX
431 hppa1.0-hp-hpux* )
432 machine=hp9000s800 opsys=hpux
433 ;;
434
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 ;;
442
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 | rs6000-ibm-aix32* )
451 machine=ibmrs6000 opsys=aix3-2
452 ;;
453 rs6000-ibm-aix31* )
454 machine=ibmrs6000 opsys=aix3-1
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 ;;
462
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 ;;
470
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 ;;
487
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 ;;
503
504 ## Masscomp machines
505 m68*-masscomp-rtu )
506 machine=masscomp opsys=rtu
507 ;;
508
509 ## Megatest machines
510 m68*-megatest-bsd* )
511 machine=mega68 opsys=bsd4-2
512 ;;
513
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.
517
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 ;;
534
535 ## The complete machine from National Semiconductor
536 ns32k-ns-genix* )
537 machine=ns32000 opsys=usg5-2
538 ;;
539
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 ;;
547
548 ## Nixdorf Targon 31
549 m68*-nixdorf-sysv* )
550 machine=targon31 opsys=usg5-2-2
551 ;;
552
553 ## Nu (TI or LMI)
554 m68*-nu-sysv* )
555 machine=nu opsys=usg5-2
556 ;;
557
558 ## Plexus
559 m68*-plexus-sysv* )
560 machine=plexus opsys=usg5-2
561 ;;
562
563 ## Prime EXL
564 i386-prime-sysv* )
565 machine=i386 opsys=usg5-3
566 ;;
567
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 ;;
574
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 ;;
586
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 ;;
597
598 ## Stride
599 m68*-stride-sysv* )
600 machine=stride opsys=usg5-2
601 ;;
602
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 ;;
619
620 ## Tadpole 68k
621 m68*-tadpole-sysv* )
622 machine=tad68k opsys=usg5-3
623 ;;
624
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 ;;
632
633 ## Tandem Integrity S2
634 mips-tandem-sysv* )
635 machine=tandem-s2 opsys=usg5-3
636 ;;
637
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 ;;
647
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 ;;
658
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 ;;
672
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 ;;
679
680 ## Wicat
681 m68*-wicat-sysv* )
682 machine=wicat opsys=usg5-2
683 ;;
684
685 * )
686 unported=true
687 ;;
688 esac
689
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
710 fi
711
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
717 fi
718
719 machfile="m/${machine}.h"
720 opsysfile="s/${opsys}.h"
721
722
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
743
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
758
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
776
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
784
785
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
805 fi
806
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
817
818
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
840 fi
841 rm -f conftest*
842
843 #### What is the return type of a signal handler?
844
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
853 fi
854 SIGTYPE=void
855 if [ "${signal_h_file}" ]; then
856 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*('
857
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}
866 fi
867 echo " Guessing that signals return \`${SIGTYPE}'."
868
869
870 #### Extract some information from the operating system and machine files.
871
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}
896
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.)"
904 fi
905
906 if [ ! "${REL_ALLOC}" ]; then
907 REL_ALLOC=${GNU_MALLOC}
908 fi
909
910 LISP_FLOAT_TYPE=yes
911
912
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
920 fi
921
922
923 #### Make the proper settings in `src/config.h'.
924 rm -f config.status
925 set -e
926
927 echo "Making \`./src/config.h' from \`${srcdir}/src/config.h.in'."
928 sed_flags="-e 's:@machine@:${machfile}:' -e 's:@opsystem@:${opsysfile}:'"
929
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
945
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
957
958
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
977
978 ### I'm commenting out this section until I bring the `build-install' script
979 ### into line with the rest of the configuration stuff.
980
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
999
1000
1001 #### Describe the results.
1002
1003 ### Create a verbal description of what we have done.
1004 message="Configured for \`${configuration}'.
1005
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}"
1013
1014 ### Write config.status, documenting the damage we have done.
1015
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.
1021 "
1022 echo "${message}" | sed -e 's/^/# /'
1023 echo "exec '${progname}' ${arguments} "'$@') > config.status
1024
1025 ### Remind people not to edit this.
1026 chmod -w config.status
1027 chmod +x config.status
1028
1029 ### Print the description.
1030 echo
1031 echo "${message}"
1032
1033 exit 0