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