Commit | Line | Data |
---|---|---|
fa97f756 | 1 | dnl This is an autoconf script. |
8fc40e80 JB |
2 | dnl To rebuild the `configure' script from this, execute the command |
3 | dnl autoconf | |
65d0cca4 | 4 | dnl in the directory containing this script. |
de5d70c1 | 5 | [#!/bin/sh |
0c22fbca | 6 | #### Configuration script for GNU Emacs |
5dd53b99 | 7 | #### Copyright (C) 1992, 1994 Free Software Foundation, Inc. |
65d0cca4 | 8 | #### This script requires autoconf version 1.9 or later. |
0c22fbca | 9 | |
8fc40e80 JB |
10 | ### Don't edit this script! |
11 | ### This script was automatically generated by the `autoconf' program | |
12 | ### from the file `./configure.in'. | |
13 | ### To rebuild it, execute the command | |
14 | ### autoconf | |
65d0cca4 | 15 | ### in the this directory. |
8fc40e80 | 16 | |
0c22fbca JB |
17 | ### This file is part of GNU Emacs. |
18 | ||
19 | ### GNU Emacs is free software; you can redistribute it and/or modify | |
20 | ### it under the terms of the GNU General Public License as published by | |
5dd53b99 | 21 | ### the Free Software Foundation; either version 2, or (at your option) |
0c22fbca JB |
22 | ### any later version. |
23 | ||
24 | ### GNU Emacs is distributed in the hope that it will be useful, | |
25 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
27 | ### GNU General Public License for more details. | |
28 | ||
29 | ### You should have received a copy of the GNU General Public License | |
30 | ### along with GNU Emacs; see the file COPYING. If not, write to | |
31 | ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
32 | ||
7d99494c JB |
33 | ### Since Emacs has configuration requirements that autoconf can't |
34 | ### meet, this file is an unholy marriage of custom-baked | |
44ee550f | 35 | ### configuration code and autoconf macros. |
7d99494c JB |
36 | ### |
37 | ### We use the m4 quoting characters [ ] (as established by the | |
38 | ### autoconf system) to include large sections of raw sewage - Oops, I | |
39 | ### mean, shell code - in the final configuration script. | |
0c22fbca JB |
40 | ### |
41 | ### Usage: configure config_name | |
42 | ### | |
43 | ### If configure succeeds, it leaves its status in config.status. | |
44 | ### If configure fails after disturbing the status quo, | |
45 | ### config.status is removed. | |
0c22fbca | 46 | |
3647c171 JB |
47 | ### Remove any more than one leading "." element from the path name. |
48 | ### If we don't remove them, then another "./" will be prepended to | |
49 | ### the file name each time we use config.status, and the program name | |
50 | ### will get larger and larger. This wouldn't be a problem, except | |
51 | ### that since progname gets recorded in all the Makefiles this script | |
52 | ### produces, move-if-change thinks they're different when they're | |
53 | ### not. | |
0c22fbca JB |
54 | ### |
55 | ### It would be nice if we could put the ./ in a \( \) group and then | |
56 | ### apply the * operator to that, so we remove as many leading ./././'s | |
57 | ### as are present, but some seds (like Ultrix's sed) don't allow you to | |
58 | ### apply * to a \( \) group. Bleah. | |
3647c171 | 59 | progname="`echo $0 | sed 's:^\./\./:\./:'`" |
ca1d1d23 | 60 | |
ca1d1d23 | 61 | |
cedb6c1b BF |
62 | ### Establish some default values. |
63 | run_in_place= | |
64 | single_tree= | |
65 | prefix='/usr/local' | |
66 | exec_prefix='${prefix}' | |
67 | bindir='${exec_prefix}/bin' | |
68 | datadir='${prefix}/lib' | |
69 | statedir='${prefix}/lib' | |
70 | libdir='${exec_prefix}/lib' | |
71 | mandir='${prefix}/man/man1' | |
72 | infodir='${prefix}/info' | |
73 | lispdir='${datadir}/emacs/${version}/lisp' | |
74 | locallisppath='${datadir}/emacs/site-lisp' | |
75 | lisppath='${locallisppath}:${lispdir}' | |
76 | etcdir='${datadir}/emacs/${version}/etc' | |
77 | lockdir='${statedir}/emacs/lock' | |
78 | archlibdir='${libdir}/emacs/${version}/${configuration}' | |
080d8166 | 79 | docdir='${datadir}/emacs/${version}/etc' |
cedb6c1b | 80 | |
1c4ce111 RS |
81 | # On Sun systems, people sometimes set up the variable CPP |
82 | # with a value that is a directory, not an executable at all. | |
83 | # Detect that case, and ignore that value. | |
84 | if [ "x$CPP" != x ] && [ -d "$CPP" ]; | |
85 | then | |
86 | CPP= | |
87 | fi | |
88 | ||
cedb6c1b BF |
89 | # We cannot use this variable in the case statement below, because many |
90 | # /bin/sh's have broken semantics for "case". Unfortunately, you must | |
91 | # actually edit the clause itself. | |
92 | # path_options="prefix | exec_prefix | bindir | libdir | etcdir | datadir" | |
93 | # path_options="$path_options | archlibdir | statedir | mandir | infodir" | |
94 | # path_options="$path_options | lispdir | lockdir | lisppath | locallisppath" | |
95 | ||
0c22fbca JB |
96 | #### Usage messages. |
97 | ||
ae6756a2 | 98 | short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...] |
8509d50c | 99 | |
ca1d1d23 | 100 | Set compilation and installation parameters for GNU Emacs, and report. |
8509d50c | 101 | CONFIGURATION specifies the machine and operating system to build for. |
ae6756a2 | 102 | --with-x Support the X Window System. |
b735d4b3 | 103 | --with-x=no Don't support X. |
1c4ce111 RS |
104 | --with-x-toolkit Use an X toolkit. |
105 | --with-x-toolkit=no Don't use an X toolkit. | |
ae6756a2 JB |
106 | --with-gcc Use GCC to compile Emacs. |
107 | --with-gcc=no Don't use GCC to compile Emacs. | |
1c4ce111 RS |
108 | --x-includes=DIR Search for X header files in DIR. |
109 | --x-libraries=DIR Search for X libraries in DIR. | |
ae6756a2 JB |
110 | --run-in-place Use libraries and data files directly out of the |
111 | source tree. | |
cedb6c1b BF |
112 | --single-tree=DIR Has the effect of creating a directory tree at DIR |
113 | which looks like: | |
114 | .../DIR/bin/CONFIGNAME (emacs, etags, etc.) | |
115 | .../DIR/bin/CONFIGNAME/etc (movemail, etc.) | |
116 | .../DIR/common/lisp (emacs' lisp files) | |
117 | .../DIR/common/site-lisp (local lisp files) | |
118 | .../DIR/common/lib (DOC, TUTORIAL, etc.) | |
119 | .../DIR/common/lock (lockfiles) | |
120 | --srcdir=DIR Look for the Emacs source files in DIR. | |
121 | --prefix=DIR Install files below DIR. Defaults to \`${prefix}'. | |
122 | ||
123 | You may also specify any of the \`path' variables found in Makefile.in, | |
124 | including --bindir, --libdir, --etcdir, --infodir, and so on. This allows | |
125 | you to override a single default location when configuring. | |
0c22fbca | 126 | |
ca1d1d23 | 127 | If successful, ${progname} leaves its status in config.status. If |
0c22fbca JB |
128 | unsuccessful after disturbing the status quo, it removes config.status." |
129 | ||
130 | ||
131 | #### Option processing. | |
ca1d1d23 | 132 | |
0c22fbca | 133 | ### Record all the arguments, so we can save them in config.status. |
20d9a863 | 134 | arguments="$@" |
e065a56e | 135 | |
6703f6cd BF |
136 | ### Shell Magic: Quote the quoted arguments in ARGUMENTS. At a later date, |
137 | ### in order to get the arguments back in $@, we have to do an | |
138 | ### `eval set x "$quoted_arguments"; shift'. | |
139 | quoted_arguments= | |
140 | for i in "$@"; do | |
141 | quoted_arguments="$quoted_arguments '$i'" | |
142 | done | |
143 | ||
3517b2e9 JB |
144 | ### Don't use shift -- that destroys the argument list, which autoconf needs |
145 | ### to produce config.status. It turns out that "set - ${arguments}" doesn't | |
146 | ### work portably. | |
6703f6cd BF |
147 | ### However, it also turns out that many shells cannot expand ${10} at all. |
148 | ### So using an index variable doesn't work either. It is possible to use | |
149 | ### some shell magic to make 'set x "$arguments"; shift' work portably. | |
f9328e98 | 150 | config_options="$*" |
6703f6cd BF |
151 | while [ $# != 0 ]; do |
152 | arg="$1"; shift | |
ca1d1d23 | 153 | case "${arg}" in |
0c22fbca JB |
154 | |
155 | ## Anything starting with a hyphen we assume is an option. | |
156 | -* ) | |
0c22fbca | 157 | ## Separate the switch name from the value it's being given. |
ca1d1d23 | 158 | case "${arg}" in |
2c44309a | 159 | -*=*) |
20d9a863 | 160 | opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'` |
2c44309a | 161 | val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'` |
ca1d1d23 JB |
162 | valomitted=no |
163 | ;; | |
2c44309a | 164 | -*) |
0c22fbca JB |
165 | ## If FOO is a boolean argument, --FOO is equivalent to |
166 | ## --FOO=yes. Otherwise, the value comes from the next | |
167 | ## argument - see below. | |
c0b2f23c | 168 | opt=`echo ${arg} | sed 's:^-*::'` |
ca1d1d23 JB |
169 | val="yes" |
170 | valomitted=yes | |
171 | ;; | |
172 | esac | |
173 | ||
0c22fbca | 174 | ## Change `-' in the option name to `_'. |
b0209e18 | 175 | optname="${opt}" |
20d9a863 JB |
176 | opt="`echo ${opt} | tr - _`" |
177 | ||
0c22fbca JB |
178 | ## Process the option. |
179 | case "${opt}" in | |
ca1d1d23 | 180 | |
0c22fbca JB |
181 | ## Has the user specified which window systems they want to support? |
182 | "with_x" | "with_x11" | "with_x10" ) | |
183 | ## Make sure the value given was either "yes" or "no". | |
ca1d1d23 JB |
184 | case "${val}" in |
185 | y | ye | yes ) val=yes ;; | |
186 | n | no ) val=no ;; | |
187 | * ) | |
b0209e18 | 188 | (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value. |
0c22fbca JB |
189 | Set it to either \`yes' or \`no'." |
190 | echo "${short_usage}") >&2 | |
ca1d1d23 JB |
191 | exit 1 |
192 | ;; | |
193 | esac | |
0c22fbca | 194 | eval "${opt}=\"${val}\"" |
ca1d1d23 | 195 | ;; |
0c22fbca | 196 | |
1c4ce111 RS |
197 | ## Has the user specified which toolkit they want to support? |
198 | "with_x_toolkit" ) | |
1c4ce111 RS |
199 | case "${val}" in |
200 | y | ye | yes ) val=athena ;; | |
201 | n | no ) val=no ;; | |
202 | l | lu | luc | luci | lucid ) val=lucid ;; | |
203 | a | at | ath | athe | athena ) val=athena ;; | |
0de5246d RS |
204 | # These don't currently work. |
205 | # m | mo | mot | moti | motif ) val=motif ;; | |
206 | # o | op | ope | open | open- | open-l | open-lo \ | |
207 | # | open-loo | open-look ) val=open-look ;; | |
1c4ce111 | 208 | * ) |
0de5246d RS |
209 | ( |
210 | #echo "${progname}: the \`--${optname}' option is supposed to have a value | |
211 | #which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'." | |
212 | echo "${progname}: the \`--${optname}' option is supposed to have a value | |
6a66e3be RS |
213 | which is \`yes', \`no', \`lucid', or \`athena'. |
214 | Currently, \`yes', \`athena' and \`lucid' are synonyms." | |
1c4ce111 RS |
215 | echo "${short_usage}") >&2 |
216 | exit 1 | |
217 | ;; | |
218 | esac | |
219 | eval "${opt}=\"${val}\"" | |
220 | ;; | |
221 | ||
1bba56f6 | 222 | ## Has the user specified whether or not they want GCC? |
b735d4b3 | 223 | "with_gcc" | "with_gnu_cc" ) |
1bba56f6 JB |
224 | ## Make sure the value given was either "yes" or "no". |
225 | case "${val}" in | |
226 | y | ye | yes ) val=yes ;; | |
227 | n | no ) val=no ;; | |
228 | * ) | |
b0209e18 | 229 | (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value. |
1bba56f6 JB |
230 | Set it to either \`yes' or \`no'." |
231 | echo "${short_usage}") >&2 | |
232 | exit 1 | |
233 | ;; | |
234 | esac | |
235 | eval "${opt}=\"${val}\"" | |
236 | ;; | |
237 | ||
0c22fbca JB |
238 | ## Has the user specified a source directory? |
239 | "srcdir" ) | |
240 | ## If the value was omitted, get it from the next argument. | |
ca1d1d23 | 241 | if [ "${valomitted}" = "yes" ]; then |
0c22fbca | 242 | ## Get the next argument from the argument list, if there is one. |
6703f6cd | 243 | if [ $# = 0 ]; then |
b0209e18 JB |
244 | (echo "${progname}: You must give a value for the \`--${optname}' option, as in |
245 | \`--${optname}=FOO'." | |
0c22fbca | 246 | echo "${short_usage}") >&2 |
4746118a JB |
247 | exit 1 |
248 | fi | |
1052acbf | 249 | val="$1"; shift |
ca1d1d23 | 250 | fi |
0c22fbca JB |
251 | srcdir="${val}" |
252 | ;; | |
253 | ||
9c7a7556 JB |
254 | ## Has the user tried to tell us where the X files are? |
255 | ## I think these are dopey, but no less than three alpha | |
256 | ## testers, at large sites, have said they have their X files | |
257 | ## installed in odd places. | |
b0209e18 | 258 | "x_includes" ) |
9c7a7556 JB |
259 | ## If the value was omitted, get it from the next argument. |
260 | if [ "${valomitted}" = "yes" ]; then | |
261 | ## Get the next argument from the argument list, if there is one. | |
6703f6cd | 262 | if [ $# = 0 ]; then |
b0209e18 | 263 | (echo "${progname}: You must give a value for the \`--${optname}' option, as in |
cedb6c1b | 264 | \`--${optname}=/usr/local/X11/include'." |
9c7a7556 JB |
265 | echo "${short_usage}") >&2 |
266 | exit 1 | |
267 | fi | |
6703f6cd | 268 | val="$1"; shift |
9c7a7556 JB |
269 | fi |
270 | x_includes="${val}" | |
9c7a7556 | 271 | ;; |
b0209e18 | 272 | "x_libraries" ) |
9c7a7556 JB |
273 | ## If the value was omitted, get it from the next argument. |
274 | if [ "${valomitted}" = "yes" ]; then | |
275 | ## Get the next argument from the argument list, if there is one. | |
6703f6cd | 276 | if [ $# = 0 ]; then |
b0209e18 | 277 | (echo "${progname}: You must give a value for the \`--${optname}' option, as in |
cedb6c1b | 278 | \`--${optname}=/usr/local/X11/lib'." |
9c7a7556 JB |
279 | echo "${short_usage}") >&2 |
280 | exit 1 | |
281 | fi | |
6703f6cd | 282 | val="$1"; shift |
9c7a7556 JB |
283 | fi |
284 | x_libraries="${val}" | |
9c7a7556 JB |
285 | ;; |
286 | ||
376b3ec2 | 287 | ## Should this use the "development" file organization? |
c5f67786 | 288 | "run_in_place" ) |
cedb6c1b BF |
289 | single_tree= |
290 | run_in_place=1 | |
c5f67786 JB |
291 | ;; |
292 | ||
376b3ec2 | 293 | ## Should this use the "single tree" file organization? |
1052acbf BF |
294 | "single_tree" ) |
295 | run_in_place= | |
296 | single_tree=1 | |
297 | ;; | |
298 | ||
cedb6c1b BF |
299 | ## Has the user specified one of the path options? |
300 | prefix | exec_prefix | bindir | libdir | etcdir | datadir | \ | |
301 | archlibdir | statedir | mandir | infodir | lispdir | lockdir | \ | |
109ebdd4 | 302 | lisppath | locallisppath | docdir ) |
cedb6c1b BF |
303 | ## If the value was omitted, get it from the next argument. |
304 | if [ "${valomitted}" = "yes" ]; then | |
6703f6cd | 305 | if [ $# = 0 ]; then |
cedb6c1b BF |
306 | (echo \ |
307 | "$progname: You must give a value for the \`--${optname}' option,"; | |
308 | echo \ | |
309 | "as in \`--${optname}=`eval echo '$'$optname`.'" | |
310 | echo "$short_usage") >&2 | |
311 | exit 1 | |
312 | fi | |
6703f6cd | 313 | val="$1"; shift |
cedb6c1b | 314 | fi |
6703f6cd BF |
315 | eval "${opt}=\"${val}\"" |
316 | eval "${opt}_specified=1" | |
cedb6c1b | 317 | ;; |
86ddcc58 | 318 | |
d02e05d1 JB |
319 | ## Verbose flag, tested by autoconf macros. |
320 | "verbose" ) | |
321 | verbose=yes | |
322 | ;; | |
323 | ||
0c22fbca JB |
324 | ## Has the user asked for some help? |
325 | "usage" | "help" ) | |
1c0feb67 RS |
326 | if [ "x$PAGER" = x ] |
327 | then | |
328 | echo "${short_usage}" | more | |
329 | else | |
330 | echo "${short_usage}" | $PAGER | |
331 | fi | |
0c22fbca JB |
332 | exit |
333 | ;; | |
ca1d1d23 | 334 | |
0c22fbca JB |
335 | ## We ignore all other options silently. |
336 | esac | |
ca1d1d23 | 337 | ;; |
0c22fbca JB |
338 | |
339 | ## Anything not starting with a hyphen we assume is a | |
340 | ## configuration name. | |
ca1d1d23 | 341 | *) |
8509d50c | 342 | configuration=${arg} |
ca1d1d23 | 343 | ;; |
0c22fbca | 344 | |
ca1d1d23 JB |
345 | esac |
346 | done | |
347 | ||
6703f6cd BF |
348 | ### Get the arguments back. See the diatribe on Shell Magic above. |
349 | eval set x "$quoted_arguments"; shift | |
350 | ||
8509d50c | 351 | if [ "${configuration}" = "" ]; then |
334e7c23 JB |
352 | echo '- You did not tell me what kind of host system you want to configure. |
353 | - I will attempt to guess the kind of system this is.' 1>&2 | |
354 | guesssys=`echo ${progname} | sed 's/configure$/config.guess/'` | |
355 | if configuration=`${guesssys}` ; then | |
356 | echo "- Looks like this is a ${configuration}" 1>&2 | |
357 | else | |
358 | echo '- Failed to guess the system type. You need to tell me.' 1>&2 | |
8428ef44 | 359 | echo "${short_usage}" >&2 |
334e7c23 JB |
360 | exit 1 |
361 | fi | |
0c22fbca JB |
362 | fi |
363 | ||
0c22fbca JB |
364 | #### Decide where the source is. |
365 | case "${srcdir}" in | |
366 | ||
e94740ce | 367 | ## If it's not specified, see if `.' or `..' might work. |
0c22fbca | 368 | "" ) |
2e694846 JB |
369 | confdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'` |
370 | if [ -f $confdir/src/lisp.h -a -f $confdir/lisp/version.el ]; then | |
0871bc22 | 371 | srcdir="${confdir}" |
e94740ce | 372 | else |
2e694846 | 373 | if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then |
426460bf | 374 | srcdir='.' |
e94740ce | 375 | else |
2e694846 | 376 | if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then |
426460bf | 377 | srcdir='..' |
2e694846 JB |
378 | else |
379 | (echo "\ | |
e94740ce JB |
380 | ${progname}: Neither the current directory nor its parent seem to |
381 | contain the Emacs sources. If you do not want to build Emacs in its | |
382 | source tree, you should run \`${progname}' in the directory in which | |
383 | you wish to build Emacs, using its \`--srcdir' option to say where the | |
384 | sources may be found." | |
2e694846 JB |
385 | echo "${short_usage}") >&2 |
386 | exit 1 | |
387 | fi | |
e94740ce JB |
388 | fi |
389 | fi | |
0c22fbca JB |
390 | ;; |
391 | ||
e94740ce | 392 | ## Otherwise, check if the directory they specified is okay. |
0c22fbca | 393 | * ) |
e94740ce JB |
394 | if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then |
395 | (echo "\ | |
396 | ${progname}: The directory specified with the \`--srcdir' option, | |
397 | \`${srcdir}', doesn't seem to contain the Emacs sources. You should | |
398 | either run the \`${progname}' script at the top of the Emacs source | |
399 | tree, or use the \`--srcdir' option to specify where the Emacs sources | |
400 | are." | |
0c22fbca JB |
401 | echo "${short_usage}") >&2 |
402 | exit 1 | |
403 | fi | |
404 | ;; | |
0871bc22 | 405 | esac |
0c22fbca | 406 | |
0871bc22 JB |
407 | #### Make srcdir absolute, if it isn't already. It's important to |
408 | #### avoid running the path through pwd unnecessary, since pwd can | |
409 | #### give you automounter prefixes, which can go away. | |
410 | case "${srcdir}" in | |
411 | /* ) ;; | |
c9ed10f6 JB |
412 | . ) |
413 | ## We may be able to use the $PWD environment variable to make this | |
414 | ## absolute. But sometimes PWD is inaccurate. | |
dce3d8a9 | 415 | if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ] ; then |
c9ed10f6 JB |
416 | srcdir="$PWD" |
417 | else | |
418 | srcdir="`(cd ${srcdir}; pwd)`" | |
1d488950 | 419 | fi |
c9ed10f6 | 420 | ;; |
0871bc22 | 421 | * ) srcdir="`(cd ${srcdir}; pwd)`" ;; |
0c22fbca JB |
422 | esac |
423 | ||
13595f8b DM |
424 | ### Remove trailing slashes. |
425 | srcdir=`echo "${srcdir}" | sed 's,\([^/]\)/*$,\1,'` | |
426 | ||
acd399a1 RM |
427 | #### Check if the source directory already has a configured system in it. |
428 | if [ `pwd` != `(cd ${srcdir} && pwd)` ] \ | |
429 | && [ -f "${srcdir}/src/config.h" ] ; then | |
430 | (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used" | |
431 | echo " as a build directory right now; it has been configured in its own" | |
432 | echo " right. To configure in another directory as well, you MUST" | |
433 | echo " use GNU make. If you do not have GNU make, then you must" | |
434 | echo " now do \`make distclean' in ${srcdir}," | |
435 | echo " and then run ${progname} again.") >&2 | |
91675811 RM |
436 | extrasub='/^VPATH[ ]*=/c\ |
437 | vpath %.c $(srcdir)\ | |
438 | vpath %.h $(srcdir)\ | |
eb8a344d RM |
439 | vpath %.y $(srcdir)\ |
440 | vpath %.l $(srcdir)\ | |
441 | vpath %.s $(srcdir)\ | |
91675811 | 442 | vpath %.in $(srcdir)' |
acd399a1 | 443 | fi |
acd399a1 | 444 | |
0c22fbca | 445 | ### Make the necessary directories, if they don't exist. |
1c4ce111 | 446 | for dir in ./src ./lib-src ./cpp ./oldXMenu ./lwlib ./etc ; do |
30945baf JB |
447 | if [ ! -d ${dir} ]; then |
448 | mkdir ${dir} | |
449 | fi | |
450 | done | |
0c22fbca JB |
451 | |
452 | #### Given the configuration name, set machfile and opsysfile to the | |
453 | #### names of the m/*.h and s/*.h files we should use. | |
454 | ||
455 | ### Canonicalize the configuration name. | |
e9ba01ff | 456 | echo "Checking the configuration name" |
279271ba | 457 | if canonical=`${srcdir}/config.sub "${configuration}"` ; then : ; else |
8509d50c JB |
458 | exit $? |
459 | fi | |
20d9a863 | 460 | |
3647c171 JB |
461 | ### If you add support for a new configuration, add code to this |
462 | ### switch statement to recognize your configuration name and select | |
463 | ### the appropriate operating system and machine description files. | |
464 | ||
8509d50c JB |
465 | ### You would hope that you could choose an m/*.h file pretty much |
466 | ### based on the machine portion of the configuration name, and an s- | |
467 | ### file based on the operating system portion. However, it turns out | |
468 | ### that each m/*.h file is pretty manufacturer-specific - for | |
469 | ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are | |
470 | ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS | |
471 | ### machines. So we basically have to have a special case for each | |
472 | ### configuration name. | |
3647c171 | 473 | ### |
8509d50c JB |
474 | ### As far as handling version numbers on operating systems is |
475 | ### concerned, make sure things will fail in a fixable way. If | |
476 | ### /etc/MACHINES doesn't say anything about version numbers, be | |
477 | ### prepared to handle anything reasonably. If version numbers | |
478 | ### matter, be sure /etc/MACHINES says something about it. | |
3647c171 JB |
479 | ### |
480 | ### Eric Raymond says we should accept strings like "sysvr4" to mean | |
481 | ### "System V Release 4"; he writes, "The old convention encouraged | |
482 | ### confusion between `system' and `release' levels'." | |
483 | ||
8509d50c | 484 | machine='' opsys='' unported='false' |
279271ba | 485 | case "${canonical}" in |
8509d50c | 486 | |
8c044644 CH |
487 | ## NetBSD ports |
488 | *-*-netbsd* ) | |
489 | opsys=netbsd | |
490 | case "${canonical}" in | |
422450b9 | 491 | i[345]86-*-netbsd*) machine=intel386 ;; |
e2b721b7 CH |
492 | m68k-*-netbsd*) |
493 | # This is somewhat bogus. | |
8c044644 | 494 | machine=hp9000s300 ;; |
e2b721b7 CH |
495 | mips-*-netbsd*) machine=pmax ;; |
496 | ns32k-*-netbsd*) machine=ns32000 ;; | |
497 | sparc-*-netbsd*) machine=sparc ;; | |
8c044644 CH |
498 | esac |
499 | ;; | |
500 | ||
c5417c91 RS |
501 | ## Acorn RISCiX: |
502 | arm-acorn-riscix1.1* ) | |
f3b0152b | 503 | machine=acorn opsys=riscix1-1 |
c5417c91 RS |
504 | ;; |
505 | arm-acorn-riscix1.2* | arm-acorn-riscix ) | |
f3b0152b | 506 | machine=acorn opsys=riscix1-2 |
c5417c91 RS |
507 | ;; |
508 | ||
8509d50c | 509 | ## Alliant machines |
20d9a863 JB |
510 | ## Strictly speaking, we need the version of the alliant operating |
511 | ## system to choose the right machine file, but currently the | |
512 | ## configuration name doesn't tell us enough to choose the right | |
513 | ## one; we need to give alliants their own operating system name to | |
514 | ## do this right. When someone cares, they can help us. | |
515 | fx80-alliant-* ) | |
8509d50c | 516 | machine=alliant4 opsys=bsd4-2 |
20d9a863 JB |
517 | ;; |
518 | i860-alliant-* ) | |
8509d50c | 519 | machine=alliant-2800 opsys=bsd4-3 |
20d9a863 | 520 | ;; |
ca1d1d23 | 521 | |
eee2204a RS |
522 | alpha-dec-osf* ) |
523 | machine=alpha opsys=osf1 | |
524 | ;; | |
525 | ||
8509d50c JB |
526 | ## Altos 3068 |
527 | m68*-altos-sysv* ) | |
528 | machine=altos opsys=usg5-2 | |
20d9a863 | 529 | ;; |
8509d50c JB |
530 | |
531 | ## Amdahl UTS | |
532 | 580-amdahl-sysv* ) | |
533 | machine=amdahl opsys=usg5-2-2 | |
20d9a863 | 534 | ;; |
ca1d1d23 | 535 | |
8509d50c JB |
536 | ## Appallings - I mean, Apollos - running Domain |
537 | m68*-apollo* ) | |
e4474817 | 538 | machine=apollo opsys=bsd4-2 |
20d9a863 | 539 | ;; |
8509d50c JB |
540 | |
541 | ## AT&T 3b2, 3b5, 3b15, 3b20 | |
542 | we32k-att-sysv* ) | |
543 | machine=att3b opsys=usg5-2-2 | |
544 | ;; | |
545 | ||
546 | ## AT&T 3b1 - The Mighty Unix PC! | |
547 | m68*-att-sysv* ) | |
548 | machine=7300 opsys=usg5-2-2 | |
549 | ;; | |
550 | ||
f9b9f71b FP |
551 | ## Bull dpx20 |
552 | rs6000-bull-bosx* ) | |
553 | machine=ibmrs6000 opsys=aix3-2 | |
554 | ;; | |
555 | ||
6ec1f458 JB |
556 | ## Bull dpx2 |
557 | m68*-bull-sysv3* ) | |
558 | machine=dpx2 opsys=usg5-3 | |
559 | ;; | |
560 | ||
8509d50c | 561 | ## Bull sps7 |
6ec1f458 | 562 | m68*-bull-sysv2* ) |
8509d50c | 563 | machine=sps7 opsys=usg5-2 |
20d9a863 | 564 | ;; |
8509d50c JB |
565 | |
566 | ## CCI 5/32, 6/32 -- see "Tahoe". | |
567 | ||
568 | ## Celerity | |
569 | ## I don't know what configuration name to use for this; config.sub | |
570 | ## doesn't seem to know anything about it. Hey, Celerity users, get | |
571 | ## in touch with us! | |
572 | celerity-celerity-bsd* ) | |
573 | machine=celerity opsys=bsd4-2 | |
574 | ;; | |
575 | ||
576 | ## Clipper | |
577 | ## What operating systems does this chip run that Emacs has been | |
578 | ## tested on? | |
579 | clipper-* ) | |
580 | machine=clipper | |
581 | ## We'll use the catch-all code at the bottom to guess the | |
582 | ## operating system. | |
583 | ;; | |
584 | ||
585 | ## Convex | |
0c287afb | 586 | *-convex-bsd* | *-convex-convexos* ) |
8509d50c | 587 | machine=convex opsys=bsd4-3 |
2c205270 RS |
588 | ## Prevents suprious white space in makefiles - d.m.cooke@larc.nasa.gov |
589 | NON_GNU_CPP="cc -E -P" | |
8509d50c JB |
590 | ;; |
591 | ||
592 | ## Cubix QBx/386 | |
422450b9 | 593 | i[345]86-cubix-sysv* ) |
8509d50c JB |
594 | machine=intel386 opsys=usg5-3 |
595 | ;; | |
596 | ||
597 | ## Cydra 5 | |
598 | cydra*-cydrome-sysv* ) | |
599 | machine=cydra5 opsys=usg5-3 | |
600 | ;; | |
601 | ||
b86d694e | 602 | ## Data General AViiON Machines |
39178e9e RS |
603 | m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) |
604 | machine=aviion opsys=dgux5-4r3 | |
677159d6 | 605 | ;; |
39178e9e RS |
606 | m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) |
607 | machine=aviion opsys=dgux5-4r2 | |
677159d6 | 608 | ;; |
b86d694e JB |
609 | m88k-dg-dgux* ) |
610 | machine=aviion opsys=dgux | |
611 | ;; | |
612 | ||
8509d50c | 613 | ## DECstations |
1c0feb67 | 614 | mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* ) |
8509d50c JB |
615 | machine=pmax opsys=bsd4-2 |
616 | ;; | |
617 | mips-dec-ultrix* | mips-dec-bsd* ) | |
618 | machine=pmax opsys=bsd4-3 | |
619 | ;; | |
620 | mips-dec-osf* ) | |
621 | machine=pmax opsys=osf1 | |
622 | ;; | |
623 | ||
624 | ## Motorola Delta machines | |
98f5cfc3 | 625 | m68k-motorola-sysv* | m68000-motorola-sysv* ) |
8509d50c | 626 | machine=delta opsys=usg5-3 |
764b979b RS |
627 | if [ -z "`type gnucc | grep 'not found'`" ] |
628 | then CC=gnucc | |
629 | else | |
630 | if [ -z "`type gcc | grep 'not found'`" ] | |
631 | then CC=gcc | |
632 | else CC=cc | |
633 | fi | |
634 | fi | |
8509d50c | 635 | ;; |
ac0e6f3b JB |
636 | m88k-motorola-sysv4* ) |
637 | machine=delta88k opsys=usg5-4 | |
638 | ;; | |
8509d50c JB |
639 | m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) |
640 | machine=delta88k opsys=usg5-3 | |
641 | ;; | |
642 | ||
643 | ## Dual machines | |
644 | m68*-dual-sysv* ) | |
645 | machine=dual opsys=usg5-2 | |
646 | ;; | |
647 | m68*-dual-uniplus* ) | |
648 | machine=dual opsys=unipl5-2 | |
649 | ;; | |
650 | ||
651 | ## Elxsi 6400 | |
652 | elxsi-elxsi-sysv* ) | |
653 | machine=elxsi opsys=usg5-2 | |
654 | ;; | |
655 | ||
656 | ## Encore machines | |
657 | ns16k-encore-bsd* ) | |
658 | machine=ns16000 opsys=umax | |
659 | ;; | |
660 | ||
661 | ## The GEC 93 - apparently, this port isn't really finished yet. | |
662 | ||
663 | ## Gould Power Node and NP1 | |
1c0feb67 | 664 | pn-gould-bsd4.2* ) |
8509d50c JB |
665 | machine=gould opsys=bsd4-2 |
666 | ;; | |
1c0feb67 | 667 | pn-gould-bsd4.3* ) |
8509d50c JB |
668 | machine=gould opsys=bsd4-3 |
669 | ;; | |
670 | np1-gould-bsd* ) | |
671 | machine=gould-np1 opsys=bsd4-3 | |
672 | ;; | |
673 | ||
d8e16cd2 RS |
674 | ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000 |
675 | ## as far as Emacs is concerned). | |
676 | m88k-harris-cxux* ) | |
677 | # Build needs to be different on 7.0 and later releases | |
678 | case "`uname -r`" in | |
679 | [56].[0-9] ) machine=nh4000 opsys=cxux ;; | |
680 | [7].[0-9] ) machine=nh4000 opsys=cxux7 ;; | |
681 | esac | |
682 | ;; | |
683 | ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000) | |
684 | m68k-harris-cxux* ) | |
685 | machine=nh3000 opsys=cxux | |
686 | ;; | |
687 | ||
8509d50c JB |
688 | ## Honeywell XPS100 |
689 | xps*-honeywell-sysv* ) | |
690 | machine=xps100 opsys=usg5-2 | |
691 | ;; | |
692 | ||
693 | ## HP 9000 series 200 or 300 | |
694 | m68*-hp-bsd* ) | |
695 | machine=hp9000s300 opsys=bsd4-3 | |
696 | ;; | |
d69d8d1e | 697 | ## HP/UX 7, 8 and 9 are supported on these machines. |
20d9a863 | 698 | m68*-hp-hpux* ) |
d69d8d1e | 699 | case "`uname -r`" in |
1c0feb67 RS |
700 | ## Someone's system reports A.B8.05 for this. |
701 | ## I wonder what other possibilities there are. | |
702 | *.B8.* ) machine=hp9000s300 opsys=hpux8 ;; | |
d69d8d1e JB |
703 | *.08.* ) machine=hp9000s300 opsys=hpux8 ;; |
704 | *.09.* ) machine=hp9000s300 opsys=hpux9 ;; | |
705 | *) machine=hp9000s300 opsys=hpux ;; | |
706 | esac | |
20d9a863 | 707 | ;; |
ca1d1d23 | 708 | |
c55f453b | 709 | ## HP 9000 series 700 and 800, running HP/UX |
ea2c2e02 | 710 | hppa*-hp-hpux7* ) |
280ec6c2 | 711 | machine=hp800 opsys=hpux |
c55f453b | 712 | ;; |
ea2c2e02 | 713 | hppa*-hp-hpux8* ) |
280ec6c2 | 714 | machine=hp800 opsys=hpux8 |
c55f453b | 715 | ;; |
d3da379e RS |
716 | hppa*-hp-hpux9shr* ) |
717 | machine=hp800 opsys=hpux9shr | |
718 | ;; | |
65d0cca4 RS |
719 | hppa*-hp-hpux9* ) |
720 | machine=hp800 opsys=hpux9 | |
721 | ;; | |
ea2c2e02 JB |
722 | |
723 | ## HP 9000 series 700 and 800, running HP/UX | |
c55f453b JB |
724 | hppa*-hp-hpux* ) |
725 | ## Cross-compilation? Nah! | |
252c8b3b | 726 | case "`uname -r`" in |
1c0feb67 RS |
727 | ## Someone's system reports A.B8.05 for this. |
728 | ## I wonder what other possibilities there are. | |
280ec6c2 RS |
729 | *.B8.* ) machine=hp800 opsys=hpux8 ;; |
730 | *.08.* ) machine=hp800 opsys=hpux8 ;; | |
731 | *.09.* ) machine=hp800 opsys=hpux9 ;; | |
732 | *) machine=hp800 opsys=hpux ;; | |
c55f453b | 733 | esac |
8509d50c JB |
734 | ;; |
735 | ||
736 | ## Orion machines | |
737 | orion-orion-bsd* ) | |
738 | machine=orion opsys=bsd4-2 | |
739 | ;; | |
740 | clipper-orion-bsd* ) | |
741 | machine=orion105 opsys=bsd4-2 | |
742 | ;; | |
743 | ||
744 | ## IBM machines | |
422450b9 | 745 | i[345]86-ibm-aix1.1* ) |
8509d50c JB |
746 | machine=ibmps2-aix opsys=usg5-2-2 |
747 | ;; | |
422450b9 | 748 | i[345]86-ibm-aix1.[23]* | i[345]86-ibm-aix* ) |
8509d50c JB |
749 | machine=ibmps2-aix opsys=usg5-3 |
750 | ;; | |
d5aac16a RS |
751 | i370-ibm-aix*) |
752 | machine=ibm370aix opsys=usg5-3 | |
753 | ;; | |
1174421c | 754 | rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* ) |
8509d50c JB |
755 | machine=ibmrs6000 opsys=aix3-1 |
756 | ;; | |
1174421c | 757 | rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 ) |
a69c774b KH |
758 | machine=ibmrs6000 opsys=aix3-2-5 |
759 | ;; | |
1174421c | 760 | rs6000-ibm-aix* | powerpc-ibm-aix* ) |
17a624d1 JB |
761 | machine=ibmrs6000 opsys=aix3-2 |
762 | ;; | |
1c0feb67 | 763 | romp-ibm-bsd4.3* ) |
d20c62bf RS |
764 | machine=ibmrt opsys=bsd4-3 |
765 | ;; | |
1c0feb67 | 766 | romp-ibm-bsd4.2* ) |
d20c62bf RS |
767 | machine=ibmrt opsys=bsd4-2 |
768 | ;; | |
1c0feb67 | 769 | romp-ibm-aos4.3* ) |
d20c62bf RS |
770 | machine=ibmrt opsys=bsd4-3 |
771 | ;; | |
1c0feb67 | 772 | romp-ibm-aos4.2* ) |
8509d50c JB |
773 | machine=ibmrt opsys=bsd4-2 |
774 | ;; | |
d20c62bf RS |
775 | romp-ibm-aos* ) |
776 | machine=ibmrt opsys=bsd4-3 | |
777 | ;; | |
778 | romp-ibm-bsd* ) | |
779 | machine=ibmrt opsys=bsd4-3 | |
780 | ;; | |
8509d50c JB |
781 | romp-ibm-aix* ) |
782 | machine=ibmrt-aix opsys=usg5-2-2 | |
783 | ;; | |
784 | ||
785 | ## Integrated Solutions `Optimum V' | |
1c0feb67 | 786 | m68*-isi-bsd4.2* ) |
8509d50c JB |
787 | machine=isi-ov opsys=bsd4-2 |
788 | ;; | |
1c0feb67 | 789 | m68*-isi-bsd4.3* ) |
8509d50c JB |
790 | machine=isi-ov opsys=bsd4-3 |
791 | ;; | |
792 | ||
793 | ## Intel 386 machines where we do care about the manufacturer | |
422450b9 | 794 | i[345]86-intsys-sysv* ) |
8509d50c JB |
795 | machine=is386 opsys=usg5-2-2 |
796 | ;; | |
6992e6b7 RS |
797 | |
798 | ## Prime EXL | |
422450b9 | 799 | i[345]86-prime-sysv* ) |
6992e6b7 RS |
800 | machine=i386 opsys=usg5-3 |
801 | ;; | |
802 | ||
a66d4bd3 | 803 | ## Sequent Symmetry running Dynix |
422450b9 | 804 | i[345]86-sequent-bsd* ) |
6992e6b7 RS |
805 | machine=symmetry opsys=bsd4-3 |
806 | ;; | |
807 | ||
a66d4bd3 RS |
808 | ## Sequent Symmetry running DYNIX/ptx |
809 | ## Use the old cpp rather than the newer ANSI one. | |
810 | i[345]86-sequent-ptx* ) | |
811 | machine=sequent-ptx opsys=ptx | |
812 | NON_GNU_CPP="/lib/cpp" | |
813 | ;; | |
814 | ||
4acc6824 RS |
815 | ## Unspecified sysv on an ncr machine defaults to svr4.2. |
816 | ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.) | |
422450b9 | 817 | i[345]86-ncr-sysv* ) |
4acc6824 | 818 | machine=intel386 opsys=usg5-4-2 |
14442cbf RS |
819 | ;; |
820 | ||
df4da582 | 821 | ## Intel 860 |
9c34bd79 | 822 | i860-*-sysv4* ) |
df4da582 | 823 | machine=i860 opsys=usg5-4 |
abf1ee75 RS |
824 | NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc. |
825 | NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion. | |
df4da582 JB |
826 | ;; |
827 | ||
8509d50c | 828 | ## Masscomp machines |
1c0feb67 | 829 | m68*-masscomp-rtu* ) |
8509d50c JB |
830 | machine=masscomp opsys=rtu |
831 | ;; | |
832 | ||
833 | ## Megatest machines | |
834 | m68*-megatest-bsd* ) | |
835 | machine=mega68 opsys=bsd4-2 | |
836 | ;; | |
837 | ||
838 | ## Workstations sold by MIPS | |
839 | ## This is not necessarily all workstations using the MIPS processor - | |
840 | ## Irises are produced by SGI, and DECstations by DEC. | |
841 | ||
842 | ## etc/MACHINES lists mips.h and mips4.h as possible machine files, | |
843 | ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance | |
844 | ## it gives for choosing between the alternatives seems to be "Use | |
845 | ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with | |
846 | ## the BSD world." I'll assume that these are instructions for | |
847 | ## handling two odd situations, and that every other situation | |
848 | ## should use mips.h and usg5-2-2, they being listed first. | |
60e1b37f JB |
849 | mips-mips-usg* ) |
850 | machine=mips4 | |
851 | ## Fall through to the general code at the bottom to decide on the OS. | |
852 | ;; | |
8509d50c | 853 | mips-mips-riscos4* ) |
cc40a99e | 854 | machine=mips4 opsys=bsd4-3 |
9c34bd79 | 855 | NON_GNU_CC="cc -systype bsd43" |
781ce8e8 | 856 | NON_GNU_CPP="cc -systype bsd43 -E" |
8509d50c JB |
857 | ;; |
858 | mips-mips-bsd* ) | |
859 | machine=mips opsys=bsd4-3 | |
860 | ;; | |
861 | mips-mips-* ) | |
862 | machine=mips opsys=usg5-2-2 | |
863 | ;; | |
864 | ||
c5f67786 | 865 | ## NeXT |
422450b9 | 866 | m68*-next-* | i[345]86-next-* ) |
c5f67786 JB |
867 | machine=next opsys=mach2 |
868 | ;; | |
869 | ||
8509d50c JB |
870 | ## The complete machine from National Semiconductor |
871 | ns32k-ns-genix* ) | |
872 | machine=ns32000 opsys=usg5-2 | |
873 | ;; | |
874 | ||
875 | ## NCR machines | |
3647c171 | 876 | m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) |
8509d50c JB |
877 | machine=tower32 opsys=usg5-2-2 |
878 | ;; | |
3647c171 | 879 | m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) |
8509d50c JB |
880 | machine=tower32v3 opsys=usg5-3 |
881 | ;; | |
882 | ||
883 | ## Nixdorf Targon 31 | |
884 | m68*-nixdorf-sysv* ) | |
885 | machine=targon31 opsys=usg5-2-2 | |
886 | ;; | |
887 | ||
888 | ## Nu (TI or LMI) | |
889 | m68*-nu-sysv* ) | |
890 | machine=nu opsys=usg5-2 | |
891 | ;; | |
892 | ||
893 | ## Plexus | |
894 | m68*-plexus-sysv* ) | |
895 | machine=plexus opsys=usg5-2 | |
896 | ;; | |
897 | ||
8509d50c JB |
898 | ## Pyramid machines |
899 | ## I don't really have any idea what sort of processor the Pyramid has, | |
900 | ## so I'm assuming it is its own architecture. | |
901 | pyramid-pyramid-bsd* ) | |
902 | machine=pyramid opsys=bsd4-2 | |
903 | ;; | |
904 | ||
905 | ## Sequent Balance | |
1c0feb67 | 906 | ns32k-sequent-bsd4.2* ) |
8509d50c JB |
907 | machine=sequent opsys=bsd4-2 |
908 | ;; | |
1c0feb67 | 909 | ns32k-sequent-bsd4.3* ) |
8509d50c | 910 | machine=sequent opsys=bsd4-3 |
8509d50c JB |
911 | ;; |
912 | ||
73e7c7be RS |
913 | ## Siemens Nixdorf |
914 | mips-siemens-sysv* ) | |
915 | machine=mips-siemens opsys=usg5-4 | |
916 | NON_GNU_CC=/usr/ccs/bin/cc | |
9fb89b5e | 917 | NON_GNU_CPP=/usr/ccs/lib/cpp |
73e7c7be RS |
918 | ;; |
919 | ||
920 | ## Silicon Graphics machines | |
921 | ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030) | |
922 | m68*-sgi-iris3.5* ) | |
923 | machine=irist opsys=iris3-5 | |
924 | ;; | |
925 | m68*-sgi-iris3.6* | m68*-sgi-iris*) | |
926 | machine=irist opsys=iris3-6 | |
927 | ;; | |
928 | ## Iris 4D | |
65d0cca4 | 929 | mips-sgi-irix3* ) |
73e7c7be RS |
930 | machine=iris4d opsys=irix3-3 |
931 | ;; | |
65d0cca4 | 932 | mips-sgi-irix5* ) |
73e7c7be RS |
933 | machine=iris4d opsys=irix5-0 |
934 | ;; | |
65d0cca4 | 935 | mips-sgi-irix4* | mips-sgi-irix* ) |
73e7c7be RS |
936 | machine=iris4d opsys=irix4-0 |
937 | ;; | |
938 | ||
8509d50c | 939 | ## SONY machines |
1c0feb67 | 940 | m68*-sony-bsd4.2* ) |
8509d50c JB |
941 | machine=news opsys=bsd4-2 |
942 | ;; | |
1c0feb67 RS |
943 | m68*-sony-bsd4.3* ) |
944 | machine=news opsys=bsd4-3 | |
945 | ;; | |
946 | m68*-sony-newsos3*) | |
8509d50c JB |
947 | machine=news opsys=bsd4-3 |
948 | ;; | |
be4d8b37 | 949 | mips-sony-bsd* | mips-sony-newsos4* ) |
8509d50c JB |
950 | machine=news-risc opsys=bsd4-3 |
951 | ;; | |
eaa2dcbd | 952 | mips-sony-newsos* ) |
e8d9f2df | 953 | machine=news-risc opsys=newsos5 |
eaa2dcbd | 954 | ;; |
8509d50c JB |
955 | |
956 | ## Stride | |
957 | m68*-stride-sysv* ) | |
958 | machine=stride opsys=usg5-2 | |
959 | ;; | |
960 | ||
961 | ## Suns | |
422450b9 | 962 | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* | i[345]86-*-solaris2* | i[345]86-*-sunos5* ) |
279271ba | 963 | case "${canonical}" in |
8509d50c JB |
964 | m68*-sunos1* ) machine=sun1 ;; |
965 | m68*-sunos2* ) machine=sun2 ;; | |
966 | m68* ) machine=sun3 ;; | |
422450b9 RS |
967 | i[345]86-sun-sunos[34]* ) machine=sun386 ;; |
968 | i[345]86-*-* ) machine=intel386 ;; | |
8509d50c JB |
969 | sparc* ) machine=sparc ;; |
970 | * ) unported=true ;; | |
971 | esac | |
279271ba | 972 | case "${canonical}" in |
34207774 | 973 | ## The Sun386 didn't get past 4.0. |
422450b9 | 974 | i[345]86-*-sunos4 ) opsys=sunos4-0 ;; |
8509d50c | 975 | *-sunos4.0* ) opsys=sunos4-0 ;; |
fa4a954e RS |
976 | *-sunos4.1.3* ) opsys=sunos4-1-3 |
977 | NON_GCC_TEST_OPTIONS=-Bstatic | |
978 | GCC_TEST_OPTIONS=-static | |
979 | ;; | |
b2c3b7ff | 980 | *-sunos4shr* ) opsys=sunos4shr ;; |
65d0cca4 RS |
981 | *-sunos4* | *-sunos ) opsys=sunos4-1 |
982 | NON_GCC_TEST_OPTIONS=-Bstatic | |
983 | GCC_TEST_OPTIONS=-static | |
984 | ;; | |
9c34bd79 RS |
985 | *-sunos5.3* | *-solaris2.3* ) |
986 | opsys=sol2-3 | |
987 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
988 | ;; | |
32304ff9 RS |
989 | *-sunos5.4* | *-solaris2.4* ) |
990 | opsys=sol2-4 | |
991 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
992 | ;; | |
9c34bd79 RS |
993 | *-sunos5* | *-solaris* ) |
994 | opsys=sol2 | |
995 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
996 | ;; | |
8509d50c | 997 | * ) opsys=bsd4-2 ;; |
20d9a863 | 998 | esac |
8509d50c JB |
999 | ;; |
1000 | ||
1001 | ## Tadpole 68k | |
1002 | m68*-tadpole-sysv* ) | |
1003 | machine=tad68k opsys=usg5-3 | |
1004 | ;; | |
1005 | ||
1006 | ## Tahoe machines | |
1c0feb67 | 1007 | tahoe-tahoe-bsd4.2* ) |
8509d50c JB |
1008 | machine=tahoe opsys=bsd4-2 |
1009 | ;; | |
1c0feb67 | 1010 | tahoe-tahoe-bsd4.3* ) |
8509d50c JB |
1011 | machine=tahoe opsys=bsd4-3 |
1012 | ;; | |
1013 | ||
1014 | ## Tandem Integrity S2 | |
1015 | mips-tandem-sysv* ) | |
1016 | machine=tandem-s2 opsys=usg5-3 | |
1017 | ;; | |
1018 | ||
26f186c2 | 1019 | ## Tektronix XD88 |
0d33a690 RS |
1020 | m88k-tektronix-sysv3* ) |
1021 | machine=tekxd88 opsys=usg5-3 | |
26f186c2 JB |
1022 | ;; |
1023 | ||
8509d50c JB |
1024 | ## Tektronix 16000 box (6130?) |
1025 | ns16k-tektronix-bsd* ) | |
1026 | machine=ns16000 opsys=bsd4-2 | |
1027 | ;; | |
1028 | ## Tektronix 4300 | |
1029 | ## src/m/tek4300.h hints that this is a m68k machine. | |
1030 | m68*-tektronix-bsd* ) | |
1c0feb67 | 1031 | machine=tek4300 opsys=bsd4-3 |
8509d50c JB |
1032 | ;; |
1033 | ||
1034 | ## Titan P2 or P3 | |
1035 | ## We seem to have lost the machine-description file titan.h! | |
1036 | titan-titan-sysv* ) | |
1037 | machine=titan opsys=usg5-3 | |
1038 | ;; | |
1039 | ||
1040 | ## Ustation E30 (SS5E) | |
1041 | m68*-unisys-uniplus* ) | |
1042 | machine=ustation opsystem=unipl5-2 | |
1043 | ;; | |
1044 | ||
1045 | ## Vaxen. | |
1046 | vax-dec-* ) | |
1047 | machine=vax | |
279271ba | 1048 | case "${canonical}" in |
1c0feb67 RS |
1049 | *-bsd4.1* ) opsys=bsd4-1 ;; |
1050 | *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;; | |
1051 | *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;; | |
c326cbeb | 1052 | *-bsd386* | *-bsdi* ) opsys=bsd386 ;; |
3647c171 JB |
1053 | *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;; |
1054 | *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;; | |
1055 | *-vms* ) opsys=vms ;; | |
1056 | * ) unported=true | |
20d9a863 JB |
1057 | esac |
1058 | ;; | |
1059 | ||
8509d50c JB |
1060 | ## Whitechapel MG1 |
1061 | ns16k-whitechapel-* ) | |
1062 | machine=mg1 | |
1063 | ## We don't know what sort of OS runs on these; we'll let the | |
1064 | ## operating system guessing code below try. | |
1065 | ;; | |
1066 | ||
1067 | ## Wicat | |
1068 | m68*-wicat-sysv* ) | |
1069 | machine=wicat opsys=usg5-2 | |
1070 | ;; | |
1071 | ||
b3fb7fc3 | 1072 | ## Intel 386 machines where we don't care about the manufacturer |
422450b9 | 1073 | i[345]86-*-* ) |
b3fb7fc3 | 1074 | machine=intel386 |
279271ba | 1075 | case "${canonical}" in |
b3fb7fc3 | 1076 | *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;; |
1c0feb67 | 1077 | *-isc2.2* ) opsys=isc2-2 ;; |
e5f1d6a0 | 1078 | *-isc4.0* ) opsys=isc4-0 ;; |
b3fb7fc3 | 1079 | *-isc* ) opsys=isc3-0 ;; |
dc6ace12 | 1080 | *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;; |
b3fb7fc3 JB |
1081 | *-esix* ) opsys=esix ;; |
1082 | *-xenix* ) opsys=xenix ;; | |
1083 | *-linux* ) opsys=linux ;; | |
4394c854 | 1084 | *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;; |
c326cbeb | 1085 | *-bsd386* | *-bsdi* ) opsys=bsd386 ;; |
1c0feb67 | 1086 | *-386bsd* ) opsys=386bsd ;; |
a117e51e | 1087 | *-freebsd* ) opsys=freebsd ;; |
91d39bf0 | 1088 | *-nextstep* ) opsys=mach2 ;; |
b3fb7fc3 JB |
1089 | ## Otherwise, we'll fall through to the generic opsys code at the bottom. |
1090 | esac | |
1091 | ;; | |
1092 | ||
20d9a863 | 1093 | * ) |
8509d50c | 1094 | unported=true |
20d9a863 | 1095 | ;; |
20d9a863 | 1096 | esac |
ca1d1d23 | 1097 | |
8509d50c JB |
1098 | ### If the code above didn't choose an operating system, just choose |
1099 | ### an operating system based on the configuration name. You really | |
1100 | ### only want to use this when you have no idea what the right | |
1101 | ### operating system is; if you know what operating systems a machine | |
1102 | ### runs, it's cleaner to make it explicit in the case statement | |
1103 | ### above. | |
87a6b538 | 1104 | if [ x"${opsys}" = x ]; then |
279271ba | 1105 | case "${canonical}" in |
d6dddccb RM |
1106 | *-gnu* ) opsys=gnu ;; |
1107 | *-bsd4.[01] ) opsys=bsd4-1 ;; | |
1108 | *-bsd4.2 ) opsys=bsd4-2 ;; | |
1109 | *-bsd4.3 ) opsys=bsd4-3 ;; | |
3647c171 JB |
1110 | *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;; |
1111 | *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;; | |
1112 | *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;; | |
1113 | *-sysv3 | *-sysvr3 ) opsys=usg5-3 ;; | |
1114 | *-sysv4 | *-sysvr4 ) opsys=usg5-4 ;; | |
effdbe0d RS |
1115 | *-sysv4.1 | *-sysvr4.1 ) |
1116 | NON_GNU_CPP=/usr/lib/cpp | |
1117 | opsys=usg5-4 ;; | |
7846ef2c | 1118 | *-sysv4.2 | *-sysvr4.2 ) opsys=usg5-4-2 ;; |
8509d50c JB |
1119 | * ) |
1120 | unported=true | |
1121 | ;; | |
1122 | esac | |
1123 | fi | |
1124 | ||
1125 | if $unported ; then | |
279271ba | 1126 | (echo "${progname}: Emacs hasn't been ported to \`${canonical}' systems." |
8509d50c JB |
1127 | echo "${progname}: Check \`etc/MACHINES' for recognized configuration names." |
1128 | ) >&2 | |
1129 | exit 1 | |
1130 | fi | |
1131 | ||
1132 | machfile="m/${machine}.h" | |
1133 | opsysfile="s/${opsys}.h" | |
1134 | ||
c5f67786 JB |
1135 | ] |
1136 | AC_PREPARE(lisp) | |
e4474817 | 1137 | AC_CONFIG_HEADER(src/config.h) |
c5f67786 | 1138 | [ |
7d99494c JB |
1139 | |
1140 | #### Choose a compiler. | |
63041661 | 1141 | if [ "x$CC" = x ] |
c78f294b RS |
1142 | then true |
1143 | else cc_specified=1 | |
63041661 RS |
1144 | fi |
1145 | ||
7d99494c | 1146 | case ${with_gcc} in |
8ba83d88 | 1147 | "yes" ) CC="gcc" GCC=1 ;; |
63041661 RS |
1148 | "no" ) |
1149 | if [ "x$CC" = x ] | |
c78f294b RS |
1150 | then CC=cc; |
1151 | else true; | |
63041661 RS |
1152 | fi |
1153 | ;; | |
7d99494c | 1154 | * ) |
e4474817 | 1155 | ] AC_PROG_CC [ |
7d99494c JB |
1156 | esac |
1157 | ||
9c34bd79 RS |
1158 | #### Some systems specify a CPP to use unless we are using GCC. |
1159 | #### Now that we know whether we are using GCC, we can decide whether | |
1160 | #### to use that one. | |
f4828eac | 1161 | if [ "x$NON_GNU_CPP" = x ] || [ x$GCC = x1 ] || [ "x$CPP" != x ] |
9c34bd79 RS |
1162 | then true |
1163 | else | |
990a7421 | 1164 | CPP="$NON_GNU_CPP" |
9c34bd79 RS |
1165 | fi |
1166 | ||
1167 | #### Some systems specify a CC to use unless we are using GCC. | |
1168 | #### Now that we know whether we are using GCC, we can decide whether | |
1169 | #### to use that one. | |
63041661 | 1170 | if [ "x$NON_GNU_CC" = x ] || [ x$GCC = x1 ] || [ x$cc_specified = x1 ] |
9c34bd79 RS |
1171 | then true |
1172 | else | |
63041661 | 1173 | CC="$NON_GNU_CC" |
9c34bd79 RS |
1174 | fi |
1175 | ||
fa4a954e RS |
1176 | if [ x$GCC = x1 ] && [ "x$GCC_TEST_OPTIONS" != x ] |
1177 | then | |
1178 | CC="$CC $GCC_TEST_OPTIONS" | |
1179 | fi | |
1180 | ||
1181 | if [ x$GCC = x ] && [ "x$NON_GCC_TEST_OPTIONS" != x ] | |
1182 | then | |
1183 | CC="$CC $NON_GCC_TEST_OPTIONS" | |
1184 | fi | |
1185 | ||
00c564b5 JB |
1186 | #### Some other nice autoconf tests. If you add a test here which |
1187 | #### should make an entry in src/config.h, don't forget to add an | |
1188 | #### #undef clause to src/config.h.in for autoconf to modify. | |
7d99494c | 1189 | ] |
00c564b5 | 1190 | dnl checks for programs |
e4474817 | 1191 | AC_LN_S |
c5f67786 | 1192 | AC_PROG_CPP |
86ddcc58 | 1193 | AC_PROG_INSTALL |
4b5a51c1 | 1194 | AC_PROG_YACC |
00c564b5 JB |
1195 | |
1196 | dnl checks for UNIX variants that set `DEFS' | |
619a9b1e | 1197 | AC_AIX |
00c564b5 JB |
1198 | |
1199 | dnl checks for header files | |
f48c727a | 1200 | AC_HAVE_HEADERS(sys/timeb.h sys/time.h unistd.h utime.h) |
d855a603 | 1201 | AC_STDC_HEADERS |
9397d456 | 1202 | AC_TIME_WITH_SYS_TIME |
764b979b RS |
1203 | dnl In Autoconf 1.8 use AC_SYS_SIGLIST_DECLARED instead of this. |
1204 | AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h, | |
1205 | [#include <signal.h> | |
1206 | /* NetBSD declares sys_siglist in <unistd.h>. */ | |
1207 | #ifdef HAVE_UNISTD_H | |
1208 | #include <unistd.h> | |
1209 | #endif], [char *msg = *(sys_siglist + 1);], | |
1210 | AC_DEFINE(SYS_SIGLIST_DECLARED)) | |
f48c727a KH |
1211 | dnl Some systems have utime.h but don't declare the struct anyplace. |
1212 | AC_COMPILE_CHECK(struct utimbuf, [#ifdef TIME_WITH_SYS_TIME | |
1213 | #include <sys/time.h> | |
1214 | #include <time.h> | |
1215 | #else | |
1216 | #ifdef HAVE_SYS_TIME_H | |
1217 | #include <sys/time.h> | |
1218 | #else | |
1219 | #include <time.h> | |
1220 | #endif | |
1221 | #endif | |
1222 | #ifdef HAVE_UTIME_H | |
1223 | #include <utime.h> | |
1224 | #endif], [static struct utimbuf x; x.actime = x.modtime;], | |
1225 | AC_DEFINE(HAVE_STRUCT_UTIMBUF)) | |
00c564b5 JB |
1226 | |
1227 | dnl checks for typedefs | |
7d99494c | 1228 | AC_RETSIGTYPE |
3622dcd9 KH |
1229 | AC_COMPILE_CHECK(struct timeval, [#ifdef TIME_WITH_SYS_TIME |
1230 | #include <sys/time.h> | |
1231 | #include <time.h> | |
1232 | #else | |
1233 | #ifdef HAVE_SYS_TIME_H | |
1234 | #include <sys/time.h> | |
1235 | #else | |
1236 | #include <time.h> | |
1237 | #endif | |
1238 | #endif], [static struct timeval x; x.tv_sec = x.tv_usec;], | |
1239 | AC_DEFINE(HAVE_TIMEVAL)) | |
00c564b5 | 1240 | |
00c564b5 | 1241 | dnl checks for structure members |
a6eb6797 | 1242 | AC_STRUCT_TM |
d52c5f58 | 1243 | AC_TIMEZONE |
00c564b5 JB |
1244 | |
1245 | dnl checks for compiler characteristics | |
c5f67786 | 1246 | AC_CONST |
00c564b5 | 1247 | |
4703b679 RS |
1248 | dnl check for Make feature |
1249 | AC_SET_MAKE | |
1250 | ||
00c564b5 | 1251 | dnl checks for operating system services |
fe5de478 | 1252 | AC_LONG_FILE_NAMES |
00c564b5 JB |
1253 | |
1254 | dnl other checks for UNIX variants | |
7d99494c JB |
1255 | [ |
1256 | ||
0c22fbca | 1257 | #### Choose a window system. |
e9ba01ff | 1258 | echo "checking for specified window system" |
c5f67786 | 1259 | |
8509d50c | 1260 | window_system='' |
20d9a863 | 1261 | case "${with_x}" in |
2c44309a RS |
1262 | yes ) |
1263 | window_system=${window_system}x11 | |
20d9a863 JB |
1264 | ;; |
1265 | no ) | |
1266 | window_system=${window_system}none | |
20d9a863 | 1267 | ;; |
2c44309a | 1268 | esac |
a1493829 RS |
1269 | case "${window_system}" in |
1270 | .* ) | |
1271 | ;; | |
1272 | * ) | |
1273 | case "${with_x11}" in | |
1274 | yes ) | |
1275 | window_system=x11 | |
1276 | ;; | |
1277 | no ) | |
1278 | window_system=none | |
1279 | ;; | |
1280 | esac | |
1281 | case "${with_x10}" in | |
1282 | yes ) | |
1283 | window_system=x10 | |
1284 | ;; | |
1285 | no ) | |
1286 | window_system=none | |
1287 | ;; | |
1288 | esac | |
20d9a863 | 1289 | ;; |
2c44309a RS |
1290 | esac |
1291 | ||
ca1d1d23 JB |
1292 | case "${window_system}" in |
1293 | "none" | "x11" | "x10" ) ;; | |
ca1d1d23 | 1294 | "" ) |
825e4ec2 JB |
1295 | # --x-includes or --x-libraries implies --with-x11. |
1296 | if [ -n "${x_includes}" ] || [ -n "${x_libraries}" ]; then | |
1297 | window_system=x11 | |
1298 | else | |
1299 | echo " No window system specified. Looking for X11." | |
1300 | # If the user didn't specify a window system and we found X11, use it. | |
1301 | if [ -r /usr/lib/libX11.a \ | |
5d9aefc7 | 1302 | -o -d /usr/include/X11 \ |
7d99494c JB |
1303 | -o -d /usr/X386/include \ |
1304 | -o -d ${x_includes}/X11 ]; then | |
825e4ec2 JB |
1305 | window_system=x11 |
1306 | fi | |
46947372 | 1307 | fi |
ca1d1d23 JB |
1308 | ;; |
1309 | * ) | |
825e4ec2 | 1310 | echo "Don't specify a window system more than once." >&2 |
ca1d1d23 JB |
1311 | exit 1 |
1312 | ;; | |
1313 | esac | |
1314 | ||
1659e114 RS |
1315 | case "${window_system}" in |
1316 | "" | "x11" ) | |
1317 | ### If the user hasn't specified where we should find X, try | |
1318 | ### letting autoconf figure that out. | |
1319 | if [ -z "${x_includes}" ] && [ -z "${x_libraries}" ]; then | |
1320 | ] | |
1321 | AC_FIND_X | |
1322 | [ | |
1323 | fi | |
1324 | if [ -n "${x_includes}" ] || [ -n "${x_libraries}" ]; then | |
1325 | window_system=x11 | |
1326 | fi | |
1327 | ;; | |
1328 | esac | |
1329 | ||
825e4ec2 JB |
1330 | [ -z "${window_system}" ] && window_system=none |
1331 | ||
1332 | [ -n "${x_libraries}" ] && LD_SWITCH_X_SITE="-L${x_libraries}" | |
5b46c383 | 1333 | [ -n "${x_libraries}" ] && LD_SWITCH_X_SITE_AUX="-R${x_libraries}" |
825e4ec2 JB |
1334 | [ -n "${x_includes}" ] && C_SWITCH_X_SITE="-I${x_includes}" |
1335 | ||
7a5e0891 BF |
1336 | # Avoid forcing the search of /usr/include before fixed include files. |
1337 | if [ "$C_SWITCH_X_SITE" = "-I/usr/include" ]; then | |
1338 | C_SWITCH_X_SITE=" " | |
1339 | fi | |
1340 | ||
ca1d1d23 JB |
1341 | case "${window_system}" in |
1342 | x11 ) | |
0c22fbca JB |
1343 | HAVE_X_WINDOWS=yes |
1344 | HAVE_X11=yes | |
8509d50c | 1345 | echo " Using X11." |
1c4ce111 | 1346 | case "${with_x_toolkit}" in |
c6a9d251 | 1347 | athena | lucid ) |
1c4ce111 | 1348 | USE_X_TOOLKIT=LUCID |
c6a9d251 | 1349 | echo " Using Xt toolkit." |
1c4ce111 RS |
1350 | ;; |
1351 | motif ) | |
1352 | USE_X_TOOLKIT=MOTIF | |
1353 | echo " Using Motif toolkit." | |
1354 | ;; | |
1355 | open-look ) | |
1356 | USE_X_TOOLKIT=OPEN_LOOK | |
1357 | echo " Using Open-Look toolkit." | |
1358 | ;; | |
1359 | * ) | |
78a0e199 | 1360 | USE_X_TOOLKIT=none |
1c4ce111 RS |
1361 | echo " Using Xlib directly." |
1362 | ;; | |
1363 | esac | |
ca1d1d23 JB |
1364 | ;; |
1365 | x10 ) | |
0c22fbca JB |
1366 | HAVE_X_WINDOWS=yes |
1367 | HAVE_X11=no | |
78a0e199 | 1368 | USE_X_TOOLKIT=none |
8509d50c | 1369 | echo " Using X10." |
ca1d1d23 JB |
1370 | ;; |
1371 | none ) | |
0c22fbca JB |
1372 | HAVE_X_WINDOWS=no |
1373 | HAVE_X11=no | |
78a0e199 | 1374 | USE_X_TOOLKIT=none |
8509d50c | 1375 | echo " Using no window system." |
ca1d1d23 JB |
1376 | ;; |
1377 | esac | |
1c4ce111 | 1378 | X_TOOLKIT_TYPE=$USE_X_TOOLKIT |
ca1d1d23 | 1379 | |
0c22fbca JB |
1380 | ### If we're using X11, we should use the X menu package. |
1381 | HAVE_X_MENU=no | |
1382 | case ${HAVE_X11} in | |
20d9a863 | 1383 | yes ) |
0c22fbca | 1384 | HAVE_X_MENU=yes |
ca1d1d23 JB |
1385 | ;; |
1386 | esac | |
1387 | ||
0c22fbca | 1388 | #### Extract some information from the operating system and machine files. |
4746118a | 1389 | |
e9ba01ff | 1390 | echo "examining the machine- and system-dependent files to find out" |
46947372 | 1391 | echo " - which libraries the lib-src programs will want, and" |
e9ba01ff | 1392 | echo " - whether the GNU malloc routines are usable" |
c5f67786 | 1393 | |
3ef1da47 RS |
1394 | ### First figure out CFLAGS (which we use for running the compiler here) |
1395 | ### and REAL_CFLAGS (which we use for real compilation). | |
1396 | ### The two are the same except on a few systems, where they are made | |
1397 | ### different to work around various lossages. For example, | |
1398 | ### GCC 2.5 on Linux needs them to be different because it treats -g | |
1399 | ### as implying static linking. | |
1400 | ||
02366d6b RS |
1401 | ### If the CFLAGS env var is specified, we use that value |
1402 | ### instead of the default. | |
1403 | ||
c5f67786 JB |
1404 | ### It's not important that this name contain the PID; you can't run |
1405 | ### two configures in the same directory and have anything work | |
1406 | ### anyway. | |
1407 | tempcname="conftest.c" | |
1408 | ||
e94740ce JB |
1409 | echo ' |
1410 | #include "'${srcdir}'/src/'${opsysfile}'" | |
1411 | #include "'${srcdir}'/src/'${machfile}'" | |
ca1d1d23 JB |
1412 | #ifndef LIBS_MACHINE |
1413 | #define LIBS_MACHINE | |
1414 | #endif | |
1415 | #ifndef LIBS_SYSTEM | |
1416 | #define LIBS_SYSTEM | |
1417 | #endif | |
80afd15e JB |
1418 | #ifndef C_SWITCH_SYSTEM |
1419 | #define C_SWITCH_SYSTEM | |
f071c05a | 1420 | #endif |
1e39d86d RS |
1421 | #ifndef C_SWITCH_MACHINE |
1422 | #define C_SWITCH_MACHINE | |
1423 | #endif | |
0028bd66 RS |
1424 | configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM |
1425 | configure___ c_switch_system=C_SWITCH_SYSTEM | |
1e39d86d | 1426 | configure___ c_switch_machine=C_SWITCH_MACHINE |
ac384e4f | 1427 | |
825e4ec2 | 1428 | #ifndef LIB_X11_LIB |
1c0feb67 | 1429 | #define LIB_X11_LIB -lX11 |
825e4ec2 JB |
1430 | #endif |
1431 | ||
1432 | #ifndef LIBX11_MACHINE | |
1433 | #define LIBX11_MACHINE | |
1434 | #endif | |
1435 | ||
1436 | #ifndef LIBX11_SYSTEM | |
1437 | #define LIBX11_SYSTEM | |
1438 | #endif | |
0028bd66 | 1439 | configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM |
825e4ec2 | 1440 | |
ac384e4f | 1441 | #ifdef UNEXEC |
0028bd66 | 1442 | configure___ unexec=UNEXEC |
ac384e4f | 1443 | #else |
0028bd66 | 1444 | configure___ unexec=unexec.o |
ac384e4f JB |
1445 | #endif |
1446 | ||
46947372 | 1447 | #ifdef SYSTEM_MALLOC |
0028bd66 | 1448 | configure___ system_malloc=yes |
46947372 | 1449 | #else |
0028bd66 | 1450 | configure___ system_malloc=no |
46947372 | 1451 | #endif |
4ed216b3 JB |
1452 | |
1453 | #ifndef C_DEBUG_SWITCH | |
1454 | #define C_DEBUG_SWITCH -g | |
1455 | #endif | |
1456 | ||
1457 | #ifndef C_OPTIMIZE_SWITCH | |
1458 | #define C_OPTIMIZE_SWITCH -O | |
1459 | #endif | |
1460 | ||
3ef1da47 RS |
1461 | #ifdef THIS_IS_CONFIGURE |
1462 | ||
1463 | /* Get the CFLAGS for tests in configure. */ | |
4ed216b3 | 1464 | #ifdef __GNUC__ |
a84cd140 | 1465 | configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}' |
4ed216b3 | 1466 | #else |
a84cd140 | 1467 | configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}' |
4ed216b3 | 1468 | #endif |
3ef1da47 RS |
1469 | |
1470 | #else /* not THIS_IS_CONFIGURE */ | |
1471 | ||
1472 | /* Get the CFLAGS for real compilation. */ | |
1473 | #ifdef __GNUC__ | |
1474 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}' | |
1475 | #else | |
1476 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${CFLAGS}' | |
1477 | #endif | |
1478 | ||
1479 | #endif /* not THIS_IS_CONFIGURE */ | |
46947372 | 1480 | ' > ${tempcname} |
a6eb6797 JB |
1481 | # The value of CPP is a quoted variable reference, so we need to do this |
1482 | # to get its actual value... | |
b73fe839 | 1483 | CPP=`eval "echo $CPP"` |
12d733d0 RS |
1484 | eval `${CPP} -Isrc ${tempcname} \ |
1485 | | grep 'configure___' \ | |
1486 | | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` | |
02366d6b | 1487 | if [ "x$CFLAGS" = x ]; then |
02366d6b RS |
1488 | eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \ |
1489 | | grep 'configure___' \ | |
1490 | | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` | |
1491 | else | |
1492 | REAL_CFLAGS="$CFLAGS" | |
1493 | fi | |
46947372 JB |
1494 | rm ${tempcname} |
1495 | ||
ac384e4f JB |
1496 | ### Compute the unexec source name from the object name. |
1497 | UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`" | |
7d99494c | 1498 | |
46947372 | 1499 | # Do the opsystem or machine files prohibit the use of the GNU malloc? |
e94740ce JB |
1500 | # Assume not, until told otherwise. |
1501 | GNU_MALLOC=yes | |
46947372 | 1502 | if [ "${system_malloc}" = "yes" ]; then |
0c22fbca JB |
1503 | GNU_MALLOC=no |
1504 | GNU_MALLOC_reason=" | |
8509d50c | 1505 | (The GNU allocators don't work with this system configuration.)" |
46947372 JB |
1506 | fi |
1507 | ||
87a6b538 | 1508 | if [ x"${REL_ALLOC}" = x ]; then |
0c22fbca | 1509 | REL_ALLOC=${GNU_MALLOC} |
46947372 | 1510 | fi |
ca1d1d23 | 1511 | |
0c22fbca JB |
1512 | LISP_FLOAT_TYPE=yes |
1513 | ||
e94740ce | 1514 | |
825e4ec2 JB |
1515 | #### Add the libraries to LIBS and check for some functions. |
1516 | ||
30945baf | 1517 | ] |
1e39d86d | 1518 | DEFS="$c_switch_system $c_switch_machine $DEFS" |
825e4ec2 JB |
1519 | LIBS="$libsrc_libs" |
1520 | ||
1521 | dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks, | |
1522 | dnl and also adds -ldnet to LIBS, which Autoconf uses for checks. | |
1523 | AC_HAVE_LIBRARY(-ldnet) | |
30a91516 RS |
1524 | dnl This causes -lresolv to get used in subsequent tests, |
1525 | dnl which causes failures on some systems such as HPUX 9. | |
1526 | dnl AC_HAVE_LIBRARY(-lresolv) | |
30945baf | 1527 | |
dbf6ad3d RM |
1528 | AC_HAVE_LIBRARY(-lXbsd, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") |
1529 | ||
1530 | echo checking for XFree86 | |
1531 | if test -d /usr/X386/include; then | |
1532 | HAVE_XFREE386=yes | |
1533 | test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include" | |
1534 | fi | |
30945baf | 1535 | |
56988bbe RS |
1536 | # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used |
1537 | # for the tests that follow. | |
56988bbe | 1538 | |
825e4ec2 JB |
1539 | if test "${HAVE_X11}" = "yes"; then |
1540 | DEFS="$C_SWITCH_X_SITE $DEFS" | |
1541 | LIBS="$LD_SWITCH_X_SITE $LIBX $LIBS" | |
56988bbe | 1542 | CFLAGS="$C_SWITCH_X_SITE $CFLAGS" |
5725490b RM |
1543 | AC_HAVE_FUNCS(XrmSetDatabase XScreenResourceString \ |
1544 | XScreenNumberOfScreen XSetWMProtocols) | |
825e4ec2 JB |
1545 | fi |
1546 | ||
4624e651 RS |
1547 | if test "${USE_X_TOOLKIT}" != "none"; then |
1548 | AC_COMPILE_CHECK(X11 toolkit version, | |
1549 | [#include <X11/Intrinsic.h>], | |
152e1c0d RS |
1550 | [ |
1551 | #if XtSpecificationRelease < 6 | |
4624e651 | 1552 | fail; |
56988bbe RS |
1553 | #endif |
1554 | ], | |
4624e651 RS |
1555 | AC_DEFINE(HAVE_X11XTR6)) |
1556 | fi | |
1557 | ||
e9ba01ff RS |
1558 | # If netdb.h doesn't declare h_errno, we must declare it by hand. |
1559 | AC_COMPILE_CHECK(declaration of h_errno in netdb.h, | |
1560 | [#include <netdb.h>], | |
1561 | [ | |
1562 | int | |
1563 | foo () | |
1564 | { | |
1565 | return h_errno; | |
1566 | } | |
1567 | ], | |
1568 | AC_DEFINE(HAVE_H_ERRNO)) | |
1569 | ||
825e4ec2 | 1570 | AC_ALLOCA |
3f469c2e RM |
1571 | |
1572 | # logb and frexp are found in -lm on most systems. | |
1573 | AC_HAVE_LIBRARY(-lm) | |
5dd53b99 | 1574 | AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \ |
ad11d3de | 1575 | random lrand48 bcopy bcmp logb frexp fmod drem ftime res_init setsid \ |
3622dcd9 | 1576 | strerror fpathconf select) |
825e4ec2 JB |
1577 | |
1578 | ok_so_far=true | |
1579 | AC_FUNC_CHECK(socket, , ok_so_far=) | |
1580 | if test -n "$ok_so_far"; then | |
1581 | AC_HEADER_CHECK(netinet/in.h, , ok_so_far=) | |
1582 | fi | |
1583 | if test -n "$ok_so_far"; then | |
1584 | AC_HEADER_CHECK(arpa/inet.h, , ok_so_far=) | |
1585 | fi | |
1586 | if test -n "$ok_so_far"; then | |
1587 | AC_DEFINE(HAVE_INET_SOCKETS) | |
1588 | fi | |
56988bbe | 1589 | |
3ef1da47 RS |
1590 | # Set up the CFLAGS for real compilation, so we can substitute it. |
1591 | CFLAGS="$REAL_CFLAGS" | |
56988bbe | 1592 | |
825e4ec2 | 1593 | [ |
e94740ce JB |
1594 | #### Find out which version of Emacs this is. |
1595 | version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | |
73e7c7be | 1596 | | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` |
87a6b538 | 1597 | if [ x"${version}" = x ]; then |
e94740ce JB |
1598 | echo "${progname}: can't find current emacs version in |
1599 | \`${srcdir}/lisp/version.el'." >&2 | |
1600 | exit 1 | |
1601 | fi | |
1602 | ||
8686888e JB |
1603 | if [ -f /usr/lpp/X11/bin/smt.exp ]; then |
1604 | ] | |
1605 | AC_DEFINE(HAVE_AIX_SMT_EXP) | |
1606 | [ | |
1607 | fi | |
1608 | ||
e4474817 | 1609 | #### Specify what sort of things we'll be editing into Makefile and config.h. |
279271ba | 1610 | ### Use configuration here uncanonicalized to avoid exceeding size limits. |
7d99494c | 1611 | ] |
7d99494c | 1612 | AC_SUBST(version) |
ca2a1384 | 1613 | AC_SUBST(configuration) |
7d99494c | 1614 | AC_SUBST(srcdir) |
cedb6c1b BF |
1615 | AC_SUBST(prefix) |
1616 | AC_SUBST(exec_prefix) | |
1617 | AC_SUBST(bindir) | |
1618 | AC_SUBST(datadir) | |
1619 | AC_SUBST(statedir) | |
1620 | AC_SUBST(libdir) | |
1621 | AC_SUBST(mandir) | |
1622 | AC_SUBST(infodir) | |
1623 | AC_SUBST(lispdir) | |
1624 | AC_SUBST(locallisppath) | |
1625 | AC_SUBST(lisppath) | |
1626 | AC_SUBST(etcdir) | |
1627 | AC_SUBST(lockdir) | |
1628 | AC_SUBST(archlibdir) | |
109ebdd4 | 1629 | AC_SUBST(docdir) |
7d99494c | 1630 | AC_SUBST(c_switch_system) |
1e39d86d | 1631 | AC_SUBST(c_switch_machine) |
7d99494c | 1632 | AC_SUBST(LD_SWITCH_X_SITE) |
5b46c383 | 1633 | AC_SUBST(LD_SWITCH_X_SITE_AUX) |
7d99494c | 1634 | AC_SUBST(C_SWITCH_X_SITE) |
e4474817 | 1635 | AC_SUBST(CFLAGS) |
1c4ce111 | 1636 | AC_SUBST(X_TOOLKIT_TYPE) |
73e7c7be RS |
1637 | AC_SUBST(machfile) |
1638 | AC_SUBST(opsysfile) | |
e4474817 | 1639 | |
376b3ec2 | 1640 | AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "\"${configuration}\"") |
64cfec5c | 1641 | AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "\"${config_options}\"") |
9361e005 JB |
1642 | AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") |
1643 | AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"") | |
1644 | AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE}) | |
382d3536 | 1645 | AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX}) |
9361e005 | 1646 | AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE}) |
ac384e4f | 1647 | AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC}) |
9361e005 | 1648 | |
7d99494c JB |
1649 | [ |
1650 | if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then | |
1651 | ] AC_DEFINE(HAVE_X_WINDOWS) [ | |
1652 | fi | |
78a0e199 | 1653 | if [ "${USE_X_TOOLKIT}" != "none" ] ; then |
1c4ce111 RS |
1654 | ] AC_DEFINE(USE_X_TOOLKIT) [ |
1655 | fi | |
7d99494c JB |
1656 | if [ "${HAVE_X11}" = "yes" ] ; then |
1657 | ] AC_DEFINE(HAVE_X11) [ | |
1658 | fi | |
1659 | if [ "${HAVE_XFREE386}" = "yes" ] ; then | |
1660 | ] AC_DEFINE(HAVE_XFREE386) [ | |
1661 | fi | |
1662 | if [ "${HAVE_X_MENU}" = "yes" ] ; then | |
1663 | ] AC_DEFINE(HAVE_X_MENU) [ | |
1664 | fi | |
1665 | if [ "${GNU_MALLOC}" = "yes" ] ; then | |
1666 | ] AC_DEFINE(GNU_MALLOC) [ | |
1667 | fi | |
1668 | if [ "${REL_ALLOC}" = "yes" ] ; then | |
1669 | ] AC_DEFINE(REL_ALLOC) [ | |
1670 | fi | |
1671 | if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then | |
1672 | ] AC_DEFINE(LISP_FLOAT_TYPE) [ | |
1673 | fi | |
ca1d1d23 | 1674 | |
cedb6c1b BF |
1675 | # ====================== Developer's configuration ======================= |
1676 | ||
1677 | # The following assignments make sense if you're running Emacs on a single | |
1678 | # machine, one version at a time, and you want changes to the lisp and etc | |
1679 | # directories in the source tree to show up immediately in your working | |
1680 | # environment. It saves a great deal of disk space by not duplicating the | |
1681 | # lisp and etc directories. | |
1682 | ||
1683 | if [ "$run_in_place" = "1" ]; then | |
1684 | lispdir='${srcdir}/lisp' | |
7f291b64 | 1685 | locallisppath='${srcdir}/site-lisp' |
cedb6c1b BF |
1686 | etcdir='${srcdir}/etc' |
1687 | lockdir='${srcdir}/lock' | |
542eb82b RS |
1688 | # We used to make archlibdir and docdir absolute, |
1689 | # but that caused trouble with automounters. | |
1690 | archlibdir='${srcdir}/lib-src' | |
1691 | docdir='${srcdir}/etc' | |
cedb6c1b BF |
1692 | infodir='${srcdir}/info' |
1693 | elif [ "$single_tree" = "1" ]; then | |
1694 | if [ "$exec_prefix_specified" = "" ]; then | |
1695 | exec_prefix='${prefix}' | |
1696 | fi | |
1697 | if [ "$bindir_specified" = "" ]; then | |
1698 | bindir='${exec_prefix}/bin/${configuration}' | |
1699 | fi | |
1700 | if [ "$datadir_specified" = "" ]; then | |
1701 | datadir='${prefix}/common' | |
1702 | fi | |
1703 | if [ "$statedir_specified" = "" ]; then | |
1704 | statedir='${prefix}/common' | |
1705 | fi | |
1706 | if [ "$libdir_specified" = "" ]; then | |
1707 | libdir='${bindir}' | |
1708 | fi | |
1709 | if [ "$lispdir_specified" = "" ]; then | |
1710 | lispdir='${prefix}/common/lisp' | |
1711 | fi | |
1712 | if [ "$locallisppath_specified" = "" ]; then | |
1713 | locallisppath='${prefix}/common/site-lisp' | |
1714 | fi | |
1715 | if [ "$lockdir_specified" = "" ]; then | |
1716 | lockdir='${prefix}/common/lock' | |
1717 | fi | |
1718 | if [ "$archlibdir_specified" = "" ]; then | |
1719 | archlibdir='${libdir}/etc' | |
1720 | fi | |
1721 | if [ "$etcdir_specified" = "" ]; then | |
1722 | etcdir='${prefix}/common/data' | |
1723 | fi | |
109ebdd4 KH |
1724 | if [ "$docdir_specified" = "" ]; then |
1725 | docdir='${prefix}/common/data' | |
1726 | fi | |
cedb6c1b | 1727 | fi |
f6766fff | 1728 | |
7d99494c JB |
1729 | #### Report on what we decided to do. |
1730 | echo " | |
f6766fff | 1731 | |
279271ba | 1732 | Configured for \`${canonical}'. |
8509d50c | 1733 | |
c9ed10f6 | 1734 | Where should the build process find the source code? ${srcdir} |
8509d50c JB |
1735 | What operating system and machine description files should Emacs use? |
1736 | \`${opsysfile}' and \`${machfile}' | |
e4474817 | 1737 | What compiler should emacs be built with? ${CC} ${CFLAGS} |
0c22fbca JB |
1738 | Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} |
1739 | Should Emacs use the relocating allocator for buffers? ${REL_ALLOC} | |
78a0e199 RS |
1740 | What window system should Emacs use? ${window_system} |
1741 | What toolkit should Emacs use? ${USE_X_TOOLKIT}${x_includes+ | |
9c7a7556 | 1742 | Where do we find X Windows header files? }${x_includes}${x_libraries+ |
7d99494c | 1743 | Where do we find X Windows libraries? }${x_libraries} |
8c0e7b73 | 1744 | |
e94740ce | 1745 | " |
825e4ec2 JB |
1746 | |
1747 | # Remove any trailing slashes in these variables. | |
1748 | test -n "${prefix}" && | |
1749 | prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'` | |
1750 | test -n "${exec_prefix}" && | |
1751 | exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` | |
7d99494c | 1752 | ] |
4acc6824 | 1753 | AC_OUTPUT(Makefile lib-src/Makefile.in oldXMenu/Makefile lwlib/Makefile src/Makefile.in, [ |
6e4b48e2 | 1754 | |
cedb6c1b | 1755 | # Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done |
47241a65 RM |
1756 | # after src/config.h is built, since we rely on that file. |
1757 | ||
1758 | changequote(,)dnl The horror, the horror. | |
764b979b RS |
1759 | # Now get this: Some word that is part of the ${srcdir} directory name |
1760 | # or the ${configuration} value might, just might, happen to be an | |
1761 | # identifier like `sun4' or `i386' or something, and be predefined by | |
1762 | # the C preprocessor to some helpful value like 1, or maybe the empty | |
1763 | # string. Needless to say consequent macro substitutions are less | |
1764 | # than conducive to the makefile finding the correct directory. | |
23aaa342 | 1765 | undefs="`echo $top_srcdir $configuration $canonical | |
196a7903 KH |
1766 | sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \ |
1767 | -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \ | |
47241a65 RM |
1768 | `" |
1769 | changequote([,])dnl | |
1770 | ||
4acc6824 RS |
1771 | echo creating lib-src/Makefile |
1772 | ( cd lib-src | |
23aaa342 RS |
1773 | rm -f junk.c junk1.c junk2.c |
1774 | sed -e '/start of cpp stuff/q' \ | |
1775 | < Makefile.in > junk1.c | |
1776 | sed -e '1,/start of cpp stuff/d'\ | |
4acc6824 RS |
1777 | -e 's@/\*\*/#\(.*\)$@/* \1 */@' \ |
1778 | < Makefile.in > junk.c | |
23aaa342 RS |
1779 | $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
1780 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c | |
1781 | cat junk1.c junk2.c > Makefile.new | |
1782 | rm -f junk.c junk1.c junk2.c | |
1783 | chmod 444 Makefile.new | |
1784 | mv -f Makefile.new Makefile | |
4acc6824 RS |
1785 | ) |
1786 | ||
47241a65 RM |
1787 | echo creating src/Makefile |
1788 | ( cd src | |
23aaa342 RS |
1789 | rm -f junk.c junk1.c junk2.c |
1790 | sed -e '/start of cpp stuff/q' \ | |
1791 | < Makefile.in > junk1.c | |
1792 | sed -e '1,/start of cpp stuff/d'\ | |
47241a65 RM |
1793 | -e 's@/\*\*/#\(.*\)$@/* \1 */@' \ |
1794 | < Makefile.in > junk.c | |
23aaa342 RS |
1795 | $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
1796 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c | |
1797 | cat junk1.c junk2.c > Makefile.new | |
1798 | rm -f junk.c junk1.c junk2.c | |
1799 | chmod 444 Makefile.new | |
1800 | mv -f Makefile.new Makefile | |
47241a65 | 1801 | )]) |