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