Commit | Line | Data |
---|---|---|
6e502e37 | 1 | dnl Autoconf script for GNU Emacs |
9ec10b2f DM |
2 | dnl To rebuild the `configure' script from this, execute the command |
3 | dnl autoconf | |
4 | dnl in the directory containing this script. | |
6e502e37 | 5 | dnl |
6a22cdf4 | 6 | dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 |
ad4ac636 | 7 | dnl Free Software Foundation, Inc. |
552dfe31 | 8 | dnl |
6e502e37 | 9 | dnl This file is part of GNU Emacs. |
552dfe31 | 10 | dnl |
6e502e37 RS |
11 | dnl GNU Emacs is free software; you can redistribute it and/or modify |
12 | dnl it under the terms of the GNU General Public License as published by | |
13 | dnl the Free Software Foundation; either version 2, or (at your option) | |
14 | dnl any later version. | |
552dfe31 | 15 | dnl |
6e502e37 RS |
16 | dnl GNU Emacs is distributed in the hope that it will be useful, |
17 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | dnl GNU General Public License for more details. | |
20 | dnl | |
21 | dnl You should have received a copy of the GNU General Public License | |
1fb87c77 KH |
22 | dnl along with GNU Emacs; see the file COPYING. If not, write to the |
23 | dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 | dnl Boston, MA 02111-1307, USA. | |
6e502e37 | 25 | |
5a129faf | 26 | AC_PREREQ(2.51)dnl |
9ec10b2f | 27 | AC_INIT(src/lisp.h) |
5f8c8f00 | 28 | AC_CONFIG_HEADER(src/config.h:src/config.in) |
9ec10b2f | 29 | |
a4663fed PJ |
30 | dnl Support for --program-prefix, --program-suffix and |
31 | dnl --program-transform-name options | |
32 | AC_ARG_PROGRAM | |
33 | ||
9ec10b2f | 34 | lispdir='${datadir}/emacs/${version}/lisp' |
4be21f66 | 35 | locallisppath='${datadir}/emacs/${version}/site-lisp:'\ |
684f4cb3 | 36 | '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim' |
9ec10b2f DM |
37 | lisppath='${locallisppath}:${lispdir}' |
38 | etcdir='${datadir}/emacs/${version}/etc' | |
60c3568d | 39 | archlibdir='${libexecdir}/emacs/${version}/${configuration}' |
9ec10b2f | 40 | docdir='${datadir}/emacs/${version}/etc' |
93c05c18 CW |
41 | gamedir=yes |
42 | ||
43 | AC_ARG_WITH(game-dir, | |
44 | [ --with-game-dir use a shared game directory if possible], | |
45 | [if test "$withval" = yes; then | |
46 | gamedir="${localstatedir}/games/emacs" | |
47 | else | |
48 | if test "$withval" = no; then | |
49 | gamedir=no | |
50 | else | |
51 | gamedir="$withval" | |
52 | fi | |
53 | fi | |
54 | ]) | |
55 | ||
56 | gameuser=games | |
57 | AC_ARG_WITH(game-user, | |
58 | [ --with-game-user use specified user for game directory], | |
59 | [gameuser="$withval"]) | |
9ec10b2f | 60 | |
39a7c455 | 61 | AC_ARG_WITH(gcc, |
6fa064b6 | 62 | [ --without-gcc don't use GCC to compile Emacs if GCC is found]) |
4f734bde | 63 | AC_ARG_WITH(pop, |
6fa064b6 DL |
64 | [ --without-pop don't support POP mail retrieval with movemail], |
65 | [if test "$withval" = yes; then | |
66 | AC_DEFINE(MAIL_USE_POP) | |
67 | else : | |
3d9fec71 DL |
68 | fi], |
69 | AC_DEFINE(MAIL_USE_POP)) | |
a21616bd KR |
70 | AC_ARG_WITH(kerberos, |
71 | [ --with-kerberos support Kerberos-authenticated POP], | |
72 | [AC_DEFINE(KERBEROS)]) | |
73 | AC_ARG_WITH(kerberos5, | |
4d6e16b3 | 74 | [ --with-kerberos5 support Kerberos version 5 authenticated POP], |
a21616bd KR |
75 | [if test "${with_kerberos5+set}" = set; then |
76 | if test "${with_kerberos+set}" != set; then | |
77 | with_kerberos=yes | |
78 | AC_DEFINE(KERBEROS) | |
79 | fi | |
80 | fi | |
81 | AC_DEFINE(KERBEROS5)]) | |
4f734bde DM |
82 | AC_ARG_WITH(hesiod, |
83 | [ --with-hesiod support Hesiod to get the POP server host], | |
84 | [AC_DEFINE(HESIOD)]) | |
3d9830e5 PJ |
85 | |
86 | AC_ARG_WITH(sound, | |
87 | [ --without-sound don't compile with sound support]) | |
88 | ||
4f734bde DM |
89 | dnl This should be the last --with option, because --with-x is |
90 | dnl added later on when we find the path of X, and it's best to | |
91 | dnl keep them together visually. | |
9ec10b2f | 92 | AC_ARG_WITH(x-toolkit, |
f7894e88 | 93 | [ --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)], |
9ec10b2f DM |
94 | [ case "${withval}" in |
95 | y | ye | yes ) val=athena ;; | |
96 | n | no ) val=no ;; | |
97 | l | lu | luc | luci | lucid ) val=lucid ;; | |
84c5c823 | 98 | a | at | ath | athe | athen | athena ) val=athena ;; |
3cd69289 | 99 | m | mo | mot | moti | motif ) val=motif ;; |
2e71ec17 | 100 | dnl These don't currently work. |
2e71ec17 DM |
101 | dnl o | op | ope | open | open- | open-l | open-lo \ |
102 | dnl | open-loo | open-look ) val=open-look ;; | |
9ec10b2f | 103 | * ) |
2e71ec17 DM |
104 | dnl AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value |
105 | dnl which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.]) | |
90b777c5 RS |
106 | AC_MSG_ERROR([\`--with-x-toolkit=$withval' is invalid\; |
107 | this option's value should be \`yes', \`no', \`lucid', \`athena', or \`motif'. | |
9ec10b2f DM |
108 | Currently, \`yes', \`athena' and \`lucid' are synonyms.]) |
109 | ;; | |
110 | esac | |
111 | with_x_toolkit=$val | |
112 | ]) | |
b412189c GM |
113 | AC_ARG_WITH(xpm, |
114 | [ --with-xpm use -lXpm for displaying XPM images]) | |
115 | AC_ARG_WITH(jpeg, | |
116 | [ --with-jpeg use -ljpeg for displaying JPEG images]) | |
117 | AC_ARG_WITH(tiff, | |
495ccc04 | 118 | [ --with-tiff use -ltiff for displaying TIFF images]) |
b412189c GM |
119 | AC_ARG_WITH(gif, |
120 | [ --with-gif use -lungif for displaying GIF images]) | |
121 | AC_ARG_WITH(png, | |
122 | [ --with-png use -lpng for displaying PNG images]) | |
20c1822e | 123 | AC_ARG_WITH(toolkit-scroll-bars, |
4d6e16b3 | 124 | [ --without-toolkit-scroll-bars |
1c7a4f72 | 125 | don't use Motif or Xaw3d scroll bars]) |
c6f7dae8 | 126 | AC_ARG_WITH(xim, |
1c7a4f72 | 127 | [ --without-xim don't use X11 XIM]) |
9ec10b2f DM |
128 | |
129 | #### Make srcdir absolute, if it isn't already. It's important to | |
36969de6 | 130 | #### avoid running the path through pwd unnecessarily, since pwd can |
069df4bf DM |
131 | #### give you automounter prefixes, which can go away. We do all this |
132 | #### so Emacs can find its files when run uninstalled. | |
36969de6 GM |
133 | ## Make sure CDPATH doesn't affect cd (in case PWD is relative). |
134 | unset CDPATH | |
9ec10b2f DM |
135 | case "${srcdir}" in |
136 | /* ) ;; | |
137 | . ) | |
138 | ## We may be able to use the $PWD environment variable to make this | |
139 | ## absolute. But sometimes PWD is inaccurate. | |
b83e4a77 RS |
140 | ## Note: we used to use ${PWD} at the end instead of `pwd`, |
141 | ## but that tested only for a well-formed and valid PWD, | |
142 | ## it did not object when PWD was well-formed and valid but just wrong. | |
143 | if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ; | |
9ec10b2f DM |
144 | then |
145 | srcdir="$PWD" | |
146 | else | |
147 | srcdir="`(cd ${srcdir}; pwd)`" | |
148 | fi | |
149 | ;; | |
150 | * ) srcdir="`(cd ${srcdir}; pwd)`" ;; | |
151 | esac | |
152 | ||
153 | #### Check if the source directory already has a configured system in it. | |
154 | if test `pwd` != `(cd ${srcdir} && pwd)` \ | |
155 | && test -f "${srcdir}/src/config.h" ; then | |
156 | AC_MSG_WARN([The directory tree \`${srcdir}' is being used | |
157 | as a build directory right now; it has been configured in its own | |
158 | right. To configure in another directory as well, you MUST | |
159 | use GNU make. If you do not have GNU make, then you must | |
160 | now do \`make distclean' in ${srcdir}, | |
161 | and then run $0 again.]) | |
162 | ||
2d73167a | 163 | changequote(, )dnl |
9ec10b2f | 164 | extrasub='/^VPATH[ ]*=/c\ |
2d73167a | 165 | changequote([, ])dnl |
9ec10b2f DM |
166 | vpath %.c $(srcdir)\ |
167 | vpath %.h $(srcdir)\ | |
168 | vpath %.y $(srcdir)\ | |
169 | vpath %.l $(srcdir)\ | |
170 | vpath %.s $(srcdir)\ | |
5ac83f86 RS |
171 | vpath %.in $(srcdir)\ |
172 | vpath %.texi $(srcdir)' | |
9ec10b2f DM |
173 | fi |
174 | ||
175 | #### Given the configuration name, set machfile and opsysfile to the | |
176 | #### names of the m/*.h and s/*.h files we should use. | |
177 | ||
178 | ### Canonicalize the configuration name. | |
179 | ||
180 | AC_CANONICAL_HOST | |
181 | canonical=$host | |
fcb04b6e | 182 | configuration=${host_alias-$host} |
9ec10b2f DM |
183 | |
184 | changequote(, )dnl | |
185 | ||
186 | ### If you add support for a new configuration, add code to this | |
187 | ### switch statement to recognize your configuration name and select | |
188 | ### the appropriate operating system and machine description files. | |
189 | ||
190 | ### You would hope that you could choose an m/*.h file pretty much | |
191 | ### based on the machine portion of the configuration name, and an s- | |
192 | ### file based on the operating system portion. However, it turns out | |
193 | ### that each m/*.h file is pretty manufacturer-specific - for | |
194 | ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are | |
195 | ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS | |
196 | ### machines. So we basically have to have a special case for each | |
197 | ### configuration name. | |
198 | ### | |
199 | ### As far as handling version numbers on operating systems is | |
200 | ### concerned, make sure things will fail in a fixable way. If | |
201 | ### /etc/MACHINES doesn't say anything about version numbers, be | |
202 | ### prepared to handle anything reasonably. If version numbers | |
203 | ### matter, be sure /etc/MACHINES says something about it. | |
204 | ### | |
205 | ### Eric Raymond says we should accept strings like "sysvr4" to mean | |
206 | ### "System V Release 4"; he writes, "The old convention encouraged | |
207 | ### confusion between `system' and `release' levels'." | |
208 | ||
209 | machine='' opsys='' unported=no | |
210 | case "${canonical}" in | |
211 | ||
ba45dae0 GM |
212 | ## FreeBSD ports |
213 | *-*-freebsd* ) | |
214 | opsys=freebsd | |
215 | case "${canonical}" in | |
216 | alpha*-*-freebsd*) machine=alpha ;; | |
217 | i[3456]86-*-freebsd*) machine=intel386 ;; | |
218 | esac | |
219 | ;; | |
220 | ||
9ec10b2f DM |
221 | ## NetBSD ports |
222 | *-*-netbsd* ) | |
223 | opsys=netbsd | |
224 | case "${canonical}" in | |
98bbf2a1 | 225 | alpha*-*-netbsd*) machine=alpha ;; |
5ac83f86 | 226 | i[3456]86-*-netbsd*) machine=intel386 ;; |
9ec10b2f DM |
227 | m68k-*-netbsd*) |
228 | # This is somewhat bogus. | |
229 | machine=hp9000s300 ;; | |
ca568b47 | 230 | powerpc-apple-netbsd*) machine=macppc ;; |
9ec10b2f | 231 | mips-*-netbsd*) machine=pmax ;; |
69d5a2fa | 232 | mipsel-*-netbsd*) machine=pmax ;; |
9ec10b2f | 233 | ns32k-*-netbsd*) machine=ns32000 ;; |
b52425f4 | 234 | powerpc-*-netbsd*) machine=macppc ;; |
1ecefa7a | 235 | sparc*-*-netbsd*) machine=sparc ;; |
b336ddd3 | 236 | vax-*-netbsd*) machine=vax ;; |
69d5a2fa | 237 | arm-*-netbsd*) machine=arm ;; |
9ec10b2f DM |
238 | esac |
239 | ;; | |
240 | ||
e3ac1b7f RS |
241 | ## OpenBSD ports |
242 | *-*-openbsd* ) | |
243 | opsys=openbsd | |
244 | case "${canonical}" in | |
98bbf2a1 | 245 | alpha*-*-openbsd*) machine=alpha ;; |
e3ac1b7f | 246 | i386-*-openbsd*) machine=intel386 ;; |
6239880d RS |
247 | m68k-*-openbsd*) machine=hp9000s300 ;; |
248 | mipsel-*-openbsd*) machine=pmax ;; | |
e3ac1b7f RS |
249 | ns32k-*-openbsd*) machine=ns32000 ;; |
250 | sparc-*-openbsd*) machine=sparc ;; | |
ca568b47 | 251 | vax-*-openbsd*) machine=vax ;; |
e3ac1b7f RS |
252 | esac |
253 | ;; | |
254 | ||
3cd69289 DM |
255 | ## Acorn RISCiX: |
256 | arm-acorn-riscix1.1* ) | |
257 | machine=acorn opsys=riscix1-1 | |
258 | ;; | |
259 | arm-acorn-riscix1.2* | arm-acorn-riscix ) | |
aac2257c RS |
260 | ## This name is riscix12 instead of riscix1.2 |
261 | ## to avoid a file name conflict on MSDOS. | |
262 | machine=acorn opsys=riscix12 | |
3cd69289 DM |
263 | ;; |
264 | ||
2c4f7ce7 RS |
265 | ## BSDI ports |
266 | *-*-bsdi* ) | |
267 | opsys=bsdi | |
268 | case "${canonical}" in | |
269 | i[345]86-*-bsdi*) machine=intel386 ;; | |
270 | sparc-*-bsdi*) machine=sparc ;; | |
393032d2 | 271 | powerpc-*-bsdi*) machine=macppc ;; |
2c4f7ce7 RS |
272 | esac |
273 | case "${canonical}" in | |
274 | *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;; | |
275 | *-*-bsdi2.0* ) opsys=bsdos2 ;; | |
276 | *-*-bsdi2* ) opsys=bsdos2-1 ;; | |
277 | *-*-bsdi3* ) opsys=bsdos3 ;; | |
1d06fc82 | 278 | *-*-bsdi[45]* ) opsys=bsdos4 ;; |
2c4f7ce7 RS |
279 | esac |
280 | ;; | |
281 | ||
9ec10b2f DM |
282 | ## Alliant machines |
283 | ## Strictly speaking, we need the version of the alliant operating | |
284 | ## system to choose the right machine file, but currently the | |
285 | ## configuration name doesn't tell us enough to choose the right | |
286 | ## one; we need to give alliants their own operating system name to | |
287 | ## do this right. When someone cares, they can help us. | |
288 | fx80-alliant-* ) | |
289 | machine=alliant4 opsys=bsd4-2 | |
290 | ;; | |
291 | i860-alliant-* ) | |
292 | machine=alliant-2800 opsys=bsd4-3 | |
293 | ;; | |
294 | ||
30457b4f | 295 | ## Alpha (DEC) machines. |
98bbf2a1 | 296 | alpha*-dec-osf* ) |
3cd69289 | 297 | machine=alpha opsys=osf1 |
f528522b | 298 | # This is needed to find X11R6.1 libraries for certain tests. |
1bc5a004 RS |
299 | NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib |
300 | GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib | |
557dcfd7 DL |
301 | # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile |
302 | # due to non-traditional preprocessing with the current compiler | |
303 | # defaults. OSF 4 can also have that compiler version, and there | |
304 | # seems always to have been a usable /usr/bin/cpp. | |
305 | NON_GNU_CPP=/usr/bin/cpp | |
71c72a72 | 306 | case "${canonical}" in |
d5c898bb | 307 | alpha*-dec-osf[5-9]*) |
f8340326 | 308 | opsys=osf5-0 ;; |
e57196a0 | 309 | esac |
3cd69289 DM |
310 | ;; |
311 | ||
98bbf2a1 | 312 | alpha*-*-linux-gnu* ) |
5ac83f86 | 313 | machine=alpha opsys=gnu-linux |
4e90a7d5 RS |
314 | ;; |
315 | ||
d506e713 GM |
316 | arm*-*-linux-gnu* ) |
317 | machine=arm opsys=gnu-linux | |
318 | ;; | |
319 | ||
320 | ppc-*-linux | \ | |
321 | powerpc-*-linux* ) | |
393032d2 | 322 | machine=macppc opsys=gnu-linux |
d506e713 GM |
323 | ;; |
324 | ||
9ec10b2f DM |
325 | ## Altos 3068 |
326 | m68*-altos-sysv* ) | |
327 | machine=altos opsys=usg5-2 | |
328 | ;; | |
c7f493fd | 329 | |
9ec10b2f DM |
330 | ## Amdahl UTS |
331 | 580-amdahl-sysv* ) | |
332 | machine=amdahl opsys=usg5-2-2 | |
333 | ;; | |
334 | ||
acd04c87 RS |
335 | ## Apollo, Domain/OS |
336 | m68*-apollo-* ) | |
337 | machine=apollo opsys=bsd4-3 | |
9ec10b2f DM |
338 | ;; |
339 | ||
340 | ## AT&T 3b2, 3b5, 3b15, 3b20 | |
341 | we32k-att-sysv* ) | |
342 | machine=att3b opsys=usg5-2-2 | |
343 | ;; | |
344 | ||
345 | ## AT&T 3b1 - The Mighty Unix PC! | |
346 | m68*-att-sysv* ) | |
347 | machine=7300 opsys=usg5-2-2 | |
348 | ;; | |
349 | ||
350 | ## Bull dpx20 | |
351 | rs6000-bull-bosx* ) | |
352 | machine=ibmrs6000 opsys=aix3-2 | |
353 | ;; | |
354 | ||
355 | ## Bull dpx2 | |
356 | m68*-bull-sysv3* ) | |
357 | machine=dpx2 opsys=usg5-3 | |
358 | ;; | |
359 | ||
360 | ## Bull sps7 | |
361 | m68*-bull-sysv2* ) | |
362 | machine=sps7 opsys=usg5-2 | |
363 | ;; | |
364 | ||
365 | ## CCI 5/32, 6/32 -- see "Tahoe". | |
366 | ||
367 | ## Celerity | |
368 | ## I don't know what configuration name to use for this; config.sub | |
369 | ## doesn't seem to know anything about it. Hey, Celerity users, get | |
370 | ## in touch with us! | |
371 | celerity-celerity-bsd* ) | |
372 | machine=celerity opsys=bsd4-2 | |
373 | ;; | |
374 | ||
375 | ## Clipper | |
376 | ## What operating systems does this chip run that Emacs has been | |
377 | ## tested on? | |
378 | clipper-* ) | |
379 | machine=clipper | |
380 | ## We'll use the catch-all code at the bottom to guess the | |
381 | ## operating system. | |
382 | ;; | |
383 | ||
b83e4a77 RS |
384 | ## Compaq Nonstop |
385 | mips-compaq-nonstopux* ) | |
386 | machine=nonstopux opsys=nonstopux | |
387 | ;; | |
388 | ||
9ec10b2f DM |
389 | ## Convex |
390 | *-convex-bsd* | *-convex-convexos* ) | |
391 | machine=convex opsys=bsd4-3 | |
908ff139 | 392 | ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov |
9ec10b2f DM |
393 | NON_GNU_CPP="cc -E -P" |
394 | ;; | |
395 | ||
396 | ## Cubix QBx/386 | |
5ac83f86 | 397 | i[3456]86-cubix-sysv* ) |
9ec10b2f DM |
398 | machine=intel386 opsys=usg5-3 |
399 | ;; | |
400 | ||
401 | ## Cydra 5 | |
402 | cydra*-cydrome-sysv* ) | |
403 | machine=cydra5 opsys=usg5-3 | |
404 | ;; | |
405 | ||
406 | ## Data General AViiON Machines | |
651fc2d2 RS |
407 | ## DG changed naming conventions with the release of 5.4.4.10, they |
408 | ## dropped the initial 5.4 but left the intervening R. Because of the | |
409 | ## R this shouldn't conflict with older versions of the OS (which I | |
f4afda69 KH |
410 | ## think were named like dgux4.*). In addition, DG new AViiONs series |
411 | ## uses either Motorola M88k or Intel Pentium CPUs. | |
9ae70ffe | 412 | m88k-dg-dguxR4.* | m88k-dg-dgux4* ) |
651fc2d2 RS |
413 | machine=aviion opsys=dgux4 |
414 | ;; | |
9ec10b2f | 415 | m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) |
aac2257c RS |
416 | ## This name is dgux5-4-3 instead of dgux5-4r3 |
417 | ## to avoid a file name conflict on MSDOS. | |
418 | machine=aviion opsys=dgux5-4-3 | |
9ec10b2f DM |
419 | ;; |
420 | m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) | |
421 | machine=aviion opsys=dgux5-4r2 | |
422 | ;; | |
423 | m88k-dg-dgux* ) | |
424 | machine=aviion opsys=dgux | |
425 | ;; | |
426 | ||
4e746fa8 KH |
427 | ## Data General AViiON Intel (x86) Machines |
428 | ## Exists from 5.4.3 (current i586-dg-dguxR4.11) | |
429 | ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il | |
9ae70ffe | 430 | i[345]86-dg-dguxR4* ) |
4e746fa8 KH |
431 | machine=aviion-intel opsys=dgux4 |
432 | ;; | |
433 | ||
9ec10b2f DM |
434 | ## DECstations |
435 | mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* ) | |
436 | machine=pmax opsys=bsd4-2 | |
437 | ;; | |
3bbe016c | 438 | mips-dec-ultrix4.[12]* | mips-dec-bsd* ) |
9ec10b2f DM |
439 | machine=pmax opsys=bsd4-3 |
440 | ;; | |
3bbe016c KH |
441 | mips-dec-ultrix* ) |
442 | machine=pmax opsys=ultrix4-3 | |
443 | ;; | |
9ec10b2f DM |
444 | mips-dec-osf* ) |
445 | machine=pmax opsys=osf1 | |
446 | ;; | |
b95c8e7e RS |
447 | mips-dec-mach_bsd4.3* ) |
448 | machine=pmax opsys=mach-bsd4-3 | |
449 | ;; | |
9ec10b2f DM |
450 | |
451 | ## Motorola Delta machines | |
452 | m68k-motorola-sysv* | m68000-motorola-sysv* ) | |
453 | machine=delta opsys=usg5-3 | |
454 | if test -z "`type gnucc | grep 'not found'`" | |
018427ee RS |
455 | then |
456 | if test -s /etc/167config | |
457 | then CC="gnucc -m68040" | |
458 | else CC="gnucc -m68881" | |
c7f493fd | 459 | fi |
9ec10b2f DM |
460 | else |
461 | if test -z "`type gcc | grep 'not found'`" | |
462 | then CC=gcc | |
463 | else CC=cc | |
464 | fi | |
465 | fi | |
466 | ;; | |
467 | m88k-motorola-sysv4* ) | |
63c1d3f2 RS |
468 | # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110 |
469 | # needs POSIX_SIGNALS and therefore needs usg5-4-2. | |
470 | # I hope there are not other 4.0 versions for this machine | |
471 | # which really need usg5-4 instead. | |
472 | machine=delta88k opsys=usg5-4-2 | |
9ec10b2f DM |
473 | ;; |
474 | m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) | |
475 | machine=delta88k opsys=usg5-3 | |
476 | ;; | |
477 | ||
478 | ## Dual machines | |
479 | m68*-dual-sysv* ) | |
480 | machine=dual opsys=usg5-2 | |
481 | ;; | |
482 | m68*-dual-uniplus* ) | |
483 | machine=dual opsys=unipl5-2 | |
484 | ;; | |
485 | ||
486 | ## Elxsi 6400 | |
487 | elxsi-elxsi-sysv* ) | |
488 | machine=elxsi opsys=usg5-2 | |
489 | ;; | |
490 | ||
491 | ## Encore machines | |
492 | ns16k-encore-bsd* ) | |
493 | machine=ns16000 opsys=umax | |
494 | ;; | |
495 | ||
2ce723a5 DL |
496 | ## The GEC 63 - apparently, this port isn't really finished yet. |
497 | # I'm sure we finished off the last of the machines, though. -- fx | |
9ec10b2f DM |
498 | |
499 | ## Gould Power Node and NP1 | |
500 | pn-gould-bsd4.2* ) | |
501 | machine=gould opsys=bsd4-2 | |
502 | ;; | |
503 | pn-gould-bsd4.3* ) | |
504 | machine=gould opsys=bsd4-3 | |
505 | ;; | |
506 | np1-gould-bsd* ) | |
507 | machine=gould-np1 opsys=bsd4-3 | |
508 | ;; | |
509 | ||
510 | ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000 | |
511 | ## as far as Emacs is concerned). | |
512 | m88k-harris-cxux* ) | |
513 | # Build needs to be different on 7.0 and later releases | |
514 | case "`uname -r`" in | |
515 | [56].[0-9] ) machine=nh4000 opsys=cxux ;; | |
516 | [7].[0-9] ) machine=nh4000 opsys=cxux7 ;; | |
517 | esac | |
3d68df05 | 518 | NON_GNU_CPP="/lib/cpp" |
9ec10b2f DM |
519 | ;; |
520 | ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000) | |
521 | m68k-harris-cxux* ) | |
522 | machine=nh3000 opsys=cxux | |
523 | ;; | |
3d68df05 KH |
524 | ## Harris power pc NightHawk running Power UNIX (Series 6000) |
525 | powerpc-harris-powerunix ) | |
526 | machine=nh6000 opsys=powerunix | |
527 | NON_GNU_CPP="cc -Xo -E -P" | |
528 | ;; | |
0e5f305e RS |
529 | ## SR2001/SR2201 running HI-UX/MPP |
530 | hppa1.1-hitachi-hiuxmpp* ) | |
531 | machine=sr2k opsys=hiuxmpp | |
532 | ;; | |
2d0bcbcc EZ |
533 | hppa1.1-hitachi-hiuxwe2* ) |
534 | machine=sr2k opsys=hiuxwe2 | |
535 | ;; | |
9ec10b2f DM |
536 | ## Honeywell XPS100 |
537 | xps*-honeywell-sysv* ) | |
538 | machine=xps100 opsys=usg5-2 | |
539 | ;; | |
540 | ||
541 | ## HP 9000 series 200 or 300 | |
542 | m68*-hp-bsd* ) | |
543 | machine=hp9000s300 opsys=bsd4-3 | |
544 | ;; | |
42c3a7f7 | 545 | ## HP/UX 7, 8, 9, and 10 are supported on these machines. |
9ec10b2f DM |
546 | m68*-hp-hpux* ) |
547 | case "`uname -r`" in | |
548 | ## Someone's system reports A.B8.05 for this. | |
549 | ## I wonder what other possibilities there are. | |
550 | *.B8.* ) machine=hp9000s300 opsys=hpux8 ;; | |
551 | *.08.* ) machine=hp9000s300 opsys=hpux8 ;; | |
552 | *.09.* ) machine=hp9000s300 opsys=hpux9 ;; | |
88a806e9 | 553 | *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;; |
9ec10b2f DM |
554 | *) machine=hp9000s300 opsys=hpux ;; |
555 | esac | |
556 | ;; | |
557 | ||
558 | ## HP 9000 series 700 and 800, running HP/UX | |
559 | hppa*-hp-hpux7* ) | |
560 | machine=hp800 opsys=hpux | |
561 | ;; | |
562 | hppa*-hp-hpux8* ) | |
563 | machine=hp800 opsys=hpux8 | |
564 | ;; | |
565 | hppa*-hp-hpux9shr* ) | |
566 | machine=hp800 opsys=hpux9shr | |
567 | ;; | |
568 | hppa*-hp-hpux9* ) | |
569 | machine=hp800 opsys=hpux9 | |
570 | ;; | |
4f4d6b17 | 571 | hppa*-hp-hpux10* ) |
12760c02 | 572 | machine=hp800 opsys=hpux10 |
42c3a7f7 | 573 | ;; |
4f4d6b17 EZ |
574 | hppa*-hp-hpux1[1-9]* ) |
575 | machine=hp800 opsys=hpux11 | |
576 | ;; | |
9ec10b2f | 577 | |
6fa6525f RS |
578 | hppa*-*-linux-gnu* ) |
579 | machine=hp800 opsys=gnu-linux | |
580 | ;; | |
581 | ||
9ec10b2f DM |
582 | ## HP 9000 series 700 and 800, running HP/UX |
583 | hppa*-hp-hpux* ) | |
584 | ## Cross-compilation? Nah! | |
585 | case "`uname -r`" in | |
586 | ## Someone's system reports A.B8.05 for this. | |
587 | ## I wonder what other possibilities there are. | |
588 | *.B8.* ) machine=hp800 opsys=hpux8 ;; | |
589 | *.08.* ) machine=hp800 opsys=hpux8 ;; | |
590 | *.09.* ) machine=hp800 opsys=hpux9 ;; | |
842f8692 | 591 | *) machine=hp800 opsys=hpux10 ;; |
9ec10b2f DM |
592 | esac |
593 | ;; | |
da945421 | 594 | hppa*-*-nextstep* ) |
4be21f66 KH |
595 | machine=hp800 opsys=nextstep |
596 | ;; | |
9ec10b2f DM |
597 | |
598 | ## Orion machines | |
599 | orion-orion-bsd* ) | |
600 | machine=orion opsys=bsd4-2 | |
601 | ;; | |
602 | clipper-orion-bsd* ) | |
603 | machine=orion105 opsys=bsd4-2 | |
604 | ;; | |
605 | ||
606 | ## IBM machines | |
5ac83f86 | 607 | i[3456]86-ibm-aix1.1* ) |
9ec10b2f DM |
608 | machine=ibmps2-aix opsys=usg5-2-2 |
609 | ;; | |
5ac83f86 | 610 | i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* ) |
9ec10b2f DM |
611 | machine=ibmps2-aix opsys=usg5-3 |
612 | ;; | |
613 | i370-ibm-aix*) | |
614 | machine=ibm370aix opsys=usg5-3 | |
615 | ;; | |
f4c2acb3 EZ |
616 | s390-*-linux-gnu) |
617 | machine=ibms390 opsys=gnu-linux | |
618 | ;; | |
046545ec | 619 | rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* ) |
9ec10b2f DM |
620 | machine=ibmrs6000 opsys=aix3-1 |
621 | ;; | |
046545ec | 622 | rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 ) |
9ec10b2f DM |
623 | machine=ibmrs6000 opsys=aix3-2-5 |
624 | ;; | |
b63df577 RS |
625 | rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* ) |
626 | machine=ibmrs6000 opsys=aix4-1 | |
627 | ;; | |
a8958813 RS |
628 | rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* ) |
629 | machine=ibmrs6000 opsys=aix4-2 | |
630 | ;; | |
1ef1ef96 EZ |
631 | rs6000-ibm-aix5.1* | powerpc-ibm-aix5.1* ) |
632 | machine=ibmrs6000 opsys=aix4-2 | |
633 | ;; | |
a8958813 | 634 | rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* ) |
b63df577 RS |
635 | machine=ibmrs6000 opsys=aix4 |
636 | ;; | |
a8958813 RS |
637 | rs6000-ibm-aix4* | powerpc-ibm-aix4* ) |
638 | machine=ibmrs6000 opsys=aix4-1 | |
639 | ;; | |
046545ec | 640 | rs6000-ibm-aix* | powerpc-ibm-aix* ) |
9ec10b2f DM |
641 | machine=ibmrs6000 opsys=aix3-2 |
642 | ;; | |
643 | romp-ibm-bsd4.3* ) | |
644 | machine=ibmrt opsys=bsd4-3 | |
c7f493fd | 645 | ;; |
9ec10b2f DM |
646 | romp-ibm-bsd4.2* ) |
647 | machine=ibmrt opsys=bsd4-2 | |
648 | ;; | |
649 | romp-ibm-aos4.3* ) | |
650 | machine=ibmrt opsys=bsd4-3 | |
c7f493fd | 651 | ;; |
9ec10b2f DM |
652 | romp-ibm-aos4.2* ) |
653 | machine=ibmrt opsys=bsd4-2 | |
654 | ;; | |
655 | romp-ibm-aos* ) | |
656 | machine=ibmrt opsys=bsd4-3 | |
657 | ;; | |
658 | romp-ibm-bsd* ) | |
659 | machine=ibmrt opsys=bsd4-3 | |
660 | ;; | |
661 | romp-ibm-aix* ) | |
662 | machine=ibmrt-aix opsys=usg5-2-2 | |
663 | ;; | |
664 | ||
665 | ## Integrated Solutions `Optimum V' | |
666 | m68*-isi-bsd4.2* ) | |
667 | machine=isi-ov opsys=bsd4-2 | |
668 | ;; | |
669 | m68*-isi-bsd4.3* ) | |
670 | machine=isi-ov opsys=bsd4-3 | |
671 | ;; | |
672 | ||
673 | ## Intel 386 machines where we do care about the manufacturer | |
5ac83f86 | 674 | i[3456]86-intsys-sysv* ) |
9ec10b2f DM |
675 | machine=is386 opsys=usg5-2-2 |
676 | ;; | |
677 | ||
678 | ## Prime EXL | |
5ac83f86 | 679 | i[3456]86-prime-sysv* ) |
9ec10b2f DM |
680 | machine=i386 opsys=usg5-3 |
681 | ;; | |
682 | ||
3cd69289 | 683 | ## Sequent Symmetry running Dynix |
5ac83f86 | 684 | i[3456]86-sequent-bsd* ) |
9ec10b2f DM |
685 | machine=symmetry opsys=bsd4-3 |
686 | ;; | |
687 | ||
86d6f6ee RS |
688 | ## Sequent Symmetry running ptx 4, which is a modified SVR4. |
689 | i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* ) | |
690 | machine=sequent-ptx opsys=ptx4 | |
0dcdc912 | 691 | NON_GNU_CPP=/lib/cpp |
86d6f6ee RS |
692 | ;; |
693 | ||
3cd69289 DM |
694 | ## Sequent Symmetry running DYNIX/ptx |
695 | ## Use the old cpp rather than the newer ANSI one. | |
5ac83f86 | 696 | i[3456]86-sequent-ptx* ) |
3cd69289 DM |
697 | machine=sequent-ptx opsys=ptx |
698 | NON_GNU_CPP="/lib/cpp" | |
699 | ;; | |
700 | ||
cd837fee KH |
701 | ## ncr machine running svr4.3. |
702 | i[3456]86-ncr-sysv4.3 ) | |
703 | machine=ncr386 opsys=usg5-4-3 | |
704 | ;; | |
705 | ||
9ec10b2f DM |
706 | ## Unspecified sysv on an ncr machine defaults to svr4.2. |
707 | ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.) | |
5ac83f86 | 708 | i[3456]86-ncr-sysv* ) |
b0f36760 | 709 | machine=ncr386 opsys=usg5-4-2 |
9ec10b2f DM |
710 | ;; |
711 | ||
cbce363f RS |
712 | ## Intel Paragon OSF/1 |
713 | i860-intel-osf1* ) | |
714 | machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp | |
715 | ;; | |
716 | ||
9ec10b2f DM |
717 | ## Intel 860 |
718 | i860-*-sysv4* ) | |
719 | machine=i860 opsys=usg5-4 | |
720 | NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc. | |
721 | NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion. | |
722 | ;; | |
723 | ||
3ad6e32b GM |
724 | ## Macintosh PowerPC |
725 | powerpc*-*-linux-gnu* ) | |
726 | machine=macppc opsys=gnu-linux | |
727 | ;; | |
728 | ||
9ec10b2f DM |
729 | ## Masscomp machines |
730 | m68*-masscomp-rtu* ) | |
731 | machine=masscomp opsys=rtu | |
732 | ;; | |
733 | ||
734 | ## Megatest machines | |
735 | m68*-megatest-bsd* ) | |
736 | machine=mega68 opsys=bsd4-2 | |
737 | ;; | |
738 | ||
739 | ## Workstations sold by MIPS | |
740 | ## This is not necessarily all workstations using the MIPS processor - | |
741 | ## Irises are produced by SGI, and DECstations by DEC. | |
742 | ||
743 | ## etc/MACHINES lists mips.h and mips4.h as possible machine files, | |
744 | ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance | |
745 | ## it gives for choosing between the alternatives seems to be "Use | |
746 | ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with | |
747 | ## the BSD world." I'll assume that these are instructions for | |
748 | ## handling two odd situations, and that every other situation | |
749 | ## should use mips.h and usg5-2-2, they being listed first. | |
750 | mips-mips-usg* ) | |
751 | machine=mips4 | |
752 | ## Fall through to the general code at the bottom to decide on the OS. | |
753 | ;; | |
754 | mips-mips-riscos4* ) | |
755 | machine=mips4 opsys=bsd4-3 | |
756 | NON_GNU_CC="cc -systype bsd43" | |
757 | NON_GNU_CPP="cc -systype bsd43 -E" | |
758 | ;; | |
b95c8e7e RS |
759 | mips-mips-riscos5* ) |
760 | machine=mips4 opsys=riscos5 | |
761 | NON_GNU_CC="cc -systype bsd43" | |
762 | NON_GNU_CPP="cc -systype bsd43 -E" | |
763 | ;; | |
9ec10b2f DM |
764 | mips-mips-bsd* ) |
765 | machine=mips opsys=bsd4-3 | |
766 | ;; | |
767 | mips-mips-* ) | |
768 | machine=mips opsys=usg5-2-2 | |
769 | ;; | |
770 | ||
771 | ## NeXT | |
5ab52d42 RS |
772 | m68*-next-* | m68k-*-nextstep* ) |
773 | machine=m68k opsys=nextstep | |
9ec10b2f DM |
774 | ;; |
775 | ||
776 | ## The complete machine from National Semiconductor | |
777 | ns32k-ns-genix* ) | |
778 | machine=ns32000 opsys=usg5-2 | |
779 | ;; | |
780 | ||
781 | ## NCR machines | |
782 | m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) | |
783 | machine=tower32 opsys=usg5-2-2 | |
784 | ;; | |
785 | m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) | |
786 | machine=tower32v3 opsys=usg5-3 | |
787 | ;; | |
788 | ||
b4ea3111 KH |
789 | ## NEC EWS4800 |
790 | mips-nec-sysv4*) | |
791 | machine=ews4800 opsys=ux4800 | |
792 | ;; | |
793 | ||
9ec10b2f DM |
794 | ## Nixdorf Targon 31 |
795 | m68*-nixdorf-sysv* ) | |
796 | machine=targon31 opsys=usg5-2-2 | |
797 | ;; | |
798 | ||
799 | ## Nu (TI or LMI) | |
800 | m68*-nu-sysv* ) | |
801 | machine=nu opsys=usg5-2 | |
802 | ;; | |
803 | ||
804 | ## Plexus | |
805 | m68*-plexus-sysv* ) | |
806 | machine=plexus opsys=usg5-2 | |
807 | ;; | |
808 | ||
42326ef0 RS |
809 | ## PowerPC reference platform |
810 | powerpcle-*-solaris2* ) | |
811 | machine=prep | |
812 | opsys=sol2-5 | |
813 | ;; | |
814 | ||
9ec10b2f DM |
815 | ## Pyramid machines |
816 | ## I don't really have any idea what sort of processor the Pyramid has, | |
817 | ## so I'm assuming it is its own architecture. | |
818 | pyramid-pyramid-bsd* ) | |
819 | machine=pyramid opsys=bsd4-2 | |
820 | ;; | |
821 | ||
822 | ## Sequent Balance | |
823 | ns32k-sequent-bsd4.2* ) | |
824 | machine=sequent opsys=bsd4-2 | |
825 | ;; | |
826 | ns32k-sequent-bsd4.3* ) | |
827 | machine=sequent opsys=bsd4-3 | |
828 | ;; | |
829 | ||
830 | ## Siemens Nixdorf | |
7cba3845 | 831 | mips-siemens-sysv* | mips-sni-sysv*) |
9ec10b2f DM |
832 | machine=mips-siemens opsys=usg5-4 |
833 | NON_GNU_CC=/usr/ccs/bin/cc | |
834 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
835 | ;; | |
836 | ||
837 | ## Silicon Graphics machines | |
838 | ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030) | |
839 | m68*-sgi-iris3.5* ) | |
840 | machine=irist opsys=iris3-5 | |
841 | ;; | |
842 | m68*-sgi-iris3.6* | m68*-sgi-iris*) | |
843 | machine=irist opsys=iris3-6 | |
844 | ;; | |
845 | ## Iris 4D | |
846 | mips-sgi-irix3* ) | |
847 | machine=iris4d opsys=irix3-3 | |
848 | ;; | |
4ab83697 RS |
849 | mips-sgi-irix4* ) |
850 | machine=iris4d opsys=irix4-0 | |
851 | ;; | |
a187fb80 KH |
852 | mips-sgi-irix6.5 ) |
853 | machine=iris4d opsys=irix6-5 | |
91193697 DL |
854 | # Without defining _LANGUAGE_C, things get masked out in the headers |
855 | # so that, for instance, grepping for `free' in stdlib.h fails and | |
856 | # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m). | |
857 | NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C" | |
63c59d1e | 858 | NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C" |
a187fb80 | 859 | ;; |
546fa279 | 860 | mips-sgi-irix6* ) |
309daad2 | 861 | machine=iris4d opsys=irix6-0 |
d9b5c990 | 862 | # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5, |
91193697 DL |
863 | # but presumably it does no harm. |
864 | NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C" | |
63c59d1e | 865 | # -32 probably isn't necessary in later v.6s -- anyone know which? |
309daad2 | 866 | NON_GCC_TEST_OPTIONS=-32 |
546fa279 | 867 | ;; |
4ab83697 | 868 | mips-sgi-irix5.[01]* ) |
9ec10b2f DM |
869 | machine=iris4d opsys=irix5-0 |
870 | ;; | |
4ab83697 RS |
871 | mips-sgi-irix5* | mips-sgi-irix* ) |
872 | machine=iris4d opsys=irix5-2 | |
9ec10b2f DM |
873 | ;; |
874 | ||
875 | ## SONY machines | |
876 | m68*-sony-bsd4.2* ) | |
877 | machine=news opsys=bsd4-2 | |
878 | ;; | |
879 | m68*-sony-bsd4.3* ) | |
880 | machine=news opsys=bsd4-3 | |
881 | ;; | |
3d102c59 | 882 | m68*-sony-newsos3* | m68*-sony-news3*) |
9ec10b2f DM |
883 | machine=news opsys=bsd4-3 |
884 | ;; | |
3d102c59 | 885 | mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*) |
9ec10b2f DM |
886 | machine=news-risc opsys=bsd4-3 |
887 | ;; | |
423ef6e8 | 888 | mips-sony-newsos6* ) |
b48e4aeb | 889 | machine=news-r6 opsys=newsos6 |
423ef6e8 | 890 | ;; |
3d102c59 | 891 | mips-sony-news* ) |
9ec10b2f DM |
892 | machine=news-risc opsys=newsos5 |
893 | ;; | |
894 | ||
895 | ## Stride | |
896 | m68*-stride-sysv* ) | |
897 | machine=stride opsys=usg5-2 | |
898 | ;; | |
899 | ||
900 | ## Suns | |
b5b193a7 | 901 | sparc-*-linux-gnu* | sparc64-*-linux-gnu* ) |
5ac83f86 | 902 | machine=sparc opsys=gnu-linux |
28d9bc0e KH |
903 | ;; |
904 | ||
f4027958 | 905 | *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \ |
5ac83f86 | 906 | | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \ |
c42b1767 | 907 | | rs6000-*-solaris2*) |
9ec10b2f DM |
908 | case "${canonical}" in |
909 | m68*-sunos1* ) machine=sun1 ;; | |
910 | m68*-sunos2* ) machine=sun2 ;; | |
911 | m68* ) machine=sun3 ;; | |
5ac83f86 RS |
912 | i[3456]86-sun-sunos[34]* ) machine=sun386 ;; |
913 | i[3456]86-*-* ) machine=intel386 ;; | |
42326ef0 | 914 | powerpcle* ) machine=powerpcle ;; |
f7894e88 | 915 | powerpc* | rs6000* ) machine=ibmrs6000 ;; |
9ec10b2f DM |
916 | sparc* ) machine=sparc ;; |
917 | * ) unported=yes ;; | |
918 | esac | |
919 | case "${canonical}" in | |
920 | ## The Sun386 didn't get past 4.0. | |
5ac83f86 | 921 | i[3456]86-*-sunos4 ) opsys=sunos4-0 ;; |
9ec10b2f | 922 | *-sunos4.0* ) opsys=sunos4-0 ;; |
0ff0179d | 923 | *-sunos4.1.[3-9]*noshare ) |
aac2257c RS |
924 | ## This name is sunos413 instead of sunos4-1-3 |
925 | ## to avoid a file name conflict on MSDOS. | |
926 | opsys=sunos413 | |
3d68df05 KH |
927 | NON_GNU_CPP=/usr/lib/cpp |
928 | NON_GCC_TEST_OPTIONS=-Bstatic | |
929 | GCC_TEST_OPTIONS=-static | |
930 | ;; | |
3e23af40 RS |
931 | *-sunos4.1.[3-9]* | *-sunos4shr*) |
932 | opsys=sunos4shr | |
933 | NON_GNU_CPP=/usr/lib/cpp | |
934 | ;; | |
3d68df05 KH |
935 | *-sunos4* | *-sunos ) |
936 | opsys=sunos4-1 | |
9ec10b2f DM |
937 | NON_GCC_TEST_OPTIONS=-Bstatic |
938 | GCC_TEST_OPTIONS=-static | |
939 | ;; | |
940 | *-sunos5.3* | *-solaris2.3* ) | |
941 | opsys=sol2-3 | |
942 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
943 | ;; | |
944 | *-sunos5.4* | *-solaris2.4* ) | |
945 | opsys=sol2-4 | |
946 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
30457b4f | 947 | RANLIB="ar -ts" |
9ec10b2f | 948 | ;; |
2e567bad KH |
949 | *-sunos5.5* | *-solaris2.5* ) |
950 | opsys=sol2-5 | |
951 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
30457b4f | 952 | RANLIB="ar -ts" |
2e567bad | 953 | ;; |
9ec10b2f | 954 | *-sunos5* | *-solaris* ) |
348e3a08 | 955 | opsys=sol2-5 |
9ec10b2f DM |
956 | NON_GNU_CPP=/usr/ccs/lib/cpp |
957 | ;; | |
958 | * ) opsys=bsd4-2 ;; | |
959 | esac | |
6e502e37 RS |
960 | ## Watch out for a compiler that we know will not work. |
961 | case "${canonical}" in | |
962 | *-solaris* | *-sunos5* ) | |
963 | if [ "x$CC" = x/usr/ucb/cc ]; then | |
964 | ## /usr/ucb/cc doesn't work; | |
965 | ## we should find some other compiler that does work. | |
966 | unset CC | |
967 | fi | |
968 | ;; | |
969 | *) ;; | |
970 | esac | |
9ec10b2f | 971 | ;; |
5ab52d42 | 972 | sparc-*-nextstep* ) |
19e45036 | 973 | machine=sparc opsys=nextstep |
5ab52d42 | 974 | ;; |
9ec10b2f DM |
975 | |
976 | ## Tadpole 68k | |
977 | m68*-tadpole-sysv* ) | |
978 | machine=tad68k opsys=usg5-3 | |
979 | ;; | |
980 | ||
981 | ## Tahoe machines | |
982 | tahoe-tahoe-bsd4.2* ) | |
983 | machine=tahoe opsys=bsd4-2 | |
984 | ;; | |
985 | tahoe-tahoe-bsd4.3* ) | |
986 | machine=tahoe opsys=bsd4-3 | |
987 | ;; | |
988 | ||
989 | ## Tandem Integrity S2 | |
990 | mips-tandem-sysv* ) | |
991 | machine=tandem-s2 opsys=usg5-3 | |
992 | ;; | |
993 | ||
994 | ## Tektronix XD88 | |
995 | m88k-tektronix-sysv3* ) | |
996 | machine=tekxd88 opsys=usg5-3 | |
997 | ;; | |
998 | ||
999 | ## Tektronix 16000 box (6130?) | |
1000 | ns16k-tektronix-bsd* ) | |
1001 | machine=ns16000 opsys=bsd4-2 | |
1002 | ;; | |
1003 | ## Tektronix 4300 | |
1004 | ## src/m/tek4300.h hints that this is a m68k machine. | |
1005 | m68*-tektronix-bsd* ) | |
1006 | machine=tek4300 opsys=bsd4-3 | |
1007 | ;; | |
1008 | ||
1009 | ## Titan P2 or P3 | |
1010 | ## We seem to have lost the machine-description file titan.h! | |
1011 | titan-titan-sysv* ) | |
1012 | machine=titan opsys=usg5-3 | |
1013 | ;; | |
c7f493fd | 1014 | |
9ec10b2f DM |
1015 | ## Ustation E30 (SS5E) |
1016 | m68*-unisys-uniplus* ) | |
1017 | machine=ustation opsystem=unipl5-2 | |
1018 | ;; | |
1019 | ||
1020 | ## Vaxen. | |
1021 | vax-dec-* ) | |
1022 | machine=vax | |
1023 | case "${canonical}" in | |
1024 | *-bsd4.1* ) opsys=bsd4-1 ;; | |
1025 | *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;; | |
1026 | *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;; | |
9ec10b2f DM |
1027 | *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;; |
1028 | *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;; | |
1029 | *-vms* ) opsys=vms ;; | |
1030 | * ) unported=yes | |
1031 | esac | |
1032 | ;; | |
1033 | ||
1034 | ## Whitechapel MG1 | |
1035 | ns16k-whitechapel-* ) | |
1036 | machine=mg1 | |
1037 | ## We don't know what sort of OS runs on these; we'll let the | |
1038 | ## operating system guessing code below try. | |
1039 | ;; | |
1040 | ||
1041 | ## Wicat | |
1042 | m68*-wicat-sysv* ) | |
1043 | machine=wicat opsys=usg5-2 | |
1044 | ;; | |
1045 | ||
2d23c8cc GM |
1046 | ## IA-64 |
1047 | ia64*-*-linux* ) | |
1048 | machine=ia64 opsys=gnu-linux | |
1049 | ;; | |
1050 | ||
9ec10b2f | 1051 | ## Intel 386 machines where we don't care about the manufacturer |
5ac83f86 | 1052 | i[3456]86-*-* ) |
9ec10b2f DM |
1053 | machine=intel386 |
1054 | case "${canonical}" in | |
9f25f6fb | 1055 | *-lynxos* ) opsys=lynxos ;; |
9ec10b2f DM |
1056 | *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;; |
1057 | *-isc2.2* ) opsys=isc2-2 ;; | |
1058 | *-isc4.0* ) opsys=isc4-0 ;; | |
135c9ca6 RS |
1059 | *-isc4.* ) opsys=isc4-1 |
1060 | GCC_TEST_OPTIONS=-posix | |
1061 | NON_GCC_TEST_OPTIONS=-Xp | |
1062 | ;; | |
9ec10b2f DM |
1063 | *-isc* ) opsys=isc3-0 ;; |
1064 | *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;; | |
1065 | *-esix* ) opsys=esix ;; | |
1066 | *-xenix* ) opsys=xenix ;; | |
5ac83f86 | 1067 | *-linux-gnu* ) opsys=gnu-linux ;; |
9ec10b2f | 1068 | *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;; |
5ac83f86 RS |
1069 | *-sco3.2v5* ) opsys=sco5 |
1070 | NON_GNU_CPP=/lib/cpp | |
1071 | # Prevent -belf from being passed to $CPP. | |
1072 | # /lib/cpp does not accept it. | |
1e60bcf8 | 1073 | OVERRIDE_CPPFLAGS=" " |
5ac83f86 | 1074 | ;; |
0e6d70d5 | 1075 | *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;; |
9ec10b2f | 1076 | *-386bsd* ) opsys=386bsd ;; |
5ab52d42 | 1077 | *-nextstep* ) opsys=nextstep ;; |
9ec10b2f DM |
1078 | ## Otherwise, we'll fall through to the generic opsys code at the bottom. |
1079 | esac | |
1080 | ;; | |
1081 | ||
287f502c | 1082 | ## m68k Linux-based GNU system |
5ac83f86 RS |
1083 | m68k-*-linux-gnu* ) |
1084 | machine=m68k opsys=gnu-linux | |
e1fd57e3 RS |
1085 | ;; |
1086 | ||
287f502c RS |
1087 | ## Mips Linux-based GNU system |
1088 | mips-*-linux-gnu* ) | |
1089 | machine=mips opsys=gnu-linux | |
1090 | ;; | |
1091 | ||
eded5b68 RS |
1092 | ## UXP/DS |
1093 | sparc-fujitsu-sysv4* ) | |
1094 | machine=sparc opsys=uxpds | |
1095 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
1096 | RANLIB="ar -ts" | |
1097 | ;; | |
1098 | ||
5dbb45f2 KH |
1099 | ## UXP/V |
1100 | f301-fujitsu-uxpv4.1) | |
1101 | machine=f301 opsys=uxpv | |
1102 | ;; | |
1103 | ||
9ec10b2f DM |
1104 | * ) |
1105 | unported=yes | |
1106 | ;; | |
1107 | esac | |
1108 | ||
1109 | ### If the code above didn't choose an operating system, just choose | |
1110 | ### an operating system based on the configuration name. You really | |
1111 | ### only want to use this when you have no idea what the right | |
1112 | ### operating system is; if you know what operating systems a machine | |
1113 | ### runs, it's cleaner to make it explicit in the case statement | |
1114 | ### above. | |
1115 | if test x"${opsys}" = x; then | |
1116 | case "${canonical}" in | |
1117 | *-gnu* ) opsys=gnu ;; | |
1118 | *-bsd4.[01] ) opsys=bsd4-1 ;; | |
1119 | *-bsd4.2 ) opsys=bsd4-2 ;; | |
1120 | *-bsd4.3 ) opsys=bsd4-3 ;; | |
1121 | *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;; | |
1122 | *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;; | |
1123 | *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;; | |
5ab52d42 | 1124 | *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;; |
66a96cff | 1125 | *-sysv4.2uw* ) opsys=unixware ;; |
5ab52d42 | 1126 | *-sysv4.1* | *-sysvr4.1* ) |
9ec10b2f DM |
1127 | NON_GNU_CPP=/usr/lib/cpp |
1128 | opsys=usg5-4 ;; | |
5ab52d42 | 1129 | *-sysv4.[2-9]* | *-sysvr4.[2-9]* ) |
b63df577 | 1130 | if [ x$NON_GNU_CPP = x ]; then |
16831d8c RS |
1131 | if [ -f /usr/ccs/lib/cpp ]; then |
1132 | NON_GNU_CPP=/usr/ccs/lib/cpp | |
1133 | else | |
1134 | NON_GNU_CPP=/lib/cpp | |
1135 | fi | |
b63df577 RS |
1136 | fi |
1137 | opsys=usg5-4-2 ;; | |
5ab52d42 | 1138 | *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;; |
9ec10b2f DM |
1139 | * ) |
1140 | unported=yes | |
1141 | ;; | |
1142 | esac | |
1143 | fi | |
1144 | ||
1145 | changequote([, ])dnl | |
1146 | ||
1147 | if test $unported = yes; then | |
1148 | AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems. | |
1149 | Check \`etc/MACHINES' for recognized configuration names.]) | |
1150 | fi | |
1151 | ||
1152 | machfile="m/${machine}.h" | |
1153 | opsysfile="s/${opsys}.h" | |
1154 | ||
1155 | ||
1156 | #### Choose a compiler. | |
1157 | test -n "$CC" && cc_specified=yes | |
1158 | ||
5ab52d42 RS |
1159 | # Save the value of CFLAGS that the user specified. |
1160 | SPECIFIED_CFLAGS="$CFLAGS" | |
1161 | ||
9ec10b2f DM |
1162 | case ${with_gcc} in |
1163 | "yes" ) CC="gcc" GCC=yes ;; | |
6e0dc84a | 1164 | "no" ) : ${CC=cc} ;; |
e9b2a022 | 1165 | * ) |
9ec10b2f | 1166 | esac |
e9b2a022 | 1167 | AC_PROG_CC |
9ec10b2f DM |
1168 | |
1169 | # On Suns, sometimes $CPP names a directory. | |
1170 | if test -n "$CPP" && test -d "$CPP"; then | |
1171 | CPP= | |
1172 | fi | |
1173 | ||
1174 | #### Some systems specify a CPP to use unless we are using GCC. | |
1175 | #### Now that we know whether we are using GCC, we can decide whether | |
1176 | #### to use that one. | |
1177 | if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x | |
1178 | then | |
1179 | CPP="$NON_GNU_CPP" | |
1180 | fi | |
1181 | ||
1182 | #### Some systems specify a CC to use unless we are using GCC. | |
1183 | #### Now that we know whether we are using GCC, we can decide whether | |
1184 | #### to use that one. | |
1185 | if test "x$NON_GNU_CC" != x && test x$GCC != xyes && | |
1186 | test x$cc_specified != xyes | |
1187 | then | |
1188 | CC="$NON_GNU_CC" | |
1189 | fi | |
1190 | ||
1191 | if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x | |
1192 | then | |
1193 | CC="$CC $GCC_TEST_OPTIONS" | |
c7f493fd | 1194 | fi |
9ec10b2f DM |
1195 | |
1196 | if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x | |
1197 | then | |
1198 | CC="$CC $NON_GCC_TEST_OPTIONS" | |
c7f493fd | 1199 | fi |
9ec10b2f | 1200 | |
1bc5a004 RS |
1201 | if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x |
1202 | then | |
1203 | ac_link="$ac_link $GCC_LINK_TEST_OPTIONS" | |
1204 | fi | |
1205 | ||
1206 | if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x | |
1207 | then | |
1208 | ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS" | |
1209 | fi | |
1210 | ||
9ec10b2f DM |
1211 | #### Some other nice autoconf tests. If you add a test here which |
1212 | #### should make an entry in src/config.h, don't forget to add an | |
1213 | #### #undef clause to src/config.h.in for autoconf to modify. | |
1214 | ||
1215 | dnl checks for programs | |
6e0dc84a | 1216 | AC_PROG_LN_S |
9ec10b2f DM |
1217 | AC_PROG_CPP |
1218 | AC_PROG_INSTALL | |
1219 | AC_PROG_YACC | |
3f5b097c DL |
1220 | if test "x$RANLIB" = x; then |
1221 | AC_PROG_RANLIB | |
1222 | fi | |
9ec10b2f | 1223 | |
3cd69289 DM |
1224 | dnl checks for Unix variants |
1225 | AC_AIX | |
1226 | ||
4428e268 DL |
1227 | #### Extract some information from the operating system and machine files. |
1228 | ||
1229 | AC_CHECKING([the machine- and system-dependent files to find out | |
1230 | - which libraries the lib-src programs will want, and | |
1231 | - whether the GNU malloc routines are usable]) | |
1232 | ||
1233 | ### First figure out CFLAGS (which we use for running the compiler here) | |
1234 | ### and REAL_CFLAGS (which we use for real compilation). | |
1235 | ### The two are the same except on a few systems, where they are made | |
1236 | ### different to work around various lossages. For example, | |
1237 | ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g | |
1238 | ### as implying static linking. | |
1239 | ||
1240 | ### If the CFLAGS env var is specified, we use that value | |
1241 | ### instead of the default. | |
1242 | ||
1243 | ### It's not important that this name contain the PID; you can't run | |
1244 | ### two configures in the same directory and have anything work | |
1245 | ### anyway. | |
1246 | tempcname="conftest.c" | |
1247 | ||
1248 | echo ' | |
1249 | #include "'${srcdir}'/src/'${opsysfile}'" | |
1250 | #include "'${srcdir}'/src/'${machfile}'" | |
1251 | #ifndef LIBS_MACHINE | |
1252 | #define LIBS_MACHINE | |
1253 | #endif | |
1254 | #ifndef LIBS_SYSTEM | |
1255 | #define LIBS_SYSTEM | |
1256 | #endif | |
1257 | #ifndef C_SWITCH_SYSTEM | |
1258 | #define C_SWITCH_SYSTEM | |
1259 | #endif | |
1260 | #ifndef C_SWITCH_MACHINE | |
1261 | #define C_SWITCH_MACHINE | |
1262 | #endif | |
1263 | configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM | |
1264 | configure___ c_switch_system=C_SWITCH_SYSTEM | |
1265 | configure___ c_switch_machine=C_SWITCH_MACHINE | |
1266 | ||
1267 | #ifndef LIB_X11_LIB | |
1268 | #define LIB_X11_LIB -lX11 | |
1269 | #endif | |
1270 | ||
1271 | #ifndef LIBX11_MACHINE | |
1272 | #define LIBX11_MACHINE | |
1273 | #endif | |
1274 | ||
1275 | #ifndef LIBX11_SYSTEM | |
1276 | #define LIBX11_SYSTEM | |
1277 | #endif | |
1278 | configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM | |
1279 | ||
1280 | #ifdef UNEXEC | |
1281 | configure___ unexec=UNEXEC | |
1282 | #else | |
1283 | configure___ unexec=unexec.o | |
1284 | #endif | |
1285 | ||
1286 | #ifdef SYSTEM_MALLOC | |
1287 | configure___ system_malloc=yes | |
1288 | #else | |
1289 | configure___ system_malloc=no | |
1290 | #endif | |
1291 | ||
e32fac2a GM |
1292 | #ifdef USE_MMAP_FOR_BUFFERS |
1293 | configure___ use_mmap_for_buffers=yes | |
b1b4ce06 | 1294 | #else |
e32fac2a | 1295 | configure___ use_mmap_for_buffers=no |
b1b4ce06 GM |
1296 | #endif |
1297 | ||
4428e268 DL |
1298 | #ifndef C_DEBUG_SWITCH |
1299 | #define C_DEBUG_SWITCH -g | |
1300 | #endif | |
1301 | ||
1302 | #ifndef C_OPTIMIZE_SWITCH | |
1303 | #ifdef __GNUC__ | |
1304 | #define C_OPTIMIZE_SWITCH -O2 | |
1305 | #else | |
1306 | #define C_OPTIMIZE_SWITCH -O | |
1307 | #endif | |
1308 | #endif | |
1309 | ||
1310 | #ifndef LD_SWITCH_MACHINE | |
1311 | #define LD_SWITCH_MACHINE | |
1312 | #endif | |
1313 | ||
1314 | #ifndef LD_SWITCH_SYSTEM | |
1315 | #define LD_SWITCH_SYSTEM | |
1316 | #endif | |
1317 | ||
1318 | #ifndef LD_SWITCH_X_SITE_AUX | |
1319 | #define LD_SWITCH_X_SITE_AUX | |
1320 | #endif | |
1321 | ||
1322 | configure___ ld_switch_system=LD_SWITCH_SYSTEM | |
1323 | configure___ ld_switch_machine=LD_SWITCH_MACHINE | |
1324 | ||
1325 | #ifdef THIS_IS_CONFIGURE | |
1326 | ||
1327 | /* Get the CFLAGS for tests in configure. */ | |
1328 | #ifdef __GNUC__ | |
1329 | configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}' | |
1330 | #else | |
1331 | configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}' | |
1332 | #endif | |
1333 | ||
1334 | #else /* not THIS_IS_CONFIGURE */ | |
1335 | ||
1336 | /* Get the CFLAGS for real compilation. */ | |
1337 | #ifdef __GNUC__ | |
1338 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}' | |
1339 | #else | |
1340 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}' | |
1341 | #endif | |
1342 | ||
1343 | #endif /* not THIS_IS_CONFIGURE */ | |
1344 | ' > ${tempcname} | |
1345 | ||
1346 | # The value of CPP is a quoted variable reference, so we need to do this | |
1347 | # to get its actual value... | |
1348 | CPP=`eval "echo $CPP"` | |
1349 | changequote(, )dnl | |
1350 | eval `${CPP} -Isrc ${tempcname} \ | |
1351 | | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` | |
1352 | if test "x$SPECIFIED_CFLAGS" = x; then | |
1353 | eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \ | |
1354 | | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` | |
1355 | else | |
1356 | REAL_CFLAGS="$CFLAGS" | |
1357 | fi | |
1358 | changequote([, ])dnl | |
1359 | rm ${tempcname} | |
1360 | ||
1361 | ac_link="$ac_link $ld_switch_machine $ld_switch_system" | |
1362 | ||
1363 | ### Make sure subsequent tests use flags consistent with the build flags. | |
1364 | ||
1365 | if test x"${OVERRIDE_CPPFLAGS}" != x; then | |
1366 | CPPFLAGS="${OVERRIDE_CPPFLAGS}" | |
1367 | else | |
1368 | CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" | |
1369 | fi | |
1370 | ||
48989ead DL |
1371 | dnl Do this early because it can frob feature test macros for Unix-98 &c. |
1372 | AC_SYS_LARGEFILE | |
1373 | ||
3d9830e5 PJ |
1374 | if test "${with_sound}" != "no"; then |
1375 | # Sound support for GNU/Linux and the free BSDs. | |
1376 | AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h) | |
1377 | # Emulation library used on NetBSD. | |
1378 | AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) | |
1379 | AC_SUBST(LIBSOUND) | |
1380 | fi | |
b412189c | 1381 | |
9ec10b2f | 1382 | dnl checks for header files |
1113b624 PE |
1383 | AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \ |
1384 | linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \ | |
149c0cdc | 1385 | termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h) |
6e0dc84a DM |
1386 | AC_HEADER_STDC |
1387 | AC_HEADER_TIME | |
1388 | AC_DECL_SYS_SIGLIST | |
2ce723a5 | 1389 | AC_HEADER_SYS_WAIT |
9ec10b2f | 1390 | |
3cd69289 | 1391 | dnl Some systems have utime.h but don't declare the struct anyplace. |
fd0a060b | 1392 | AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf, |
3cd69289 DM |
1393 | AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME |
1394 | #include <sys/time.h> | |
1395 | #include <time.h> | |
1396 | #else | |
1397 | #ifdef HAVE_SYS_TIME_H | |
1398 | #include <sys/time.h> | |
1399 | #else | |
1400 | #include <time.h> | |
1401 | #endif | |
1402 | #endif | |
1403 | #ifdef HAVE_UTIME_H | |
1404 | #include <utime.h> | |
1405 | #endif], [static struct utimbuf x; x.actime = x.modtime;], | |
fd0a060b AS |
1406 | emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no)) |
1407 | if test $emacs_cv_struct_utimbuf = yes; then | |
1408 | AC_DEFINE(HAVE_STRUCT_UTIMBUF) | |
1409 | fi | |
3cd69289 | 1410 | |
9ec10b2f | 1411 | dnl checks for typedefs |
6e0dc84a | 1412 | AC_TYPE_SIGNAL |
9ec10b2f | 1413 | |
25abcaf1 GM |
1414 | dnl Check for speed_t typedef. |
1415 | AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, | |
1416 | AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;], | |
e9b2a022 | 1417 | emacs_cv_speed_t=yes, emacs_cv_speed_t=no)) |
25abcaf1 GM |
1418 | if test $emacs_cv_speed_t = yes; then |
1419 | AC_DEFINE(HAVE_SPEED_T) | |
1420 | fi | |
1421 | ||
fd0a060b | 1422 | AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval, |
3cd69289 DM |
1423 | AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME |
1424 | #include <sys/time.h> | |
1425 | #include <time.h> | |
1426 | #else | |
1427 | #ifdef HAVE_SYS_TIME_H | |
1428 | #include <sys/time.h> | |
1429 | #else | |
1430 | #include <time.h> | |
1431 | #endif | |
1432 | #endif], [static struct timeval x; x.tv_sec = x.tv_usec;], | |
fd0a060b AS |
1433 | emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no)) |
1434 | HAVE_TIMEVAL=$emacs_cv_struct_timeval | |
1435 | if test $emacs_cv_struct_timeval = yes; then | |
1436 | AC_DEFINE(HAVE_TIMEVAL) | |
1437 | fi | |
3cd69289 | 1438 | |
63c59d1e DL |
1439 | AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception, |
1440 | AC_TRY_COMPILE([#include <math.h>], | |
1441 | [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;], | |
1442 | emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no)) | |
1443 | HAVE_EXCEPTION=$emacs_cv_struct_exception | |
1444 | if test $emacs_cv_struct_exception != yes; then | |
1445 | AC_DEFINE(NO_MATHERR) | |
1446 | fi | |
1447 | ||
9ec10b2f DM |
1448 | dnl checks for structure members |
1449 | AC_STRUCT_TM | |
6e0dc84a | 1450 | AC_STRUCT_TIMEZONE |
1113b624 PE |
1451 | AC_CACHE_CHECK(for tm_gmtoff in struct tm, emacs_cv_tm_gmtoff, |
1452 | AC_TRY_LINK([#include <time.h>], [struct tm t; t.tm_gmtoff = 0], | |
1453 | emacs_cv_tm_gmtoff=yes, | |
1454 | emacs_cv_tm_gmtoff=no)) | |
1455 | if test $emacs_cv_tm_gmtoff = yes; then | |
1456 | AC_DEFINE(HAVE_TM_GMTOFF) | |
1457 | fi | |
9ec10b2f DM |
1458 | |
1459 | dnl checks for compiler characteristics | |
3f5b097c DL |
1460 | |
1461 | dnl Testing __STDC__ to determine prototype support isn't good enough. | |
1462 | dnl DEC C, for instance, doesn't define it with default options, and | |
1463 | dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile | |
1464 | dnl and void *. | |
1465 | AC_C_PROTOTYPES | |
1466 | AC_C_VOLATILE | |
6e0dc84a | 1467 | AC_C_CONST |
3f5b097c DL |
1468 | dnl This isn't useful because we can't turn on use of `inline' unless |
1469 | dnl the compiler groks `extern inline'. | |
1470 | dnl AC_C_INLINE | |
1471 | AC_CACHE_CHECK([for void * support], emacs_cv_void_star, | |
1472 | [AC_TRY_COMPILE(, [void * foo;], | |
1473 | emacs_cv_void_star=yes, emacs_cv_void_star=no)]) | |
1474 | if test $emacs_cv_void_star = yes; then | |
1475 | AC_DEFINE(POINTER_TYPE, void) | |
1476 | else | |
1477 | AC_DEFINE(POINTER_TYPE, char) | |
1478 | fi | |
9ec10b2f DM |
1479 | |
1480 | dnl check for Make feature | |
6e0dc84a | 1481 | AC_PROG_MAKE_SET |
9ec10b2f DM |
1482 | |
1483 | dnl checks for operating system services | |
6e0dc84a | 1484 | AC_SYS_LONG_FILE_NAMES |
9ec10b2f | 1485 | |
93c05c18 CW |
1486 | if test "$gamedir" = no; then : |
1487 | else | |
1488 | AC_MSG_CHECKING([for access to game group "$gameuser"]) | |
1489 | rm -f conf$$chown.file | |
1490 | touch conf$$chown.file | |
1491 | dnl If we can't chown a file to group games, then the users | |
1492 | dnl can't share scores. | |
1493 | if chown "$gameuser" conf$$chown.file 1>/dev/null 2>&1; then | |
1494 | AC_MSG_RESULT([yes]) | |
1495 | if test "$gamedir" = "yes"; then | |
1496 | gamedir="${localstatedir}/games/emacs" | |
1497 | fi | |
1498 | tgamedir=`eval "echo $gamedir"` | |
1499 | AC_DEFINE_UNQUOTED(HAVE_SHARED_GAME_DIR, "$tgamedir") | |
1500 | else | |
1501 | AC_MSG_RESULT([no]) | |
1502 | gamedir=no | |
1503 | fi | |
1504 | fi | |
9ec10b2f | 1505 | #### Choose a window system. |
9ec10b2f | 1506 | |
6e0dc84a | 1507 | AC_PATH_X |
530ce502 DM |
1508 | if test "$no_x" = yes; then |
1509 | window_system=none | |
1510 | else | |
1511 | window_system=x11 | |
1512 | fi | |
9ec10b2f | 1513 | |
ea199426 | 1514 | if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then |
00ac3ffc KH |
1515 | LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` |
1516 | LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` | |
66d736a9 RS |
1517 | x_default_search_path="" |
1518 | for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do | |
c8d4d4cc KH |
1519 | x_search_path="\ |
1520 | ${x_library}/X11/%L/%T/%N%C%S:\ | |
1521 | ${x_library}/X11/%l/%T/%N%C%S:\ | |
1522 | ${x_library}/X11/%T/%N%C%S:\ | |
1523 | ${x_library}/X11/%L/%T/%N%S:\ | |
1524 | ${x_library}/X11/%l/%T/%N%S:\ | |
1525 | ${x_library}/X11/%T/%N%S" | |
66d736a9 RS |
1526 | if test x"${x_default_search_path}" = x; then |
1527 | x_default_search_path=${x_search_path} | |
1528 | else | |
1529 | x_default_search_path="${x_search_path}:${x_default_search_path}" | |
1530 | fi | |
1531 | done | |
ea199426 DM |
1532 | fi |
1533 | if test "${x_includes}" != NONE && test -n "${x_includes}"; then | |
cc6476f6 | 1534 | C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` |
ea199426 | 1535 | fi |
9ec10b2f | 1536 | |
8dbeb353 DM |
1537 | if test x"${x_includes}" = x; then |
1538 | bitmapdir=/usr/include/X11/bitmaps | |
3cd69289 | 1539 | else |
908ff139 | 1540 | # accumulate include directories that have X11 bitmap subdirectories |
cc6476f6 KH |
1541 | bmd_acc="dummyval" |
1542 | for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do | |
1543 | if test -d "${bmd}/X11/bitmaps"; then | |
1544 | bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps" | |
4f6f5dab GM |
1545 | fi |
1546 | if test -d "${bmd}/bitmaps"; then | |
cc6476f6 KH |
1547 | bmd_acc="${bmd_acc}:${bmd}/bitmaps" |
1548 | fi | |
1549 | done | |
1550 | if test ${bmd_acc} != "dummyval"; then | |
1551 | bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"` | |
1552 | fi | |
3cd69289 DM |
1553 | fi |
1554 | ||
9ec10b2f DM |
1555 | case "${window_system}" in |
1556 | x11 ) | |
1557 | HAVE_X_WINDOWS=yes | |
1558 | HAVE_X11=yes | |
1559 | case "${with_x_toolkit}" in | |
c7f493fd RM |
1560 | athena | lucid ) USE_X_TOOLKIT=LUCID ;; |
1561 | motif ) USE_X_TOOLKIT=MOTIF ;; | |
1562 | dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;; | |
4be21f66 KH |
1563 | no ) USE_X_TOOLKIT=none ;; |
1564 | dnl If user did not say whether to use a toolkit, | |
1565 | dnl make this decision later: use the toolkit if we have X11R5 or newer. | |
1566 | * ) USE_X_TOOLKIT=maybe ;; | |
9ec10b2f DM |
1567 | esac |
1568 | ;; | |
9ec10b2f DM |
1569 | none ) |
1570 | HAVE_X_WINDOWS=no | |
1571 | HAVE_X11=no | |
1572 | USE_X_TOOLKIT=none | |
1573 | ;; | |
1574 | esac | |
9ec10b2f DM |
1575 | |
1576 | ### If we're using X11, we should use the X menu package. | |
08741ba9 | 1577 | HAVE_MENUS=no |
9ec10b2f | 1578 | case ${HAVE_X11} in |
08741ba9 | 1579 | yes ) HAVE_MENUS=yes ;; |
9ec10b2f | 1580 | esac |
b412189c | 1581 | |
b95c8e7e RS |
1582 | if test "${opsys}" = "hpux9"; then |
1583 | case "${x_libraries}" in | |
1584 | *X11R4* ) | |
1585 | opsysfile="s/hpux9-x11r4.h" | |
1586 | ;; | |
1587 | esac | |
1588 | fi | |
1589 | ||
1590 | if test "${opsys}" = "hpux9shr"; then | |
1591 | case "${x_libraries}" in | |
1592 | *X11R4* ) | |
1593 | opsysfile="s/hpux9shxr4.h" | |
1594 | ;; | |
1595 | esac | |
1596 | fi | |
1597 | ||
9ec10b2f DM |
1598 | ### Compute the unexec source name from the object name. |
1599 | UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`" | |
1600 | ||
1601 | # Do the opsystem or machine files prohibit the use of the GNU malloc? | |
1602 | # Assume not, until told otherwise. | |
1603 | GNU_MALLOC=yes | |
b05a95cb RS |
1604 | doug_lea_malloc=yes |
1605 | AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no) | |
1606 | AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) | |
fd0a060b AS |
1607 | AC_CACHE_CHECK(whether __after_morecore_hook exists, |
1608 | emacs_cv_var___after_morecore_hook, | |
e9b2a022 | 1609 | [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0], |
fd0a060b | 1610 | emacs_cv_var___after_morecore_hook=yes, |
e9b2a022 | 1611 | emacs_cv_var___after_morecore_hook=no)]) |
fd0a060b AS |
1612 | if test $emacs_cv_var___after_morecore_hook = no; then |
1613 | doug_lea_malloc=no | |
1614 | fi | |
8cd88038 | 1615 | if test "${system_malloc}" = "yes"; then |
9ec10b2f DM |
1616 | GNU_MALLOC=no |
1617 | GNU_MALLOC_reason=" | |
b05a95cb | 1618 | (The GNU allocators don't work with this system configuration.)" |
9ec10b2f | 1619 | fi |
8cd88038 RS |
1620 | if test "$doug_lea_malloc" = "yes" ; then |
1621 | if test "$GNU_MALLOC" = yes ; then | |
1622 | GNU_MALLOC_reason=" | |
0855015c | 1623 | (Using Doug Lea's new malloc from the GNU C Library.)" |
8cd88038 RS |
1624 | fi |
1625 | AC_DEFINE(DOUG_LEA_MALLOC) | |
1626 | fi | |
9ec10b2f DM |
1627 | |
1628 | if test x"${REL_ALLOC}" = x; then | |
1629 | REL_ALLOC=${GNU_MALLOC} | |
1630 | fi | |
1631 | ||
e32fac2a | 1632 | dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1' |
69c40632 | 1633 | dnl the system configuration file (s/*.h) to turn the use of mmap |
53c94d4d | 1634 | dnl in the relocating allocator on. |
b1b4ce06 GM |
1635 | |
1636 | AC_FUNC_MMAP | |
e32fac2a GM |
1637 | if test $use_mmap_for_buffers = yes; then |
1638 | REL_ALLOC=no | |
b1b4ce06 GM |
1639 | fi |
1640 | ||
52c76122 | 1641 | LIBS="$libsrc_libs $LIBS" |
9ec10b2f DM |
1642 | |
1643 | dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks, | |
1644 | dnl and also adds -ldnet to LIBS, which Autoconf uses for checks. | |
1645 | AC_CHECK_LIB(dnet, dnet_ntoa) | |
1646 | dnl This causes -lresolv to get used in subsequent tests, | |
1647 | dnl which causes failures on some systems such as HPUX 9. | |
1648 | dnl AC_CHECK_LIB(resolv, gethostbyname) | |
1649 | ||
1650 | dnl FIXME replace main with a function we actually want from this library. | |
1651 | AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") | |
1652 | ||
027dae63 | 1653 | AC_CHECK_LIB(pthreads, cma_open) |
1d94ee28 | 1654 | |
5d4245a6 | 1655 | AC_MSG_CHECKING(for XFree86 in /usr/X386) |
9ec10b2f | 1656 | if test -d /usr/X386/include; then |
9ec10b2f | 1657 | HAVE_XFREE386=yes |
6e0dc84a | 1658 | : ${C_SWITCH_X_SITE="-I/usr/X386/include"} |
9ec10b2f | 1659 | else |
6e0dc84a | 1660 | HAVE_XFREE386=no |
9ec10b2f | 1661 | fi |
6e0dc84a | 1662 | AC_MSG_RESULT($HAVE_XFREE386) |
9ec10b2f | 1663 | |
509fccc3 RS |
1664 | # Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used |
1665 | # for the tests that follow. We set it back to REAL_CFLAGS later on. | |
9ec10b2f | 1666 | |
5a9bf171 KR |
1667 | REAL_CPPFLAGS="$CPPFLAGS" |
1668 | ||
9ec10b2f DM |
1669 | if test "${HAVE_X11}" = "yes"; then |
1670 | DEFS="$C_SWITCH_X_SITE $DEFS" | |
96c20358 RS |
1671 | LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE" |
1672 | LIBS="$LIBX $LIBS" | |
9ec10b2f | 1673 | CFLAGS="$C_SWITCH_X_SITE $CFLAGS" |
5a9bf171 | 1674 | CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS" |
509fccc3 | 1675 | |
617a496c RS |
1676 | # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests. |
1677 | # This is handled by LD_SWITCH_X_SITE_AUX during the real build, | |
1678 | # but it's more convenient here to set LD_RUN_PATH | |
1679 | # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX. | |
1680 | if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then | |
1681 | LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH | |
1682 | export LD_RUN_PATH | |
1683 | fi | |
1684 | ||
5ac83f86 | 1685 | if test "${opsys}" = "gnu-linux"; then |
3bbe016c | 1686 | AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link) |
509fccc3 RS |
1687 | AC_TRY_LINK([], |
1688 | [XOpenDisplay ("foo");], | |
3bbe016c KH |
1689 | [xlinux_first_failure=no], |
1690 | [xlinux_first_failure=yes]) | |
1691 | if test "${xlinux_first_failure}" = "yes"; then | |
509fccc3 RS |
1692 | OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE" |
1693 | OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE" | |
1694 | OLD_CPPFLAGS="$CPPFLAGS" | |
1695 | OLD_LIBS="$LIBS" | |
1696 | LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout" | |
1697 | C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" | |
1698 | CPPFLAGS="$CPPFLAGS -b i486-linuxaout" | |
1699 | LIBS="$LIBS -b i486-linuxaout" | |
1700 | AC_TRY_LINK([], | |
1701 | [XOpenDisplay ("foo");], | |
3bbe016c KH |
1702 | [xlinux_second_failure=no], |
1703 | [xlinux_second_failure=yes]) | |
1704 | if test "${xlinux_second_failure}" = "yes"; then | |
509fccc3 RS |
1705 | # If we get the same failure with -b, there is no use adding -b. |
1706 | # So take it out. This plays safe. | |
1707 | LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE" | |
1708 | C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE" | |
1709 | CPPFLAGS="$OLD_CPPFLAGS" | |
1710 | LIBS="$OLD_LIBS" | |
1711 | AC_MSG_RESULT(no) | |
1712 | else | |
1713 | AC_MSG_RESULT(yes) | |
1714 | fi | |
1715 | else | |
1716 | AC_MSG_RESULT(no) | |
1717 | fi | |
1718 | fi | |
1719 | ||
9ca4be21 GM |
1720 | # Reportedly, some broken Solaris systems have XKBlib.h but are missing |
1721 | # header files included from there. | |
1722 | AC_MSG_CHECKING(for Xkb) | |
1723 | AC_TRY_LINK([#include <X11/Xlib.h> | |
1724 | #include <X11/XKBlib.h>], | |
1725 | [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);], | |
1726 | emacs_xkb=yes, emacs_xkb=no) | |
ad4ac636 | 1727 | AC_MSG_RESULT($emacs_xkb) |
9ca4be21 GM |
1728 | if test $emacs_xkb = yes; then |
1729 | AC_DEFINE(HAVE_XKBGETKEYBOARD) | |
1730 | fi | |
1731 | ||
6e0dc84a | 1732 | AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \ |
9ca4be21 | 1733 | XScreenNumberOfScreen XSetWMProtocols) |
9ec10b2f DM |
1734 | fi |
1735 | ||
08741ba9 | 1736 | if test "${window_system}" = "x11"; then |
4be21f66 | 1737 | AC_MSG_CHECKING(X11 version 6) |
fd0a060b | 1738 | AC_CACHE_VAL(emacs_cv_x11_version_6, |
e9b2a022 | 1739 | [AC_TRY_LINK([#include <X11/Xlib.h>], |
08741ba9 RS |
1740 | [#if XlibSpecificationRelease < 6 |
1741 | fail; | |
1742 | #endif | |
e9b2a022 | 1743 | ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) |
fd0a060b AS |
1744 | if test $emacs_cv_x11_version_6 = yes; then |
1745 | AC_MSG_RESULT(6 or newer) | |
1746 | AC_DEFINE(HAVE_X11R6) | |
1747 | else | |
1748 | AC_MSG_RESULT(before 6) | |
1749 | fi | |
08741ba9 RS |
1750 | fi |
1751 | ||
f7894e88 | 1752 | if test "${window_system}" = "x11"; then |
4be21f66 | 1753 | AC_MSG_CHECKING(X11 version 5) |
fd0a060b | 1754 | AC_CACHE_VAL(emacs_cv_x11_version_5, |
e9b2a022 | 1755 | [AC_TRY_LINK([#include <X11/Xlib.h>], |
4be21f66 KH |
1756 | [#if XlibSpecificationRelease < 5 |
1757 | fail; | |
1758 | #endif | |
e9b2a022 | 1759 | ], emacs_cv_x11_version_5=yes, emacs_cv_x11_version_5=no)]) |
fd0a060b AS |
1760 | if test $emacs_cv_x11_version_5 = yes; then |
1761 | AC_MSG_RESULT(5 or newer) | |
f7894e88 | 1762 | HAVE_X11R5=yes |
fd0a060b AS |
1763 | AC_DEFINE(HAVE_X11R5) |
1764 | else | |
f7894e88 | 1765 | HAVE_X11R5=no |
fd0a060b AS |
1766 | AC_MSG_RESULT(before 5) |
1767 | fi | |
f7894e88 RS |
1768 | fi |
1769 | ||
bce97856 RS |
1770 | dnl Do not put whitespace before the #include statements below. |
1771 | dnl Older compilers (eg sunos4 cc) choke on it. | |
f7894e88 RS |
1772 | if test x"${USE_X_TOOLKIT}" = xmaybe; then |
1773 | if test x"${HAVE_X11R5}" = xyes; then | |
1774 | AC_MSG_CHECKING(X11 version 5 with Xaw) | |
fd0a060b | 1775 | AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw, |
e9b2a022 | 1776 | [AC_TRY_LINK([ |
bce97856 RS |
1777 | #include <X11/Intrinsic.h> |
1778 | #include <X11/Xaw/Simple.h>], | |
f7894e88 | 1779 | [], |
fd0a060b | 1780 | emacs_cv_x11_version_5_with_xaw=yes, |
e9b2a022 | 1781 | emacs_cv_x11_version_5_with_xaw=no)]) |
fd0a060b AS |
1782 | if test $emacs_cv_x11_version_5_with_xaw = yes; then |
1783 | AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default]) | |
1784 | USE_X_TOOLKIT=LUCID | |
1785 | else | |
1786 | AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default) | |
1787 | USE_X_TOOLKIT=none | |
1788 | fi | |
f7894e88 RS |
1789 | else |
1790 | USE_X_TOOLKIT=none | |
1791 | fi | |
4be21f66 KH |
1792 | fi |
1793 | ||
1794 | X_TOOLKIT_TYPE=$USE_X_TOOLKIT | |
1795 | ||
9ec10b2f DM |
1796 | if test "${USE_X_TOOLKIT}" != "none"; then |
1797 | AC_MSG_CHECKING(X11 toolkit version) | |
fd0a060b | 1798 | AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, |
e9b2a022 | 1799 | [AC_TRY_LINK([#include <X11/Intrinsic.h>], |
9ec10b2f DM |
1800 | [#if XtSpecificationRelease < 6 |
1801 | fail; | |
1802 | #endif | |
e9b2a022 | 1803 | ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) |
fd0a060b AS |
1804 | HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6 |
1805 | if test $emacs_cv_x11_toolkit_version_6 = yes; then | |
1806 | AC_MSG_RESULT(6 or newer) | |
1807 | AC_DEFINE(HAVE_X11XTR6) | |
1808 | else | |
1809 | AC_MSG_RESULT(before 6) | |
1810 | fi | |
6aad10e4 RS |
1811 | |
1812 | dnl If using toolkit, check whether libXmu.a exists. | |
1813 | dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link. | |
1814 | OLDLIBS="$LIBS" | |
fcc303f4 RS |
1815 | if test x$HAVE_X11XTR6 = xyes; then |
1816 | LIBS="-lXt -lSM -lICE $LIBS" | |
1817 | else | |
1818 | LIBS="-lXt $LIBS" | |
1819 | fi | |
6aad10e4 | 1820 | AC_CHECK_LIB(Xmu, XmuConvertStandardSelection) |
ad4ac636 GM |
1821 | test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS" |
1822 | fi | |
1823 | ||
1824 | # On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D. | |
1825 | if test "${HAVE_X11}" = "yes"; then | |
1826 | if test "${USE_X_TOOLKIT}" != "none"; then | |
1827 | AC_CHECK_LIB(Xext, XShapeQueryExtension) | |
1828 | fi | |
9ec10b2f DM |
1829 | fi |
1830 | ||
66d736a9 | 1831 | if test "${USE_X_TOOLKIT}" = "MOTIF"; then |
fd0a060b | 1832 | AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1, |
e9b2a022 | 1833 | [AC_TRY_COMPILE([#include <Xm/Xm.h>], |
66d736a9 RS |
1834 | [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) |
1835 | int x = 5; | |
1836 | #else | |
1837 | Motif version prior to 2.1. | |
1838 | #endif], | |
e9b2a022 | 1839 | emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)]) |
fd0a060b AS |
1840 | HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1 |
1841 | if test $emacs_cv_motif_version_2_1 = yes; then | |
d96a4de3 | 1842 | HAVE_LIBXP=no |
fd0a060b | 1843 | AC_DEFINE(HAVE_MOTIF_2_1) |
ad4ac636 | 1844 | AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes) |
72d9b5b3 GM |
1845 | if test ${HAVE_LIBXP} = yes; then |
1846 | AC_DEFINE(HAVE_LIBXP) | |
1847 | fi | |
fd0a060b | 1848 | fi |
66d736a9 RS |
1849 | fi |
1850 | ||
620fdfdf RS |
1851 | ### Is -lXaw3d available? |
1852 | HAVE_XAW3D=no | |
1853 | if test "${HAVE_X11}" = "yes"; then | |
1854 | if test "${USE_X_TOOLKIT}" != "none"; then | |
620fdfdf | 1855 | AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h, |
ad4ac636 | 1856 | AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes)) |
620fdfdf RS |
1857 | if test "${HAVE_XAW3D}" = "yes"; then |
1858 | AC_DEFINE(HAVE_XAW3D) | |
1859 | fi | |
1860 | fi | |
1861 | fi | |
1862 | ||
0be97a72 GM |
1863 | dnl Use toolkit scroll bars if configured for X toolkit and either |
1864 | dnl using Motif or Xaw3d is available, and unless | |
1865 | dnl --with-toolkit-scroll-bars=no was specified. | |
1866 | ||
1867 | USE_TOOLKIT_SCROLL_BARS=no | |
1868 | if test "${with_toolkit_scroll_bars}" != "no"; then | |
1869 | if test "${USE_X_TOOLKIT}" != "none"; then | |
1870 | if test "${USE_X_TOOLKIT}" = "MOTIF"; then | |
1871 | AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) | |
1872 | HAVE_XAW3D=no | |
1873 | USE_TOOLKIT_SCROLL_BARS=yes | |
1874 | elif test "${HAVE_XAW3D}" = "yes"; then | |
1875 | AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) | |
1876 | USE_TOOLKIT_SCROLL_BARS=yes | |
1877 | fi | |
1878 | fi | |
1879 | fi | |
1880 | ||
c6f7dae8 GM |
1881 | dnl Don't use X11 input methods if user specifies he doesn't want it |
1882 | dnl with `--with-xim=no'. | |
1883 | ||
1884 | if test "${with_xim}" != "no"; then | |
1885 | AC_DEFINE(USE_XIM) | |
1886 | fi | |
1887 | ||
620fdfdf RS |
1888 | ### Use -lXpm if available, unless `--with-xpm=no'. |
1889 | HAVE_XPM=no | |
1890 | if test "${HAVE_X11}" = "yes"; then | |
1891 | if test "${with_xpm}" != "no"; then | |
620fdfdf | 1892 | AC_CHECK_HEADER(X11/xpm.h, |
7960d0bd GM |
1893 | AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)) |
1894 | if test "${HAVE_XPM}" = "yes"; then | |
29c1b68e GM |
1895 | AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define) |
1896 | AC_EGREP_CPP(no_return_alloc_pixels, | |
1897 | [#include "X11/xpm.h" | |
7960d0bd GM |
1898 | #ifndef XpmReturnAllocPixels |
1899 | no_return_alloc_pixels | |
1900 | #endif | |
29c1b68e GM |
1901 | ], HAVE_XPM=no, HAVE_XPM=yes) |
1902 | ||
1903 | if test "${HAVE_XPM}" = "yes"; then | |
1904 | AC_MSG_RESULT(yes) | |
1905 | else | |
1906 | AC_MSG_RESULT(no) | |
1907 | fi | |
1890c0c4 | 1908 | fi |
620fdfdf RS |
1909 | fi |
1910 | ||
1911 | if test "${HAVE_XPM}" = "yes"; then | |
1912 | AC_DEFINE(HAVE_XPM) | |
1913 | fi | |
1914 | fi | |
1915 | ||
1916 | ### Use -ljpeg if available, unless `--with-jpeg=no'. | |
1917 | HAVE_JPEG=no | |
1918 | if test "${HAVE_X11}" = "yes"; then | |
1919 | if test "${with_jpeg}" != "no"; then | |
3cc9d384 DL |
1920 | dnl Checking for jpeglib.h can lose becsue of a redefinition of |
1921 | dnl HAVE_STDLIB_H. | |
1922 | AC_CHECK_HEADER(jerror.h, | |
ad4ac636 | 1923 | AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)) |
620fdfdf RS |
1924 | fi |
1925 | ||
1926 | if test "${HAVE_JPEG}" = "yes"; then | |
1927 | AC_DEFINE(HAVE_JPEG) | |
4d766b59 RS |
1928 | AC_EGREP_CPP( |
1929 | changequote({, })dnl avoid leadingspace on the next line | |
1930 | {version= *(6[2-9]|[7-9][0-9])}, | |
1931 | changequote([, ])dnl | |
1932 | [#include <jpeglib.h> | |
1933 | version=JPEG_LIB_VERSION | |
1934 | ], | |
1935 | AC_DEFINE(HAVE_JPEG), | |
1936 | [AC_MSG_WARN([libjpeg found, but not version 6b or later]) | |
1937 | HAVE_JPEG=no]) | |
620fdfdf RS |
1938 | fi |
1939 | fi | |
1940 | ||
1941 | ### Use -lpng if available, unless `--with-png=no'. | |
1942 | HAVE_PNG=no | |
1943 | if test "${HAVE_X11}" = "yes"; then | |
1944 | if test "${with_png}" != "no"; then | |
620fdfdf | 1945 | AC_CHECK_HEADER(png.h, |
ad4ac636 | 1946 | AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm)) |
620fdfdf RS |
1947 | fi |
1948 | ||
1949 | if test "${HAVE_PNG}" = "yes"; then | |
1950 | AC_DEFINE(HAVE_PNG) | |
1951 | fi | |
1952 | fi | |
1953 | ||
1954 | ### Use -ltiff if available, unless `--with-tiff=no'. | |
1955 | HAVE_TIFF=no | |
1956 | if test "${HAVE_X11}" = "yes"; then | |
1957 | if test "${with_tiff}" != "no"; then | |
620fdfdf | 1958 | AC_CHECK_HEADER(tiffio.h, |
ad4ac636 | 1959 | tifflibs="-lz -lm" |
3b3cc4a4 KR |
1960 | # At least one tiff package requires the jpeg library. |
1961 | if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi | |
1962 | AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs)) | |
620fdfdf RS |
1963 | fi |
1964 | ||
1965 | if test "${HAVE_TIFF}" = "yes"; then | |
1966 | AC_DEFINE(HAVE_TIFF) | |
1967 | fi | |
1968 | fi | |
1969 | ||
1970 | ### Use -lgif if available, unless `--with-gif=no'. | |
1971 | HAVE_GIF=no | |
1972 | if test "${HAVE_X11}" = "yes"; then | |
1973 | if test "${with_gif}" != "no"; then | |
620fdfdf | 1974 | AC_CHECK_HEADER(gif_lib.h, |
4d766b59 RS |
1975 | # EGifPutExtensionLast only exists from version libungif-4.1.0b1. |
1976 | # Earlier versions can crash Emacs. | |
1977 | AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)) | |
620fdfdf RS |
1978 | fi |
1979 | ||
1980 | if test "${HAVE_GIF}" = "yes"; then | |
1981 | AC_DEFINE(HAVE_GIF) | |
1982 | fi | |
1983 | fi | |
1984 | ||
f21fadcc JD |
1985 | ### Use session management (-lSM -lICE) if available |
1986 | HAVE_X_SM=no | |
1987 | if test "${HAVE_X11}" = "yes"; then | |
1988 | AC_CHECK_HEADER(X11/SM/SMlib.h, | |
1989 | AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, -lICE)) | |
1990 | ||
1991 | if test "${HAVE_X_SM}" = "yes"; then | |
1992 | AC_DEFINE(HAVE_X_SM) | |
1993 | case "$LIBS" in | |
1994 | *-lSM*) ;; | |
1995 | *) LIBS="-lSM -lICE $LIBS" ;; | |
1996 | esac | |
1997 | fi | |
1998 | fi | |
1999 | ||
9ec10b2f | 2000 | # If netdb.h doesn't declare h_errno, we must declare it by hand. |
fd0a060b AS |
2001 | AC_CACHE_CHECK(whether netdb declares h_errno, |
2002 | emacs_cv_netdb_declares_h_errno, | |
e9b2a022 | 2003 | [AC_TRY_LINK([#include <netdb.h>], |
01345308 | 2004 | [return h_errno;], |
e9b2a022 | 2005 | emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)]) |
fd0a060b AS |
2006 | if test $emacs_cv_netdb_declares_h_errno = yes; then |
2007 | AC_DEFINE(HAVE_H_ERRNO) | |
2008 | fi | |
9ec10b2f | 2009 | |
6e0dc84a | 2010 | AC_FUNC_ALLOCA |
9ec10b2f | 2011 | |
f6e8adea | 2012 | # fmod, logb, and frexp are found in -lm on most systems. |
e468fb38 | 2013 | # On HPUX 9.01, -lm does not contain logb, so check for sqrt. |
e6fd9047 | 2014 | AC_CHECK_LIB(m, sqrt) |
e6fd9047 | 2015 | |
4e4db900 | 2016 | # Check for mail-locking functions in a "mail" library |
5ad9ac92 DL |
2017 | AC_CHECK_LIB(mail, maillock) |
2018 | dnl Debian, at least: | |
2019 | dnl AC_CHECK_LIB(lockfile, maillock, [AC_DEFINE(HAVE_LIBMAIL)]) | |
2020 | AC_CHECK_LIB(lockfile, maillock) | |
2021 | # If we have the shared liblockfile, assume we must use it for mail | |
2022 | # locking (e.g. Debian). If we couldn't link against liblockfile | |
2023 | # (no liblockfile.a installed), ensure that we don't need to. | |
2024 | if test "$ac_cv_lib_lockfile_maillock" = no; then | |
2025 | dnl This works for files generally, not just executables. | |
2026 | dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf? | |
2027 | AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no, | |
2028 | /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH) | |
2029 | if test $ac_cv_prog_liblockfile = yes; then | |
2030 | AC_MSG_ERROR([Shared liblockfile found but can't link against it. | |
2031 | This probably means that movemail could lose mail. | |
2032 | There may be a \`development' package to install containing liblockfile.]) | |
2033 | else AC_DEFINE(LIBMAIL, -llockfile) | |
2034 | fi | |
2035 | else : | |
2036 | fi | |
2037 | AC_CHECK_FUNCS(touchlock) | |
2038 | AC_CHECK_HEADERS(maillock.h) | |
4e4db900 | 2039 | |
66abe596 | 2040 | AC_CHECK_FUNCS(gethostname getdomainname dup2 \ |
1effc2cb | 2041 | rename closedir mkdir rmdir sysinfo \ |
fd4bc671 | 2042 | random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ |
85ea1a28 | 2043 | strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ |
290c1191 | 2044 | utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \ |
ec406751 | 2045 | __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ |
66abe596 | 2046 | sendto recvfrom getsockopt setsockopt getsockname getpeername \ |
93c05c18 | 2047 | gai_strerror mkstemp getline getdelim) |
38c44a91 | 2048 | |
66abe596 KS |
2049 | AC_CHECK_HEADERS(sys/un.h) |
2050 | ||
38c44a91 DL |
2051 | AC_FUNC_MKTIME |
2052 | if test "$ac_cv_func_working_mktime" = no; then | |
2053 | AC_DEFINE(BROKEN_MKTIME) | |
2054 | fi | |
2055 | ||
1ca2077a DL |
2056 | AC_FUNC_GETLOADAVG |
2057 | ||
64a04a42 | 2058 | AC_FUNC_FSEEKO |
63c59d1e | 2059 | |
64a04a42 | 2060 | # UNIX98 PTYs. |
40ccc4c7 GM |
2061 | AC_CHECK_FUNCS(grantpt) |
2062 | ||
2063 | # PTY-related GNU extensions. | |
2064 | AC_CHECK_FUNCS(getpt) | |
2065 | ||
16831d8c RS |
2066 | # Check this now, so that we will NOT find the above functions in ncurses. |
2067 | # That is because we have not set up to link ncurses in lib-src. | |
2068 | # It's better to believe a function is not available | |
2069 | # than to expect to find it in ncurses. | |
2070 | AC_CHECK_LIB(ncurses, tparm) | |
0c565a0a | 2071 | |
84e70f78 KR |
2072 | # Do we need the Hesiod library to provide the support routines? |
2073 | if test "$with_hesiod" = yes ; then | |
2074 | # Don't set $LIBS here -- see comments above. | |
2075 | resolv=no | |
2076 | AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, , | |
2077 | [AC_CHECK_LIB(resolv, res_send, resolv=yes, | |
2078 | [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])]) | |
2079 | if test "$resolv" = yes ; then | |
2080 | RESOLVLIB=-lresolv | |
2081 | AC_DEFINE(HAVE_LIBRESOLV) | |
2082 | else | |
2083 | RESOLVLIB= | |
2084 | fi | |
2085 | AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost, | |
2086 | AC_DEFINE(HAVE_LIBHESIOD), :, $RESOLVLIB)]) | |
2087 | fi | |
2088 | ||
a21616bd KR |
2089 | # These tell us which Kerberos-related libraries to use. |
2090 | if test "${with_kerberos+set}" = set; then | |
2091 | AC_CHECK_LIB(com_err, com_err) | |
2092 | AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt) | |
2093 | AC_CHECK_LIB(crypto, mit_des_cbc_encrypt) | |
2094 | AC_CHECK_LIB(krb5, krb5_init_context) | |
2095 | if test "${with_kerberos5+set}" != set; then | |
2096 | AC_CHECK_LIB(des425, des_cbc_encrypt,, | |
2097 | AC_CHECK_LIB(des, des_cbc_encrypt)) | |
2098 | AC_CHECK_LIB(krb4, krb_get_cred,, | |
2099 | AC_CHECK_LIB(krb, krb_get_cred)) | |
2100 | fi | |
2101 | ||
2102 | if test "${with_kerberos5+set}" = set; then | |
2103 | AC_CHECK_HEADERS(krb5.h) | |
2104 | else | |
2105 | AC_CHECK_HEADERS(des.h,, | |
5a129faf PE |
2106 | [AC_CHECK_HEADERS(kerberosIV/des.h,, |
2107 | [AC_CHECK_HEADERS(kerberos/des.h)])]) | |
a21616bd | 2108 | AC_CHECK_HEADERS(krb.h,, |
5a129faf PE |
2109 | [AC_CHECK_HEADERS(kerberosIV/krb.h,, |
2110 | [AC_CHECK_HEADERS(kerberos/krb.h)])]) | |
a21616bd KR |
2111 | fi |
2112 | AC_CHECK_HEADERS(com_err.h) | |
2113 | fi | |
2114 | ||
c4510052 PE |
2115 | # Solaris requires -lintl if you want strerror (which calls dgettext) |
2116 | # to return localized messages. | |
2117 | AC_CHECK_LIB(intl, dgettext) | |
2118 | ||
0c565a0a RS |
2119 | AC_MSG_CHECKING(whether localtime caches TZ) |
2120 | AC_CACHE_VAL(emacs_cv_localtime_cache, | |
fcc303f4 | 2121 | [if test x$ac_cv_func_tzset = xyes; then |
0c565a0a | 2122 | AC_TRY_RUN([#include <time.h> |
22cc077c RS |
2123 | extern char **environ; |
2124 | unset_TZ () | |
2125 | { | |
2126 | char **from, **to; | |
2127 | for (to = from = environ; (*to = *from); from++) | |
2128 | if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '=')) | |
2129 | to++; | |
2130 | } | |
98ab445d RS |
2131 | char TZ_GMT0[] = "TZ=GMT0"; |
2132 | char TZ_PST8[] = "TZ=PST8"; | |
0c565a0a RS |
2133 | main() |
2134 | { | |
2135 | time_t now = time ((time_t *) 0); | |
22cc077c | 2136 | int hour_GMT0, hour_unset; |
98ab445d | 2137 | if (putenv (TZ_GMT0) != 0) |
0c565a0a | 2138 | exit (1); |
22cc077c RS |
2139 | hour_GMT0 = localtime (&now)->tm_hour; |
2140 | unset_TZ (); | |
2141 | hour_unset = localtime (&now)->tm_hour; | |
98ab445d | 2142 | if (putenv (TZ_PST8) != 0) |
0c565a0a | 2143 | exit (1); |
22cc077c RS |
2144 | if (localtime (&now)->tm_hour == hour_GMT0) |
2145 | exit (1); | |
2146 | unset_TZ (); | |
2147 | if (localtime (&now)->tm_hour != hour_unset) | |
2148 | exit (1); | |
2149 | exit (0); | |
0c565a0a RS |
2150 | }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, |
2151 | [# If we have tzset, assume the worst when cross-compiling. | |
2152 | emacs_cv_localtime_cache=yes]) | |
2153 | else | |
2154 | # If we lack tzset, report that localtime does not cache TZ, | |
2155 | # since we can't invalidate the cache if we don't have tzset. | |
2156 | emacs_cv_localtime_cache=no | |
2157 | fi])dnl | |
2158 | AC_MSG_RESULT($emacs_cv_localtime_cache) | |
2159 | if test $emacs_cv_localtime_cache = yes; then | |
2160 | AC_DEFINE(LOCALTIME_CACHE) | |
2161 | fi | |
9ec10b2f | 2162 | |
3d68df05 | 2163 | if test "x$HAVE_TIMEVAL" = xyes; then |
8a2c2328 DL |
2164 | AC_CHECK_FUNCS(gettimeofday) |
2165 | AC_CACHE_CHECK(whether gettimeofday can accept two arguments, | |
2166 | emacs_cv_gettimeofday_two_arguments, | |
e9b2a022 | 2167 | [AC_TRY_COMPILE([ |
5ab52d42 RS |
2168 | #ifdef TIME_WITH_SYS_TIME |
2169 | #include <sys/time.h> | |
2170 | #include <time.h> | |
2171 | #else | |
2172 | #ifdef HAVE_SYS_TIME_H | |
2173 | #include <sys/time.h> | |
2174 | #else | |
2175 | #include <time.h> | |
2176 | #endif | |
290c1191 | 2177 | #endif], |
8a2c2328 DL |
2178 | [struct timeval time; |
2179 | gettimeofday (&time, 0);], | |
2180 | emacs_cv_gettimeofday_two_arguments=yes, | |
e9b2a022 | 2181 | emacs_cv_gettimeofday_two_arguments=no)]) |
fd0a060b AS |
2182 | if test $emacs_cv_gettimeofday_two_arguments = no; then |
2183 | AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT) | |
2184 | fi | |
5ab52d42 RS |
2185 | fi |
2186 | ||
8a2c2328 DL |
2187 | dnl Note that AC_STRUCT_TIMEZONE doesn't do what you might expect. |
2188 | if test "$ac_cv_func_gettimeofday" = yes; then | |
2189 | AC_CACHE_CHECK([for struct timezone], emacs_cv_struct_timezone, | |
2190 | [AC_TRY_COMPILE([#include <sys/time.h>], | |
2191 | [struct timezone tz;], | |
2192 | dnl It may be that we can't call gettimeofday with a non-null pointer, | |
2193 | dnl even though we have struct timezone (e.g. HPUX). In that case | |
2194 | dnl we'll lie about struct timezone. | |
2195 | [AC_TRY_RUN([ | |
2196 | #ifdef TIME_WITH_SYS_TIME | |
2197 | #include <sys/time.h> | |
2198 | #include <time.h> | |
2199 | #else | |
2200 | #ifdef HAVE_SYS_TIME_H | |
2201 | #include <sys/time.h> | |
2202 | #else | |
2203 | #include <time.h> | |
2204 | #endif | |
2205 | #endif | |
2206 | main () { | |
2207 | struct timeval time; | |
2208 | struct timezone dummy; | |
2209 | exit (gettimeofday (&time, &dummy)); | |
2210 | }], | |
2211 | emacs_cv_struct_timezone=yes, | |
2212 | emacs_cv_struct_timezone=no, emacs_cv_struct_timezone=yes)], | |
2213 | emacs_cv_struct_timezone=no)]) | |
2214 | fi | |
2215 | ||
9ec10b2f | 2216 | ok_so_far=yes |
6e0dc84a | 2217 | AC_CHECK_FUNC(socket, , ok_so_far=no) |
9ec10b2f | 2218 | if test $ok_so_far = yes; then |
6e0dc84a | 2219 | AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no) |
9ec10b2f DM |
2220 | fi |
2221 | if test $ok_so_far = yes; then | |
6e0dc84a | 2222 | AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no) |
9ec10b2f DM |
2223 | fi |
2224 | if test $ok_so_far = yes; then | |
2225 | AC_DEFINE(HAVE_INET_SOCKETS) | |
2226 | fi | |
2227 | ||
7bbbba31 DM |
2228 | if test -f /usr/lpp/X11/bin/smt.exp; then |
2229 | AC_DEFINE(HAVE_AIX_SMT_EXP) | |
2230 | fi | |
2231 | ||
27b07953 GM |
2232 | AC_MSG_CHECKING(whether system supports dynamic ptys) |
2233 | if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then | |
2234 | AC_MSG_RESULT(yes) | |
2235 | AC_DEFINE(HAVE_DEV_PTMX) | |
2236 | else | |
2237 | AC_MSG_RESULT(no) | |
2238 | fi | |
2239 | ||
5a129faf | 2240 | AC_FUNC_FORK |
79e12078 | 2241 | |
8170f46b DL |
2242 | # Fixme: This should be replaced when we have autoconf 2.14. |
2243 | AC_SIZE_T | |
2244 | ||
9ec10b2f DM |
2245 | # Set up the CFLAGS for real compilation, so we can substitute it. |
2246 | CFLAGS="$REAL_CFLAGS" | |
5a9bf171 | 2247 | CPPFLAGS="$REAL_CPPFLAGS" |
9ec10b2f DM |
2248 | |
2249 | changequote(, )dnl | |
2250 | #### Find out which version of Emacs this is. | |
2251 | version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | |
2252 | | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` | |
2253 | changequote([, ])dnl | |
2254 | if test x"${version}" = x; then | |
2255 | AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.) | |
2256 | fi | |
2257 | ||
9ec10b2f DM |
2258 | ### Specify what sort of things we'll be editing into Makefile and config.h. |
2259 | ### Use configuration here uncanonicalized to avoid exceeding size limits. | |
2260 | AC_SUBST(version) | |
2261 | AC_SUBST(configuration) | |
3cd69289 | 2262 | AC_SUBST(canonical) |
9ec10b2f DM |
2263 | AC_SUBST(srcdir) |
2264 | AC_SUBST(prefix) | |
2265 | AC_SUBST(exec_prefix) | |
2266 | AC_SUBST(bindir) | |
2267 | AC_SUBST(datadir) | |
3cd69289 DM |
2268 | AC_SUBST(sharedstatedir) |
2269 | AC_SUBST(libexecdir) | |
9ec10b2f DM |
2270 | AC_SUBST(mandir) |
2271 | AC_SUBST(infodir) | |
2272 | AC_SUBST(lispdir) | |
2273 | AC_SUBST(locallisppath) | |
2274 | AC_SUBST(lisppath) | |
66d736a9 | 2275 | AC_SUBST(x_default_search_path) |
9ec10b2f | 2276 | AC_SUBST(etcdir) |
9ec10b2f DM |
2277 | AC_SUBST(archlibdir) |
2278 | AC_SUBST(docdir) | |
3cd69289 | 2279 | AC_SUBST(bitmapdir) |
93c05c18 CW |
2280 | AC_SUBST(gamedir) |
2281 | AC_SUBST(gameuser) | |
9ec10b2f DM |
2282 | AC_SUBST(c_switch_system) |
2283 | AC_SUBST(c_switch_machine) | |
2284 | AC_SUBST(LD_SWITCH_X_SITE) | |
2285 | AC_SUBST(LD_SWITCH_X_SITE_AUX) | |
2286 | AC_SUBST(C_SWITCH_X_SITE) | |
2287 | AC_SUBST(CFLAGS) | |
2288 | AC_SUBST(X_TOOLKIT_TYPE) | |
2289 | AC_SUBST(machfile) | |
2290 | AC_SUBST(opsysfile) | |
1ca2077a | 2291 | AC_SUBST(GETLOADAVG_LIBS) |
9ec10b2f | 2292 | |
3cd69289 | 2293 | AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}") |
6d1da0d1 | 2294 | AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}") |
9ec10b2f DM |
2295 | AC_DEFINE_UNQUOTED(config_machfile, "${machfile}") |
2296 | AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}") | |
2297 | AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE}) | |
2298 | AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX}) | |
2299 | AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE}) | |
2300 | AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC}) | |
2301 | ||
2302 | if test "${HAVE_X_WINDOWS}" = "yes" ; then | |
2303 | AC_DEFINE(HAVE_X_WINDOWS) | |
2304 | fi | |
2305 | if test "${USE_X_TOOLKIT}" != "none" ; then | |
2306 | AC_DEFINE(USE_X_TOOLKIT) | |
2307 | fi | |
2308 | if test "${HAVE_X11}" = "yes" ; then | |
2309 | AC_DEFINE(HAVE_X11) | |
2310 | fi | |
2311 | if test "${HAVE_XFREE386}" = "yes" ; then | |
2312 | AC_DEFINE(HAVE_XFREE386) | |
2313 | fi | |
08741ba9 RS |
2314 | if test "${HAVE_MENUS}" = "yes" ; then |
2315 | AC_DEFINE(HAVE_MENUS) | |
9ec10b2f DM |
2316 | fi |
2317 | if test "${GNU_MALLOC}" = "yes" ; then | |
2318 | AC_DEFINE(GNU_MALLOC) | |
2319 | fi | |
2320 | if test "${REL_ALLOC}" = "yes" ; then | |
2321 | AC_DEFINE(REL_ALLOC) | |
2322 | fi | |
9ec10b2f | 2323 | |
f0f2756d SS |
2324 | AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1, |
2325 | [Define if you have <nlist.h>.])]) | |
2326 | ||
9ec10b2f DM |
2327 | #### Report on what we decided to do. |
2328 | echo " | |
9ec10b2f DM |
2329 | Configured for \`${canonical}'. |
2330 | ||
2331 | Where should the build process find the source code? ${srcdir} | |
2332 | What operating system and machine description files should Emacs use? | |
2333 | \`${opsysfile}' and \`${machfile}' | |
2334 | What compiler should emacs be built with? ${CC} ${CFLAGS} | |
2335 | Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} | |
b1b4ce06 | 2336 | Should Emacs use a relocating allocator for buffers? ${REL_ALLOC} |
e32fac2a | 2337 | Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers |
9ec10b2f | 2338 | What window system should Emacs use? ${window_system} |
93c05c18 CW |
2339 | What toolkit should Emacs use? ${USE_X_TOOLKIT} |
2340 | Should Emacs use a shared game state directory? ${gamedir}" | |
509fccc3 RS |
2341 | |
2342 | if test -n "${x_includes}"; then | |
2343 | echo " Where do we find X Windows header files? ${x_includes}" | |
2344 | else | |
2345 | echo " Where do we find X Windows header files? Standard dirs" | |
2346 | fi | |
2347 | if test -n "${x_libraries}"; then | |
2348 | echo " Where do we find X Windows libraries? ${x_libraries}" | |
2349 | else | |
2350 | echo " Where do we find X Windows libraries? Standard dirs" | |
2351 | fi | |
9ec10b2f | 2352 | |
b412189c GM |
2353 | echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}" |
2354 | echo " Does Emacs use -lXpm? ${HAVE_XPM}" | |
2355 | echo " Does Emacs use -ljpeg? ${HAVE_JPEG}" | |
495ccc04 | 2356 | echo " Does Emacs use -ltiff? ${HAVE_TIFF}" |
b412189c GM |
2357 | echo " Does Emacs use -lungif? ${HAVE_GIF}" |
2358 | echo " Does Emacs use -lpng? ${HAVE_PNG}" | |
20c1822e | 2359 | echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}" |
509fccc3 | 2360 | echo |
9ec10b2f DM |
2361 | |
2362 | # Remove any trailing slashes in these variables. | |
2363 | changequote(, )dnl | |
2364 | test "${prefix}" != NONE && | |
2365 | prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'` | |
2366 | test "${exec_prefix}" != NONE && | |
2367 | exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` | |
2368 | changequote([, ])dnl | |
2369 | ||
3aa40e0e GM |
2370 | ## Check if the C preprocessor will convert `..' to `. .'. If so, set |
2371 | ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile | |
2372 | ## from Makefile.c can correctly provide the arg `-traditional' to the | |
2373 | ## C preprocessor. | |
2374 | ||
2375 | AC_EGREP_CPP(yes..yes, | |
2376 | [yes..yes], | |
2377 | CPP_NEED_TRADITIONAL=no, | |
2378 | CPP_NEED_TRADITIONAL=yes) | |
2379 | ||
5f8c8f00 | 2380 | AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \ |
66a96cff | 2381 | man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \ |
56a0a075 | 2382 | lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [ |
7bbbba31 | 2383 | |
b63df577 | 2384 | ### Make the necessary directories, if they don't exist. |
e0a3686b | 2385 | for dir in etc lisp ; do |
b3947967 | 2386 | test -d ${dir} || mkdir ${dir} |
9ec10b2f DM |
2387 | done |
2388 | ||
5f8c8f00 RS |
2389 | # Build src/Makefile from ${srcdir}/src/Makefile.c |
2390 | # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c | |
2391 | # This must be done after src/config.h is built, since we rely on that file. | |
9ec10b2f | 2392 | |
2d73167a | 2393 | changequote(, )dnl The horror, the horror. |
9ec10b2f DM |
2394 | # Now get this: Some word that is part of the ${srcdir} directory name |
2395 | # or the ${configuration} value might, just might, happen to be an | |
2396 | # identifier like `sun4' or `i386' or something, and be predefined by | |
2397 | # the C preprocessor to some helpful value like 1, or maybe the empty | |
2398 | # string. Needless to say consequent macro substitutions are less | |
2399 | # than conducive to the makefile finding the correct directory. | |
2400 | undefs="`echo $top_srcdir $configuration $canonical | | |
2401 | sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \ | |
2402 | -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \ | |
2403 | `" | |
2d73167a | 2404 | changequote([, ])dnl |
9ec10b2f | 2405 | |
6a4bb05d | 2406 | echo creating src/epaths.h |
f8f7ab54 | 2407 | ${MAKE-make} epaths-force |
ab85d355 | 2408 | |
c776f30b GM |
2409 | # As of 2000-11-19, newest development versions of GNU cpp preprocess |
2410 | # `..' to `. .' unless invoked with -traditional | |
2411 | ||
3aa40e0e | 2412 | if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then |
c776f30b GM |
2413 | CPPFLAGS="$CPPFLAGS -traditional" |
2414 | fi | |
2415 | ||
9ec10b2f DM |
2416 | echo creating lib-src/Makefile |
2417 | ( cd lib-src | |
2418 | rm -f junk.c junk1.c junk2.c | |
2419 | sed -e '/start of cpp stuff/q' \ | |
5f8c8f00 | 2420 | < Makefile.c > junk1.c |
9ec10b2f | 2421 | sed -e '1,/start of cpp stuff/d'\ |
3b74127d | 2422 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ |
5f8c8f00 | 2423 | < Makefile.c > junk.c |
e9b2a022 | 2424 | $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \ |
9ec10b2f DM |
2425 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c |
2426 | cat junk1.c junk2.c > Makefile.new | |
2427 | rm -f junk.c junk1.c junk2.c | |
2428 | chmod 444 Makefile.new | |
2429 | mv -f Makefile.new Makefile | |
2430 | ) | |
2431 | ||
2432 | echo creating src/Makefile | |
2433 | ( cd src | |
2434 | rm -f junk.c junk1.c junk2.c | |
2435 | sed -e '/start of cpp stuff/q' \ | |
5f8c8f00 | 2436 | < Makefile.c > junk1.c |
9ec10b2f | 2437 | sed -e '1,/start of cpp stuff/d'\ |
3b74127d | 2438 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ |
5f8c8f00 | 2439 | < Makefile.c > junk.c |
e9b2a022 | 2440 | $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \ |
9ec10b2f DM |
2441 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c |
2442 | cat junk1.c junk2.c > Makefile.new | |
2443 | rm -f junk.c junk1.c junk2.c | |
2444 | chmod 444 Makefile.new | |
2445 | mv -f Makefile.new Makefile | |
2446 | ) | |
8b66759a | 2447 | |
e9b2a022 | 2448 | if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then |
8b66759a | 2449 | echo creating src/.gdbinit |
e9b2a022 | 2450 | echo source $srcdir/src/.gdbinit > src/.gdbinit |
8b66759a DM |
2451 | fi |
2452 | ||
66a96cff RS |
2453 | # This is how we know whether to re-run configure in certain cases. |
2454 | touch src/config.stamp | |
2455 | ||
3aa40e0e | 2456 | ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"]) |
464c7d2d | 2457 |