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