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