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