(decode_options): Fix last change so as not to override an explicit -display.
[bpt/emacs.git] / configure.in
1 dnl Autoconf script for GNU Emacs
2 dnl To rebuild the `configure' script from this, execute the command
3 dnl autoconf
4 dnl in the directory containing this script.
5 dnl
6 dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003,
7 dnl 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8 dnl
9 dnl This file is part of GNU Emacs.
10 dnl
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 3, or (at your option)
14 dnl any later version.
15 dnl
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
22 dnl along with GNU Emacs; see the file COPYING. If not, write to the
23 dnl Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 dnl Boston, MA 02110-1301, USA.
25
26 AC_PREREQ(2.61)dnl
27 AC_INIT(emacs, 23.0.50)
28 AC_CONFIG_HEADER(src/config.h:src/config.in)
29 AC_CONFIG_SRCDIR(src/lisp.h)
30
31 dnl Support for --program-prefix, --program-suffix and
32 dnl --program-transform-name options
33 AC_ARG_PROGRAM
34
35 lispdir='${datadir}/emacs/${version}/lisp'
36 locallisppath='${datadir}/emacs/${version}/site-lisp:'\
37 '${datadir}/emacs/site-lisp'
38 lisppath='${locallisppath}:${lispdir}:${datadir}/emacs/${version}/leim'
39 etcdir='${datadir}/emacs/${version}/etc'
40 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
41 docdir='${datadir}/emacs/${version}/etc'
42 gamedir='${localstatedir}/games/emacs'
43
44 gameuser=games
45
46 dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
47 dnl Create a new --with option that defaults to being disabled.
48 dnl NAME is the base name of the option. The shell variable with_NAME
49 dnl will be set to either the user's value (if the option is
50 dnl specified; 'yes' for a plain --with-NAME) or to 'no' (if the
51 dnl option is not specified). Note that the shell variable name is
52 dnl constructed as autoconf does, by replacing non-alphanumeric
53 dnl characters with "_".
54 dnl HELP-STRING is the help text for the option.
55 AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
56 AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
57 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
58 ])dnl
59
60 dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
61 dnl Create a new --with option that defaults to being enabled. NAME
62 dnl is the base name of the option. The shell variable with_NAME
63 dnl will be set either to 'no' (for a plain --without-NAME) or to
64 dnl 'yes' (if the option is not specified). Note that the shell
65 dnl variable name is constructed as autoconf does, by replacing
66 dnl non-alphanumeric characters with "_".
67 dnl HELP-STRING is the help text for the option.
68 AC_DEFUN([OPTION_DEFAULT_ON], [dnl
69 AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[],[dnl
70 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=yes])dnl
71 ])dnl
72
73 OPTION_DEFAULT_ON([pop],[don't support POP mail retrieval with movemail])
74 if test "$with_pop" = yes; then
75 AC_DEFINE(MAIL_USE_POP)
76 fi
77 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
78
79 OPTION_DEFAULT_OFF([kerberos],[support Kerberos-authenticated POP])
80 if test "$with_kerberos" = yes; then
81 AC_DEFINE(KERBEROS)
82 fi
83 AH_TEMPLATE(KERBEROS,
84 [Define to support Kerberos-authenticated POP mail retrieval.])dnl
85
86 OPTION_DEFAULT_OFF([kerberos5],[support Kerberos version 5 authenticated POP])
87 if test "${with_kerberos5}" = yes; then
88 if test "${with_kerberos}" != yes; then
89 with_kerberos=yes
90 AC_DEFINE(KERBEROS)
91 fi
92 AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])
93 fi
94
95 OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host])
96 if test "$with_hesiod" = yes; then
97 AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
98 fi
99
100 OPTION_DEFAULT_ON([sound],[don't compile with sound support])
101
102 dnl FIXME currently it is not the last.
103 dnl This should be the last --with option, because --with-x is
104 dnl added later on when we find the path of X, and it's best to
105 dnl keep them together visually.
106 AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
107 [use an X toolkit (KIT one of: yes, lucid, athena, motif, gtk, no)])],
108 [ case "${withval}" in
109 y | ye | yes ) val=gtk ;;
110 n | no ) val=no ;;
111 l | lu | luc | luci | lucid ) val=lucid ;;
112 a | at | ath | athe | athen | athena ) val=athena ;;
113 m | mo | mot | moti | motif ) val=motif ;;
114 g | gt | gtk ) val=gtk ;;
115 * )
116 AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
117 this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
118 `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
119 ;;
120 esac
121 with_x_toolkit=$val
122 ])
123
124 dnl _ON results in a '--without' option in the --help output, so
125 dnl the help text should refer to "don't compile", etc.
126 OPTION_DEFAULT_ON([xpm],[don't compile with XPM image support])
127 OPTION_DEFAULT_ON([jpeg],[don't compile with JPEG image support])
128 OPTION_DEFAULT_ON([tiff],[don't compile with TIFF image support])
129 OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])
130 OPTION_DEFAULT_ON([png],[don't compile with PNG image support])
131 OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])
132
133 OPTION_DEFAULT_ON([freetype],[don't use Freetype for local font support])
134 OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])
135 OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support])
136 OPTION_DEFAULT_ON([m17n-flt],[don't use m17n-flt for text shaping])
137
138 OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
139 OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
140 OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
141 OPTION_DEFAULT_OFF([carbon],[use Carbon GUI on Mac OS X. This is unsupported!])
142
143 OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
144 OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
145
146 dnl Can remove these in Emacs 24.
147 AC_ARG_WITH([gtk],,
148 AC_MSG_ERROR([--with-gtk has been removed. Use --with-x-toolkit to
149 specify a toolkit.]),,)
150
151 AC_ARG_WITH([gcc],,
152 AC_MSG_ERROR([--with-gcc has been removed. Set the `CC' environment
153 variable to specify a compiler.]),,)
154
155 AC_ARG_WITH([pkg-config-prog],dnl
156 [AS_HELP_STRING([--with-pkg-config-prog=PATH],
157 [Path to pkg-config for finding GTK and librsvg])])
158 if test "X${with_pkg_config_prog}" != X; then
159 if test "${with_pkg_config_prog}" != yes; then
160 PKG_CONFIG="${with_pkg_config_prog}"
161 fi
162 fi
163
164 AC_ARG_ENABLE(carbon-app,
165 [AS_HELP_STRING([--enable-carbon-app@<:@=DIR@:>@],
166 [specify install directory for Emacs.app on Mac OS X
167 [DIR=/Application]])],
168 [ carbon_appdir_x=${enableval}])
169
170 AC_ARG_ENABLE(font-backend,
171 [ --enable-font-backend compile code of font-backend support],
172 USE_FONT_BACKEND=$enableval,
173 USE_FONT_BACKEND=no)
174
175 AC_ARG_ENABLE(asserts,
176 [AS_HELP_STRING([--enable-asserts], [compile code with asserts enabled])],
177 USE_XASSERTS=$enableval,
178 USE_XASSERTS=no)
179
180 AC_ARG_ENABLE(maintainer-mode,
181 [AS_HELP_STRING([--enable-maintainer-mode],
182 [enable make rules and dependencies not useful (and sometimes
183 confusing) to the casual installer])],
184 USE_MAINTAINER_MODE=$enableval,
185 USE_MAINTAINER_MODE=no)
186 if test $USE_MAINTAINER_MODE = yes; then
187 MAINT=
188 else
189 MAINT=#
190 fi
191 AC_SUBST(MAINT)
192
193 AC_ARG_ENABLE(locallisppath,
194 [AS_HELP_STRING([--enable-locallisppath=PATH],
195 [directories Emacs should search for lisp files specific
196 to this site])],
197 if test "${enableval}" = "no"; then
198 locallisppath=
199 elif test "${enableval}" != "yes"; then
200 locallisppath=${enableval}
201 fi)
202
203 #### Make srcdir absolute, if it isn't already. It's important to
204 #### avoid running the path through pwd unnecessarily, since pwd can
205 #### give you automounter prefixes, which can go away. We do all this
206 #### so Emacs can find its files when run uninstalled.
207 ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
208 unset CDPATH
209 case "${srcdir}" in
210 /* ) ;;
211 . )
212 ## We may be able to use the $PWD environment variable to make this
213 ## absolute. But sometimes PWD is inaccurate.
214 ## Note: we used to use ${PWD} at the end instead of `pwd`,
215 ## but that tested only for a well-formed and valid PWD,
216 ## it did not object when PWD was well-formed and valid but just wrong.
217 if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
218 then
219 srcdir="$PWD"
220 else
221 srcdir="`(cd ${srcdir}; pwd)`"
222 fi
223 ;;
224 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
225 esac
226
227 #### Check if the source directory already has a configured system in it.
228 if test `pwd` != `(cd ${srcdir} && pwd)` \
229 && test -f "${srcdir}/src/config.h" ; then
230 AC_MSG_WARN([[The directory tree `${srcdir}' is being used
231 as a build directory right now; it has been configured in its own
232 right. To configure in another directory as well, you MUST
233 use GNU make. If you do not have GNU make, then you must
234 now do `make distclean' in ${srcdir},
235 and then run $0 again.]])
236 fi
237
238 #### Given the configuration name, set machfile and opsysfile to the
239 #### names of the m/*.h and s/*.h files we should use.
240
241 ### Canonicalize the configuration name.
242
243 AC_CANONICAL_HOST
244 canonical=$host
245 configuration=${host_alias-${build_alias-$host}}
246
247 dnl This used to use changequote, but, apart from `changequote is evil'
248 dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
249 dnl the great gob of text. Thus it's not processed for possible expansion.
250 dnl Just make sure the brackets remain balanced.
251 dnl
252 dnl Since Emacs can't find matching pairs of quotes, boundaries are
253 dnl indicated by comments.
254 dnl quotation begins
255 [
256
257 ### If you add support for a new configuration, add code to this
258 ### switch statement to recognize your configuration name and select
259 ### the appropriate operating system and machine description files.
260
261 ### You would hope that you could choose an m/*.h file pretty much
262 ### based on the machine portion of the configuration name, and an s-
263 ### file based on the operating system portion. However, it turns out
264 ### that each m/*.h file is pretty manufacturer-specific - for
265 ### example hp9000s300.h is a 68000 machine;
266 ### mips.h, pmax.h are all MIPS
267 ### machines. So we basically have to have a special case for each
268 ### configuration name.
269 ###
270 ### As far as handling version numbers on operating systems is
271 ### concerned, make sure things will fail in a fixable way. If
272 ### /etc/MACHINES doesn't say anything about version numbers, be
273 ### prepared to handle anything reasonably. If version numbers
274 ### matter, be sure /etc/MACHINES says something about it.
275 ###
276 ### Eric Raymond says we should accept strings like "sysvr4" to mean
277 ### "System V Release 4"; he writes, "The old convention encouraged
278 ### confusion between `system' and `release' levels'."
279
280 machine='' opsys='' unported=no
281 case "${canonical}" in
282
283 ## FreeBSD ports
284 *-*-freebsd* )
285 opsys=freebsd
286 case "${canonical}" in
287 alpha*-*-freebsd*) machine=alpha ;;
288 ia64-*-freebsd*) machine=ia64 ;;
289 sparc64-*-freebsd*) machine=sparc ;;
290 powerpc-*-freebsd*) machine=macppc ;;
291 i[3456]86-*-freebsd*) machine=intel386 ;;
292 amd64-*-freebsd*|x86_64-*-freebsd*) machine=amdx86-64 ;;
293 esac
294 ;;
295
296 ## FreeBSD kernel + glibc based userland
297 *-*-kfreebsd*gnu* )
298 opsys=gnu-kfreebsd
299 case "${canonical}" in
300 alpha*-*-kfreebsd*) machine=alpha ;;
301 ia64-*-kfreebsd*) machine=ia64 ;;
302 sparc64-*-kfreebsd*) machine=sparc ;;
303 powerpc-*-kfreebsd*) machine=macppc ;;
304 i[3456]86-*-kfreebsd*) machine=intel386 ;;
305 amd64-*-kfreebsd*|x86_64-*-kfreebsd*) machine=amdx86-64 ;;
306 esac
307 ;;
308
309 ## NetBSD ports
310 *-*-netbsd* )
311 opsys=netbsd
312 if test -f /usr/lib/crti.o; then]
313 dnl The close and open brackets here are because this section is quoted --
314 dnl see the `changequote' comment above.
315 AC_DEFINE(HAVE_CRTIN, [], [Define to 1 if you have /usr/lib/crti.o.])
316 [ fi
317
318 case "${canonical}" in
319 alpha*-*-netbsd*) machine=alpha ;;
320 i[3456]86-*-netbsd*) machine=intel386 ;;
321 m68k-*-netbsd*)
322 # This is somewhat bogus.
323 machine=hp9000s300 ;;
324 mips-*-netbsd*) machine=pmax ;;
325 mipsel-*-netbsd*) machine=pmax ;;
326 mipseb-*-netbsd*) machine=pmax ;;
327 powerpc-*-netbsd*) machine=macppc ;;
328 sparc*-*-netbsd*) machine=sparc ;;
329 vax-*-netbsd*) machine=vax ;;
330 arm-*-netbsd*) machine=arm ;;
331 x86_64-*-netbsd*) machine=amdx86-64 ;;
332 hppa-*-netbsd*) machine=hp800 ;;
333 esac
334 ;;
335
336 ## OpenBSD ports
337 *-*-openbsd* )
338 opsys=openbsd
339 case "${canonical}" in
340 alpha*-*-openbsd*) machine=alpha ;;
341 arm-*-openbsd*) machine=arm ;;
342 hppa-*-openbsd*) machine=hp9000s300 ;;
343 i386-*-openbsd*) machine=intel386 ;;
344 m68k-*-openbsd*) machine=hp9000s300 ;;
345 mips64-*-openbsd*) machine=mips64 ;;
346 powerpc-*-openbsd*) machine=macppc ;;
347 sparc*-*-openbsd*) machine=sparc ;;
348 vax-*-openbsd*) machine=vax ;;
349 x86_64-*-openbsd*) machine=amdx86-64 ;;
350 esac
351 ;;
352
353 ## LynxOS ports
354 *-*-lynxos* )
355 opsys=lynxos
356 case "${canonical}" in
357 i[3456]86-*-lynxos*) machine=intel386 ;;
358 powerpc-*-lynxos*) machine=powerpc ;;
359 esac
360 ;;
361
362 ## BSDI ports
363 *-*-bsdi* )
364 opsys=bsdi
365 case "${canonical}" in
366 i[345]86-*-bsdi*) machine=intel386 ;;
367 sparc-*-bsdi*) machine=sparc ;;
368 powerpc-*-bsdi*) machine=macppc ;;
369 esac
370 case "${canonical}" in
371 *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
372 *-*-bsdi2.0* ) opsys=bsdos2 ;;
373 *-*-bsdi2* ) opsys=bsdos2-1 ;;
374 *-*-bsdi3* ) opsys=bsdos3 ;;
375 *-*-bsdi[45]* ) opsys=bsdos4 ;;
376 esac
377 ;;
378
379 ## Alpha (DEC) machines.
380 alpha*-dec-osf* )
381 machine=alpha opsys=osf1
382 # This is needed to find X11R6.1 libraries for certain tests.
383 NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
384 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
385 # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile
386 # due to non-traditional preprocessing with the current compiler
387 # defaults. OSF 4 can also have that compiler version, and there
388 # seems always to have been a usable /usr/bin/cpp.
389 NON_GNU_CPP=/usr/bin/cpp
390 case "${canonical}" in
391 alpha*-dec-osf[5-9]*)
392 opsys=osf5-0 ;;
393 esac
394 ;;
395
396 alpha*-*-linux-gnu* )
397 machine=alpha opsys=gnu-linux
398 ;;
399
400 arm*-*-linux-gnu* )
401 machine=arm opsys=gnu-linux
402 ;;
403
404 ## Apple Darwin / Mac OS X
405 *-apple-darwin* )
406 case "${canonical}" in
407 i[3456]86-* ) machine=intel386 ;;
408 powerpc-* ) machine=powermac ;;
409 * ) unported=yes ;;
410 esac
411 opsys=darwin
412 # Define CPP as follows to make autoconf work correctly.
413 CPP="${CC-cc} -E -no-cpp-precomp"
414 # Use fink packages if available.
415 if test -d /sw/include && test -d /sw/lib; then
416 GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
417 CPP="${CPP} ${GCC_TEST_OPTIONS}"
418 NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
419 fi
420 ;;
421
422 ## Compaq Nonstop
423 mips-compaq-nonstopux* )
424 machine=nonstopux opsys=nonstopux
425 ;;
426
427 ## Cubix QBx/386
428 i[3456]86-cubix-sysv* )
429 machine=intel386 opsys=usg5-3
430 ;;
431
432 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
433 machine=pmax opsys=bsd4-2
434 ;;
435 mips-dec-ultrix4.[12]* | mips-dec-bsd* )
436 machine=pmax opsys=bsd4-3
437 ;;
438 mips-dec-ultrix* )
439 machine=pmax opsys=ultrix4-3
440 ;;
441 mips-dec-osf* )
442 machine=pmax opsys=osf1
443 ;;
444 mips-dec-mach_bsd4.3* )
445 machine=pmax opsys=mach-bsd4-3
446 ;;
447
448 ## HP 9000 series 200 or 300
449 m68*-hp-bsd* )
450 machine=hp9000s300 opsys=bsd4-3
451 ;;
452 ## HP/UX 7, 8, 9, and 10 are supported on these machines.
453 m68*-hp-hpux* )
454 case "`uname -r`" in
455 ## Someone's system reports A.B8.05 for this.
456 ## I wonder what other possibilities there are.
457 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
458 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
459 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
460 *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
461 *) machine=hp9000s300 opsys=hpux ;;
462 esac
463 ;;
464
465 ## HP 9000 series 700 and 800, running HP/UX
466 hppa*-hp-hpux7* )
467 machine=hp800 opsys=hpux
468 ;;
469 hppa*-hp-hpux8* )
470 machine=hp800 opsys=hpux8
471 ;;
472 hppa*-hp-hpux9shr* )
473 machine=hp800 opsys=hpux9shr
474 ;;
475 hppa*-hp-hpux9* )
476 machine=hp800 opsys=hpux9
477 ;;
478 hppa*-hp-hpux10.2* )
479 machine=hp800 opsys=hpux10-20
480 ;;
481 hppa*-hp-hpux10* )
482 machine=hp800 opsys=hpux10
483 ;;
484 hppa*-hp-hpux1[1-9]* )
485 machine=hp800 opsys=hpux11
486 CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
487 ;;
488
489 hppa*-*-linux-gnu* )
490 machine=hp800 opsys=gnu-linux
491 ;;
492
493 ## HP 9000 series 700 and 800, running HP/UX
494 hppa*-hp-hpux* )
495 ## Cross-compilation? Nah!
496 case "`uname -r`" in
497 ## Someone's system reports A.B8.05 for this.
498 ## I wonder what other possibilities there are.
499 *.B8.* ) machine=hp800 opsys=hpux8 ;;
500 *.08.* ) machine=hp800 opsys=hpux8 ;;
501 *.09.* ) machine=hp800 opsys=hpux9 ;;
502 *) machine=hp800 opsys=hpux10 ;;
503 esac
504 ;;
505 hppa*-*-nextstep* )
506 machine=hp800 opsys=nextstep
507 ;;
508
509 ## IBM machines
510 i370-ibm-aix*)
511 machine=ibm370aix opsys=usg5-3
512 ;;
513 s390-*-linux-gnu* )
514 machine=ibms390 opsys=gnu-linux
515 ;;
516 s390x-*-linux-gnu* )
517 machine=ibms390x opsys=gnu-linux
518 ;;
519 rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
520 machine=ibmrs6000 opsys=aix3-1
521 ;;
522 rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
523 machine=ibmrs6000 opsys=aix3-2-5
524 ;;
525 rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* )
526 machine=ibmrs6000 opsys=aix4-1
527 ;;
528 rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
529 machine=ibmrs6000 opsys=aix4-2
530 ;;
531 rs6000-ibm-aix4.3* | powerpc-ibm-aix4.3* )
532 machine=ibmrs6000 opsys=aix4-2
533 ;;
534 rs6000-ibm-aix5* | powerpc-ibm-aix5* )
535 machine=ibmrs6000 opsys=aix4-2
536 ;;
537 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
538 machine=ibmrs6000 opsys=aix4
539 ;;
540 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
541 machine=ibmrs6000 opsys=aix4-1
542 ;;
543 rs6000-ibm-aix* | powerpc-ibm-aix* )
544 machine=ibmrs6000 opsys=aix3-2
545 ;;
546
547 ## Prime EXL
548 i[3456]86-prime-sysv* )
549 machine=i386 opsys=usg5-3
550 ;;
551
552 ## ncr machine running svr4.3.
553 i[3456]86-ncr-sysv4.3 )
554 machine=ncr386 opsys=usg5-4-3
555 ;;
556
557 ## Unspecified sysv on an ncr machine defaults to svr4.2.
558 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
559 i[3456]86-ncr-sysv* )
560 machine=ncr386 opsys=usg5-4-2
561 ;;
562
563 ## Macintosh PowerPC
564 powerpc*-*-linux-gnu* )
565 machine=macppc opsys=gnu-linux
566 ;;
567
568 ## Workstations sold by MIPS
569 ## This is not necessarily all workstations using the MIPS processor -
570 ## Irises are produced by SGI, and DECstations by DEC.
571
572 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
573 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
574 ## it gives for choosing between the alternatives seems to be "Use
575 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
576 ## the BSD world." I'll assume that these are instructions for
577 ## handling two odd situations, and that every other situation
578 ## should use mips.h and usg5-2-2, they being listed first.
579 mips-mips-usg* )
580 machine=mips4
581 ## Fall through to the general code at the bottom to decide on the OS.
582 ;;
583 mips-mips-riscos4* )
584 machine=mips4 opsys=bsd4-3
585 NON_GNU_CC="cc -systype bsd43"
586 NON_GNU_CPP="cc -systype bsd43 -E"
587 ;;
588 mips-mips-riscos5* )
589 machine=mips4 opsys=riscos5
590 NON_GNU_CC="cc -systype bsd43"
591 NON_GNU_CPP="cc -systype bsd43 -E"
592 ;;
593 mips-mips-bsd* )
594 machine=mips opsys=bsd4-3
595 ;;
596 mips-mips-* )
597 machine=mips opsys=usg5-2-2
598 ;;
599
600 ## NeXT
601 m68*-next-* | m68k-*-nextstep* )
602 machine=m68k opsys=nextstep
603 ;;
604
605 ## NEC EWS4800
606 mips-nec-sysv4*)
607 machine=ews4800 opsys=ux4800
608 ;;
609
610 ## Siemens Nixdorf
611 mips-siemens-sysv* | mips-sni-sysv*)
612 machine=mips-siemens opsys=usg5-4
613 NON_GNU_CC=/usr/ccs/bin/cc
614 NON_GNU_CPP=/usr/ccs/lib/cpp
615 ;;
616
617 ## Silicon Graphics machines
618 ## Iris 4D
619 mips-sgi-irix6.5 )
620 machine=iris4d opsys=irix6-5
621 # Without defining _LANGUAGE_C, things get masked out in the headers
622 # so that, for instance, grepping for `free' in stdlib.h fails and
623 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
624 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
625 NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
626 ;;
627 mips-sgi-irix6* )
628 machine=iris4d opsys=irix6-0
629 # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
630 # but presumably it does no harm.
631 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
632 # -32 probably isn't necessary in later v.6s -- anyone know which?
633 NON_GCC_TEST_OPTIONS=-32
634 ;;
635 mips-sgi-irix5.[01]* )
636 machine=iris4d opsys=irix5-0
637 ;;
638 mips-sgi-irix5* | mips-sgi-irix* )
639 machine=iris4d opsys=irix5-2
640 ;;
641
642 ## Suns
643 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
644 machine=sparc opsys=gnu-linux
645 ;;
646
647 *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
648 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
649 | rs6000-*-solaris2*)
650 case "${canonical}" in
651 i[3456]86-*-* ) machine=intel386 ;;
652 amd64-*-*|x86_64-*-*) machine=amdx86-64 ;;
653 powerpcle* ) machine=powerpcle ;;
654 powerpc* | rs6000* ) machine=ibmrs6000 ;;
655 sparc* ) machine=sparc ;;
656 * ) unported=yes ;;
657 esac
658 case "${canonical}" in
659 *-sunos5.3* | *-solaris2.3* )
660 opsys=sol2-3
661 NON_GNU_CPP=/usr/ccs/lib/cpp
662 ;;
663 *-sunos5.4* | *-solaris2.4* )
664 opsys=sol2-4
665 NON_GNU_CPP=/usr/ccs/lib/cpp
666 RANLIB="ar -ts"
667 ;;
668 *-sunos5.5* | *-solaris2.5* )
669 opsys=sol2-5
670 NON_GNU_CPP=/usr/ccs/lib/cpp
671 RANLIB="ar -ts"
672 ;;
673 *-sunos5.6* | *-solaris2.6* )
674 opsys=sol2-6
675 NON_GNU_CPP=/usr/ccs/lib/cpp
676 RANLIB="ar -ts"
677 ;;
678 *-sunos5* | *-solaris* )
679 opsys=sol2-6
680 emacs_check_sunpro_c=yes
681 NON_GNU_CPP=/usr/ccs/lib/cpp
682 ;;
683 * ) opsys=bsd4-2 ;;
684 esac
685 ## Watch out for a compiler that we know will not work.
686 case "${canonical}" in
687 *-solaris* | *-sunos5* )
688 if [ "x$CC" = x/usr/ucb/cc ]; then
689 ## /usr/ucb/cc doesn't work;
690 ## we should find some other compiler that does work.
691 unset CC
692 fi
693 ;;
694 *) ;;
695 esac
696 ;;
697 sparc-*-nextstep* )
698 machine=sparc opsys=nextstep
699 ;;
700
701 ## Tandem Integrity S2
702 mips-tandem-sysv* )
703 machine=tandem-s2 opsys=usg5-3
704 ;;
705
706 ## Vaxen.
707 vax-dec-* )
708 machine=vax
709 case "${canonical}" in
710 *-bsd4.1* ) opsys=bsd4-1 ;;
711 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
712 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
713 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
714 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
715 *-vms* ) opsys=vms ;;
716 * ) unported=yes
717 esac
718 ;;
719
720 ## IA-64
721 ia64*-*-linux* )
722 machine=ia64 opsys=gnu-linux
723 ;;
724
725 ## Intel 386 machines where we don't care about the manufacturer
726 i[3456]86-*-* )
727 machine=intel386
728 case "${canonical}" in
729 *-cygwin ) opsys=cygwin ;;
730 *-darwin* ) opsys=darwin
731 CPP="${CC-cc} -E -no-cpp-precomp"
732 ;;
733 *-xenix* ) opsys=xenix ;;
734 *-linux-gnu* ) opsys=gnu-linux ;;
735 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
736 *-sysv5uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
737 *-sysv5OpenUNIX* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
738 *-386bsd* ) opsys=386bsd ;;
739 *-nextstep* ) opsys=nextstep ;;
740 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
741 esac
742 ;;
743
744 ## m68k Linux-based GNU system
745 m68k-*-linux-gnu* )
746 machine=m68k opsys=gnu-linux
747 ;;
748
749 ## Mips Linux-based GNU system
750 mips-*-linux-gnu* | mipsel-*-linux-gnu* )
751 machine=mips opsys=gnu-linux
752 ;;
753
754 ## UXP/DS
755 sparc-fujitsu-sysv4* )
756 machine=sparc opsys=uxpds
757 NON_GNU_CPP=/usr/ccs/lib/cpp
758 RANLIB="ar -ts"
759 ;;
760
761 ## AMD x86-64 Linux-based GNU system
762 x86_64-*-linux-gnu* )
763 machine=amdx86-64 opsys=gnu-linux
764 ;;
765
766 ## Tensilica Xtensa Linux-based GNU system
767 xtensa*-*-linux-gnu* )
768 machine=xtensa opsys=gnu-linux
769 ;;
770
771 * )
772 unported=yes
773 ;;
774 esac
775
776 ### If the code above didn't choose an operating system, just choose
777 ### an operating system based on the configuration name. You really
778 ### only want to use this when you have no idea what the right
779 ### operating system is; if you know what operating systems a machine
780 ### runs, it's cleaner to make it explicit in the case statement
781 ### above.
782 if test x"${opsys}" = x; then
783 case "${canonical}" in
784 *-gnu* ) opsys=gnu ;;
785 *-bsd4.[01] ) opsys=bsd4-1 ;;
786 *-bsd4.2 ) opsys=bsd4-2 ;;
787 *-bsd4.3 ) opsys=bsd4-3 ;;
788 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
789 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
790 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
791 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
792 *-sysv4.2uw* ) opsys=unixware ;;
793 *-sysv5uw* ) opsys=unixware ;;
794 *-sysv5OpenUNIX* ) opsys=unixware ;;
795 *-sysv4.1* | *-sysvr4.1* )
796 NON_GNU_CPP=/usr/lib/cpp
797 opsys=usg5-4 ;;
798 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
799 if [ x$NON_GNU_CPP = x ]; then
800 if [ -f /usr/ccs/lib/cpp ]; then
801 NON_GNU_CPP=/usr/ccs/lib/cpp
802 else
803 NON_GNU_CPP=/lib/cpp
804 fi
805 fi
806 opsys=usg5-4-2 ;;
807 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
808 * )
809 unported=yes
810 ;;
811 esac
812 fi
813
814 ]
815 dnl quotation ends
816
817 if test $unported = yes; then
818 AC_MSG_ERROR([Emacs hasn't been ported to `${canonical}' systems.
819 Check `etc/MACHINES' for recognized configuration names.])
820 fi
821
822 machfile="m/${machine}.h"
823 opsysfile="s/${opsys}.h"
824
825
826 #### Choose a compiler.
827 test -n "$CC" && cc_specified=yes
828
829 # Save the value of CFLAGS that the user specified.
830 SPECIFIED_CFLAGS="$CFLAGS"
831
832 dnl Sets GCC=yes if using gcc.
833 AC_PROG_CC
834
835 # On Suns, sometimes $CPP names a directory.
836 if test -n "$CPP" && test -d "$CPP"; then
837 CPP=
838 fi
839
840 ## If not using gcc, and on Solaris, and no CPP specified, see if
841 ## using a Sun compiler, which needs -Xs to prevent whitespace.
842 if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
843 test x"$CPP" = x; then
844 AC_MSG_CHECKING([whether we are using a Sun C compiler])
845 AC_CACHE_VAL(emacs_cv_sunpro_c,
846 [AC_TRY_LINK([],
847 [#ifndef __SUNPRO_C
848 fail;
849 #endif
850 ], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
851 AC_MSG_RESULT($emacs_cv_sunpro_c)
852
853 if test x"$emacs_cv_sunpro_c" = xyes; then
854 NON_GNU_CPP="$CC -E -Xs"
855 fi
856 fi
857
858 #### Some systems specify a CPP to use unless we are using GCC.
859 #### Now that we know whether we are using GCC, we can decide whether
860 #### to use that one.
861 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
862 then
863 CPP="$NON_GNU_CPP"
864 fi
865
866 #### Some systems specify a CC to use unless we are using GCC.
867 #### Now that we know whether we are using GCC, we can decide whether
868 #### to use that one.
869 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
870 test x$cc_specified != xyes
871 then
872 CC="$NON_GNU_CC"
873 fi
874
875 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
876 then
877 CC="$CC $GCC_TEST_OPTIONS"
878 fi
879
880 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
881 then
882 CC="$CC $NON_GCC_TEST_OPTIONS"
883 fi
884
885 dnl checks for Unix variants
886 AC_AIX
887 AC_GNU_SOURCE
888
889 ### Use -Wno-pointer-sign if the compiler supports it
890 AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
891 SAVE_CFLAGS="$CFLAGS"
892 CFLAGS="$CFLAGS -Wno-pointer-sign"
893 AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
894 if test $has_option = yes; then
895 C_WARNINGS_SWITCH="-Wno-pointer-sign $C_WARNINGS_SWITCH"
896 fi
897 AC_MSG_RESULT($has_option)
898 CFLAGS="$SAVE_CFLAGS"
899 unset has_option
900 unset SAVE_CFLAGS
901
902 #### Some other nice autoconf tests.
903
904 dnl checks for programs
905 AC_PROG_LN_S
906 AC_PROG_CPP
907 AC_PROG_INSTALL
908 if test "x$RANLIB" = x; then
909 AC_PROG_RANLIB
910 fi
911 AC_PATH_PROG(INSTALL_INFO, install-info)
912 AC_PATH_PROG(INSTALL_INFO, install-info,, /usr/sbin)
913 AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin)
914 dnl Don't use GZIP, which is used by gzip for additional parameters.
915 AC_PATH_PROG(GZIP_PROG, gzip)
916
917
918 ## Need makeinfo >= 4.6 (?) to build the manuals.
919 AC_PATH_PROG(MAKEINFO, makeinfo, no)
920 dnl By this stage, configure has already checked for egrep and set EGREP,
921 dnl or exited with an error if no egrep was found.
922 if test "$MAKEINFO" != "no" && \
923 test x"`$MAKEINFO --version 2> /dev/null | $EGREP 'texinfo[[^0-9]]*([[1-4]][[0-9]]+|[[5-9]]|4\.[[6-9]]|4\.[[1-5]][[0-9]]+)'`" = x; then
924 MAKEINFO=no
925 fi
926
927 if test "$MAKEINFO" = "no"; then
928 AC_MSG_ERROR( [makeinfo >= 4.6 is required] )
929 fi
930
931
932 dnl Add our options to ac_link now, after it is set up.
933
934 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
935 then
936 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
937 fi
938
939 if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
940 then
941 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
942 fi
943
944 dnl We need -znocombreloc if we're using a relatively recent GNU ld.
945 dnl If we can link with the flag, it shouldn't do any harm anyhow.
946 dnl (Don't use `-z nocombreloc' as -z takes no arg on Irix.)
947 dnl Treat GCC specially since it just gives a non-fatal `unrecognized option'
948 dnl if not built to support GNU ld.
949
950 late_LDFLAGS=$LDFLAGS
951 if test "$GCC" = yes; then
952 LDFLAGS="$LDFLAGS -Wl,-znocombreloc"
953 else
954 LDFLAGS="$LDFLAGS -znocombreloc"
955 fi
956
957 AC_MSG_CHECKING([for -znocombreloc])
958 AC_LINK_IFELSE([main(){return 0;}],
959 [AC_MSG_RESULT(yes)],
960 LDFLAGS=$late_LDFLAGS
961 [AC_MSG_RESULT(no)])
962
963 #### Extract some information from the operating system and machine files.
964
965 AC_CHECKING([the machine- and system-dependent files to find out
966 - which libraries the lib-src programs will want, and
967 - whether the GNU malloc routines are usable])
968
969 ### First figure out CFLAGS (which we use for running the compiler here)
970 ### and REAL_CFLAGS (which we use for real compilation).
971 ### The two are the same except on a few systems, where they are made
972 ### different to work around various lossages. For example,
973 ### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
974 ### as implying static linking.
975
976 ### If the CFLAGS env var is specified, we use that value
977 ### instead of the default.
978
979 ### It's not important that this name contain the PID; you can't run
980 ### two configures in the same directory and have anything work
981 ### anyway.
982 tempcname="conftest.c"
983
984 echo '
985 #include "'${srcdir}'/src/'${opsysfile}'"
986 #include "'${srcdir}'/src/'${machfile}'"
987 #ifndef LIBS_MACHINE
988 #define LIBS_MACHINE
989 #endif
990 #ifndef LIBS_SYSTEM
991 #define LIBS_SYSTEM
992 #endif
993 #ifndef C_SWITCH_SYSTEM
994 #define C_SWITCH_SYSTEM
995 #endif
996 #ifndef C_SWITCH_MACHINE
997 #define C_SWITCH_MACHINE
998 #endif
999 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
1000 configure___ c_switch_system=C_SWITCH_SYSTEM
1001 configure___ c_switch_machine=C_SWITCH_MACHINE
1002
1003 #ifndef LIB_X11_LIB
1004 #define LIB_X11_LIB -lX11
1005 #endif
1006
1007 #ifndef LIBX11_MACHINE
1008 #define LIBX11_MACHINE
1009 #endif
1010
1011 #ifndef LIBX11_SYSTEM
1012 #define LIBX11_SYSTEM
1013 #endif
1014 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
1015
1016 #ifdef UNEXEC
1017 configure___ unexec=UNEXEC
1018 #else
1019 configure___ unexec=unexec.o
1020 #endif
1021
1022 #ifdef SYSTEM_MALLOC
1023 configure___ system_malloc=yes
1024 #else
1025 configure___ system_malloc=no
1026 #endif
1027
1028 #ifdef USE_MMAP_FOR_BUFFERS
1029 configure___ use_mmap_for_buffers=yes
1030 #else
1031 configure___ use_mmap_for_buffers=no
1032 #endif
1033
1034 #ifndef C_DEBUG_SWITCH
1035 #define C_DEBUG_SWITCH -g
1036 #endif
1037
1038 #ifndef C_OPTIMIZE_SWITCH
1039 #ifdef __GNUC__
1040 #define C_OPTIMIZE_SWITCH -O2
1041 #else
1042 #define C_OPTIMIZE_SWITCH -O
1043 #endif
1044 #endif
1045
1046 #ifndef C_WARNINGS_SWITCH
1047 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
1048 #endif
1049
1050 #ifndef LD_SWITCH_MACHINE
1051 #define LD_SWITCH_MACHINE
1052 #endif
1053
1054 #ifndef LD_SWITCH_SYSTEM
1055 #define LD_SWITCH_SYSTEM
1056 #endif
1057
1058 #ifndef LD_SWITCH_X_SITE_AUX
1059 #define LD_SWITCH_X_SITE_AUX
1060 #endif
1061
1062 configure___ ld_switch_system=LD_SWITCH_SYSTEM
1063 configure___ ld_switch_machine=LD_SWITCH_MACHINE
1064
1065 #ifdef THIS_IS_CONFIGURE
1066
1067 /* Get the CFLAGS for tests in configure. */
1068 #ifdef __GNUC__
1069 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
1070 #else
1071 configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1072 #endif
1073
1074 #else /* not THIS_IS_CONFIGURE */
1075
1076 /* Get the CFLAGS for real compilation. */
1077 #ifdef __GNUC__
1078 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH '${SPECIFIED_CFLAGS}'
1079 #else
1080 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
1081 #endif
1082
1083 #endif /* not THIS_IS_CONFIGURE */
1084 ' > ${tempcname}
1085
1086 # The value of CPP is a quoted variable reference, so we need to do this
1087 # to get its actual value...
1088 CPP=`eval "echo $CPP"`
1089 [eval `${CPP} -Isrc ${tempcname} \
1090 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1091 if test "x$SPECIFIED_CFLAGS" = x; then
1092 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1093 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1094 else
1095 REAL_CFLAGS="$CFLAGS"
1096 fi]
1097 rm ${tempcname}
1098
1099 ac_link="$ac_link $ld_switch_machine $ld_switch_system"
1100
1101 ### Make sure subsequent tests use flags consistent with the build flags.
1102
1103 if test x"${OVERRIDE_CPPFLAGS}" != x; then
1104 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
1105 else
1106 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1107 fi
1108
1109 dnl For AC_FUNC_GETLOADAVG, at least:
1110 AC_CONFIG_LIBOBJ_DIR(src)
1111
1112 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1113 AC_SYS_LARGEFILE
1114
1115
1116 ### The standard library on x86-64 and s390x GNU/Linux distributions can
1117 ### be located in either /usr/lib64 or /usr/lib.
1118 case "${canonical}" in
1119 x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
1120 if test -d /usr/lib64; then
1121 AC_DEFINE(HAVE_LIB64_DIR, 1,
1122 [Define to 1 if the directory /usr/lib64 exists.])
1123 fi
1124 esac
1125
1126 dnl This function defintion taken from Gnome 2.0
1127 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1128 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1129 dnl also defines GSTUFF_PKG_ERRORS on error
1130 AC_DEFUN([PKG_CHECK_MODULES], [
1131 succeeded=no
1132
1133 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1134
1135 if test "$PKG_CONFIG" = "no" ; then
1136 ifelse([$4], , [AC_MSG_ERROR([
1137 *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog. Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.])], [$4])
1138 else
1139 PKG_CONFIG_MIN_VERSION=0.9.0
1140 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1141 AC_MSG_CHECKING(for $2)
1142
1143 if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then
1144 AC_MSG_RESULT(yes)
1145 succeeded=yes
1146
1147 AC_MSG_CHECKING($1_CFLAGS)
1148 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"|sed -e 's,///*,/,g'`
1149 AC_MSG_RESULT($$1_CFLAGS)
1150
1151 AC_MSG_CHECKING($1_LIBS)
1152 $1_LIBS=`$PKG_CONFIG --libs "$2"|sed -e 's,///*,/,g'`
1153 AC_MSG_RESULT($$1_LIBS)
1154 else
1155 AC_MSG_RESULT(no)
1156 $1_CFLAGS=""
1157 $1_LIBS=""
1158 ## If we have a custom action on failure, don't print errors, but
1159 ## do set a variable so people can do so.
1160 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1161 ifelse([$4], ,echo $$1_PKG_ERRORS,)
1162 fi
1163
1164 AC_SUBST($1_CFLAGS)
1165 AC_SUBST($1_LIBS)
1166 else
1167 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1168 echo "*** See http://www.freedesktop.org/software/pkgconfig"
1169 fi
1170 fi
1171
1172 if test $succeeded = yes; then
1173 ifelse([$3], , :, [$3])
1174 else
1175 ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4])
1176 fi
1177 ])
1178
1179
1180 if test "${with_sound}" != "no"; then
1181 # Sound support for GNU/Linux and the free BSDs.
1182 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1183 # Emulation library used on NetBSD.
1184 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1185 AC_SUBST(LIBSOUND)
1186
1187 ALSA_REQUIRED=1.0.0
1188 ALSA_MODULES="alsa >= $ALSA_REQUIRED"
1189 PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
1190 if test $HAVE_ALSA = yes; then
1191 SAVE_CFLAGS="$CFLAGS"
1192 SAVE_LDFLAGS="$LDFLAGS"
1193 CFLAGS="$ALSA_CFLAGS $CFLAGS"
1194 LDFLAGS="$ALSA_LIBS $LDFLAGS"
1195 AC_TRY_COMPILE([#include <asoundlib.h>], [snd_lib_error_set_handler (0);],
1196 emacs_alsa_normal=yes,
1197 emacs_alsa_normal=no)
1198 if test "$emacs_alsa_normal" != yes; then
1199 AC_TRY_COMPILE([#include <alsa/asoundlib.h>],
1200 [snd_lib_error_set_handler (0);],
1201 emacs_alsa_subdir=yes,
1202 emacs_alsa_subdir=no)
1203 if test "$emacs_alsa_subdir" != yes; then
1204 AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.])
1205 fi
1206 ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
1207 fi
1208
1209 CFLAGS="$SAVE_CFLAGS"
1210 LDFLAGS="$SAVE_LDFLAGS"
1211 LIBSOUND="$LIBSOUND $ALSA_LIBS"
1212 CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
1213 AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
1214 fi
1215 AC_SUBST(CFLAGS_SOUND)
1216 fi
1217
1218 dnl checks for header files
1219 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1220 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1221 termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
1222 sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
1223 sys/utsname.h pwd.h)
1224
1225 AC_MSG_CHECKING(if personality LINUX32 can be set)
1226 AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
1227 emacs_cv_personality_linux32=yes,
1228 emacs_cv_personality_linux32=no)
1229 AC_MSG_RESULT($emacs_cv_personality_linux32)
1230
1231 if test $emacs_cv_personality_linux32 = yes; then
1232 AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1,
1233 [Define to 1 if personality LINUX32 can be set.])
1234 fi
1235
1236 dnl On Solaris 8 there's a compilation warning for term.h because
1237 dnl it doesn't define `bool'.
1238 AC_CHECK_HEADERS(term.h, , , -)
1239 AC_HEADER_STDC
1240 AC_HEADER_TIME
1241 AC_CHECK_DECLS([sys_siglist])
1242 if test $ac_cv_have_decl_sys_siglist != yes; then
1243 # For Tru64, at least:
1244 AC_CHECK_DECLS([__sys_siglist])
1245 if test $ac_cv_have_decl___sys_siglist = yes; then
1246 AC_DEFINE(sys_siglist, __sys_siglist,
1247 [Define to any substitute for sys_siglist.])
1248 fi
1249 fi
1250 AC_HEADER_SYS_WAIT
1251
1252 dnl Some systems have utime.h but don't declare the struct anyplace.
1253 AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf,
1254 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1255 #include <sys/time.h>
1256 #include <time.h>
1257 #else
1258 #ifdef HAVE_SYS_TIME_H
1259 #include <sys/time.h>
1260 #else
1261 #include <time.h>
1262 #endif
1263 #endif
1264 #ifdef HAVE_UTIME_H
1265 #include <utime.h>
1266 #endif], [static struct utimbuf x; x.actime = x.modtime;],
1267 emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no))
1268 if test $emacs_cv_struct_utimbuf = yes; then
1269 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by <utime.h>.])
1270 fi
1271
1272 dnl checks for typedefs
1273 AC_TYPE_SIGNAL
1274
1275 dnl Check for speed_t typedef.
1276 AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t,
1277 [AC_TRY_COMPILE([#include <termios.h>], [speed_t x = 1;],
1278 emacs_cv_speed_t=yes, emacs_cv_speed_t=no)])
1279 if test $emacs_cv_speed_t = yes; then
1280 AC_DEFINE(HAVE_SPEED_T, 1,
1281 [Define to 1 if `speed_t' is declared by <termios.h>.])
1282 fi
1283
1284 AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval,
1285 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
1286 #include <sys/time.h>
1287 #include <time.h>
1288 #else
1289 #ifdef HAVE_SYS_TIME_H
1290 #include <sys/time.h>
1291 #else
1292 #include <time.h>
1293 #endif
1294 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
1295 emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no))
1296 HAVE_TIMEVAL=$emacs_cv_struct_timeval
1297 if test $emacs_cv_struct_timeval = yes; then
1298 AC_DEFINE(HAVE_TIMEVAL, 1, [Define to 1 if `struct timeval' is declared by <sys/time.h>.])
1299 fi
1300
1301 AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception,
1302 AC_TRY_COMPILE([#include <math.h>],
1303 [static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;],
1304 emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no))
1305 HAVE_EXCEPTION=$emacs_cv_struct_exception
1306 if test $emacs_cv_struct_exception != yes; then
1307 AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
1308 fi
1309
1310 AC_CHECK_HEADERS(sys/socket.h)
1311 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
1312 #if HAVE_SYS_SOCKET_H
1313 #include <sys/socket.h>
1314 #endif])
1315
1316 dnl checks for structure members
1317 AC_STRUCT_TM
1318 AC_STRUCT_TIMEZONE
1319 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
1320 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
1321 [Define to 1 if `tm_gmtoff' is member of `struct tm'.])],,
1322 [#include <time.h>])
1323 AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr,
1324 struct ifreq.ifr_netmask, struct ifreq.ifr_broadaddr,
1325 struct ifreq.ifr_addr], , ,
1326 [AC_INCLUDES_DEFAULT
1327 #if HAVE_SYS_SOCKET_H
1328 #include <sys/socket.h>
1329 #endif
1330 #if HAVE_NET_IF_H
1331 #include <net/if.h>
1332 #endif])
1333
1334 dnl checks for compiler characteristics
1335
1336 dnl Testing __STDC__ to determine prototype support isn't good enough.
1337 dnl DEC C, for instance, doesn't define it with default options, and
1338 dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile
1339 dnl and void *.
1340 AC_C_PROTOTYPES
1341 AC_C_VOLATILE
1342 AC_C_CONST
1343 dnl This isn't useful because we can't turn on use of `inline' unless
1344 dnl the compiler groks `extern inline'.
1345 dnl AC_C_INLINE
1346 AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
1347 [AC_TRY_COMPILE(, [void * foo;],
1348 emacs_cv_void_star=yes, emacs_cv_void_star=no)])
1349 if test $emacs_cv_void_star = yes; then
1350 AC_DEFINE(POINTER_TYPE, void)
1351 else
1352 AC_DEFINE(POINTER_TYPE, char)
1353 fi
1354 AH_TEMPLATE(POINTER_TYPE,
1355 [Define as `void' if your compiler accepts `void *'; otherwise
1356 define as `char'.])dnl
1357
1358
1359
1360 dnl This could be used for targets which can have both byte sexes.
1361 dnl We could presumably replace the hardwired WORDS_BIG_ENDIAN generally.
1362 dnl AC_C_BIGENDIAN
1363
1364 dnl check for Make feature
1365 AC_PROG_MAKE_SET
1366
1367 dnl checks for operating system services
1368 AC_SYS_LONG_FILE_NAMES
1369
1370 #### Choose a window system.
1371
1372 AC_PATH_X
1373 if test "$no_x" = yes; then
1374 window_system=none
1375 else
1376 window_system=x11
1377 fi
1378
1379 if test "${x_libraries}" != NONE; then
1380 if test -n "${x_libraries}"; then
1381 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
1382 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
1383 fi
1384 x_default_search_path=""
1385 x_search_path=${x_libraries}
1386 if test -z "${x_search_path}"; then
1387 x_search_path=/usr/lib
1388 fi
1389 for x_library in `echo ${x_search_path}: | \
1390 sed -e "s/:/ /g" -e p -e "s:/lib[[^ /]]* :/share :g"`; do
1391 x_search_path="\
1392 ${x_library}/X11/%L/%T/%N%C%S:\
1393 ${x_library}/X11/%l/%T/%N%C%S:\
1394 ${x_library}/X11/%T/%N%C%S:\
1395 ${x_library}/X11/%L/%T/%N%S:\
1396 ${x_library}/X11/%l/%T/%N%S:\
1397 ${x_library}/X11/%T/%N%S"
1398 if test x"${x_default_search_path}" = x; then
1399 x_default_search_path=${x_search_path}
1400 else
1401 x_default_search_path="${x_search_path}:${x_default_search_path}"
1402 fi
1403 done
1404 fi
1405 if test "${x_includes}" != NONE && test -n "${x_includes}"; then
1406 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
1407 fi
1408
1409 if test x"${x_includes}" = x; then
1410 bitmapdir=/usr/include/X11/bitmaps
1411 else
1412 # accumulate include directories that have X11 bitmap subdirectories
1413 bmd_acc="dummyval"
1414 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
1415 if test -d "${bmd}/X11/bitmaps"; then
1416 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
1417 fi
1418 if test -d "${bmd}/bitmaps"; then
1419 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
1420 fi
1421 done
1422 if test ${bmd_acc} != "dummyval"; then
1423 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
1424 fi
1425 fi
1426
1427 HAVE_CARBON=no
1428 if test "${with_carbon}" != no; then
1429 AC_CHECK_HEADER(Carbon/Carbon.h, HAVE_CARBON=yes)
1430 fi
1431 if test "${window_system}" = x11 && test "${HAVE_CARBON}" = yes; then
1432 if test "${with_carbon+set}" != set \
1433 && test "${carbon_appdir_x+set}" != set; then
1434 for var in with_x with_x_toolkit with_xim \
1435 with_xpm with_jpeg with_tiff with_gif with_png; do
1436 if eval test \"\${$var+set}\" = set; then
1437 HAVE_CARBON=no
1438 break
1439 fi
1440 done
1441 fi
1442 fi
1443 if test "${HAVE_CARBON}" = yes; then
1444 window_system=mac
1445 fi
1446
1447 case "${window_system}" in
1448 x11 )
1449 HAVE_X_WINDOWS=yes
1450 HAVE_X11=yes
1451 case "${with_x_toolkit}" in
1452 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1453 motif ) USE_X_TOOLKIT=MOTIF ;;
1454 gtk ) with_gtk=yes
1455 dnl Dont set this for GTK. A lot of tests below assumes Xt when
1456 dnl USE_X_TOOLKIT is set.
1457 USE_X_TOOLKIT=none ;;
1458 no ) USE_X_TOOLKIT=none ;;
1459 dnl If user did not say whether to use a toolkit, make this decision later:
1460 dnl use the toolkit if we have gtk, or X11R5 or newer.
1461 * ) USE_X_TOOLKIT=maybe ;;
1462 esac
1463 ;;
1464 mac | none )
1465 HAVE_X_WINDOWS=no
1466 HAVE_X11=no
1467 USE_X_TOOLKIT=none
1468 ;;
1469 esac
1470
1471 if test "$window_system" = none && test "X$with_x" != "Xno"; then
1472 AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
1473 if test "$HAVE_XSERVER" = true ||
1474 test -n "$DISPLAY" ||
1475 test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
1476 AC_MSG_ERROR([You seem to be running X, but no X development libraries
1477 were found. You should install the relevant development files for X
1478 and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make
1479 sure you have development files for image handling, i.e.
1480 tiff, gif, jpeg, png and xpm.
1481 If you are sure you want Emacs compiled without X window support, pass
1482 --without-x
1483 to configure.])
1484 fi
1485 fi
1486
1487 ### If we're using X11, we should use the X menu package.
1488 HAVE_MENUS=no
1489 case ${HAVE_X11} in
1490 yes ) HAVE_MENUS=yes ;;
1491 esac
1492
1493 ### Compute the unexec source name from the object name.
1494 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1495
1496 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1497 # Assume not, until told otherwise.
1498 GNU_MALLOC=yes
1499 doug_lea_malloc=yes
1500 AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
1501 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
1502 AC_CACHE_CHECK(whether __after_morecore_hook exists,
1503 emacs_cv_var___after_morecore_hook,
1504 [AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0],
1505 emacs_cv_var___after_morecore_hook=yes,
1506 emacs_cv_var___after_morecore_hook=no)])
1507 if test $emacs_cv_var___after_morecore_hook = no; then
1508 doug_lea_malloc=no
1509 fi
1510 if test "${system_malloc}" = "yes"; then
1511 GNU_MALLOC=no
1512 GNU_MALLOC_reason="
1513 (The GNU allocators don't work with this system configuration.)"
1514 fi
1515 if test "$doug_lea_malloc" = "yes" ; then
1516 if test "$GNU_MALLOC" = yes ; then
1517 GNU_MALLOC_reason="
1518 (Using Doug Lea's new malloc from the GNU C Library.)"
1519 fi
1520 AC_DEFINE(DOUG_LEA_MALLOC, 1,
1521 [Define to 1 if you are using the GNU C Library.])
1522 fi
1523
1524 if test x"${REL_ALLOC}" = x; then
1525 REL_ALLOC=${GNU_MALLOC}
1526 fi
1527
1528 dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
1529 dnl the system configuration file (s/*.h) to turn the use of mmap
1530 dnl in the relocating allocator on.
1531
1532 AC_FUNC_MMAP
1533 if test $use_mmap_for_buffers = yes; then
1534 REL_ALLOC=no
1535 fi
1536
1537 LIBS="$libsrc_libs $LIBS"
1538
1539 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1540 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1541 AC_CHECK_LIB(dnet, dnet_ntoa)
1542 dnl This causes -lresolv to get used in subsequent tests,
1543 dnl which causes failures on some systems such as HPUX 9.
1544 dnl AC_CHECK_LIB(resolv, gethostbyname)
1545
1546 dnl FIXME replace main with a function we actually want from this library.
1547 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1548
1549 AC_CHECK_LIB(pthreads, cma_open)
1550
1551 AC_MSG_CHECKING(for XFree86 in /usr/X386)
1552 if test -d /usr/X386/include; then
1553 HAVE_XFREE386=yes
1554 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
1555 else
1556 HAVE_XFREE386=no
1557 fi
1558 AC_MSG_RESULT($HAVE_XFREE386)
1559
1560 dnl Check for need for bigtoc support on IBM AIX
1561
1562 case ${host_os} in
1563 aix*)
1564 AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
1565 case $GCC in
1566 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
1567 *) gdb_cv_bigtoc=-bbigtoc ;;
1568 esac
1569
1570 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
1571 AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
1572 ])
1573 ;;
1574 esac
1575
1576 # Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets
1577 # used for the tests that follow. We set them back to REAL_CFLAGS and
1578 # REAL_CPPFLAGS later on.
1579
1580 REAL_CPPFLAGS="$CPPFLAGS"
1581
1582 if test "${HAVE_X11}" = "yes"; then
1583 DEFS="$C_SWITCH_X_SITE $DEFS"
1584 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
1585 LIBS="$LIBX $LIBS"
1586 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1587 CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
1588
1589 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
1590 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
1591 # but it's more convenient here to set LD_RUN_PATH
1592 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
1593 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
1594 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
1595 export LD_RUN_PATH
1596 fi
1597
1598 if test "${opsys}" = "gnu-linux"; then
1599 AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
1600 AC_TRY_LINK([],
1601 [XOpenDisplay ("foo");],
1602 [xlinux_first_failure=no],
1603 [xlinux_first_failure=yes])
1604 if test "${xlinux_first_failure}" = "yes"; then
1605 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
1606 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
1607 OLD_CPPFLAGS="$CPPFLAGS"
1608 OLD_LIBS="$LIBS"
1609 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
1610 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
1611 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
1612 LIBS="$LIBS -b i486-linuxaout"
1613 AC_TRY_LINK([],
1614 [XOpenDisplay ("foo");],
1615 [xlinux_second_failure=no],
1616 [xlinux_second_failure=yes])
1617 if test "${xlinux_second_failure}" = "yes"; then
1618 # If we get the same failure with -b, there is no use adding -b.
1619 # So take it out. This plays safe.
1620 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
1621 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
1622 CPPFLAGS="$OLD_CPPFLAGS"
1623 LIBS="$OLD_LIBS"
1624 AC_MSG_RESULT(no)
1625 else
1626 AC_MSG_RESULT(yes)
1627 fi
1628 else
1629 AC_MSG_RESULT(no)
1630 fi
1631 fi
1632
1633 # Reportedly, some broken Solaris systems have XKBlib.h but are missing
1634 # header files included from there.
1635 AC_MSG_CHECKING(for Xkb)
1636 AC_TRY_LINK([#include <X11/Xlib.h>
1637 #include <X11/XKBlib.h>],
1638 [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
1639 emacs_xkb=yes, emacs_xkb=no)
1640 AC_MSG_RESULT($emacs_xkb)
1641 if test $emacs_xkb = yes; then
1642 AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
1643 fi
1644
1645 AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
1646 XScreenNumberOfScreen XSetWMProtocols)
1647 fi
1648
1649 if test "${window_system}" = "x11"; then
1650 AC_MSG_CHECKING(X11 version 6)
1651 AC_CACHE_VAL(emacs_cv_x11_version_6,
1652 [AC_TRY_LINK([#include <X11/Xlib.h>],
1653 [#if XlibSpecificationRelease < 6
1654 fail;
1655 #endif
1656 ], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
1657 if test $emacs_cv_x11_version_6 = yes; then
1658 AC_MSG_RESULT(6 or newer)
1659 AC_DEFINE(HAVE_X11R6, 1,
1660 [Define to 1 if you have the X11R6 or newer version of Xlib.])
1661 else
1662 AC_MSG_RESULT(before 6)
1663 fi
1664 fi
1665
1666
1667 ### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
1668 HAVE_RSVG=no
1669 if test "${HAVE_X11}" = "yes" || test "${HAVE_CARBON}" = "yes"; then
1670 if test "${with_rsvg}" != "no"; then
1671 RSVG_REQUIRED=2.0.0
1672 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
1673
1674 PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, :, :)
1675 AC_SUBST(RSVG_CFLAGS)
1676 AC_SUBST(RSVG_LIBS)
1677
1678 if test ".${RSVG_CFLAGS}" != "."; then
1679 HAVE_RSVG=yes
1680 AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])
1681 CFLAGS="$CFLAGS $RSVG_CFLAGS"
1682 LIBS="$RSVG_LIBS $LIBS"
1683 fi
1684 fi
1685 fi
1686
1687
1688 HAVE_GTK=no
1689 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
1690 GLIB_REQUIRED=2.6
1691 GTK_REQUIRED=2.6
1692 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
1693
1694 dnl Checks for libraries.
1695 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
1696 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
1697 AC_MSG_ERROR($GTK_PKG_ERRORS)
1698 fi
1699 fi
1700
1701
1702 if test x"$pkg_check_gtk" = xyes; then
1703
1704 AC_SUBST(GTK_CFLAGS)
1705 AC_SUBST(GTK_LIBS)
1706 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
1707 CFLAGS="$CFLAGS $GTK_CFLAGS"
1708 LIBS="$GTK_LIBS $LIBS"
1709 dnl Try to compile a simple GTK program.
1710 GTK_COMPILES=no
1711 AC_CHECK_FUNCS(gtk_main, GTK_COMPILES=yes)
1712 if test "${GTK_COMPILES}" != "yes"; then
1713 if test "$USE_X_TOOLKIT" != "maybe"; then
1714 AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]);
1715 fi
1716 else
1717 HAVE_GTK=yes
1718 AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
1719 USE_X_TOOLKIT=none
1720 fi
1721
1722 fi
1723
1724
1725 if test "${HAVE_GTK}" = "yes"; then
1726
1727 dnl GTK scrollbars resemble toolkit scrollbars a lot, so to avoid
1728 dnl a lot if #ifdef:s, say we have toolkit scrollbars.
1729 if test "$with_toolkit_scroll_bars" != no; then
1730 with_toolkit_scroll_bars=yes
1731 fi
1732
1733 dnl Check if we can use multiple displays with this GTK version.
1734 dnl If gdk_display_open exists, assume all others are there also.
1735 HAVE_GTK_MULTIDISPLAY=no
1736 AC_CHECK_FUNCS(gdk_display_open, HAVE_GTK_MULTIDISPLAY=yes)
1737 if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
1738 AC_DEFINE(HAVE_GTK_MULTIDISPLAY, 1,
1739 [Define to 1 if GTK can handle more than one display.])
1740 fi
1741
1742 dnl Check if we have the old file selection dialog.
1743 dnl If gdk_display_open exists, assume all others are there also.
1744 HAVE_GTK_FILE_SELECTION=no
1745 AC_CHECK_FUNCS(gtk_file_selection_new, HAVE_GTK_FILE_SELECTION=yes)
1746
1747 dnl Check if we have the new file chooser dialog
1748 dnl If gdk_display_open exists, assume all others are there also.
1749 HAVE_GTK_FILE_CHOOSER=no
1750 AC_CHECK_FUNCS(gtk_file_chooser_dialog_new, HAVE_GTK_FILE_CHOOSER=yes)
1751
1752 if test "$HAVE_GTK_FILE_SELECTION" = yes \
1753 && test "$HAVE_GTK_FILE_CHOOSER" = yes; then
1754 AC_DEFINE(HAVE_GTK_FILE_BOTH, 1,
1755 [Define to 1 if GTK has both file selection and chooser dialog.])
1756 fi
1757
1758 dnl Check if pthreads are available. Emacs only needs this when using
1759 dnl gtk_file_chooser under Gnome.
1760 if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
1761 HAVE_GTK_AND_PTHREAD=no
1762 AC_CHECK_HEADERS(pthread.h)
1763 if test "$ac_cv_header_pthread_h"; then
1764 AC_CHECK_LIB(pthread, pthread_self, HAVE_GTK_AND_PTHREAD=yes)
1765 fi
1766 if test "$HAVE_GTK_AND_PTHREAD" = yes; then
1767 case "${canonical}" in
1768 *-hpux*) ;;
1769 *) GTK_LIBS="$GTK_LIBS -lpthread" ;;
1770 esac
1771 AC_DEFINE(HAVE_GTK_AND_PTHREAD, 1,
1772 [Define to 1 if you have GTK and pthread (-lpthread).])
1773 fi
1774 fi
1775 fi
1776
1777 dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
1778 dnl other platforms. Support for higher D-Bus versions than 1.0 is
1779 dnl also not configured.
1780 HAVE_DBUS=no
1781 if test "${with_dbus}" = "yes"; then
1782 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
1783 if test "$HAVE_DBUS" = yes; then
1784 AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
1785 fi
1786 fi
1787
1788 dnl Do not put whitespace before the #include statements below.
1789 dnl Older compilers (eg sunos4 cc) choke on it.
1790 HAVE_XAW3D=no
1791 if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
1792 if test "$with_xaw3d" != no; then
1793 AC_MSG_CHECKING(for xaw3d)
1794 AC_CACHE_VAL(emacs_cv_xaw3d,
1795 [AC_TRY_LINK([
1796 #include <X11/Intrinsic.h>
1797 #include <X11/Xaw3d/Simple.h>],
1798 [],
1799 emacs_cv_xaw3d=yes,
1800 emacs_cv_xaw3d=no)])
1801 else
1802 emacs_cv_xaw3d=no
1803 fi
1804 if test $emacs_cv_xaw3d = yes; then
1805 AC_MSG_RESULT([yes; using Lucid toolkit])
1806 USE_X_TOOLKIT=LUCID
1807 HAVE_XAW3D=yes
1808 AC_DEFINE(HAVE_XAW3D, 1,
1809 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
1810 else
1811 AC_MSG_RESULT(no)
1812 AC_MSG_CHECKING(for libXaw)
1813 AC_CACHE_VAL(emacs_cv_xaw,
1814 [AC_TRY_LINK([
1815 #include <X11/Intrinsic.h>
1816 #include <X11/Xaw/Simple.h>],
1817 [],
1818 emacs_cv_xaw=yes,
1819 emacs_cv_xaw=no)])
1820 if test $emacs_cv_xaw = yes; then
1821 AC_MSG_RESULT([yes; using Lucid toolkit])
1822 USE_X_TOOLKIT=LUCID
1823 elif test x"${USE_X_TOOLKIT}" = xLUCID; then
1824 AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
1825 else
1826 AC_MSG_RESULT([no; do not use toolkit by default])
1827 USE_X_TOOLKIT=none
1828 fi
1829 fi
1830 fi
1831
1832 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
1833
1834 if test "${USE_X_TOOLKIT}" != "none"; then
1835 AC_MSG_CHECKING(X11 toolkit version)
1836 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
1837 [AC_TRY_LINK([#include <X11/Intrinsic.h>],
1838 [#if XtSpecificationRelease < 6
1839 fail;
1840 #endif
1841 ], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
1842 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
1843 if test $emacs_cv_x11_toolkit_version_6 = yes; then
1844 AC_MSG_RESULT(6 or newer)
1845 AC_DEFINE(HAVE_X11XTR6, 1,
1846 [Define to 1 if you have the X11R6 or newer version of Xt.])
1847 else
1848 AC_MSG_RESULT(before 6)
1849 fi
1850
1851 dnl If using toolkit, check whether libXmu.a exists.
1852 dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
1853 OLDLIBS="$LIBS"
1854 if test x$HAVE_X11XTR6 = xyes; then
1855 LIBS="-lXt -lSM -lICE $LIBS"
1856 else
1857 LIBS="-lXt $LIBS"
1858 fi
1859 AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
1860 test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
1861 fi
1862
1863 # On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
1864 if test "${HAVE_X11}" = "yes"; then
1865 if test "${USE_X_TOOLKIT}" != "none"; then
1866 AC_CHECK_LIB(Xext, XShapeQueryExtension)
1867 fi
1868 fi
1869
1870 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1871 AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
1872 [AC_TRY_COMPILE([#include <Xm/Xm.h>],
1873 [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
1874 int x = 5;
1875 #else
1876 Motif version prior to 2.1.
1877 #endif],
1878 emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
1879 HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
1880 if test $emacs_cv_motif_version_2_1 = yes; then
1881 HAVE_LIBXP=no
1882 AC_DEFINE(HAVE_MOTIF_2_1, 1,
1883 [Define to 1 if you have Motif 2.1 or newer.])
1884 AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
1885 if test ${HAVE_LIBXP} = yes; then
1886 AC_DEFINE(HAVE_LIBXP, 1,
1887 [Define to 1 if you have the Xp library (-lXp).])
1888 fi
1889 else
1890 AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
1891 # We put this in CFLAGS temporarily to precede other -I options
1892 # that might be in CFLAGS temporarily.
1893 # We put this in CPPFLAGS where it precedes the other -I options.
1894 OLD_CPPFLAGS=$CPPFLAGS
1895 OLD_CFLAGS=$CFLAGS
1896 CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
1897 CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
1898 [AC_TRY_COMPILE([#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>],
1899 [int x = 5;],
1900 emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
1901 if test $emacs_cv_lesstif = yes; then
1902 # Make sure this -I option remains in CPPFLAGS after it is set
1903 # back to REAL_CPPFLAGS.
1904 # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
1905 # have those other -I options anyway. Ultimately, having this
1906 # directory ultimately in CPPFLAGS will be enough.
1907 REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
1908 LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
1909 else
1910 CFLAGS=$OLD_CFLAGS
1911 CPPFLAGS=$OLD_CPPFLAGS
1912 fi
1913 fi
1914 fi
1915
1916 dnl Use toolkit scroll bars if configured for GTK or X toolkit and either
1917 dnl using Motif or Xaw3d is available, and unless
1918 dnl --with-toolkit-scroll-bars=no was specified.
1919
1920 AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
1921 [Define to 1 if we should use toolkit scroll bars.])dnl
1922 USE_TOOLKIT_SCROLL_BARS=no
1923 if test "${with_toolkit_scroll_bars}" != "no"; then
1924 if test "${USE_X_TOOLKIT}" != "none"; then
1925 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
1926 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1927 HAVE_XAW3D=no
1928 USE_TOOLKIT_SCROLL_BARS=yes
1929 elif test "${HAVE_XAW3D}" = "yes"; then
1930 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1931 USE_TOOLKIT_SCROLL_BARS=yes
1932 fi
1933 elif test "${HAVE_GTK}" = "yes"; then
1934 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1935 USE_TOOLKIT_SCROLL_BARS=yes
1936 elif test "${HAVE_CARBON}" = "yes"; then
1937 AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
1938 USE_TOOLKIT_SCROLL_BARS=yes
1939 fi
1940 fi
1941
1942 dnl See if XIM is available.
1943 AC_TRY_COMPILE([
1944 #include <X11/Xlib.h>
1945 #include <X11/Xresource.h>],
1946 [XIMProc callback;],
1947 [HAVE_XIM=yes
1948 AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])],
1949 HAVE_XIM=no)
1950
1951 dnl `--with-xim' now controls only the initial value of use_xim at run time.
1952
1953 if test "${with_xim}" != "no"; then
1954 AC_DEFINE(USE_XIM, 1,
1955 [Define to 1 if we should use XIM, if it is available.])
1956 fi
1957
1958
1959 if test "${HAVE_XIM}" != "no"; then
1960 late_CFLAGS=$CFLAGS
1961 if test "$GCC" = yes; then
1962 CFLAGS="$CFLAGS --pedantic-errors"
1963 fi
1964 AC_TRY_COMPILE([
1965 #include <X11/Xlib.h>
1966 #include <X11/Xresource.h>],
1967 [Display *display;
1968 XrmDatabase db;
1969 char *res_name;
1970 char *res_class;
1971 XIMProc callback;
1972 XPointer *client_data;
1973 #ifndef __GNUC__
1974 /* If we're not using GCC, it's probably not XFree86, and this is
1975 probably right, but we can't use something like --pedantic-errors. */
1976 extern Bool XRegisterIMInstantiateCallback(Display*, XrmDatabase, char*,
1977 char*, XIMProc, XPointer*);
1978 #endif
1979 (void)XRegisterIMInstantiateCallback(display, db, res_name, res_class, callback,
1980 client_data);],
1981 [emacs_cv_arg6_star=yes])
1982 AH_TEMPLATE(XRegisterIMInstantiateCallback_arg6,
1983 [Define to the type of the 6th arg of XRegisterIMInstantiateCallback,
1984 either XPointer or XPointer*.])dnl
1985 if test "$emacs_cv_arg6_star" = yes; then
1986 AC_DEFINE(XRegisterIMInstantiateCallback_arg6, [XPointer*])
1987 else
1988 AC_DEFINE(XRegisterIMInstantiateCallback_arg6, [XPointer])
1989 fi
1990 CFLAGS=$late_CFLAGS
1991 fi
1992
1993 #### For font-backend
1994 if test "${USE_FONT_BACKEND}" = "yes"; then
1995
1996 AC_DEFINE(USE_FONT_BACKEND, 1,
1997 [Define to 1 if we should use font-backend.])
1998
1999 ### Use -lXft if available, unless `--with-freetype=no' nor `--with-xft=no'.
2000 HAVE_XFT=maybe
2001 if test "${HAVE_X11}" = "yes"; then
2002 if test "x${with_freetype}" = "xno"; then
2003 with_xft="no";
2004 fi
2005 if test "x${with_xft}" != "xno"; then
2006
2007 dnl Check if --with-pkg-config-prog has been given.
2008 if test "X${with_pkg_config_prog}" != X; then
2009 PKG_CONFIG="${with_pkg_config_prog}"
2010 fi
2011
2012 PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
2013 if test "$HAVE_XFT" != no; then
2014 OLD_CPPFLAGS="$CPPFLAGS"
2015 OLD_CFLAGS="$CFLAGS"
2016 OLD_LIBS="$LIBS"
2017 CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
2018 CFLAGS="$CFLAGS $XFT_CFLAGS"
2019 LIBS="$XFT_LIBS $LIBS"
2020 AC_CHECK_HEADER(X11/Xft/Xft.h,
2021 AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS))
2022
2023 if test "${HAVE_XFT}" = "yes"; then
2024 AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
2025 AC_SUBST(XFT_LIBS)
2026 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
2027 else
2028 CPPFLAGS="$OLD_CPPFLAGS"
2029 CFLAGS="$OLD_CFLAGS"
2030 LIBS="$OLD_LIBS"
2031 fi
2032 fi
2033 fi
2034 fi
2035 dnl For the "Does Emacs use" message at the end.
2036 if test "$HAVE_XFT" != "yes"; then
2037 HAVE_XFT=no
2038 fi
2039
2040
2041 HAVE_FREETYPE=no
2042 ### Use -lfreetype if available, unless `--with-freetype=no'.
2043 if test "${HAVE_XFT}" = "yes"; then
2044 dnl As we use Xft, we anyway use freetype.
2045 dnl In this case, there's no need of additional CFLAGS and LIBS.
2046 HAVE_FREETYPE=yes
2047 elif test "x${with_freetype}" != "xno"; then
2048 dnl Check if --with-pkg-config-prog has been given.
2049 if test "X${with_pkg_config_prog}" != X; then
2050 PKG_CONFIG="${with_pkg_config_prog}"
2051 fi
2052
2053 PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, HAVE_FREETYPE=no)
2054 if test "${HAVE_FREETYPE}" = "yes"; then
2055 PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FC=yes, HAVE_FC=no)
2056 if test "${HAVE_FC}" = "no"; then
2057 dnl Witout fontconfig, we can't use freetype at the moment.
2058 HAVE_FREETYPE=no
2059 fi
2060 fi
2061 fi
2062
2063 HAVE_LIBOTF=no
2064 if test "${HAVE_FREETYPE}" = "yes"; then
2065 AC_DEFINE(HAVE_FREETYPE, 1,
2066 [Define to 1 if you have freetype and fontconfig libraries.])
2067 if test "${with_libotf}" != "no"; then
2068 dnl Check if --with-pkg-config-prog has been given.
2069 if test "X${with_pkg_config_prog}" != X; then
2070 PKG_CONFIG="${with_pkg_config_prog}"
2071 fi
2072 PKG_CHECK_MODULES(LIBOTF, libotf, HAVE_LIBOTF=yes,
2073 HAVE_LIBOTF=no)
2074 if test "$HAVE_LIBOTF" = "yes"; then
2075 AC_DEFINE(HAVE_LIBOTF, 1,
2076 [Define to 1 if you have libotf library.])
2077 fi
2078 fi
2079 fi
2080
2081 HAVE_M17N_FLT=no
2082 if test "${with_m17n_flt}" != "no"; then
2083 dnl Check if --with-pkg-config-prog has been given.
2084 if test "X${with_pkg_config_prog}" != X; then
2085 PKG_CONFIG="${with_pkg_config_prog}"
2086 fi
2087 dnl Checks for libraries.
2088 PKG_CHECK_MODULES(M17N_FLT, m17n-flt, HAVE_M17N_FLT=yes,
2089 HAVE_M17N_FLT=no)
2090 if test "$HAVE_M17N_FLT" = "yes"; then
2091 AC_DEFINE(HAVE_M17N_FLT, 1,
2092 [Define to 1 if you have m17n-flt library.])
2093 fi
2094 fi
2095
2096 AC_SUBST(FREETYPE_CFLAGS)
2097 AC_SUBST(FREETYPE_LIBS)
2098 AC_SUBST(FONTCONFIG_CFLAGS)
2099 AC_SUBST(FONTCONFIG_LIBS)
2100 AC_SUBST(LIBOTF_CFLAGS)
2101 AC_SUBST(LIBOTF_LIBS)
2102 AC_SUBST(M17N_FLT_CFLAGS)
2103 AC_SUBST(M17N_FLT_LIBS)
2104
2105 fi
2106 #### End for font-backend
2107
2108 ### Use -lXpm if available, unless `--with-xpm=no'.
2109 HAVE_XPM=no
2110 if test "${HAVE_X11}" = "yes"; then
2111 if test "${with_xpm}" != "no"; then
2112 AC_CHECK_HEADER(X11/xpm.h,
2113 [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)])
2114 if test "${HAVE_XPM}" = "yes"; then
2115 AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
2116 AC_EGREP_CPP(no_return_alloc_pixels,
2117 [#include "X11/xpm.h"
2118 #ifndef XpmReturnAllocPixels
2119 no_return_alloc_pixels
2120 #endif
2121 ], HAVE_XPM=no, HAVE_XPM=yes)
2122
2123 if test "${HAVE_XPM}" = "yes"; then
2124 AC_MSG_RESULT(yes)
2125 else
2126 AC_MSG_RESULT(no)
2127 fi
2128 fi
2129 fi
2130
2131 if test "${HAVE_XPM}" = "yes"; then
2132 AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
2133 fi
2134 fi
2135
2136 ### Use -ljpeg if available, unless `--with-jpeg=no'.
2137 HAVE_JPEG=no
2138 if test "${HAVE_X11}" = "yes"; then
2139 if test "${with_jpeg}" != "no"; then
2140 dnl Checking for jpeglib.h can lose because of a redefinition of
2141 dnl HAVE_STDLIB_H.
2142 AC_CHECK_HEADER(jerror.h,
2143 [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2144 fi
2145
2146 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2147 if test "${HAVE_JPEG}" = "yes"; then
2148 AC_DEFINE(HAVE_JPEG)
2149 AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
2150 [#include <jpeglib.h>
2151 version=JPEG_LIB_VERSION
2152 ],
2153 [AC_DEFINE(HAVE_JPEG)],
2154 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2155 HAVE_JPEG=no])
2156 fi
2157 fi
2158
2159 ### Use -lpng if available, unless `--with-png=no'.
2160 HAVE_PNG=no
2161 if test "${HAVE_X11}" = "yes"; then
2162 if test "${with_png}" != "no"; then
2163 # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
2164 # in /usr/include/libpng.
2165 AC_CHECK_HEADERS(png.h libpng/png.h)
2166 if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
2167 AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm)
2168 fi
2169 fi
2170
2171 if test "${HAVE_PNG}" = "yes"; then
2172 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
2173 fi
2174 fi
2175
2176 ### Use -ltiff if available, unless `--with-tiff=no'.
2177 HAVE_TIFF=no
2178 if test "${HAVE_X11}" = "yes"; then
2179 if test "${with_tiff}" != "no"; then
2180 AC_CHECK_HEADER(tiffio.h,
2181 [tifflibs="-lz -lm"
2182 # At least one tiff package requires the jpeg library.
2183 if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
2184 AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs)])
2185 fi
2186
2187 if test "${HAVE_TIFF}" = "yes"; then
2188 AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
2189 fi
2190 fi
2191
2192 ### Use -lgif or -lungif if available, unless `--with-gif=no'.
2193 HAVE_GIF=no
2194 if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
2195 AC_CHECK_HEADER(gif_lib.h,
2196 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
2197 # Earlier versions can crash Emacs.
2198 [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, try_libungif=yes)])
2199
2200 if test "$HAVE_GIF" = yes; then
2201 ac_gif_lib_name="-lgif"
2202 fi
2203
2204 # If gif_lib.h but no libgif, try libungif.
2205 if test x"$try_libungif" = xyes; then
2206 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)
2207
2208 if test "$HAVE_GIF" = yes; then
2209 AC_DEFINE(LIBGIF, -lungif, [Compiler option to link with the gif library (if not -lgif).])
2210 ac_gif_lib_name="-lungif"
2211 fi
2212 fi
2213
2214 if test "${HAVE_GIF}" = "yes"; then
2215 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lgif; otherwise specify with LIBGIF).])
2216 fi
2217 fi
2218
2219 dnl Check for required libraries.
2220 if test "${HAVE_X11}" = "yes"; then
2221 MISSING=""
2222 WITH_NO=""
2223 test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
2224 MISSING="libXpm" && WITH_NO="--with-xpm=no"
2225 test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
2226 MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
2227 test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
2228 MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
2229 test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
2230 MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
2231 test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
2232 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
2233
2234 if test "X${MISSING}" != X; then
2235 AC_MSG_ERROR([The following required libraries were not found:
2236 $MISSING
2237 Maybe some development libraries/packages are missing?
2238 If you don't want to link with them give
2239 $WITH_NO
2240 as options to configure])
2241 fi
2242 fi
2243
2244 ### Use -lgpm if available, unless `--with-gpm=no'.
2245 HAVE_GPM=no
2246 if test "${with_gpm}" != "no"; then
2247 AC_CHECK_HEADER(gpm.h,
2248 [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
2249 fi
2250
2251 if test "${HAVE_GPM}" = "yes"; then
2252 AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
2253 fi
2254
2255 dnl Check for malloc/malloc.h on darwin
2256 AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])])
2257
2258 ### Use Mac OS X Carbon API to implement GUI.
2259 if test "${HAVE_CARBON}" = "yes"; then
2260 AC_DEFINE(HAVE_CARBON, 1, [Define to 1 if you are using the Carbon API on Mac OS X.])
2261 ## Specify the install directory
2262 carbon_appdir=
2263 if test "${carbon_appdir_x}" != ""; then
2264 case ${carbon_appdir_x} in
2265 y | ye | yes) carbon_appdir=/Applications ;;
2266 * ) carbon_appdir=${carbon_appdir_x} ;;
2267 esac
2268 fi
2269 # We also have mouse menus.
2270 HAVE_MENUS=yes
2271 fi
2272
2273 ### Use session management (-lSM -lICE) if available
2274 HAVE_X_SM=no
2275 if test "${HAVE_X11}" = "yes"; then
2276 AC_CHECK_HEADER(X11/SM/SMlib.h,
2277 [AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)])
2278
2279 if test "${HAVE_X_SM}" = "yes"; then
2280 AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
2281 case "$LIBS" in
2282 *-lSM*) ;;
2283 *) LIBS="-lSM -lICE $LIBS" ;;
2284 esac
2285 fi
2286 fi
2287
2288 # If netdb.h doesn't declare h_errno, we must declare it by hand.
2289 AC_CACHE_CHECK(whether netdb declares h_errno,
2290 emacs_cv_netdb_declares_h_errno,
2291 [AC_TRY_LINK([#include <netdb.h>],
2292 [return h_errno;],
2293 emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
2294 if test $emacs_cv_netdb_declares_h_errno = yes; then
2295 AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
2296 fi
2297
2298 AC_FUNC_ALLOCA
2299
2300 dnl src/alloca.c has been removed. Could also check if $ALLOCA is set?
2301 dnl FIXME is there an autoconf test that does the right thing, without
2302 dnl needing to call A_M_E afterwards?
2303 if test x"$ac_cv_func_alloca_works" != xyes; then
2304 AC_MSG_ERROR( [a system implementation of alloca is required] )
2305 fi
2306
2307 # fmod, logb, and frexp are found in -lm on most systems.
2308 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
2309 AC_CHECK_LIB(m, sqrt)
2310
2311 # Check for mail-locking functions in a "mail" library. Probably this should
2312 # have the same check as for liblockfile below.
2313 AC_CHECK_LIB(mail, maillock)
2314 dnl Debian, at least:
2315 AC_CHECK_LIB(lockfile, maillock)
2316 # If we have the shared liblockfile, assume we must use it for mail
2317 # locking (e.g. Debian). If we couldn't link against liblockfile
2318 # (no liblockfile.a installed), ensure that we don't need to.
2319 if test "$ac_cv_lib_lockfile_maillock" = no; then
2320 dnl This works for files generally, not just executables.
2321 dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
2322 AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
2323 /usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH)
2324 if test $ac_cv_prog_liblockfile = yes; then
2325 AC_MSG_ERROR([Shared liblockfile found but can't link against it.
2326 This probably means that movemail could lose mail.
2327 There may be a `development' package to install containing liblockfile.])
2328 else :
2329 fi
2330 fi
2331 AC_CHECK_FUNCS(touchlock)
2332 AC_CHECK_HEADERS(maillock.h)
2333
2334 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
2335 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
2336 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
2337 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
2338 utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
2339 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
2340 sendto recvfrom getsockopt setsockopt getsockname getpeername \
2341 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
2342 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign)
2343
2344 AC_CHECK_HEADERS(sys/un.h)
2345
2346 AC_FUNC_MKTIME
2347 if test "$ac_cv_func_working_mktime" = no; then
2348 AC_DEFINE(BROKEN_MKTIME, 1, [Define to 1 if the mktime function is broken.])
2349 fi
2350
2351 AC_FUNC_GETLOADAVG
2352
2353 AC_FUNC_FSEEKO
2354
2355 # Configure getopt.
2356 m4_include([m4/getopt.m4])
2357 gl_GETOPT_IFELSE([
2358 gl_GETOPT_SUBSTITUTE_HEADER
2359 gl_PREREQ_GETOPT
2360 GETOPTOBJS='getopt.o getopt1.o'
2361 ])
2362 AC_SUBST(GETOPTOBJS)
2363
2364 AC_FUNC_GETPGRP
2365
2366 AC_FUNC_STRFTIME
2367
2368 # UNIX98 PTYs.
2369 AC_CHECK_FUNCS(grantpt)
2370
2371 # PTY-related GNU extensions.
2372 AC_CHECK_FUNCS(getpt)
2373
2374 # Check this now, so that we will NOT find the above functions in ncurses.
2375 # That is because we have not set up to link ncurses in lib-src.
2376 # It's better to believe a function is not available
2377 # than to expect to find it in ncurses.
2378 AC_CHECK_LIB(ncurses, tparm)
2379
2380 # Do we have res_init, for detecting changes in /etc/resolv.conf?
2381
2382 resolv=no
2383 AC_TRY_LINK([#include <netinet/in.h>
2384 #include <arpa/nameser.h>
2385 #include <resolv.h>],
2386 [return res_init();],
2387 have_res_init=yes, have_res_init=no)
2388 if test "$have_res_init" = no; then
2389 OLIBS="$LIBS"
2390 LIBS="$LIBS -lresolv"
2391 AC_MSG_CHECKING(for res_init with -lresolv)
2392 AC_TRY_LINK([#include <netinet/in.h>
2393 #include <arpa/nameser.h>
2394 #include <resolv.h>],
2395 [return res_init();],
2396 have_res_init=yes, have_res_init=no)
2397 AC_MSG_RESULT($have_res_init)
2398 if test "$have_res_init" = yes ; then
2399 resolv=yes
2400 fi
2401 LIBS="$OLIBS"
2402 fi
2403
2404 if test "$have_res_init" = yes; then
2405 AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
2406 fi
2407
2408 # Do we need the Hesiod library to provide the support routines?
2409 if test "$with_hesiod" = yes ; then
2410 # Don't set $LIBS here -- see comments above.
2411 AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
2412 [AC_CHECK_LIB(resolv, res_send, resolv=yes,
2413 [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
2414 if test "$resolv" = yes ; then
2415 RESOLVLIB=-lresolv
2416 else
2417 RESOLVLIB=
2418 fi
2419 AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
2420 [AC_DEFINE(HAVE_LIBHESIOD, 1,
2421 [Define to 1 if you have the hesiod library (-lhesiod).])],
2422 :, $RESOLVLIB)])
2423 fi
2424
2425 # Do we need libresolv (due to res_init or Hesiod)?
2426 if test "$resolv" = yes ; then
2427 AC_DEFINE(HAVE_LIBRESOLV, 1,
2428 [Define to 1 if you have the resolv library (-lresolv).])
2429 fi
2430
2431 # These tell us which Kerberos-related libraries to use.
2432 if test "${with_kerberos+set}" = set; then
2433 AC_CHECK_LIB(com_err, com_err)
2434 AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
2435 AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
2436 AC_CHECK_LIB(krb5, krb5_init_context)
2437 if test "${with_kerberos5+set}" != set; then
2438 AC_CHECK_LIB(des425, des_cbc_encrypt,,
2439 [AC_CHECK_LIB(des, des_cbc_encrypt)])
2440 AC_CHECK_LIB(krb4, krb_get_cred,,
2441 [AC_CHECK_LIB(krb, krb_get_cred)])
2442 fi
2443
2444 if test "${with_kerberos5+set}" = set; then
2445 AC_CHECK_HEADERS(krb5.h)
2446 else
2447 AC_CHECK_HEADERS(des.h,,
2448 [AC_CHECK_HEADERS(kerberosIV/des.h,,
2449 [AC_CHECK_HEADERS(kerberos/des.h)])])
2450 AC_CHECK_HEADERS(krb.h,,
2451 [AC_CHECK_HEADERS(kerberosIV/krb.h,,
2452 [AC_CHECK_HEADERS(kerberos/krb.h)])])
2453 fi
2454 AC_CHECK_HEADERS(com_err.h)
2455 fi
2456
2457 # Solaris requires -lintl if you want strerror (which calls dgettext)
2458 # to return localized messages.
2459 AC_CHECK_LIB(intl, dgettext)
2460
2461 AC_MSG_CHECKING(whether localtime caches TZ)
2462 AC_CACHE_VAL(emacs_cv_localtime_cache,
2463 [if test x$ac_cv_func_tzset = xyes; then
2464 AC_TRY_RUN([#include <time.h>
2465 extern char **environ;
2466 unset_TZ ()
2467 {
2468 char **from, **to;
2469 for (to = from = environ; (*to = *from); from++)
2470 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
2471 to++;
2472 }
2473 char TZ_GMT0[] = "TZ=GMT0";
2474 char TZ_PST8[] = "TZ=PST8";
2475 main()
2476 {
2477 time_t now = time ((time_t *) 0);
2478 int hour_GMT0, hour_unset;
2479 if (putenv (TZ_GMT0) != 0)
2480 exit (1);
2481 hour_GMT0 = localtime (&now)->tm_hour;
2482 unset_TZ ();
2483 hour_unset = localtime (&now)->tm_hour;
2484 if (putenv (TZ_PST8) != 0)
2485 exit (1);
2486 if (localtime (&now)->tm_hour == hour_GMT0)
2487 exit (1);
2488 unset_TZ ();
2489 if (localtime (&now)->tm_hour != hour_unset)
2490 exit (1);
2491 exit (0);
2492 }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes,
2493 [# If we have tzset, assume the worst when cross-compiling.
2494 emacs_cv_localtime_cache=yes])
2495 else
2496 # If we lack tzset, report that localtime does not cache TZ,
2497 # since we can't invalidate the cache if we don't have tzset.
2498 emacs_cv_localtime_cache=no
2499 fi])dnl
2500 AC_MSG_RESULT($emacs_cv_localtime_cache)
2501 if test $emacs_cv_localtime_cache = yes; then
2502 AC_DEFINE(LOCALTIME_CACHE, 1,
2503 [Define to 1 if localtime caches TZ.])
2504 fi
2505
2506 if test "x$HAVE_TIMEVAL" = xyes; then
2507 AC_CHECK_FUNCS(gettimeofday)
2508 if test $ac_cv_func_gettimeofday = yes; then
2509 AC_CACHE_CHECK(whether gettimeofday can accept two arguments,
2510 emacs_cv_gettimeofday_two_arguments,
2511 [AC_TRY_COMPILE([
2512 #ifdef TIME_WITH_SYS_TIME
2513 #include <sys/time.h>
2514 #include <time.h>
2515 #else
2516 #ifdef HAVE_SYS_TIME_H
2517 #include <sys/time.h>
2518 #else
2519 #include <time.h>
2520 #endif
2521 #endif],
2522 [struct timeval time;
2523 gettimeofday (&time, 0);],
2524 emacs_cv_gettimeofday_two_arguments=yes,
2525 emacs_cv_gettimeofday_two_arguments=no)])
2526 if test $emacs_cv_gettimeofday_two_arguments = no; then
2527 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT, 1,
2528 [Define to 1 if gettimeofday accepts only one argument.])
2529 fi
2530 fi
2531 fi
2532
2533 ok_so_far=yes
2534 AC_CHECK_FUNC(socket, , ok_so_far=no)
2535 if test $ok_so_far = yes; then
2536 AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
2537 fi
2538 if test $ok_so_far = yes; then
2539 AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
2540 fi
2541 if test $ok_so_far = yes; then
2542 dnl Fixme: Not used. Should this be HAVE_SOCKETS?
2543 AC_DEFINE(HAVE_INET_SOCKETS, 1,
2544 [Define to 1 if you have inet sockets.])
2545 fi
2546
2547 AC_CHECK_HEADERS(sys/ioctl.h)
2548
2549 if test -f /usr/lpp/X11/bin/smt.exp; then
2550 AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
2551 [Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists.])
2552 fi
2553
2554 AC_MSG_CHECKING(whether system supports dynamic ptys)
2555 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
2556 AC_MSG_RESULT(yes)
2557 AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if dynamic ptys are supported.])
2558 else
2559 AC_MSG_RESULT(no)
2560 fi
2561
2562 AC_FUNC_FORK
2563
2564 dnl Adapted from Haible's version.
2565 AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset,
2566 [AC_TRY_LINK([#include <langinfo.h>],
2567 [char* cs = nl_langinfo(CODESET);],
2568 emacs_cv_langinfo_codeset=yes,
2569 emacs_cv_langinfo_codeset=no)
2570 ])
2571 if test $emacs_cv_langinfo_codeset = yes; then
2572 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2573 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2574 fi
2575
2576 AC_CHECK_TYPES(size_t)
2577
2578 AC_TYPE_MBSTATE_T
2579
2580 dnl Restrict could probably be used effectively other than in regex.c.
2581 AC_CACHE_CHECK([for C restrict keyword], emacs_cv_c_restrict,
2582 [AC_TRY_COMPILE([void fred (int *restrict x);], [],
2583 emacs_cv_c_restrict=yes,
2584 [AC_TRY_COMPILE([void fred (int *__restrict x);], [],
2585 emacs_cv_c_restrict=__restrict,
2586 emacs_cv_c_restrict=no)])])
2587 case "$emacs_cv_c_restrict" in
2588 yes) emacs_restrict=restrict;;
2589 no) emacs_restrict="";;
2590 *) emacs_restrict="$emacs_cv_c_restrict";;
2591 esac
2592 if test "$emacs_restrict" != __restrict; then
2593 AC_DEFINE_UNQUOTED(__restrict, $emacs_restrict,
2594 [Define to compiler's equivalent of C99 restrict keyword.
2595 Don't define if equivalent is `__restrict'.])
2596 fi
2597
2598 AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr,
2599 [AC_TRY_COMPILE([void fred (int x[__restrict]);], [],
2600 emacs_cv_c_restrict_arr=yes, emacs_cv_c_restrict_arr=no)])
2601 if test "$emacs_cv_c_restrict_arr" = yes; then
2602 AC_DEFINE(__restrict_arr, __restrict,
2603 [Define to compiler's equivalent of C99 restrict keyword in array
2604 declarations. Define as empty for no equivalent.])
2605 fi
2606
2607 dnl Fixme: AC_SYS_POSIX_TERMIOS should probably be used, but it's not clear
2608 dnl how the tty code is related to POSIX and/or other versions of termios.
2609 dnl The following looks like a useful start.
2610 dnl
2611 dnl AC_SYS_POSIX_TERMIOS
2612 dnl if test $ac_cv_sys_posix_termios = yes; then
2613 dnl AC_DEFINE(HAVE_TERMIOS, 1, [Define to 1 if you have POSIX-style functions
2614 dnl and macros for terminal control.])
2615 dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.])
2616 dnl fi
2617
2618 dnl Fixme: Use AC_FUNC_MEMCMP since memcmp is used. (Needs libobj replacement.)
2619
2620 # Set up the CFLAGS for real compilation, so we can substitute it.
2621 CFLAGS="$REAL_CFLAGS"
2622 CPPFLAGS="$REAL_CPPFLAGS"
2623
2624 #### Find out which version of Emacs this is.
2625 [version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
2626 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
2627 if test x"${version}" = x; then
2628 AC_MSG_ERROR([can't find current emacs version in `${srcdir}/lisp/version.el'.])
2629 fi
2630
2631 ### Specify what sort of things we'll be editing into Makefile and config.h.
2632 ### Use configuration here uncanonicalized to avoid exceeding size limits.
2633 AC_SUBST(version)
2634 AC_SUBST(configuration)
2635 AC_SUBST(canonical)
2636 AC_SUBST(srcdir)
2637 AC_SUBST(prefix)
2638 AC_SUBST(exec_prefix)
2639 AC_SUBST(bindir)
2640 AC_SUBST(datadir)
2641 AC_SUBST(sharedstatedir)
2642 AC_SUBST(libexecdir)
2643 AC_SUBST(mandir)
2644 AC_SUBST(infodir)
2645 AC_SUBST(lispdir)
2646 AC_SUBST(locallisppath)
2647 AC_SUBST(lisppath)
2648 AC_SUBST(x_default_search_path)
2649 AC_SUBST(etcdir)
2650 AC_SUBST(archlibdir)
2651 AC_SUBST(docdir)
2652 AC_SUBST(bitmapdir)
2653 AC_SUBST(gamedir)
2654 AC_SUBST(gameuser)
2655 AC_SUBST(c_switch_system)
2656 AC_SUBST(c_switch_machine)
2657 AC_SUBST(LD_SWITCH_X_SITE)
2658 AC_SUBST(LD_SWITCH_X_SITE_AUX)
2659 AC_SUBST(C_SWITCH_X_SITE)
2660 AC_SUBST(CFLAGS)
2661 AC_SUBST(X_TOOLKIT_TYPE)
2662 AC_SUBST(machfile)
2663 AC_SUBST(opsysfile)
2664 AC_SUBST(GETLOADAVG_LIBS)
2665 AC_SUBST(carbon_appdir)
2666
2667 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
2668 [Define to the canonical Emacs configuration name.])
2669 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}",
2670 [Define to the options passed to configure.])
2671 AC_DEFINE_UNQUOTED(config_machfile, "${machfile}",
2672 [Define to the used machine dependent file.])
2673 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
2674 [Define to the used os dependent file.])
2675 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
2676 [Define LD_SWITCH_X_SITE to contain any special flags your loader
2677 may need to deal with X Windows. For instance, if you've defined
2678 HAVE_X_WINDOWS above and your X libraries aren't in a place that
2679 your loader can find on its own, you might want to add "-L/..." or
2680 something similar.])
2681 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
2682 [Define LD_SWITCH_X_SITE_AUX with an -R option
2683 in case it's needed (for Solaris, for example).])
2684 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE},
2685 [Define C_SWITCH_X_SITE to contain any special flags your compiler
2686 may need to deal with X Windows. For instance, if you've defined
2687 HAVE_X_WINDOWS above and your X include files aren't in a place
2688 that your compiler can find on its own, you might want to add
2689 "-I/..." or something similar.])
2690 AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC},
2691 [Define to the unexec source file name.])
2692
2693 if test "${HAVE_X_WINDOWS}" = "yes" ; then
2694 AC_DEFINE(HAVE_X_WINDOWS, 1,
2695 [Define to 1 if you want to use the X window system.])
2696 fi
2697 if test "${USE_X_TOOLKIT}" != "none" ; then
2698 AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
2699 fi
2700 if test "${HAVE_X11}" = "yes" ; then
2701 AC_DEFINE(HAVE_X11, 1,
2702 [Define to 1 if you want to use version 11 of X windows.
2703 Otherwise, Emacs expects to use version 10.])
2704 fi
2705 if test "${HAVE_XFREE386}" = "yes" ; then
2706 AC_DEFINE(HAVE_XFREE386, 1, [Define to 1 if you're using XFree386.])
2707 fi
2708 if test "${HAVE_MENUS}" = "yes" ; then
2709 AC_DEFINE(HAVE_MENUS, 1,
2710 [Define to 1 if you have mouse menus.
2711 (This is automatic if you use X, but the option to specify it remains.)
2712 It is also defined with other window systems that support xmenu.c.])
2713 fi
2714 if test "${GNU_MALLOC}" = "yes" ; then
2715 AC_DEFINE(GNU_MALLOC, 1,
2716 [Define to 1 if you want to use the GNU memory allocator.])
2717 fi
2718 if test "${REL_ALLOC}" = "yes" ; then
2719 AC_DEFINE(REL_ALLOC, 1,
2720 [Define REL_ALLOC if you want to use the relocating allocator for
2721 buffer space.])
2722 fi
2723
2724
2725 AH_TOP([/* GNU Emacs site configuration template file.
2726 Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
2727 2006, 2007, 2008 Free Software Foundation, Inc.
2728
2729 This file is part of GNU Emacs.
2730
2731 GNU Emacs is free software; you can redistribute it and/or modify
2732 it under the terms of the GNU General Public License as published by
2733 the Free Software Foundation; either version 3, or (at your option)
2734 any later version.
2735
2736 GNU Emacs is distributed in the hope that it will be useful,
2737 but WITHOUT ANY WARRANTY; without even the implied warranty of
2738 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2739 GNU General Public License for more details.
2740
2741 You should have received a copy of the GNU General Public License
2742 along with GNU Emacs; see the file COPYING. If not, write to the
2743 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2744 Boston, MA 02110-1301, USA. */
2745
2746
2747 /* No code in Emacs #includes config.h twice, but some bits of code
2748 intended to work with other packages as well (like gmalloc.c)
2749 think they can include it as many times as they like. */
2750 #ifndef EMACS_CONFIG_H
2751 #define EMACS_CONFIG_H
2752 ])dnl
2753
2754 AH_BOTTOM([
2755 /* If we're using any sort of window system, define some consequences. */
2756 #ifdef HAVE_X_WINDOWS
2757 #define HAVE_WINDOW_SYSTEM
2758 #define MULTI_KBOARD
2759 #define HAVE_MOUSE
2760 #endif
2761
2762 /* Multi-tty support relies on MULTI_KBOARD. It seems safe to turn it
2763 on unconditionally. */
2764 #ifndef MULTI_KBOARD
2765 #define MULTI_KBOARD
2766 #endif
2767
2768 /* If we're using the Carbon API on Mac OS X, define a few more
2769 variables as well. */
2770 #ifdef HAVE_CARBON
2771 #define HAVE_WINDOW_SYSTEM
2772 #define HAVE_MOUSE
2773 #endif
2774
2775 /* Define USER_FULL_NAME to return a string
2776 that is the user's full name.
2777 It can assume that the variable `pw'
2778 points to the password file entry for this user.
2779
2780 At some sites, the pw_gecos field contains
2781 the user's full name. If neither this nor any other
2782 field contains the right thing, use pw_name,
2783 giving the user's login name, since that is better than nothing. */
2784 #define USER_FULL_NAME pw->pw_gecos
2785
2786 /* Define AMPERSAND_FULL_NAME if you use the convention
2787 that & in the full name stands for the login id. */
2788 /* Turned on June 1996 supposing nobody will mind it. */
2789 #define AMPERSAND_FULL_NAME
2790
2791 /* We have blockinput.h. */
2792 #define DO_BLOCK_INPUT
2793
2794 /* Define HAVE_SOUND if we have sound support. We know it works
2795 and compiles only on the specified platforms. For others,
2796 it probably doesn't make sense to try. */
2797
2798 #if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
2799 #ifdef HAVE_MACHINE_SOUNDCARD_H
2800 #define HAVE_SOUND 1
2801 #endif
2802 #ifdef HAVE_SYS_SOUNDCARD_H
2803 #define HAVE_SOUND 1
2804 #endif
2805 #ifdef HAVE_SOUNDCARD_H
2806 #define HAVE_SOUND 1
2807 #endif
2808 #ifdef HAVE_ALSA
2809 #define HAVE_SOUND 1
2810 #endif
2811 #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
2812
2813 /* If using GNU, then support inline function declarations. */
2814 /* Don't try to switch on inline handling as detected by AC_C_INLINE
2815 generally, because even if non-gcc compilers accept `inline', they
2816 may reject `extern inline'. */
2817 #if defined (__GNUC__) && defined (OPTIMIZE)
2818 #define INLINE __inline__
2819 #else
2820 #define INLINE
2821 #endif
2822
2823 /* Include the os and machine dependent files. */
2824 #include config_opsysfile
2825 #include config_machfile
2826
2827 /* Load in the conversion definitions if this system
2828 needs them and the source file being compiled has not
2829 said to inhibit this. There should be no need for you
2830 to alter these lines. */
2831
2832 #ifdef SHORTNAMES
2833 #ifndef NO_SHORTNAMES
2834 #include "../shortnames/remap.h"
2835 #endif /* not NO_SHORTNAMES */
2836 #endif /* SHORTNAMES */
2837
2838 /* If no remapping takes place, static variables cannot be dumped as
2839 pure, so don't worry about the `static' keyword. */
2840 #ifdef NO_REMAP
2841 #undef static
2842 #endif
2843
2844 /* Define `subprocesses' should be defined if you want to
2845 have code for asynchronous subprocesses
2846 (as used in M-x compile and M-x shell).
2847 These do not work for some USG systems yet;
2848 for the ones where they work, the s/SYSTEM.h file defines this flag. */
2849
2850 #ifndef VMS
2851 #ifndef USG
2852 /* #define subprocesses */
2853 #endif
2854 #endif
2855
2856 /* SIGTYPE is the macro we actually use. */
2857 #ifndef SIGTYPE
2858 #define SIGTYPE RETSIGTYPE
2859 #endif
2860
2861 #ifdef emacs /* Don't do this for lib-src. */
2862 /* Tell regex.c to use a type compatible with Emacs. */
2863 #define RE_TRANSLATE_TYPE Lisp_Object
2864 #define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C)
2865 #ifdef make_number
2866 /* If make_number is a macro, use it. */
2867 #define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0)))
2868 #else
2869 /* If make_number is a function, avoid it. */
2870 #define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0))
2871 #endif
2872 #endif
2873
2874 /* Avoid link-time collision with system mktime if we will use our own. */
2875 #if ! HAVE_MKTIME || BROKEN_MKTIME
2876 #define mktime emacs_mktime
2877 #endif
2878
2879 #define my_strftime nstrftime /* for strftime.c */
2880
2881 /* The rest of the code currently tests the CPP symbol BSTRING.
2882 Override any claims made by the system-description files.
2883 Note that on some SCO version it is possible to have bcopy and not bcmp. */
2884 #undef BSTRING
2885 #if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
2886 #define BSTRING
2887 #endif
2888
2889 /* Some of the files of Emacs which are intended for use with other
2890 programs assume that if you have a config.h file, you must declare
2891 the type of getenv.
2892
2893 This declaration shouldn't appear when alloca.s or Makefile.in
2894 includes config.h. */
2895 #ifndef NOT_C_CODE
2896 extern char *getenv ();
2897 #endif
2898
2899 /* These default definitions are good for almost all machines.
2900 The exceptions override them in m/MACHINE.h. */
2901
2902 #ifndef BITS_PER_CHAR
2903 #define BITS_PER_CHAR 8
2904 #endif
2905
2906 #ifndef BITS_PER_SHORT
2907 #define BITS_PER_SHORT 16
2908 #endif
2909
2910 /* Note that lisp.h uses this in a preprocessor conditional, so it
2911 would not work to use sizeof. That being so, we do all of them
2912 without sizeof, for uniformity's sake. */
2913 #ifndef BITS_PER_INT
2914 #define BITS_PER_INT 32
2915 #endif
2916
2917 #ifndef BITS_PER_LONG
2918 #ifdef _LP64
2919 #define BITS_PER_LONG 64
2920 #else
2921 #define BITS_PER_LONG 32
2922 #endif
2923 #endif
2924
2925 /* Define if the compiler supports function prototypes. It may do so
2926 but not define __STDC__ (e.g. DEC C by default) or may define it as
2927 zero. */
2928 #undef PROTOTYPES
2929 /* For mktime.c: */
2930 #ifndef __P
2931 # if defined PROTOTYPES
2932 # define __P(args) args
2933 # else
2934 # define __P(args) ()
2935 # endif /* GCC. */
2936 #endif /* __P */
2937
2938 /* Don't include "string.h" or <stdlib.h> in non-C code. */
2939 #ifndef NOT_C_CODE
2940 #ifdef HAVE_STRING_H
2941 #include "string.h"
2942 #endif
2943 #ifdef HAVE_STRINGS_H
2944 #include "strings.h" /* May be needed for bcopy & al. */
2945 #endif
2946 #ifdef HAVE_STDLIB_H
2947 #include <stdlib.h>
2948 #endif
2949 #ifndef __GNUC__
2950 # ifdef HAVE_ALLOCA_H
2951 # include <alloca.h>
2952 # else /* AIX files deal with #pragma. */
2953 # ifndef alloca /* predefined by HP cc +Olibcalls */
2954 char *alloca ();
2955 # endif
2956 # endif /* HAVE_ALLOCA_H */
2957 #endif /* __GNUC__ */
2958 #ifndef HAVE_SIZE_T
2959 typedef unsigned size_t;
2960 #endif
2961 #endif /* NOT_C_CODE */
2962
2963 /* Define HAVE_X_I18N if we have usable i18n support. */
2964
2965 #ifdef HAVE_X11R6
2966 #define HAVE_X_I18N
2967 #elif !defined X11R5_INHIBIT_I18N
2968 #define HAVE_X_I18N
2969 #endif
2970
2971 /* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
2972
2973 #if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
2974 #define HAVE_X11R6_XIM
2975 #endif
2976
2977 /* Should we enable expensive run-time checking of data types? */
2978 #undef ENABLE_CHECKING
2979
2980 #if defined __GNUC__ && (__GNUC__ > 2 \
2981 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
2982 #define NO_RETURN __attribute__ ((__noreturn__))
2983 #else
2984 #define NO_RETURN /* nothing */
2985 #endif
2986
2987 /* These won't be used automatically yet. We also need to know, at least,
2988 that the stack is continuous. */
2989 #ifdef __GNUC__
2990 # ifndef GC_SETJMP_WORKS
2991 /* GC_SETJMP_WORKS is nearly always appropriate for GCC --
2992 see NON_SAVING_SETJMP in the target descriptions. */
2993 /* Exceptions (see NON_SAVING_SETJMP in target description) are
2994 SCO5 non-ELF (but Emacs specifies ELF) and SVR3 on x86.
2995 Fixme: Deal with SVR3. */
2996 # define GC_SETJMP_WORKS 1
2997 # endif
2998 # ifndef GC_LISP_OBJECT_ALIGNMENT
2999 # define GC_LISP_OBJECT_ALIGNMENT (__alignof__ (Lisp_Object))
3000 # endif
3001 #endif
3002
3003 #ifndef HAVE_BCOPY
3004 #define bcopy(a,b,s) memcpy (b,a,s)
3005 #endif
3006 #ifndef HAVE_BZERO
3007 #define bzero(a,s) memset (a,0,s)
3008 #endif
3009 #ifndef HAVE_BCMP
3010 #define BCMP memcmp
3011 #endif
3012
3013 #endif /* EMACS_CONFIG_H */
3014
3015 /*
3016 Local Variables:
3017 mode: c
3018 End:
3019 */
3020 ])dnl
3021
3022 #### Report on what we decided to do.
3023 #### Report GTK as a toolkit, even if it doesn't use Xt.
3024 #### It makes printing result more understandable as using GTK sets
3025 #### toolkit_scroll_bars to yes by default.
3026 if test "${HAVE_GTK}" = "yes"; then
3027 USE_X_TOOLKIT=GTK
3028 fi
3029
3030 echo "
3031 Configured for \`${canonical}'.
3032
3033 Where should the build process find the source code? ${srcdir}
3034 What operating system and machine description files should Emacs use?
3035 \`${opsysfile}' and \`${machfile}'
3036 What compiler should emacs be built with? ${CC} ${CFLAGS}
3037 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
3038 Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
3039 Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
3040 What window system should Emacs use? ${window_system}
3041 What toolkit should Emacs use? ${USE_X_TOOLKIT}"
3042
3043 if test -n "${x_includes}"; then
3044 echo " Where do we find X Windows header files? ${x_includes}"
3045 else
3046 echo " Where do we find X Windows header files? Standard dirs"
3047 fi
3048 if test -n "${x_libraries}"; then
3049 echo " Where do we find X Windows libraries? ${x_libraries}"
3050 else
3051 echo " Where do we find X Windows libraries? Standard dirs"
3052 fi
3053
3054 echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
3055 echo " Does Emacs use -lXpm? ${HAVE_XPM}"
3056 echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
3057 echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
3058 echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
3059 echo " Does Emacs use -lpng? ${HAVE_PNG}"
3060 echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
3061 echo " Does Emacs use -lgpm? ${HAVE_GPM}"
3062 echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
3063 echo " Does Emacs use a font backend? ${USE_FONT_BACKEND}"
3064
3065 if test "${USE_FONT_BACKEND}" = "yes"; then
3066 echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}"
3067 echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}"
3068 echo " Does Emacs use -lotf? ${HAVE_LIBOTF}"
3069 echo " Does Emacs use -lxft? ${HAVE_XFT}"
3070 fi
3071 echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
3072 echo
3073
3074 if test $USE_XASSERTS = yes; then
3075 echo " Compiling with asserts turned on."
3076 CPPFLAGS="$CPPFLAGS -DXASSERTS=1"
3077 echo
3078 fi
3079
3080 if test "$USE_X_TOOLKIT" = GTK; then
3081 case "$canonical" in
3082 *cygwin*)
3083 echo "There are known problems with Emacs and Gtk+ on cygwin, so you
3084 will probably get a crash on startup. If this happens, please use another
3085 toolkit for Emacs. See etc/PROBLEMS for more information."
3086 ;;
3087 esac
3088 fi
3089
3090
3091 if test "$HAVE_CARBON" = "yes"; then
3092 echo
3093 echo "Warning: The Mac Carbon port is currently unsupported and has
3094 known problems. It is not recommended for use by non-developers.
3095 Read the emacs-devel archives for more information."
3096 echo
3097 fi
3098
3099 if test "$HAVE_DBUS" = yes && test "${opsys}" != "gnu-linux"; then
3100 echo "D-Bus integration has been tested for GNU/Linux only."
3101 echo
3102 fi
3103
3104
3105 # Remove any trailing slashes in these variables.
3106 [test "${prefix}" != NONE &&
3107 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
3108 test "${exec_prefix}" != NONE &&
3109 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`]
3110
3111 ## Check if the C preprocessor will convert `..' to `. .'. If so, set
3112 ## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
3113 ## from Makefile.c can correctly provide the arg `-traditional' to the
3114 ## C preprocessor.
3115
3116 AC_EGREP_CPP(yes..yes,
3117 [yes..yes],
3118 CPP_NEED_TRADITIONAL=no,
3119 CPP_NEED_TRADITIONAL=yes)
3120
3121 AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
3122 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
3123 doc/lispref/Makefile src/Makefile.c:src/Makefile.in \
3124 lwlib/Makefile lisp/Makefile leim/Makefile, [
3125
3126 ### Make the necessary directories, if they don't exist.
3127 for dir in etc lisp ; do
3128 test -d ${dir} || mkdir ${dir}
3129 done
3130
3131 # Build src/Makefile from ${srcdir}/src/Makefile.c
3132 # and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
3133 # This must be done after src/config.h is built, since we rely on that file.
3134
3135 # Now get this: Some word that is part of the ${srcdir} directory name
3136 # or the ${configuration} value might, just might, happen to be an
3137 # identifier like `sun4' or `i386' or something, and be predefined by
3138 # the C preprocessor to some helpful value like 1, or maybe the empty
3139 # string. Needless to say consequent macro substitutions are less
3140 # than conducive to the makefile finding the correct directory.
3141 [undefs="`echo $top_srcdir $configuration $canonical |
3142 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
3143 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
3144 `"]
3145
3146 echo creating src/epaths.h
3147 ${MAKE-make} epaths-force
3148
3149 # As of 2000-11-19, newest development versions of GNU cpp preprocess
3150 # `..' to `. .' unless invoked with -traditional
3151
3152 if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
3153 CPPFLAGS="$CPPFLAGS -traditional"
3154 fi
3155
3156 echo creating lib-src/Makefile
3157 ( cd lib-src
3158 rm -f junk.c junk1.c junk2.c
3159 sed -e '/start of cpp stuff/q' \
3160 < Makefile.c > junk1.c
3161 sed -e '1,/start of cpp stuff/d'\
3162 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
3163 < Makefile.c > junk.c
3164 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
3165 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
3166 cat junk1.c junk2.c > Makefile.new
3167 rm -f junk.c junk1.c junk2.c
3168 chmod 444 Makefile.new
3169 mv -f Makefile.new Makefile
3170 )
3171
3172 echo creating src/Makefile
3173 ( cd src
3174 rm -f junk.c junk1.c junk2.c
3175 sed -e '/start of cpp stuff/q' \
3176 < Makefile.c > junk1.c
3177 sed -e '1,/start of cpp stuff/d'\
3178 -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
3179 < Makefile.c > junk.c
3180 if test -f ${srcdir}/admin/unidata/UnicodeData.txt; then
3181 echo creating ${srcdir}/admin/unidata/Makefile
3182 cp ${srcdir}/admin/unidata/Makefile.in ${srcdir}/admin/unidata/Makefile
3183 CPPFLAGS="$CPPFLAGS -DHAVE_UNIDATA"
3184 fi
3185 $CPP $undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
3186 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
3187 cat junk1.c junk2.c > Makefile.new
3188 rm -f junk.c junk1.c junk2.c
3189 chmod 444 Makefile.new
3190 mv -f Makefile.new Makefile
3191 )
3192
3193 if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then
3194 echo creating src/.gdbinit
3195 echo source $srcdir/src/.gdbinit > src/.gdbinit
3196 fi
3197
3198 # This is how we know whether to re-run configure in certain cases.
3199 touch src/config.stamp
3200
3201 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])
3202
3203 m4_if(dnl Do not change this comment
3204 arch-tag: 156a4dd5-bddc-4d18-96ac-f37742cf6a5e
3205 )dnl