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