*** empty log message ***
[bpt/emacs.git] / configure
CommitLineData
ba4481b5
DL
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
c4bb2108 4# Generated automatically using autoconf version 2.13
ba4481b5
DL
5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
10# Defaults:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
243cf185 15 --without-gcc don't use GCC to compile Emacs if GCC is found"
ba4481b5 16ac_help="$ac_help
243cf185 17 --without-pop don't support POP mail retrieval with movemail"
a21616bd
KR
18ac_help="$ac_help
19 --with-kerberos support Kerberos-authenticated POP"
20ac_help="$ac_help
4d6e16b3 21 --with-kerberos5 support Kerberos version 5 authenticated POP"
ba4481b5
DL
22ac_help="$ac_help
23 --with-hesiod support Hesiod to get the POP server host"
24ac_help="$ac_help
25 --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)"
26ac_help="$ac_help
27 --with-xpm use -lXpm for displaying XPM images"
28ac_help="$ac_help
29 --with-jpeg use -ljpeg for displaying JPEG images"
30ac_help="$ac_help
31 --with-tiff use -ltiff for displaying TIFF images"
32ac_help="$ac_help
33 --with-gif use -lungif for displaying GIF images"
34ac_help="$ac_help
35 --with-png use -lpng for displaying PNG images"
36ac_help="$ac_help
4d6e16b3 37 --without-toolkit-scroll-bars
1d36487c
GM
38 don't use Motif or Xaw3d scroll bars"
39ac_help="$ac_help
40 --without-xim don't use X11 XIM"
d42122a3
DL
41ac_help="$ac_help
42 --disable-largefile omit support for large files"
f4988be7
GM
43ac_help="$ac_help
44 --with-x use the X Window System"
ba4481b5
DL
45
46# Initialize some variables set by options.
47# The variables have the same names as the options, with
48# dashes changed to underlines.
49build=NONE
50cache_file=./config.cache
51exec_prefix=NONE
52host=NONE
53no_create=
54nonopt=NONE
55no_recursion=
56prefix=NONE
57program_prefix=NONE
58program_suffix=NONE
59program_transform_name=s,x,x,
60silent=
61site=
62srcdir=
63target=NONE
64verbose=
65x_includes=NONE
66x_libraries=NONE
67bindir='${exec_prefix}/bin'
68sbindir='${exec_prefix}/sbin'
69libexecdir='${exec_prefix}/libexec'
70datadir='${prefix}/share'
71sysconfdir='${prefix}/etc'
72sharedstatedir='${prefix}/com'
73localstatedir='${prefix}/var'
74libdir='${exec_prefix}/lib'
75includedir='${prefix}/include'
76oldincludedir='/usr/include'
77infodir='${prefix}/info'
78mandir='${prefix}/man'
79
80# Initialize some other variables.
81subdirs=
82MFLAGS= MAKEFLAGS=
c4bb2108 83SHELL=${CONFIG_SHELL-/bin/sh}
ba4481b5
DL
84# Maximum number of lines to put in a shell here document.
85ac_max_here_lines=12
86
87ac_prev=
88for ac_option
89do
90
91 # If the previous option needs an argument, assign it.
92 if test -n "$ac_prev"; then
93 eval "$ac_prev=\$ac_option"
94 ac_prev=
95 continue
96 fi
97
98 case "$ac_option" in
99 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
100 *) ac_optarg= ;;
101 esac
102
103 # Accept the important Cygnus configure options, so we can diagnose typos.
104
105 case "$ac_option" in
106
107 -bindir | --bindir | --bindi | --bind | --bin | --bi)
108 ac_prev=bindir ;;
109 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
110 bindir="$ac_optarg" ;;
111
112 -build | --build | --buil | --bui | --bu)
113 ac_prev=build ;;
114 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
115 build="$ac_optarg" ;;
116
117 -cache-file | --cache-file | --cache-fil | --cache-fi \
118 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
119 ac_prev=cache_file ;;
120 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
121 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
122 cache_file="$ac_optarg" ;;
123
124 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
125 ac_prev=datadir ;;
126 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
127 | --da=*)
128 datadir="$ac_optarg" ;;
129
130 -disable-* | --disable-*)
131 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
132 # Reject names that are not valid shell variable names.
133 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
134 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
135 fi
136 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
137 eval "enable_${ac_feature}=no" ;;
138
139 -enable-* | --enable-*)
140 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
141 # Reject names that are not valid shell variable names.
142 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
143 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
144 fi
145 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
146 case "$ac_option" in
147 *=*) ;;
148 *) ac_optarg=yes ;;
149 esac
150 eval "enable_${ac_feature}='$ac_optarg'" ;;
151
152 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
153 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
154 | --exec | --exe | --ex)
155 ac_prev=exec_prefix ;;
156 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
157 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
158 | --exec=* | --exe=* | --ex=*)
159 exec_prefix="$ac_optarg" ;;
160
161 -gas | --gas | --ga | --g)
162 # Obsolete; use --with-gas.
163 with_gas=yes ;;
164
165 -help | --help | --hel | --he)
166 # Omit some internal or obsolete options to make the list less imposing.
167 # This message is too long to be a string in the A/UX 3.1 sh.
168 cat << EOF
169Usage: configure [options] [host]
170Options: [defaults in brackets after descriptions]
171Configuration:
172 --cache-file=FILE cache test results in FILE
173 --help print this message
174 --no-create do not create output files
175 --quiet, --silent do not print \`checking...' messages
176 --version print the version of autoconf that created configure
177Directory and file names:
178 --prefix=PREFIX install architecture-independent files in PREFIX
179 [$ac_default_prefix]
180 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
181 [same as prefix]
182 --bindir=DIR user executables in DIR [EPREFIX/bin]
183 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
184 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
185 --datadir=DIR read-only architecture-independent data in DIR
186 [PREFIX/share]
187 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
188 --sharedstatedir=DIR modifiable architecture-independent data in DIR
189 [PREFIX/com]
190 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
191 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
192 --includedir=DIR C header files in DIR [PREFIX/include]
193 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
194 --infodir=DIR info documentation in DIR [PREFIX/info]
195 --mandir=DIR man documentation in DIR [PREFIX/man]
196 --srcdir=DIR find the sources in DIR [configure dir or ..]
197 --program-prefix=PREFIX prepend PREFIX to installed program names
198 --program-suffix=SUFFIX append SUFFIX to installed program names
199 --program-transform-name=PROGRAM
200 run sed PROGRAM on installed program names
201EOF
202 cat << EOF
203Host type:
204 --build=BUILD configure for building on BUILD [BUILD=HOST]
205 --host=HOST configure for HOST [guessed]
206 --target=TARGET configure for TARGET [TARGET=HOST]
207Features and packages:
208 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
209 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
210 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
211 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
212 --x-includes=DIR X include files are in DIR
213 --x-libraries=DIR X library files are in DIR
214EOF
215 if test -n "$ac_help"; then
216 echo "--enable and --with options recognized:$ac_help"
217 fi
218 exit 0 ;;
219
220 -host | --host | --hos | --ho)
221 ac_prev=host ;;
222 -host=* | --host=* | --hos=* | --ho=*)
223 host="$ac_optarg" ;;
224
225 -includedir | --includedir | --includedi | --included | --include \
226 | --includ | --inclu | --incl | --inc)
227 ac_prev=includedir ;;
228 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
229 | --includ=* | --inclu=* | --incl=* | --inc=*)
230 includedir="$ac_optarg" ;;
231
232 -infodir | --infodir | --infodi | --infod | --info | --inf)
233 ac_prev=infodir ;;
234 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
235 infodir="$ac_optarg" ;;
236
237 -libdir | --libdir | --libdi | --libd)
238 ac_prev=libdir ;;
239 -libdir=* | --libdir=* | --libdi=* | --libd=*)
240 libdir="$ac_optarg" ;;
241
242 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
243 | --libexe | --libex | --libe)
244 ac_prev=libexecdir ;;
245 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
246 | --libexe=* | --libex=* | --libe=*)
247 libexecdir="$ac_optarg" ;;
248
249 -localstatedir | --localstatedir | --localstatedi | --localstated \
250 | --localstate | --localstat | --localsta | --localst \
251 | --locals | --local | --loca | --loc | --lo)
252 ac_prev=localstatedir ;;
253 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
254 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
255 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
256 localstatedir="$ac_optarg" ;;
257
258 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
259 ac_prev=mandir ;;
260 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
261 mandir="$ac_optarg" ;;
262
263 -nfp | --nfp | --nf)
264 # Obsolete; use --without-fp.
265 with_fp=no ;;
266
267 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
268 | --no-cr | --no-c)
269 no_create=yes ;;
270
271 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
272 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
273 no_recursion=yes ;;
274
275 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
276 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
277 | --oldin | --oldi | --old | --ol | --o)
278 ac_prev=oldincludedir ;;
279 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
280 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
281 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
282 oldincludedir="$ac_optarg" ;;
283
284 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
285 ac_prev=prefix ;;
286 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
287 prefix="$ac_optarg" ;;
288
289 -program-prefix | --program-prefix | --program-prefi | --program-pref \
290 | --program-pre | --program-pr | --program-p)
291 ac_prev=program_prefix ;;
292 -program-prefix=* | --program-prefix=* | --program-prefi=* \
293 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
294 program_prefix="$ac_optarg" ;;
295
296 -program-suffix | --program-suffix | --program-suffi | --program-suff \
297 | --program-suf | --program-su | --program-s)
298 ac_prev=program_suffix ;;
299 -program-suffix=* | --program-suffix=* | --program-suffi=* \
300 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
301 program_suffix="$ac_optarg" ;;
302
303 -program-transform-name | --program-transform-name \
304 | --program-transform-nam | --program-transform-na \
305 | --program-transform-n | --program-transform- \
306 | --program-transform | --program-transfor \
307 | --program-transfo | --program-transf \
308 | --program-trans | --program-tran \
309 | --progr-tra | --program-tr | --program-t)
310 ac_prev=program_transform_name ;;
311 -program-transform-name=* | --program-transform-name=* \
312 | --program-transform-nam=* | --program-transform-na=* \
313 | --program-transform-n=* | --program-transform-=* \
314 | --program-transform=* | --program-transfor=* \
315 | --program-transfo=* | --program-transf=* \
316 | --program-trans=* | --program-tran=* \
317 | --progr-tra=* | --program-tr=* | --program-t=*)
318 program_transform_name="$ac_optarg" ;;
319
320 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
321 | -silent | --silent | --silen | --sile | --sil)
322 silent=yes ;;
323
324 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
325 ac_prev=sbindir ;;
326 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
327 | --sbi=* | --sb=*)
328 sbindir="$ac_optarg" ;;
329
330 -sharedstatedir | --sharedstatedir | --sharedstatedi \
331 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
332 | --sharedst | --shareds | --shared | --share | --shar \
333 | --sha | --sh)
334 ac_prev=sharedstatedir ;;
335 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
336 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
337 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
338 | --sha=* | --sh=*)
339 sharedstatedir="$ac_optarg" ;;
340
341 -site | --site | --sit)
342 ac_prev=site ;;
343 -site=* | --site=* | --sit=*)
344 site="$ac_optarg" ;;
345
346 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
347 ac_prev=srcdir ;;
348 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
349 srcdir="$ac_optarg" ;;
350
351 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
352 | --syscon | --sysco | --sysc | --sys | --sy)
353 ac_prev=sysconfdir ;;
354 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
355 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
356 sysconfdir="$ac_optarg" ;;
357
358 -target | --target | --targe | --targ | --tar | --ta | --t)
359 ac_prev=target ;;
360 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
361 target="$ac_optarg" ;;
362
363 -v | -verbose | --verbose | --verbos | --verbo | --verb)
364 verbose=yes ;;
365
366 -version | --version | --versio | --versi | --vers)
c4bb2108 367 echo "configure generated by autoconf version 2.13"
ba4481b5
DL
368 exit 0 ;;
369
370 -with-* | --with-*)
371 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
372 # Reject names that are not valid shell variable names.
373 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
374 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
375 fi
376 ac_package=`echo $ac_package| sed 's/-/_/g'`
377 case "$ac_option" in
378 *=*) ;;
379 *) ac_optarg=yes ;;
380 esac
381 eval "with_${ac_package}='$ac_optarg'" ;;
382
383 -without-* | --without-*)
384 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
385 # Reject names that are not valid shell variable names.
386 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
387 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
388 fi
389 ac_package=`echo $ac_package| sed 's/-/_/g'`
390 eval "with_${ac_package}=no" ;;
391
392 --x)
393 # Obsolete; use --with-x.
394 with_x=yes ;;
395
396 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
397 | --x-incl | --x-inc | --x-in | --x-i)
398 ac_prev=x_includes ;;
399 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
400 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
401 x_includes="$ac_optarg" ;;
402
403 -x-libraries | --x-libraries | --x-librarie | --x-librari \
404 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
405 ac_prev=x_libraries ;;
406 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
407 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
408 x_libraries="$ac_optarg" ;;
409
410 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
411 ;;
412
413 *)
414 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
415 echo "configure: warning: $ac_option: invalid host type" 1>&2
416 fi
417 if test "x$nonopt" != xNONE; then
418 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
419 fi
420 nonopt="$ac_option"
421 ;;
422
423 esac
424done
425
426if test -n "$ac_prev"; then
427 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
428fi
429
430trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
431
432# File descriptor usage:
433# 0 standard input
434# 1 file creation
435# 2 errors and warnings
436# 3 some systems may open it to /dev/tty
437# 4 used on the Kubota Titan
438# 6 checking for... messages and results
439# 5 compiler messages saved in config.log
440if test "$silent" = yes; then
441 exec 6>/dev/null
442else
443 exec 6>&1
444fi
445exec 5>./config.log
446
447echo "\
448This file contains any messages produced by compilers while
449running configure, to aid debugging if configure makes a mistake.
450" 1>&5
451
452# Strip out --no-create and --no-recursion so they do not pile up.
453# Also quote any args containing shell metacharacters.
454ac_configure_args=
455for ac_arg
456do
457 case "$ac_arg" in
458 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
459 | --no-cr | --no-c) ;;
460 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
461 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
462 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
463 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
464 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
465 esac
466done
467
468# NLS nuisances.
469# Only set these to C if already set. These must not be set unconditionally
470# because not all systems understand e.g. LANG=C (notably SCO).
471# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
472# Non-C LC_CTYPE values break the ctype check.
473if test "${LANG+set}" = set; then LANG=C; export LANG; fi
474if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
475if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
476if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
477
478# confdefs.h avoids OS command line length limits that DEFS can exceed.
479rm -rf conftest* confdefs.h
480# AIX cpp loses on an empty file, so make sure it contains at least a newline.
481echo > confdefs.h
482
483# A filename unique to this package, relative to the directory that
484# configure is in, which we can look for to find out if srcdir is correct.
485ac_unique_file=src/lisp.h
486
487# Find the source files, if location was not specified.
488if test -z "$srcdir"; then
489 ac_srcdir_defaulted=yes
490 # Try the directory containing this script, then its parent.
491 ac_prog=$0
492 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
493 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
494 srcdir=$ac_confdir
495 if test ! -r $srcdir/$ac_unique_file; then
496 srcdir=..
497 fi
498else
499 ac_srcdir_defaulted=no
500fi
501if test ! -r $srcdir/$ac_unique_file; then
502 if test "$ac_srcdir_defaulted" = yes; then
503 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
504 else
505 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
506 fi
507fi
508srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
509
510# Prefer explicitly selected file to automatically selected ones.
511if test -z "$CONFIG_SITE"; then
512 if test "x$prefix" != xNONE; then
513 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
514 else
515 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
516 fi
517fi
518for ac_site_file in $CONFIG_SITE; do
519 if test -r "$ac_site_file"; then
520 echo "loading site script $ac_site_file"
521 . "$ac_site_file"
522 fi
523done
524
525if test -r "$cache_file"; then
526 echo "loading cache $cache_file"
527 . $cache_file
528else
529 echo "creating cache $cache_file"
530 > $cache_file
531fi
532
533ac_ext=c
534# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
535ac_cpp='$CPP $CPPFLAGS'
536ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
c4bb2108 537ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ba4481b5
DL
538cross_compiling=$ac_cv_prog_cc_cross
539
c4bb2108
DL
540ac_exeext=
541ac_objext=o
ba4481b5
DL
542if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
543 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
544 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
545 ac_n= ac_c='
546' ac_t=' '
547 else
548 ac_n=-n ac_c= ac_t=
549 fi
550else
551 ac_n= ac_c='\c' ac_t=
552fi
553
554
555
556
557lispdir='${datadir}/emacs/${version}/lisp'
558locallisppath='${datadir}/emacs/${version}/site-lisp:'\
559'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
560lisppath='${locallisppath}:${lispdir}'
561etcdir='${datadir}/emacs/${version}/etc'
562archlibdir='${libexecdir}/emacs/${version}/${configuration}'
563docdir='${datadir}/emacs/${version}/etc'
564
565# Check whether --with-gcc or --without-gcc was given.
566if test "${with_gcc+set}" = set; then
567 withval="$with_gcc"
568 :
569fi
570
571# Check whether --with-pop or --without-pop was given.
572if test "${with_pop+set}" = set; then
573 withval="$with_pop"
243cf185
DL
574 if test "$withval" = yes; then
575 cat >> confdefs.h <<\EOF
ba4481b5
DL
576#define MAIL_USE_POP 1
577EOF
578
243cf185
DL
579else :
580fi
3d9fec71
DL
581else
582 cat >> confdefs.h <<\EOF
583#define MAIL_USE_POP 1
584EOF
585
ba4481b5
DL
586fi
587
a21616bd
KR
588# Check whether --with-kerberos or --without-kerberos was given.
589if test "${with_kerberos+set}" = set; then
590 withval="$with_kerberos"
591 cat >> confdefs.h <<\EOF
592#define KERBEROS 1
593EOF
594
595fi
596
597# Check whether --with-kerberos5 or --without-kerberos5 was given.
598if test "${with_kerberos5+set}" = set; then
599 withval="$with_kerberos5"
600 if test "${with_kerberos5+set}" = set; then
601 if test "${with_kerberos+set}" != set; then
602 with_kerberos=yes
603 cat >> confdefs.h <<\EOF
604#define KERBEROS 1
605EOF
606
607 fi
608fi
609cat >> confdefs.h <<\EOF
610#define KERBEROS5 1
611EOF
612
613fi
614
ba4481b5
DL
615# Check whether --with-hesiod or --without-hesiod was given.
616if test "${with_hesiod+set}" = set; then
617 withval="$with_hesiod"
618 cat >> confdefs.h <<\EOF
619#define HESIOD 1
620EOF
621
622fi
623
624# Check whether --with-x-toolkit or --without-x-toolkit was given.
625if test "${with_x_toolkit+set}" = set; then
626 withval="$with_x_toolkit"
627 case "${withval}" in
628 y | ye | yes ) val=athena ;;
629 n | no ) val=no ;;
630 l | lu | luc | luci | lucid ) val=lucid ;;
631 a | at | ath | athe | athen | athena ) val=athena ;;
632 m | mo | mot | moti | motif ) val=motif ;;
633 * )
634{ echo "configure: error: \`--with-x-toolkit=$withval' is invalid\;
635this option's value should be \`yes', \`no', \`lucid', \`athena', or \`motif'.
636Currently, \`yes', \`athena' and \`lucid' are synonyms." 1>&2; exit 1; }
637 ;;
638 esac
639 with_x_toolkit=$val
640
641fi
642
643# Check whether --with-xpm or --without-xpm was given.
644if test "${with_xpm+set}" = set; then
645 withval="$with_xpm"
646 :
647fi
648
649# Check whether --with-jpeg or --without-jpeg was given.
650if test "${with_jpeg+set}" = set; then
651 withval="$with_jpeg"
652 :
653fi
654
655# Check whether --with-tiff or --without-tiff was given.
656if test "${with_tiff+set}" = set; then
657 withval="$with_tiff"
658 :
659fi
660
661# Check whether --with-gif or --without-gif was given.
662if test "${with_gif+set}" = set; then
663 withval="$with_gif"
664 :
665fi
666
667# Check whether --with-png or --without-png was given.
668if test "${with_png+set}" = set; then
669 withval="$with_png"
670 :
671fi
672
673# Check whether --with-toolkit-scroll-bars or --without-toolkit-scroll-bars was given.
674if test "${with_toolkit_scroll_bars+set}" = set; then
675 withval="$with_toolkit_scroll_bars"
676 :
677fi
678
1d36487c
GM
679# Check whether --with-xim or --without-xim was given.
680if test "${with_xim+set}" = set; then
681 withval="$with_xim"
682 :
683fi
684
ba4481b5
DL
685
686#### Make srcdir absolute, if it isn't already. It's important to
17494071 687#### avoid running the path through pwd unnecessarily, since pwd can
ba4481b5
DL
688#### give you automounter prefixes, which can go away. We do all this
689#### so Emacs can find its files when run uninstalled.
17494071
GM
690## Make sure CDPATH doesn't affect cd (in case PWD is relative).
691unset CDPATH
ba4481b5
DL
692case "${srcdir}" in
693 /* ) ;;
694 . )
695 ## We may be able to use the $PWD environment variable to make this
696 ## absolute. But sometimes PWD is inaccurate.
17494071 697 if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".${PWD}" ;
ba4481b5
DL
698 then
699 srcdir="$PWD"
700 else
701 srcdir="`(cd ${srcdir}; pwd)`"
702 fi
703 ;;
704 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
705esac
706
707#### Check if the source directory already has a configured system in it.
708if test `pwd` != `(cd ${srcdir} && pwd)` \
709 && test -f "${srcdir}/src/config.h" ; then
710 echo "configure: warning: The directory tree \`${srcdir}' is being used
711 as a build directory right now; it has been configured in its own
712 right. To configure in another directory as well, you MUST
713 use GNU make. If you do not have GNU make, then you must
714 now do \`make distclean' in ${srcdir},
715 and then run $0 again." 1>&2
716
717 extrasub='/^VPATH[ ]*=/c\
718vpath %.c $(srcdir)\
719vpath %.h $(srcdir)\
720vpath %.y $(srcdir)\
721vpath %.l $(srcdir)\
722vpath %.s $(srcdir)\
723vpath %.in $(srcdir)\
724vpath %.texi $(srcdir)'
725fi
726
727#### Given the configuration name, set machfile and opsysfile to the
728#### names of the m/*.h and s/*.h files we should use.
729
730### Canonicalize the configuration name.
731
732ac_aux_dir=
733for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
734 if test -f $ac_dir/install-sh; then
735 ac_aux_dir=$ac_dir
736 ac_install_sh="$ac_aux_dir/install-sh -c"
737 break
738 elif test -f $ac_dir/install.sh; then
739 ac_aux_dir=$ac_dir
740 ac_install_sh="$ac_aux_dir/install.sh -c"
741 break
742 fi
743done
744if test -z "$ac_aux_dir"; then
745 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
746fi
747ac_config_guess=$ac_aux_dir/config.guess
748ac_config_sub=$ac_aux_dir/config.sub
749ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
750
751
752# Make sure we can run config.sub.
c4bb2108 753if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
ba4481b5
DL
754else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
755fi
756
757echo $ac_n "checking host system type""... $ac_c" 1>&6
1d36487c 758echo "configure:759: checking host system type" >&5
ba4481b5
DL
759
760host_alias=$host
761case "$host_alias" in
762NONE)
763 case $nonopt in
764 NONE)
c4bb2108 765 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
ba4481b5
DL
766 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
767 fi ;;
768 *) host_alias=$nonopt ;;
769 esac ;;
770esac
771
c4bb2108 772host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
ba4481b5
DL
773host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
774host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
775host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
776echo "$ac_t""$host" 1>&6
777
778canonical=$host
779configuration=$host_alias
780
781
782### If you add support for a new configuration, add code to this
783### switch statement to recognize your configuration name and select
784### the appropriate operating system and machine description files.
785
786### You would hope that you could choose an m/*.h file pretty much
787### based on the machine portion of the configuration name, and an s-
788### file based on the operating system portion. However, it turns out
789### that each m/*.h file is pretty manufacturer-specific - for
790### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
791### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
792### machines. So we basically have to have a special case for each
793### configuration name.
794###
795### As far as handling version numbers on operating systems is
796### concerned, make sure things will fail in a fixable way. If
797### /etc/MACHINES doesn't say anything about version numbers, be
798### prepared to handle anything reasonably. If version numbers
799### matter, be sure /etc/MACHINES says something about it.
800###
801### Eric Raymond says we should accept strings like "sysvr4" to mean
802### "System V Release 4"; he writes, "The old convention encouraged
803### confusion between `system' and `release' levels'."
804
805machine='' opsys='' unported=no
806case "${canonical}" in
807
808 ## NetBSD ports
809 *-*-netbsd* )
810 opsys=netbsd
811 case "${canonical}" in
812 alpha*-*-netbsd*) machine=alpha ;;
813 i[3456]86-*-netbsd*) machine=intel386 ;;
814 m68k-*-netbsd*)
815 # This is somewhat bogus.
816 machine=hp9000s300 ;;
817 powerpc-apple-netbsd*) machine=macppc ;;
818 mips-*-netbsd*) machine=pmax ;;
2df636f4 819 mipsel-*-netbsd*) machine=pmax ;;
ba4481b5 820 ns32k-*-netbsd*) machine=ns32000 ;;
3a64eef5 821 powerpc-*-netbsd*) machine=macppc ;;
ba4481b5
DL
822 sparc-*-netbsd*) machine=sparc ;;
823 vax-*-netbsd*) machine=vax ;;
2df636f4 824 arm-*-netbsd*) machine=arm ;;
ba4481b5
DL
825 esac
826 ;;
827
828 ## OpenBSD ports
829 *-*-openbsd* )
830 opsys=openbsd
831 case "${canonical}" in
832 alpha*-*-openbsd*) machine=alpha ;;
833 i386-*-openbsd*) machine=intel386 ;;
834 m68k-*-openbsd*) machine=hp9000s300 ;;
835 mipsel-*-openbsd*) machine=pmax ;;
836 ns32k-*-openbsd*) machine=ns32000 ;;
837 sparc-*-openbsd*) machine=sparc ;;
838 vax-*-openbsd*) machine=vax ;;
839 esac
840 ;;
841
842 ## Acorn RISCiX:
843 arm-acorn-riscix1.1* )
844 machine=acorn opsys=riscix1-1
845 ;;
846 arm-acorn-riscix1.2* | arm-acorn-riscix )
847 ## This name is riscix12 instead of riscix1.2
848 ## to avoid a file name conflict on MSDOS.
849 machine=acorn opsys=riscix12
850 ;;
851
852 ## BSDI ports
853 *-*-bsdi* )
854 opsys=bsdi
855 case "${canonical}" in
856 i[345]86-*-bsdi*) machine=intel386 ;;
857 sparc-*-bsdi*) machine=sparc ;;
858 powerpc-*-bsdi*) machine=powerpc ;;
859 esac
860 case "${canonical}" in
861 *-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
862 *-*-bsdi2.0* ) opsys=bsdos2 ;;
863 *-*-bsdi2* ) opsys=bsdos2-1 ;;
864 *-*-bsdi3* ) opsys=bsdos3 ;;
865 *-*-bsdi4* ) opsys=bsdos4 ;;
866 esac
867 ;;
868
869 ## Alliant machines
870 ## Strictly speaking, we need the version of the alliant operating
871 ## system to choose the right machine file, but currently the
872 ## configuration name doesn't tell us enough to choose the right
873 ## one; we need to give alliants their own operating system name to
874 ## do this right. When someone cares, they can help us.
875 fx80-alliant-* )
876 machine=alliant4 opsys=bsd4-2
877 ;;
878 i860-alliant-* )
879 machine=alliant-2800 opsys=bsd4-3
880 ;;
881
882 ## Alpha (DEC) machines.
883 alpha*-dec-osf* )
884 machine=alpha opsys=osf1
885 # This is needed to find X11R6.1 libraries for certain tests.
886 NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
887 GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
bb17930d
GM
888 # This is necessary on 5.0 to avoid mangling src/Makefile due to
889 # non-traditional preprocessing with the current compiler defaults.
890 # OSF 4 can also have that compiler version, and there seems always
891 # to have been a usable /usr/bin/cpp.
892 NON_GNU_CPP='cpp'
ca512671 893 case "${canonical}" in
bb17930d
GM
894 alpha*-dec-osf[4-9]*)
895 opsys=osf5-0 ;;
ca512671 896 esac
ba4481b5
DL
897 ;;
898
899 alpha*-*-linux-gnu* )
900 machine=alpha opsys=gnu-linux
901 ;;
902
c4bb2108
DL
903 arm*-*-linux-gnu* )
904 machine=arm opsys=gnu-linux
905 ;;
906
907 ppc-*-linux | \
908 powerpc-*-linux* )
909 machine=powerpc opsys=gnu-linux
910 ;;
911
ba4481b5
DL
912 ## Altos 3068
913 m68*-altos-sysv* )
914 machine=altos opsys=usg5-2
915 ;;
916
917 ## Amdahl UTS
918 580-amdahl-sysv* )
919 machine=amdahl opsys=usg5-2-2
920 ;;
921
922 ## Apollo, Domain/OS
923 m68*-apollo-* )
924 machine=apollo opsys=bsd4-3
925 ;;
926
927 ## AT&T 3b2, 3b5, 3b15, 3b20
928 we32k-att-sysv* )
929 machine=att3b opsys=usg5-2-2
930 ;;
931
932 ## AT&T 3b1 - The Mighty Unix PC!
933 m68*-att-sysv* )
934 machine=7300 opsys=usg5-2-2
935 ;;
936
937 ## Bull dpx20
938 rs6000-bull-bosx* )
939 machine=ibmrs6000 opsys=aix3-2
940 ;;
941
942 ## Bull dpx2
943 m68*-bull-sysv3* )
944 machine=dpx2 opsys=usg5-3
945 ;;
946
947 ## Bull sps7
948 m68*-bull-sysv2* )
949 machine=sps7 opsys=usg5-2
950 ;;
951
952 ## CCI 5/32, 6/32 -- see "Tahoe".
953
954 ## Celerity
955 ## I don't know what configuration name to use for this; config.sub
956 ## doesn't seem to know anything about it. Hey, Celerity users, get
957 ## in touch with us!
958 celerity-celerity-bsd* )
959 machine=celerity opsys=bsd4-2
960 ;;
961
962 ## Clipper
963 ## What operating systems does this chip run that Emacs has been
964 ## tested on?
965 clipper-* )
966 machine=clipper
967 ## We'll use the catch-all code at the bottom to guess the
968 ## operating system.
969 ;;
970
971 ## Convex
972 *-convex-bsd* | *-convex-convexos* )
973 machine=convex opsys=bsd4-3
974 ## Prevents spurious white space in makefiles - d.m.cooke@larc.nasa.gov
975 NON_GNU_CPP="cc -E -P"
976 ;;
977
978 ## Cubix QBx/386
979 i[3456]86-cubix-sysv* )
980 machine=intel386 opsys=usg5-3
981 ;;
982
983 ## Cydra 5
984 cydra*-cydrome-sysv* )
985 machine=cydra5 opsys=usg5-3
986 ;;
987
988 ## Data General AViiON Machines
989 ## DG changed naming conventions with the release of 5.4.4.10, they
990 ## dropped the initial 5.4 but left the intervening R. Because of the
991 ## R this shouldn't conflict with older versions of the OS (which I
992 ## think were named like dgux4.*). In addition, DG new AViiONs series
993 ## uses either Motorola M88k or Intel Pentium CPUs.
994 m88k-dg-dguxR4.* | m88k-dg-dgux4* )
995 machine=aviion opsys=dgux4
996 ;;
997 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
998 ## This name is dgux5-4-3 instead of dgux5-4r3
999 ## to avoid a file name conflict on MSDOS.
1000 machine=aviion opsys=dgux5-4-3
1001 ;;
1002 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
1003 machine=aviion opsys=dgux5-4r2
1004 ;;
1005 m88k-dg-dgux* )
1006 machine=aviion opsys=dgux
1007 ;;
1008
1009 ## Data General AViiON Intel (x86) Machines
1010 ## Exists from 5.4.3 (current i586-dg-dguxR4.11)
1011 ## Ehud Karni, 1998-may-30, ehud@unix.simonwiesel.co.il
1012 i[345]86-dg-dguxR4* )
1013 machine=aviion-intel opsys=dgux4
1014 ;;
1015
1016 ## DECstations
1017 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
1018 machine=pmax opsys=bsd4-2
1019 ;;
1020 mips-dec-ultrix4.[12]* | mips-dec-bsd* )
1021 machine=pmax opsys=bsd4-3
1022 ;;
1023 mips-dec-ultrix* )
1024 machine=pmax opsys=ultrix4-3
1025 ;;
1026 mips-dec-osf* )
1027 machine=pmax opsys=osf1
1028 ;;
1029 mips-dec-mach_bsd4.3* )
1030 machine=pmax opsys=mach-bsd4-3
1031 ;;
1032
1033 ## Motorola Delta machines
1034 m68k-motorola-sysv* | m68000-motorola-sysv* )
1035 machine=delta opsys=usg5-3
1036 if test -z "`type gnucc | grep 'not found'`"
1037 then
1038 if test -s /etc/167config
1039 then CC="gnucc -m68040"
1040 else CC="gnucc -m68881"
1041 fi
1042 else
1043 if test -z "`type gcc | grep 'not found'`"
1044 then CC=gcc
1045 else CC=cc
1046 fi
1047 fi
1048 ;;
1049 m88k-motorola-sysv4* )
1050 # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
1051 # needs POSIX_SIGNALS and therefore needs usg5-4-2.
1052 # I hope there are not other 4.0 versions for this machine
1053 # which really need usg5-4 instead.
1054 machine=delta88k opsys=usg5-4-2
1055 ;;
1056 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
1057 machine=delta88k opsys=usg5-3
1058 ;;
1059
1060 ## Dual machines
1061 m68*-dual-sysv* )
1062 machine=dual opsys=usg5-2
1063 ;;
1064 m68*-dual-uniplus* )
1065 machine=dual opsys=unipl5-2
1066 ;;
1067
1068 ## Elxsi 6400
1069 elxsi-elxsi-sysv* )
1070 machine=elxsi opsys=usg5-2
1071 ;;
1072
1073 ## Encore machines
1074 ns16k-encore-bsd* )
1075 machine=ns16000 opsys=umax
1076 ;;
1077
65171e3a
DL
1078 ## The GEC 63 - apparently, this port isn't really finished yet.
1079 # I'm sure we finished off the last of the machines, though. -- fx
ba4481b5
DL
1080
1081 ## Gould Power Node and NP1
1082 pn-gould-bsd4.2* )
1083 machine=gould opsys=bsd4-2
1084 ;;
1085 pn-gould-bsd4.3* )
1086 machine=gould opsys=bsd4-3
1087 ;;
1088 np1-gould-bsd* )
1089 machine=gould-np1 opsys=bsd4-3
1090 ;;
1091
1092 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
1093 ## as far as Emacs is concerned).
1094 m88k-harris-cxux* )
1095 # Build needs to be different on 7.0 and later releases
1096 case "`uname -r`" in
1097 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
1098 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
1099 esac
1100 NON_GNU_CPP="/lib/cpp"
1101 ;;
1102 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
1103 m68k-harris-cxux* )
1104 machine=nh3000 opsys=cxux
1105 ;;
1106 ## Harris power pc NightHawk running Power UNIX (Series 6000)
1107 powerpc-harris-powerunix )
1108 machine=nh6000 opsys=powerunix
1109 NON_GNU_CPP="cc -Xo -E -P"
1110 ;;
1111 ## SR2001/SR2201 running HI-UX/MPP
1112 hppa1.1-hitachi-hiuxmpp* )
1113 machine=sr2k opsys=hiuxmpp
1114 ;;
1115 ## Honeywell XPS100
1116 xps*-honeywell-sysv* )
1117 machine=xps100 opsys=usg5-2
1118 ;;
1119
1120 ## HP 9000 series 200 or 300
1121 m68*-hp-bsd* )
1122 machine=hp9000s300 opsys=bsd4-3
1123 ;;
1124 ## HP/UX 7, 8, 9, and 10 are supported on these machines.
1125 m68*-hp-hpux* )
1126 case "`uname -r`" in
1127 ## Someone's system reports A.B8.05 for this.
1128 ## I wonder what other possibilities there are.
1129 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
1130 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
1131 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
1132 *.1[0-9].* ) machine=hp9000s300 opsys=hpux9shr ;;
1133 *) machine=hp9000s300 opsys=hpux ;;
1134 esac
1135 ;;
1136
1137 ## HP 9000 series 700 and 800, running HP/UX
1138 hppa*-hp-hpux7* )
1139 machine=hp800 opsys=hpux
1140 ;;
1141 hppa*-hp-hpux8* )
1142 machine=hp800 opsys=hpux8
1143 ;;
1144 hppa*-hp-hpux9shr* )
1145 machine=hp800 opsys=hpux9shr
1146 ;;
1147 hppa*-hp-hpux9* )
1148 machine=hp800 opsys=hpux9
1149 ;;
1150 hppa*-hp-hpux1[0-9]* )
1151 machine=hp800 opsys=hpux10
1152 ;;
1153
1154 ## HP 9000 series 700 and 800, running HP/UX
1155 hppa*-hp-hpux* )
1156 ## Cross-compilation? Nah!
1157 case "`uname -r`" in
1158 ## Someone's system reports A.B8.05 for this.
1159 ## I wonder what other possibilities there are.
1160 *.B8.* ) machine=hp800 opsys=hpux8 ;;
1161 *.08.* ) machine=hp800 opsys=hpux8 ;;
1162 *.09.* ) machine=hp800 opsys=hpux9 ;;
1163 *) machine=hp800 opsys=hpux10 ;;
1164 esac
1165 ;;
1166 hppa*-*-nextstep* )
1167 machine=hp800 opsys=nextstep
1168 ;;
1169
1170 ## Orion machines
1171 orion-orion-bsd* )
1172 machine=orion opsys=bsd4-2
1173 ;;
1174 clipper-orion-bsd* )
1175 machine=orion105 opsys=bsd4-2
1176 ;;
1177
1178 ## IBM machines
1179 i[3456]86-ibm-aix1.1* )
1180 machine=ibmps2-aix opsys=usg5-2-2
1181 ;;
1182 i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
1183 machine=ibmps2-aix opsys=usg5-3
1184 ;;
1185 i370-ibm-aix*)
1186 machine=ibm370aix opsys=usg5-3
1187 ;;
1188 rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
1189 machine=ibmrs6000 opsys=aix3-1
1190 ;;
1191 rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
1192 machine=ibmrs6000 opsys=aix3-2-5
1193 ;;
1194 rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1* )
1195 machine=ibmrs6000 opsys=aix4-1
1196 ;;
1197 rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
1198 machine=ibmrs6000 opsys=aix4-2
1199 ;;
1200 rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
1201 machine=ibmrs6000 opsys=aix4
1202 ;;
1203 rs6000-ibm-aix4* | powerpc-ibm-aix4* )
1204 machine=ibmrs6000 opsys=aix4-1
1205 ;;
1206 rs6000-ibm-aix* | powerpc-ibm-aix* )
1207 machine=ibmrs6000 opsys=aix3-2
1208 ;;
1209 romp-ibm-bsd4.3* )
1210 machine=ibmrt opsys=bsd4-3
1211 ;;
1212 romp-ibm-bsd4.2* )
1213 machine=ibmrt opsys=bsd4-2
1214 ;;
1215 romp-ibm-aos4.3* )
1216 machine=ibmrt opsys=bsd4-3
1217 ;;
1218 romp-ibm-aos4.2* )
1219 machine=ibmrt opsys=bsd4-2
1220 ;;
1221 romp-ibm-aos* )
1222 machine=ibmrt opsys=bsd4-3
1223 ;;
1224 romp-ibm-bsd* )
1225 machine=ibmrt opsys=bsd4-3
1226 ;;
1227 romp-ibm-aix* )
1228 machine=ibmrt-aix opsys=usg5-2-2
1229 ;;
1230
1231 ## Integrated Solutions `Optimum V'
1232 m68*-isi-bsd4.2* )
1233 machine=isi-ov opsys=bsd4-2
1234 ;;
1235 m68*-isi-bsd4.3* )
1236 machine=isi-ov opsys=bsd4-3
1237 ;;
1238
1239 ## Intel 386 machines where we do care about the manufacturer
1240 i[3456]86-intsys-sysv* )
1241 machine=is386 opsys=usg5-2-2
1242 ;;
1243
1244 ## Prime EXL
1245 i[3456]86-prime-sysv* )
1246 machine=i386 opsys=usg5-3
1247 ;;
1248
1249 ## Sequent Symmetry running Dynix
1250 i[3456]86-sequent-bsd* )
1251 machine=symmetry opsys=bsd4-3
1252 ;;
1253
1254 ## Sequent Symmetry running ptx 4, which is a modified SVR4.
1255 i[3456]86-sequent-ptx4* | i[3456]86-sequent-sysv4* )
1256 machine=sequent-ptx opsys=ptx4
1257 NON_GNU_CPP=/lib/cpp
1258 ;;
1259
1260 ## Sequent Symmetry running DYNIX/ptx
1261 ## Use the old cpp rather than the newer ANSI one.
1262 i[3456]86-sequent-ptx* )
1263 machine=sequent-ptx opsys=ptx
1264 NON_GNU_CPP="/lib/cpp"
1265 ;;
1266
1267 ## ncr machine running svr4.3.
1268 i[3456]86-ncr-sysv4.3 )
1269 machine=ncr386 opsys=usg5-4-3
1270 ;;
1271
1272 ## Unspecified sysv on an ncr machine defaults to svr4.2.
1273 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
1274 i[3456]86-ncr-sysv* )
1275 machine=ncr386 opsys=usg5-4-2
1276 ;;
1277
1278 ## Intel Paragon OSF/1
1279 i860-intel-osf1* )
1280 machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
1281 ;;
1282
1283 ## Intel 860
1284 i860-*-sysv4* )
1285 machine=i860 opsys=usg5-4
1286 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
1287 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
1288 ;;
1289
c76e04a8
GM
1290 ## Macintosh PowerPC
1291 powerpc*-*-linux-gnu* )
1292 machine=macppc opsys=gnu-linux
1293 ;;
1294
ba4481b5
DL
1295 ## Masscomp machines
1296 m68*-masscomp-rtu* )
1297 machine=masscomp opsys=rtu
1298 ;;
1299
1300 ## Megatest machines
1301 m68*-megatest-bsd* )
1302 machine=mega68 opsys=bsd4-2
1303 ;;
1304
1305 ## Workstations sold by MIPS
1306 ## This is not necessarily all workstations using the MIPS processor -
1307 ## Irises are produced by SGI, and DECstations by DEC.
1308
1309 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
1310 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
1311 ## it gives for choosing between the alternatives seems to be "Use
1312 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
1313 ## the BSD world." I'll assume that these are instructions for
1314 ## handling two odd situations, and that every other situation
1315 ## should use mips.h and usg5-2-2, they being listed first.
1316 mips-mips-usg* )
1317 machine=mips4
1318 ## Fall through to the general code at the bottom to decide on the OS.
1319 ;;
1320 mips-mips-riscos4* )
1321 machine=mips4 opsys=bsd4-3
1322 NON_GNU_CC="cc -systype bsd43"
1323 NON_GNU_CPP="cc -systype bsd43 -E"
1324 ;;
1325 mips-mips-riscos5* )
1326 machine=mips4 opsys=riscos5
1327 NON_GNU_CC="cc -systype bsd43"
1328 NON_GNU_CPP="cc -systype bsd43 -E"
1329 ;;
1330 mips-mips-bsd* )
1331 machine=mips opsys=bsd4-3
1332 ;;
1333 mips-mips-* )
1334 machine=mips opsys=usg5-2-2
1335 ;;
1336
1337 ## NeXT
1338 m68*-next-* | m68k-*-nextstep* )
1339 machine=m68k opsys=nextstep
1340 ;;
1341
1342 ## The complete machine from National Semiconductor
1343 ns32k-ns-genix* )
1344 machine=ns32000 opsys=usg5-2
1345 ;;
1346
1347 ## NCR machines
1348 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
1349 machine=tower32 opsys=usg5-2-2
1350 ;;
1351 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
1352 machine=tower32v3 opsys=usg5-3
1353 ;;
1354
1355 ## NEC EWS4800
1356 mips-nec-sysv4*)
1357 machine=ews4800 opsys=ux4800
1358 ;;
1359
1360 ## Nixdorf Targon 31
1361 m68*-nixdorf-sysv* )
1362 machine=targon31 opsys=usg5-2-2
1363 ;;
1364
1365 ## Nu (TI or LMI)
1366 m68*-nu-sysv* )
1367 machine=nu opsys=usg5-2
1368 ;;
1369
1370 ## Plexus
1371 m68*-plexus-sysv* )
1372 machine=plexus opsys=usg5-2
1373 ;;
1374
1375 ## PowerPC reference platform
1376 powerpcle-*-solaris2* )
1377 machine=prep
1378 opsys=sol2-5
1379 ;;
1380
1381 ## Pyramid machines
1382 ## I don't really have any idea what sort of processor the Pyramid has,
1383 ## so I'm assuming it is its own architecture.
1384 pyramid-pyramid-bsd* )
1385 machine=pyramid opsys=bsd4-2
1386 ;;
1387
1388 ## Sequent Balance
1389 ns32k-sequent-bsd4.2* )
1390 machine=sequent opsys=bsd4-2
1391 ;;
1392 ns32k-sequent-bsd4.3* )
1393 machine=sequent opsys=bsd4-3
1394 ;;
1395
1396 ## Siemens Nixdorf
1397 mips-siemens-sysv* | mips-sni-sysv*)
1398 machine=mips-siemens opsys=usg5-4
1399 NON_GNU_CC=/usr/ccs/bin/cc
1400 NON_GNU_CPP=/usr/ccs/lib/cpp
1401 ;;
1402
1403 ## Silicon Graphics machines
1404 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
1405 m68*-sgi-iris3.5* )
1406 machine=irist opsys=iris3-5
1407 ;;
1408 m68*-sgi-iris3.6* | m68*-sgi-iris*)
1409 machine=irist opsys=iris3-6
1410 ;;
1411 ## Iris 4D
1412 mips-sgi-irix3* )
1413 machine=iris4d opsys=irix3-3
1414 ;;
1415 mips-sgi-irix4* )
1416 machine=iris4d opsys=irix4-0
1417 ;;
1418 mips-sgi-irix6.5 )
1419 machine=iris4d opsys=irix6-5
946173ad
DL
1420 # Without defining _LANGUAGE_C, things get masked out in the headers
1421 # so that, for instance, grepping for `free' in stdlib.h fails and
1422 # AC_HEADER_STD_C fails. (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
1423 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
d42122a3 1424 NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
ba4481b5
DL
1425 ;;
1426 mips-sgi-irix6* )
1427 machine=iris4d opsys=irix6-0
c4bb2108 1428 # It's not clear whether -D_LANGUAGE_C is necessary as it is for 6.5,
946173ad
DL
1429 # but presumably it does no harm.
1430 NON_GNU_CPP="/lib/cpp -D_LANGUAGE_C"
d42122a3 1431 # -32 probably isn't necessary in later v.6s -- anyone know which?
ba4481b5
DL
1432 NON_GCC_TEST_OPTIONS=-32
1433 ;;
1434 mips-sgi-irix5.[01]* )
1435 machine=iris4d opsys=irix5-0
1436 ;;
1437 mips-sgi-irix5* | mips-sgi-irix* )
1438 machine=iris4d opsys=irix5-2
1439 ;;
1440
1441 ## SONY machines
1442 m68*-sony-bsd4.2* )
1443 machine=news opsys=bsd4-2
1444 ;;
1445 m68*-sony-bsd4.3* )
1446 machine=news opsys=bsd4-3
1447 ;;
1448 m68*-sony-newsos3* | m68*-sony-news3*)
1449 machine=news opsys=bsd4-3
1450 ;;
1451 mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
1452 machine=news-risc opsys=bsd4-3
1453 ;;
1454 mips-sony-newsos6* )
1455 machine=news-r6 opsys=newsos6
1456 ;;
1457 mips-sony-news* )
1458 machine=news-risc opsys=newsos5
1459 ;;
1460
1461 ## Stride
1462 m68*-stride-sysv* )
1463 machine=stride opsys=usg5-2
1464 ;;
1465
1466 ## Suns
1467 sparc-*-linux-gnu* | sparc64-*-linux-gnu* )
1468 machine=sparc opsys=gnu-linux
1469 ;;
1470
d054101f 1471 *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
ba4481b5
DL
1472 | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
1473 | rs6000-*-solaris2*)
1474 case "${canonical}" in
1475 m68*-sunos1* ) machine=sun1 ;;
1476 m68*-sunos2* ) machine=sun2 ;;
1477 m68* ) machine=sun3 ;;
1478 i[3456]86-sun-sunos[34]* ) machine=sun386 ;;
1479 i[3456]86-*-* ) machine=intel386 ;;
1480 powerpcle* ) machine=powerpcle ;;
1481 powerpc* | rs6000* ) machine=ibmrs6000 ;;
1482 sparc* ) machine=sparc ;;
1483 * ) unported=yes ;;
1484 esac
1485 case "${canonical}" in
1486 ## The Sun386 didn't get past 4.0.
1487 i[3456]86-*-sunos4 ) opsys=sunos4-0 ;;
1488 *-sunos4.0* ) opsys=sunos4-0 ;;
1489 *-sunos4.1.[3-9]*noshare )
1490 ## This name is sunos413 instead of sunos4-1-3
1491 ## to avoid a file name conflict on MSDOS.
1492 opsys=sunos413
1493 NON_GNU_CPP=/usr/lib/cpp
1494 NON_GCC_TEST_OPTIONS=-Bstatic
1495 GCC_TEST_OPTIONS=-static
1496 ;;
1497 *-sunos4.1.[3-9]* | *-sunos4shr*)
1498 opsys=sunos4shr
1499 NON_GNU_CPP=/usr/lib/cpp
1500 ;;
1501 *-sunos4* | *-sunos )
1502 opsys=sunos4-1
1503 NON_GCC_TEST_OPTIONS=-Bstatic
1504 GCC_TEST_OPTIONS=-static
1505 ;;
1506 *-sunos5.3* | *-solaris2.3* )
1507 opsys=sol2-3
1508 NON_GNU_CPP=/usr/ccs/lib/cpp
1509 ;;
1510 *-sunos5.4* | *-solaris2.4* )
1511 opsys=sol2-4
1512 NON_GNU_CPP=/usr/ccs/lib/cpp
1513 RANLIB="ar -ts"
1514 ;;
1515 *-sunos5.5* | *-solaris2.5* )
1516 opsys=sol2-5
1517 NON_GNU_CPP=/usr/ccs/lib/cpp
1518 RANLIB="ar -ts"
1519 ;;
1520 *-sunos5* | *-solaris* )
1521 opsys=sol2-5
1522 NON_GNU_CPP=/usr/ccs/lib/cpp
1523 ;;
1524 * ) opsys=bsd4-2 ;;
1525 esac
1526 ## Watch out for a compiler that we know will not work.
1527 case "${canonical}" in
1528 *-solaris* | *-sunos5* )
1529 if [ "x$CC" = x/usr/ucb/cc ]; then
1530 ## /usr/ucb/cc doesn't work;
1531 ## we should find some other compiler that does work.
1532 unset CC
1533 fi
1534 ;;
1535 *) ;;
1536 esac
1537 ;;
1538 sparc-*-nextstep* )
1539 machine=sparc opsys=nextstep
1540 ;;
1541
1542 ## Tadpole 68k
1543 m68*-tadpole-sysv* )
1544 machine=tad68k opsys=usg5-3
1545 ;;
1546
1547 ## Tahoe machines
1548 tahoe-tahoe-bsd4.2* )
1549 machine=tahoe opsys=bsd4-2
1550 ;;
1551 tahoe-tahoe-bsd4.3* )
1552 machine=tahoe opsys=bsd4-3
1553 ;;
1554
1555 ## Tandem Integrity S2
1556 mips-tandem-sysv* )
1557 machine=tandem-s2 opsys=usg5-3
1558 ;;
1559
1560 ## Tektronix XD88
1561 m88k-tektronix-sysv3* )
1562 machine=tekxd88 opsys=usg5-3
1563 ;;
1564
1565 ## Tektronix 16000 box (6130?)
1566 ns16k-tektronix-bsd* )
1567 machine=ns16000 opsys=bsd4-2
1568 ;;
1569 ## Tektronix 4300
1570 ## src/m/tek4300.h hints that this is a m68k machine.
1571 m68*-tektronix-bsd* )
1572 machine=tek4300 opsys=bsd4-3
1573 ;;
1574
1575 ## Titan P2 or P3
1576 ## We seem to have lost the machine-description file titan.h!
1577 titan-titan-sysv* )
1578 machine=titan opsys=usg5-3
1579 ;;
1580
1581 ## Ustation E30 (SS5E)
1582 m68*-unisys-uniplus* )
1583 machine=ustation opsystem=unipl5-2
1584 ;;
1585
1586 ## Vaxen.
1587 vax-dec-* )
1588 machine=vax
1589 case "${canonical}" in
1590 *-bsd4.1* ) opsys=bsd4-1 ;;
1591 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
1592 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
1593 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
1594 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
1595 *-vms* ) opsys=vms ;;
1596 * ) unported=yes
1597 esac
1598 ;;
1599
1600 ## Whitechapel MG1
1601 ns16k-whitechapel-* )
1602 machine=mg1
1603 ## We don't know what sort of OS runs on these; we'll let the
1604 ## operating system guessing code below try.
1605 ;;
1606
1607 ## Wicat
1608 m68*-wicat-sysv* )
1609 machine=wicat opsys=usg5-2
1610 ;;
1611
f4988be7
GM
1612 ## IA-64
1613 ia64*-*-linux* )
1614 machine=ia64 opsys=gnu-linux
1615 ;;
1616
ba4481b5
DL
1617 ## Intel 386 machines where we don't care about the manufacturer
1618 i[3456]86-*-* )
1619 machine=intel386
1620 case "${canonical}" in
9f817ea4 1621 *-lynxos* ) opsys=lynxos ;;
ba4481b5
DL
1622 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
1623 *-isc2.2* ) opsys=isc2-2 ;;
1624 *-isc4.0* ) opsys=isc4-0 ;;
1625 *-isc4.* ) opsys=isc4-1
1626 GCC_TEST_OPTIONS=-posix
1627 NON_GCC_TEST_OPTIONS=-Xp
1628 ;;
1629 *-isc* ) opsys=isc3-0 ;;
1630 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
1631 *-esix* ) opsys=esix ;;
1632 *-xenix* ) opsys=xenix ;;
1633 *-linux-gnu* ) opsys=gnu-linux ;;
1634 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
1635 *-sco3.2v5* ) opsys=sco5
1636 NON_GNU_CPP=/lib/cpp
1637 # Prevent -belf from being passed to $CPP.
1638 # /lib/cpp does not accept it.
1639 OVERRIDE_CPPFLAGS=" "
1640 ;;
1641 *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
1642 *-386bsd* ) opsys=386bsd ;;
1643 *-freebsd* ) opsys=freebsd ;;
1644 *-nextstep* ) opsys=nextstep ;;
1645 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
1646 esac
1647 ;;
1648
1649 ## m68k Linux-based GNU system
1650 m68k-*-linux-gnu* )
1651 machine=m68k opsys=gnu-linux
1652 ;;
1653
1654 ## Mips Linux-based GNU system
1655 mips-*-linux-gnu* )
1656 machine=mips opsys=gnu-linux
1657 ;;
1658
1659 ## UXP/DS
1660 sparc-fujitsu-sysv4* )
1661 machine=sparc opsys=uxpds
1662 NON_GNU_CPP=/usr/ccs/lib/cpp
1663 RANLIB="ar -ts"
1664 ;;
1665
1666 ## UXP/V
1667 f301-fujitsu-uxpv4.1)
1668 machine=f301 opsys=uxpv
1669 ;;
1670
1671 * )
1672 unported=yes
1673 ;;
1674esac
1675
1676### If the code above didn't choose an operating system, just choose
1677### an operating system based on the configuration name. You really
1678### only want to use this when you have no idea what the right
1679### operating system is; if you know what operating systems a machine
1680### runs, it's cleaner to make it explicit in the case statement
1681### above.
1682if test x"${opsys}" = x; then
1683 case "${canonical}" in
1684 *-gnu* ) opsys=gnu ;;
1685 *-bsd4.[01] ) opsys=bsd4-1 ;;
1686 *-bsd4.2 ) opsys=bsd4-2 ;;
1687 *-bsd4.3 ) opsys=bsd4-3 ;;
1688 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
1689 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
1690 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
1691 *-sysv3* | *-sysvr3* ) opsys=usg5-3 ;;
1692 *-sysv4.2uw* ) opsys=unixware ;;
1693 *-sysv4.1* | *-sysvr4.1* )
1694 NON_GNU_CPP=/usr/lib/cpp
1695 opsys=usg5-4 ;;
1696 *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
1697 if [ x$NON_GNU_CPP = x ]; then
1698 if [ -f /usr/ccs/lib/cpp ]; then
1699 NON_GNU_CPP=/usr/ccs/lib/cpp
1700 else
1701 NON_GNU_CPP=/lib/cpp
1702 fi
1703 fi
1704 opsys=usg5-4-2 ;;
1705 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
1706 * )
1707 unported=yes
1708 ;;
1709 esac
1710fi
1711
ba4481b5
DL
1712
1713if test $unported = yes; then
1714 { echo "configure: error: Emacs hasn't been ported to \`${canonical}' systems.
1715Check \`etc/MACHINES' for recognized configuration names." 1>&2; exit 1; }
1716fi
1717
1718machfile="m/${machine}.h"
1719opsysfile="s/${opsys}.h"
1720
1721
1722#### Choose a compiler.
1723test -n "$CC" && cc_specified=yes
1724
1725# Save the value of CFLAGS that the user specified.
1726SPECIFIED_CFLAGS="$CFLAGS"
1727
1728case ${with_gcc} in
1729 "yes" ) CC="gcc" GCC=yes ;;
1730 "no" ) : ${CC=cc} ;;
1731 * ) # Extract the first word of "gcc", so it can be a program name with args.
1732set dummy gcc; ac_word=$2
1733echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 1734echo "configure:1735: checking for $ac_word" >&5
ba4481b5
DL
1735if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1736 echo $ac_n "(cached) $ac_c" 1>&6
1737else
1738 if test -n "$CC"; then
1739 ac_cv_prog_CC="$CC" # Let the user override the test.
1740else
c4bb2108
DL
1741 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1742 ac_dummy="$PATH"
1743 for ac_dir in $ac_dummy; do
ba4481b5
DL
1744 test -z "$ac_dir" && ac_dir=.
1745 if test -f $ac_dir/$ac_word; then
1746 ac_cv_prog_CC="gcc"
1747 break
1748 fi
1749 done
1750 IFS="$ac_save_ifs"
1751fi
1752fi
1753CC="$ac_cv_prog_CC"
1754if test -n "$CC"; then
1755 echo "$ac_t""$CC" 1>&6
1756else
1757 echo "$ac_t""no" 1>&6
1758fi
1759
1760if test -z "$CC"; then
1761 # Extract the first word of "cc", so it can be a program name with args.
1762set dummy cc; ac_word=$2
1763echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 1764echo "configure:1765: checking for $ac_word" >&5
ba4481b5
DL
1765if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1766 echo $ac_n "(cached) $ac_c" 1>&6
1767else
1768 if test -n "$CC"; then
1769 ac_cv_prog_CC="$CC" # Let the user override the test.
1770else
c4bb2108 1771 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ba4481b5 1772 ac_prog_rejected=no
c4bb2108
DL
1773 ac_dummy="$PATH"
1774 for ac_dir in $ac_dummy; do
ba4481b5
DL
1775 test -z "$ac_dir" && ac_dir=.
1776 if test -f $ac_dir/$ac_word; then
1777 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1778 ac_prog_rejected=yes
1779 continue
1780 fi
1781 ac_cv_prog_CC="cc"
1782 break
1783 fi
1784 done
1785 IFS="$ac_save_ifs"
1786if test $ac_prog_rejected = yes; then
1787 # We found a bogon in the path, so make sure we never use it.
1788 set dummy $ac_cv_prog_CC
1789 shift
1790 if test $# -gt 0; then
1791 # We chose a different compiler from the bogus one.
1792 # However, it has the same basename, so the bogon will be chosen
1793 # first if we set CC to just the basename; use the full file name.
1794 shift
1795 set dummy "$ac_dir/$ac_word" "$@"
1796 shift
1797 ac_cv_prog_CC="$@"
1798 fi
1799fi
1800fi
1801fi
1802CC="$ac_cv_prog_CC"
1803if test -n "$CC"; then
1804 echo "$ac_t""$CC" 1>&6
1805else
1806 echo "$ac_t""no" 1>&6
1807fi
1808
c4bb2108
DL
1809 if test -z "$CC"; then
1810 case "`uname -s`" in
1811 *win32* | *WIN32*)
1812 # Extract the first word of "cl", so it can be a program name with args.
1813set dummy cl; ac_word=$2
1814echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 1815echo "configure:1816: checking for $ac_word" >&5
c4bb2108
DL
1816if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1817 echo $ac_n "(cached) $ac_c" 1>&6
1818else
1819 if test -n "$CC"; then
1820 ac_cv_prog_CC="$CC" # Let the user override the test.
1821else
1822 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1823 ac_dummy="$PATH"
1824 for ac_dir in $ac_dummy; do
1825 test -z "$ac_dir" && ac_dir=.
1826 if test -f $ac_dir/$ac_word; then
1827 ac_cv_prog_CC="cl"
1828 break
1829 fi
1830 done
1831 IFS="$ac_save_ifs"
1832fi
1833fi
1834CC="$ac_cv_prog_CC"
1835if test -n "$CC"; then
1836 echo "$ac_t""$CC" 1>&6
1837else
1838 echo "$ac_t""no" 1>&6
1839fi
1840 ;;
1841 esac
1842 fi
ba4481b5
DL
1843 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1844fi
1845
1846echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
bb17930d 1847echo "configure:1848: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ba4481b5
DL
1848
1849ac_ext=c
1850# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1851ac_cpp='$CPP $CPPFLAGS'
1852ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
c4bb2108 1853ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ba4481b5
DL
1854cross_compiling=$ac_cv_prog_cc_cross
1855
c4bb2108
DL
1856cat > conftest.$ac_ext << EOF
1857
bb17930d 1858#line 1859 "configure"
ba4481b5 1859#include "confdefs.h"
c4bb2108 1860
ba4481b5
DL
1861main(){return(0);}
1862EOF
bb17930d 1863if { (eval echo configure:1864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
1864 ac_cv_prog_cc_works=yes
1865 # If we can't run a trivial program, we are probably using a cross compiler.
1866 if (./conftest; exit) 2>/dev/null; then
1867 ac_cv_prog_cc_cross=no
1868 else
1869 ac_cv_prog_cc_cross=yes
1870 fi
1871else
1872 echo "configure: failed program was:" >&5
1873 cat conftest.$ac_ext >&5
1874 ac_cv_prog_cc_works=no
1875fi
1876rm -fr conftest*
c4bb2108
DL
1877ac_ext=c
1878# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1879ac_cpp='$CPP $CPPFLAGS'
1880ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1881ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1882cross_compiling=$ac_cv_prog_cc_cross
ba4481b5
DL
1883
1884echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1885if test $ac_cv_prog_cc_works = no; then
1886 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1887fi
1888echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
bb17930d 1889echo "configure:1890: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
ba4481b5
DL
1890echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1891cross_compiling=$ac_cv_prog_cc_cross
1892
1893echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
bb17930d 1894echo "configure:1895: checking whether we are using GNU C" >&5
ba4481b5
DL
1895if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1896 echo $ac_n "(cached) $ac_c" 1>&6
1897else
1898 cat > conftest.c <<EOF
1899#ifdef __GNUC__
1900 yes;
1901#endif
1902EOF
bb17930d 1903if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ba4481b5
DL
1904 ac_cv_prog_gcc=yes
1905else
1906 ac_cv_prog_gcc=no
1907fi
1908fi
1909
1910echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1911
1912if test $ac_cv_prog_gcc = yes; then
1913 GCC=yes
c4bb2108
DL
1914else
1915 GCC=
1916fi
1917
1918ac_test_CFLAGS="${CFLAGS+set}"
1919ac_save_CFLAGS="$CFLAGS"
1920CFLAGS=
1921echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
bb17930d 1922echo "configure:1923: checking whether ${CC-cc} accepts -g" >&5
ba4481b5
DL
1923if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1924 echo $ac_n "(cached) $ac_c" 1>&6
1925else
1926 echo 'void f(){}' > conftest.c
1927if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1928 ac_cv_prog_cc_g=yes
1929else
1930 ac_cv_prog_cc_g=no
1931fi
1932rm -f conftest*
1933
1934fi
1935
1936echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
c4bb2108
DL
1937if test "$ac_test_CFLAGS" = set; then
1938 CFLAGS="$ac_save_CFLAGS"
1939elif test $ac_cv_prog_cc_g = yes; then
1940 if test "$GCC" = yes; then
ba4481b5
DL
1941 CFLAGS="-g -O2"
1942 else
c4bb2108 1943 CFLAGS="-g"
ba4481b5 1944 fi
22afa6e8 1945else
c4bb2108
DL
1946 if test "$GCC" = yes; then
1947 CFLAGS="-O2"
1948 else
1949 CFLAGS=
1950 fi
ba4481b5
DL
1951fi
1952
1953esac
1954
1955# On Suns, sometimes $CPP names a directory.
1956if test -n "$CPP" && test -d "$CPP"; then
1957 CPP=
1958fi
1959
1960#### Some systems specify a CPP to use unless we are using GCC.
1961#### Now that we know whether we are using GCC, we can decide whether
1962#### to use that one.
1963if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
1964then
1965 CPP="$NON_GNU_CPP"
1966fi
1967
1968#### Some systems specify a CC to use unless we are using GCC.
1969#### Now that we know whether we are using GCC, we can decide whether
1970#### to use that one.
1971if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
1972 test x$cc_specified != xyes
1973then
1974 CC="$NON_GNU_CC"
1975fi
1976
1977if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
1978then
1979 CC="$CC $GCC_TEST_OPTIONS"
1980fi
1981
1982if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
1983then
1984 CC="$CC $NON_GCC_TEST_OPTIONS"
1985fi
1986
1987if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
1988then
1989 ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
1990fi
1991
1992if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x
1993then
1994 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1995fi
1996
1997#### Some other nice autoconf tests. If you add a test here which
1998#### should make an entry in src/config.h, don't forget to add an
1999#### #undef clause to src/config.h.in for autoconf to modify.
2000
2001echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
bb17930d 2002echo "configure:2003: checking whether ln -s works" >&5
ba4481b5
DL
2003if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2004 echo $ac_n "(cached) $ac_c" 1>&6
2005else
2006 rm -f conftestdata
2007if ln -s X conftestdata 2>/dev/null
2008then
2009 rm -f conftestdata
2010 ac_cv_prog_LN_S="ln -s"
2011else
2012 ac_cv_prog_LN_S=ln
2013fi
2014fi
2015LN_S="$ac_cv_prog_LN_S"
2016if test "$ac_cv_prog_LN_S" = "ln -s"; then
2017 echo "$ac_t""yes" 1>&6
2018else
2019 echo "$ac_t""no" 1>&6
2020fi
2021
2022echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
bb17930d 2023echo "configure:2024: checking how to run the C preprocessor" >&5
ba4481b5
DL
2024# On Suns, sometimes $CPP names a directory.
2025if test -n "$CPP" && test -d "$CPP"; then
2026 CPP=
2027fi
2028if test -z "$CPP"; then
2029if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2030 echo $ac_n "(cached) $ac_c" 1>&6
2031else
2032 # This must be in double quotes, not single quotes, because CPP may get
2033 # substituted into the Makefile and "${CC-cc}" will confuse make.
2034 CPP="${CC-cc} -E"
2035 # On the NeXT, cc -E runs the code through the compiler's parser,
2036 # not just through cpp.
2037 cat > conftest.$ac_ext <<EOF
bb17930d 2038#line 2039 "configure"
ba4481b5
DL
2039#include "confdefs.h"
2040#include <assert.h>
2041Syntax Error
2042EOF
2043ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2044{ (eval echo configure:2045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 2045ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
2046if test -z "$ac_err"; then
2047 :
2048else
2049 echo "$ac_err" >&5
2050 echo "configure: failed program was:" >&5
2051 cat conftest.$ac_ext >&5
2052 rm -rf conftest*
2053 CPP="${CC-cc} -E -traditional-cpp"
2054 cat > conftest.$ac_ext <<EOF
bb17930d 2055#line 2056 "configure"
ba4481b5
DL
2056#include "confdefs.h"
2057#include <assert.h>
2058Syntax Error
2059EOF
2060ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2061{ (eval echo configure:2062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108
DL
2062ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2063if test -z "$ac_err"; then
2064 :
2065else
2066 echo "$ac_err" >&5
2067 echo "configure: failed program was:" >&5
2068 cat conftest.$ac_ext >&5
2069 rm -rf conftest*
2070 CPP="${CC-cc} -nologo -E"
2071 cat > conftest.$ac_ext <<EOF
bb17930d 2072#line 2073 "configure"
c4bb2108
DL
2073#include "confdefs.h"
2074#include <assert.h>
2075Syntax Error
2076EOF
2077ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2078{ (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 2079ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
2080if test -z "$ac_err"; then
2081 :
2082else
2083 echo "$ac_err" >&5
2084 echo "configure: failed program was:" >&5
2085 cat conftest.$ac_ext >&5
2086 rm -rf conftest*
2087 CPP=/lib/cpp
2088fi
2089rm -f conftest*
2090fi
c4bb2108
DL
2091rm -f conftest*
2092fi
ba4481b5
DL
2093rm -f conftest*
2094 ac_cv_prog_CPP="$CPP"
2095fi
2096 CPP="$ac_cv_prog_CPP"
2097else
2098 ac_cv_prog_CPP="$CPP"
2099fi
2100echo "$ac_t""$CPP" 1>&6
2101
2102# Find a good install program. We prefer a C program (faster),
2103# so one script is as good as another. But avoid the broken or
2104# incompatible versions:
2105# SysV /etc/install, /usr/sbin/install
2106# SunOS /usr/etc/install
2107# IRIX /sbin/install
2108# AIX /bin/install
c4bb2108 2109# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
ba4481b5
DL
2110# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2111# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2112# ./install, which can be erroneously created by make from ./install.sh.
2113echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
bb17930d 2114echo "configure:2115: checking for a BSD compatible install" >&5
ba4481b5
DL
2115if test -z "$INSTALL"; then
2116if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2117 echo $ac_n "(cached) $ac_c" 1>&6
2118else
c4bb2108 2119 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
ba4481b5
DL
2120 for ac_dir in $PATH; do
2121 # Account for people who put trailing slashes in PATH elements.
2122 case "$ac_dir/" in
2123 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2124 *)
2125 # OSF1 and SCO ODT 3.0 have their own names for install.
c4bb2108
DL
2126 # Don't use installbsd from OSF since it installs stuff as root
2127 # by default.
2128 for ac_prog in ginstall scoinst install; do
ba4481b5
DL
2129 if test -f $ac_dir/$ac_prog; then
2130 if test $ac_prog = install &&
2131 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2132 # AIX install. It has an incompatible calling convention.
2133 :
2134 else
2135 ac_cv_path_install="$ac_dir/$ac_prog -c"
2136 break 2
2137 fi
2138 fi
2139 done
2140 ;;
2141 esac
2142 done
2143 IFS="$ac_save_IFS"
2144
2145fi
2146 if test "${ac_cv_path_install+set}" = set; then
2147 INSTALL="$ac_cv_path_install"
2148 else
2149 # As a last resort, use the slow shell script. We don't cache a
2150 # path for INSTALL within a source directory, because that will
2151 # break other packages using the cache if that directory is
2152 # removed, or if the path is relative.
2153 INSTALL="$ac_install_sh"
2154 fi
2155fi
2156echo "$ac_t""$INSTALL" 1>&6
2157
2158# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2159# It thinks the first close brace ends the variable substitution.
2160test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2161
c4bb2108
DL
2162test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
2163
ba4481b5
DL
2164test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2165
2166for ac_prog in 'bison -y' byacc
2167do
2168# Extract the first word of "$ac_prog", so it can be a program name with args.
2169set dummy $ac_prog; ac_word=$2
2170echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 2171echo "configure:2172: checking for $ac_word" >&5
ba4481b5
DL
2172if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
2173 echo $ac_n "(cached) $ac_c" 1>&6
2174else
2175 if test -n "$YACC"; then
2176 ac_cv_prog_YACC="$YACC" # Let the user override the test.
2177else
c4bb2108
DL
2178 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2179 ac_dummy="$PATH"
2180 for ac_dir in $ac_dummy; do
ba4481b5
DL
2181 test -z "$ac_dir" && ac_dir=.
2182 if test -f $ac_dir/$ac_word; then
2183 ac_cv_prog_YACC="$ac_prog"
2184 break
2185 fi
2186 done
2187 IFS="$ac_save_ifs"
2188fi
2189fi
2190YACC="$ac_cv_prog_YACC"
2191if test -n "$YACC"; then
2192 echo "$ac_t""$YACC" 1>&6
2193else
2194 echo "$ac_t""no" 1>&6
2195fi
2196
2197test -n "$YACC" && break
2198done
2199test -n "$YACC" || YACC="yacc"
2200
7397acc4
DL
2201if test "x$RANLIB" = x; then
2202 # Extract the first word of "ranlib", so it can be a program name with args.
2203set dummy ranlib; ac_word=$2
2204echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 2205echo "configure:2206: checking for $ac_word" >&5
7397acc4
DL
2206if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2207 echo $ac_n "(cached) $ac_c" 1>&6
2208else
2209 if test -n "$RANLIB"; then
2210 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2211else
2212 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2213 ac_dummy="$PATH"
2214 for ac_dir in $ac_dummy; do
2215 test -z "$ac_dir" && ac_dir=.
2216 if test -f $ac_dir/$ac_word; then
2217 ac_cv_prog_RANLIB="ranlib"
2218 break
2219 fi
2220 done
2221 IFS="$ac_save_ifs"
2222 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2223fi
2224fi
2225RANLIB="$ac_cv_prog_RANLIB"
2226if test -n "$RANLIB"; then
2227 echo "$ac_t""$RANLIB" 1>&6
2228else
2229 echo "$ac_t""no" 1>&6
2230fi
2231
2232fi
ba4481b5
DL
2233
2234echo $ac_n "checking for AIX""... $ac_c" 1>&6
bb17930d 2235echo "configure:2236: checking for AIX" >&5
ba4481b5 2236cat > conftest.$ac_ext <<EOF
bb17930d 2237#line 2238 "configure"
ba4481b5
DL
2238#include "confdefs.h"
2239#ifdef _AIX
2240 yes
2241#endif
2242
2243EOF
2244if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2245 egrep "yes" >/dev/null 2>&1; then
2246 rm -rf conftest*
2247 echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2248#define _ALL_SOURCE 1
2249EOF
2250
2251else
2252 rm -rf conftest*
2253 echo "$ac_t""no" 1>&6
2254fi
2255rm -f conftest*
2256
2257
2258
3b33a005
DL
2259#### Extract some information from the operating system and machine files.
2260
2261echo "checking the machine- and system-dependent files to find out
2262 - which libraries the lib-src programs will want, and
2263 - whether the GNU malloc routines are usable" 1>&6
bb17930d 2264echo "configure:2265: checking the machine- and system-dependent files to find out
3b33a005
DL
2265 - which libraries the lib-src programs will want, and
2266 - whether the GNU malloc routines are usable" >&5
2267
2268### First figure out CFLAGS (which we use for running the compiler here)
2269### and REAL_CFLAGS (which we use for real compilation).
2270### The two are the same except on a few systems, where they are made
2271### different to work around various lossages. For example,
2272### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
2273### as implying static linking.
2274
2275### If the CFLAGS env var is specified, we use that value
2276### instead of the default.
2277
2278### It's not important that this name contain the PID; you can't run
2279### two configures in the same directory and have anything work
2280### anyway.
2281tempcname="conftest.c"
2282
2283echo '
2284#include "'${srcdir}'/src/'${opsysfile}'"
2285#include "'${srcdir}'/src/'${machfile}'"
2286#ifndef LIBS_MACHINE
2287#define LIBS_MACHINE
2288#endif
2289#ifndef LIBS_SYSTEM
2290#define LIBS_SYSTEM
2291#endif
2292#ifndef C_SWITCH_SYSTEM
2293#define C_SWITCH_SYSTEM
2294#endif
2295#ifndef C_SWITCH_MACHINE
2296#define C_SWITCH_MACHINE
2297#endif
2298configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
2299configure___ c_switch_system=C_SWITCH_SYSTEM
2300configure___ c_switch_machine=C_SWITCH_MACHINE
2301
2302#ifndef LIB_X11_LIB
2303#define LIB_X11_LIB -lX11
2304#endif
2305
2306#ifndef LIBX11_MACHINE
2307#define LIBX11_MACHINE
2308#endif
2309
2310#ifndef LIBX11_SYSTEM
2311#define LIBX11_SYSTEM
2312#endif
2313configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
2314
2315#ifdef UNEXEC
2316configure___ unexec=UNEXEC
2317#else
2318configure___ unexec=unexec.o
2319#endif
2320
2321#ifdef SYSTEM_MALLOC
2322configure___ system_malloc=yes
2323#else
2324configure___ system_malloc=no
2325#endif
2326
2327#ifndef C_DEBUG_SWITCH
2328#define C_DEBUG_SWITCH -g
2329#endif
2330
2331#ifndef C_OPTIMIZE_SWITCH
2332#ifdef __GNUC__
2333#define C_OPTIMIZE_SWITCH -O2
2334#else
2335#define C_OPTIMIZE_SWITCH -O
2336#endif
2337#endif
2338
2339#ifndef LD_SWITCH_MACHINE
2340#define LD_SWITCH_MACHINE
2341#endif
2342
2343#ifndef LD_SWITCH_SYSTEM
2344#define LD_SWITCH_SYSTEM
2345#endif
2346
2347#ifndef LD_SWITCH_X_SITE_AUX
2348#define LD_SWITCH_X_SITE_AUX
2349#endif
2350
2351configure___ ld_switch_system=LD_SWITCH_SYSTEM
2352configure___ ld_switch_machine=LD_SWITCH_MACHINE
2353
2354#ifdef THIS_IS_CONFIGURE
2355
2356/* Get the CFLAGS for tests in configure. */
2357#ifdef __GNUC__
2358configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
2359#else
2360configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
2361#endif
2362
2363#else /* not THIS_IS_CONFIGURE */
2364
2365/* Get the CFLAGS for real compilation. */
2366#ifdef __GNUC__
2367configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
2368#else
2369configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
2370#endif
2371
2372#endif /* not THIS_IS_CONFIGURE */
2373' > ${tempcname}
2374
2375# The value of CPP is a quoted variable reference, so we need to do this
2376# to get its actual value...
2377CPP=`eval "echo $CPP"`
2378eval `${CPP} -Isrc ${tempcname} \
2379 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
2380if test "x$SPECIFIED_CFLAGS" = x; then
2381 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
2382 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
2383else
2384 REAL_CFLAGS="$CFLAGS"
2385fi
2386rm ${tempcname}
2387
2388ac_link="$ac_link $ld_switch_machine $ld_switch_system"
2389
2390### Make sure subsequent tests use flags consistent with the build flags.
2391
2392if test x"${OVERRIDE_CPPFLAGS}" != x; then
2393 CPPFLAGS="${OVERRIDE_CPPFLAGS}"
2394else
2395 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
2396fi
2397
f4988be7
GM
2398# Check whether --enable-largefile or --disable-largefile was given.
2399if test "${enable_largefile+set}" = set; then
2400 enableval="$enable_largefile"
2401 :
2402fi
2403
2404 if test "$enable_largefile" != no; then
2405
2406 echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6
bb17930d 2407echo "configure:2408: checking for special C compiler options needed for large files" >&5
f4988be7 2408if eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then
ba4481b5
DL
2409 echo $ac_n "(cached) $ac_c" 1>&6
2410else
f4988be7
GM
2411 ac_cv_sys_largefile_CC=no
2412 if test "$GCC" != yes; then
2413 # IRIX 6.2 and later do not support large files by default,
2414 # so use the C compiler's -n32 option if that helps.
2415 cat > conftest.$ac_ext <<EOF
bb17930d 2416#line 2417 "configure"
ba4481b5 2417#include "confdefs.h"
f4988be7
GM
2418#include <sys/types.h>
2419 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2420
2421int main() {
2422
2423; return 0; }
ba4481b5 2424EOF
bb17930d 2425if { (eval echo configure:2426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7 2426 :
ba4481b5 2427else
ba4481b5
DL
2428 echo "configure: failed program was:" >&5
2429 cat conftest.$ac_ext >&5
2430 rm -rf conftest*
f4988be7
GM
2431 ac_save_CC="$CC"
2432 CC="$CC -n32"
2433 cat > conftest.$ac_ext <<EOF
bb17930d 2434#line 2435 "configure"
b192d653 2435#include "confdefs.h"
f4988be7
GM
2436#include <sys/types.h>
2437 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2438
b192d653 2439int main() {
f4988be7 2440
b192d653
KR
2441; return 0; }
2442EOF
bb17930d 2443if { (eval echo configure:2444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b192d653 2444 rm -rf conftest*
f4988be7 2445 ac_cv_sys_largefile_CC=' -n32'
b192d653
KR
2446else
2447 echo "configure: failed program was:" >&5
2448 cat conftest.$ac_ext >&5
b192d653
KR
2449fi
2450rm -f conftest*
f4988be7 2451 CC="$ac_save_CC"
b192d653 2452fi
f4988be7
GM
2453rm -f conftest*
2454 fi
b192d653
KR
2455fi
2456
f4988be7
GM
2457echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6
2458 if test "$ac_cv_sys_largefile_CC" != no; then
2459 CC="$CC$ac_cv_sys_largefile_CC"
2460 fi
b192d653 2461
f4988be7 2462 echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6
bb17930d 2463echo "configure:2464: checking for _FILE_OFFSET_BITS value needed for large files" >&5
f4988be7 2464if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then
ba4481b5
DL
2465 echo $ac_n "(cached) $ac_c" 1>&6
2466else
f4988be7
GM
2467 ac_cv_sys_file_offset_bits=no
2468 cat > conftest.$ac_ext <<EOF
bb17930d 2469#line 2470 "configure"
f4988be7
GM
2470#include "confdefs.h"
2471#include <sys/types.h>
2472 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2473
2474
2475
2476int main() {
2477
2478; return 0; }
2479EOF
bb17930d 2480if { (eval echo configure:2481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
2481 :
2482else
2483 echo "configure: failed program was:" >&5
2484 cat conftest.$ac_ext >&5
2485 rm -rf conftest*
ba4481b5 2486 cat > conftest.$ac_ext <<EOF
bb17930d 2487#line 2488 "configure"
ba4481b5 2488#include "confdefs.h"
f4988be7
GM
2489#define _FILE_OFFSET_BITS 64
2490#include <sys/types.h>
2491 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2492
2493
2494
2495int main() {
2496
2497; return 0; }
ba4481b5 2498EOF
bb17930d 2499if { (eval echo configure:2500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5 2500 rm -rf conftest*
f4988be7 2501 ac_cv_sys_file_offset_bits=64
ba4481b5 2502else
ba4481b5
DL
2503 echo "configure: failed program was:" >&5
2504 cat conftest.$ac_ext >&5
ba4481b5
DL
2505fi
2506rm -f conftest*
2507fi
f4988be7 2508rm -f conftest*
ba4481b5 2509fi
ba4481b5 2510
f4988be7
GM
2511echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6
2512 if test "$ac_cv_sys_file_offset_bits" != no; then
2513 cat >> confdefs.h <<EOF
2514#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
2515EOF
2516
2517 fi
2518 echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6
bb17930d 2519echo "configure:2520: checking for _LARGEFILE_SOURCE value needed for large files" >&5
f4988be7 2520if eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then
ba4481b5
DL
2521 echo $ac_n "(cached) $ac_c" 1>&6
2522else
f4988be7
GM
2523 ac_cv_sys_largefile_source=no
2524 cat > conftest.$ac_ext <<EOF
bb17930d 2525#line 2526 "configure"
ba4481b5 2526#include "confdefs.h"
f4988be7
GM
2527#include <sys/types.h>
2528 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2529
2530#include <stdio.h>
2531
2532int main() {
2533return !ftello;
2534; return 0; }
ba4481b5 2535EOF
bb17930d 2536if { (eval echo configure:2537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7 2537 :
ba4481b5 2538else
ba4481b5
DL
2539 echo "configure: failed program was:" >&5
2540 cat conftest.$ac_ext >&5
2541 rm -rf conftest*
f4988be7 2542 cat > conftest.$ac_ext <<EOF
bb17930d 2543#line 2544 "configure"
ba4481b5 2544#include "confdefs.h"
f4988be7
GM
2545#define _LARGEFILE_SOURCE 1
2546#include <sys/types.h>
2547 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2548
2549#include <stdio.h>
2550
2551int main() {
2552return !ftello;
2553; return 0; }
ba4481b5 2554EOF
bb17930d 2555if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5 2556 rm -rf conftest*
f4988be7
GM
2557 ac_cv_sys_largefile_source=1
2558else
2559 echo "configure: failed program was:" >&5
2560 cat conftest.$ac_ext >&5
2561fi
2562rm -f conftest*
ba4481b5
DL
2563fi
2564rm -f conftest*
ba4481b5
DL
2565fi
2566
f4988be7
GM
2567echo "$ac_t""$ac_cv_sys_largefile_source" 1>&6
2568 if test "$ac_cv_sys_largefile_source" != no; then
2569 cat >> confdefs.h <<EOF
2570#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
ba4481b5 2571EOF
f4988be7
GM
2572
2573 fi
2574 echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6
bb17930d 2575echo "configure:2576: checking for _LARGE_FILES value needed for large files" >&5
f4988be7
GM
2576if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then
2577 echo $ac_n "(cached) $ac_c" 1>&6
ba4481b5 2578else
f4988be7
GM
2579 ac_cv_sys_large_files=no
2580 cat > conftest.$ac_ext <<EOF
bb17930d 2581#line 2582 "configure"
f4988be7
GM
2582#include "confdefs.h"
2583#include <sys/types.h>
2584 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2585
ba4481b5 2586
f4988be7
GM
2587
2588int main() {
ba4481b5 2589
f4988be7
GM
2590; return 0; }
2591EOF
bb17930d 2592if { (eval echo configure:2593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
2593 :
2594else
f4988be7
GM
2595 echo "configure: failed program was:" >&5
2596 cat conftest.$ac_ext >&5
2597 rm -rf conftest*
ba4481b5 2598 cat > conftest.$ac_ext <<EOF
bb17930d 2599#line 2600 "configure"
ba4481b5 2600#include "confdefs.h"
f4988be7
GM
2601#define _LARGE_FILES 1
2602#include <sys/types.h>
2603 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2604
2605
2606
2607int main() {
ba4481b5 2608
f4988be7 2609; return 0; }
ba4481b5 2610EOF
bb17930d 2611if { (eval echo configure:2612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
2612 rm -rf conftest*
2613 ac_cv_sys_large_files=1
ba4481b5
DL
2614else
2615 echo "configure: failed program was:" >&5
2616 cat conftest.$ac_ext >&5
ba4481b5 2617fi
f4988be7 2618rm -f conftest*
ba4481b5 2619fi
f4988be7 2620rm -f conftest*
ba4481b5
DL
2621fi
2622
f4988be7
GM
2623echo "$ac_t""$ac_cv_sys_large_files" 1>&6
2624 if test "$ac_cv_sys_large_files" != no; then
2625 cat >> confdefs.h <<EOF
2626#define _LARGE_FILES $ac_cv_sys_large_files
ba4481b5
DL
2627EOF
2628
f4988be7
GM
2629 fi
2630 echo $ac_n "checking for _XOPEN_SOURCE value needed for large files""... $ac_c" 1>&6
bb17930d 2631echo "configure:2632: checking for _XOPEN_SOURCE value needed for large files" >&5
f4988be7 2632if eval "test \"`echo '$''{'ac_cv_sys_xopen_source'+set}'`\" = set"; then
ba4481b5
DL
2633 echo $ac_n "(cached) $ac_c" 1>&6
2634else
f4988be7
GM
2635 ac_cv_sys_xopen_source=no
2636 cat > conftest.$ac_ext <<EOF
bb17930d 2637#line 2638 "configure"
f4988be7
GM
2638#include "confdefs.h"
2639#include <sys/types.h>
2640 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2641
2642#include <stdio.h>
2643
2644int main() {
2645return !ftello;
2646; return 0; }
2647EOF
bb17930d 2648if { (eval echo configure:2649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
2649 :
2650else
2651 echo "configure: failed program was:" >&5
2652 cat conftest.$ac_ext >&5
2653 rm -rf conftest*
ba4481b5 2654 cat > conftest.$ac_ext <<EOF
bb17930d 2655#line 2656 "configure"
ba4481b5 2656#include "confdefs.h"
f4988be7 2657#define _XOPEN_SOURCE 500
ba4481b5 2658#include <sys/types.h>
f4988be7
GM
2659 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
2660
2661#include <stdio.h>
2662
ba4481b5 2663int main() {
f4988be7 2664return !ftello;
ba4481b5
DL
2665; return 0; }
2666EOF
bb17930d 2667if { (eval echo configure:2668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5 2668 rm -rf conftest*
f4988be7 2669 ac_cv_sys_xopen_source=500
ba4481b5
DL
2670else
2671 echo "configure: failed program was:" >&5
2672 cat conftest.$ac_ext >&5
f4988be7
GM
2673fi
2674rm -f conftest*
ba4481b5
DL
2675fi
2676rm -f conftest*
2677fi
2678
f4988be7
GM
2679echo "$ac_t""$ac_cv_sys_xopen_source" 1>&6
2680 if test "$ac_cv_sys_xopen_source" != no; then
2681 cat >> confdefs.h <<EOF
2682#define _XOPEN_SOURCE $ac_cv_sys_xopen_source
ba4481b5
DL
2683EOF
2684
f4988be7
GM
2685 fi
2686 fi
2687
ba4481b5 2688
f4988be7
GM
2689# Sound support for GNU/Linux and the free BSDs.
2690for ac_hdr in machine/soundcard.h sys/soundcard.h soundcard.h
2691do
2692ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2693echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 2694echo "configure:2695: checking for $ac_hdr" >&5
f4988be7 2695if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
ba4481b5
DL
2696 echo $ac_n "(cached) $ac_c" 1>&6
2697else
2698 cat > conftest.$ac_ext <<EOF
bb17930d 2699#line 2700 "configure"
ba4481b5 2700#include "confdefs.h"
f4988be7 2701#include <$ac_hdr>
ba4481b5 2702EOF
f4988be7 2703ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2704{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
f4988be7
GM
2705ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2706if test -z "$ac_err"; then
ba4481b5 2707 rm -rf conftest*
f4988be7 2708 eval "ac_cv_header_$ac_safe=yes"
ba4481b5 2709else
f4988be7 2710 echo "$ac_err" >&5
ba4481b5
DL
2711 echo "configure: failed program was:" >&5
2712 cat conftest.$ac_ext >&5
2713 rm -rf conftest*
f4988be7 2714 eval "ac_cv_header_$ac_safe=no"
ba4481b5
DL
2715fi
2716rm -f conftest*
2717fi
f4988be7
GM
2718if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2719 echo "$ac_t""yes" 1>&6
2720 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2721 cat >> confdefs.h <<EOF
2722#define $ac_tr_hdr 1
ba4481b5 2723EOF
f4988be7
GM
2724
2725else
2726 echo "$ac_t""no" 1>&6
ba4481b5 2727fi
f4988be7 2728done
ba4481b5 2729
f4988be7
GM
2730# Emulation library used on NetBSD.
2731echo $ac_n "checking for _oss_ioctl in -lossaudio""... $ac_c" 1>&6
bb17930d 2732echo "configure:2733: checking for _oss_ioctl in -lossaudio" >&5
f4988be7
GM
2733ac_lib_var=`echo ossaudio'_'_oss_ioctl | sed 'y%./+-%__p_%'`
2734if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
65171e3a
DL
2735 echo $ac_n "(cached) $ac_c" 1>&6
2736else
f4988be7
GM
2737 ac_save_LIBS="$LIBS"
2738LIBS="-lossaudio $LIBS"
2739cat > conftest.$ac_ext <<EOF
bb17930d 2740#line 2741 "configure"
65171e3a 2741#include "confdefs.h"
f4988be7
GM
2742/* Override any gcc2 internal prototype to avoid an error. */
2743/* We use char because int might match the return type of a gcc2
2744 builtin and then its argument prototype would still apply. */
2745char _oss_ioctl();
2746
65171e3a 2747int main() {
f4988be7 2748_oss_ioctl()
65171e3a
DL
2749; return 0; }
2750EOF
bb17930d 2751if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
65171e3a 2752 rm -rf conftest*
f4988be7 2753 eval "ac_cv_lib_$ac_lib_var=yes"
65171e3a
DL
2754else
2755 echo "configure: failed program was:" >&5
2756 cat conftest.$ac_ext >&5
2757 rm -rf conftest*
f4988be7 2758 eval "ac_cv_lib_$ac_lib_var=no"
65171e3a
DL
2759fi
2760rm -f conftest*
f4988be7 2761LIBS="$ac_save_LIBS"
65171e3a
DL
2762
2763fi
f4988be7
GM
2764if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2765 echo "$ac_t""yes" 1>&6
2766 LIBSOUND=-lossaudio
2767else
2768 echo "$ac_t""no" 1>&6
2769LIBSOUND=
2770fi
65171e3a 2771
ba4481b5 2772
f4988be7
GM
2773
2774for ac_hdr in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
2775 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
bb17930d 2776 termcap.h stdio_ext.h fcntl.h term.h strings.h
f4988be7
GM
2777do
2778ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2779echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 2780echo "configure:2781: checking for $ac_hdr" >&5
f4988be7 2781if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
ba4481b5
DL
2782 echo $ac_n "(cached) $ac_c" 1>&6
2783else
2784 cat > conftest.$ac_ext <<EOF
bb17930d 2785#line 2786 "configure"
ba4481b5 2786#include "confdefs.h"
f4988be7 2787#include <$ac_hdr>
ba4481b5 2788EOF
f4988be7 2789ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2790{ (eval echo configure:2791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
f4988be7
GM
2791ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2792if test -z "$ac_err"; then
ba4481b5 2793 rm -rf conftest*
f4988be7 2794 eval "ac_cv_header_$ac_safe=yes"
ba4481b5 2795else
f4988be7 2796 echo "$ac_err" >&5
ba4481b5
DL
2797 echo "configure: failed program was:" >&5
2798 cat conftest.$ac_ext >&5
2799 rm -rf conftest*
f4988be7 2800 eval "ac_cv_header_$ac_safe=no"
ba4481b5
DL
2801fi
2802rm -f conftest*
2803fi
f4988be7
GM
2804if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2805 echo "$ac_t""yes" 1>&6
2806 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2807 cat >> confdefs.h <<EOF
2808#define $ac_tr_hdr 1
ba4481b5 2809EOF
f4988be7
GM
2810
2811else
2812 echo "$ac_t""no" 1>&6
ba4481b5 2813fi
f4988be7 2814done
ba4481b5 2815
f4988be7 2816echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
bb17930d 2817echo "configure:2818: checking for ANSI C header files" >&5
f4988be7 2818if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
ba4481b5
DL
2819 echo $ac_n "(cached) $ac_c" 1>&6
2820else
2821 cat > conftest.$ac_ext <<EOF
bb17930d 2822#line 2823 "configure"
ba4481b5 2823#include "confdefs.h"
f4988be7
GM
2824#include <stdlib.h>
2825#include <stdarg.h>
2826#include <string.h>
2827#include <float.h>
ba4481b5 2828EOF
f4988be7 2829ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 2830{ (eval echo configure:2831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
f4988be7
GM
2831ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2832if test -z "$ac_err"; then
ba4481b5 2833 rm -rf conftest*
f4988be7 2834 ac_cv_header_stdc=yes
ba4481b5 2835else
f4988be7 2836 echo "$ac_err" >&5
ba4481b5
DL
2837 echo "configure: failed program was:" >&5
2838 cat conftest.$ac_ext >&5
2839 rm -rf conftest*
f4988be7 2840 ac_cv_header_stdc=no
ba4481b5
DL
2841fi
2842rm -f conftest*
ba4481b5 2843
f4988be7
GM
2844if test $ac_cv_header_stdc = yes; then
2845 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2846cat > conftest.$ac_ext <<EOF
bb17930d 2847#line 2848 "configure"
f4988be7
GM
2848#include "confdefs.h"
2849#include <string.h>
2850EOF
2851if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2852 egrep "memchr" >/dev/null 2>&1; then
2853 :
2854else
2855 rm -rf conftest*
2856 ac_cv_header_stdc=no
2857fi
2858rm -f conftest*
2859
2860fi
2861
2862if test $ac_cv_header_stdc = yes; then
2863 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2864cat > conftest.$ac_ext <<EOF
bb17930d 2865#line 2866 "configure"
f4988be7
GM
2866#include "confdefs.h"
2867#include <stdlib.h>
2868EOF
2869if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2870 egrep "free" >/dev/null 2>&1; then
2871 :
2872else
2873 rm -rf conftest*
2874 ac_cv_header_stdc=no
2875fi
2876rm -f conftest*
2877
2878fi
2879
2880if test $ac_cv_header_stdc = yes; then
2881 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2882if test "$cross_compiling" = yes; then
2883 :
2884else
2885 cat > conftest.$ac_ext <<EOF
bb17930d 2886#line 2887 "configure"
f4988be7
GM
2887#include "confdefs.h"
2888#include <ctype.h>
2889#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2890#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2891#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2892int main () { int i; for (i = 0; i < 256; i++)
2893if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2894exit (0); }
2895
2896EOF
bb17930d 2897if { (eval echo configure:2898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
f4988be7
GM
2898then
2899 :
2900else
2901 echo "configure: failed program was:" >&5
2902 cat conftest.$ac_ext >&5
2903 rm -fr conftest*
2904 ac_cv_header_stdc=no
2905fi
2906rm -fr conftest*
2907fi
2908
2909fi
2910fi
2911
2912echo "$ac_t""$ac_cv_header_stdc" 1>&6
2913if test $ac_cv_header_stdc = yes; then
2914 cat >> confdefs.h <<\EOF
2915#define STDC_HEADERS 1
2916EOF
2917
2918fi
2919
2920echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
bb17930d 2921echo "configure:2922: checking whether time.h and sys/time.h may both be included" >&5
f4988be7
GM
2922if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2923 echo $ac_n "(cached) $ac_c" 1>&6
2924else
2925 cat > conftest.$ac_ext <<EOF
bb17930d 2926#line 2927 "configure"
f4988be7
GM
2927#include "confdefs.h"
2928#include <sys/types.h>
2929#include <sys/time.h>
2930#include <time.h>
2931int main() {
2932struct tm *tp;
2933; return 0; }
2934EOF
bb17930d 2935if { (eval echo configure:2936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
2936 rm -rf conftest*
2937 ac_cv_header_time=yes
2938else
2939 echo "configure: failed program was:" >&5
2940 cat conftest.$ac_ext >&5
2941 rm -rf conftest*
2942 ac_cv_header_time=no
2943fi
2944rm -f conftest*
2945fi
2946
2947echo "$ac_t""$ac_cv_header_time" 1>&6
2948if test $ac_cv_header_time = yes; then
2949 cat >> confdefs.h <<\EOF
2950#define TIME_WITH_SYS_TIME 1
2951EOF
2952
2953fi
2954
2955echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
bb17930d 2956echo "configure:2957: checking for sys_siglist declaration in signal.h or unistd.h" >&5
f4988be7
GM
2957if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
2958 echo $ac_n "(cached) $ac_c" 1>&6
2959else
2960 cat > conftest.$ac_ext <<EOF
bb17930d 2961#line 2962 "configure"
f4988be7
GM
2962#include "confdefs.h"
2963#include <sys/types.h>
2964#include <signal.h>
2965/* NetBSD declares sys_siglist in unistd.h. */
2966#ifdef HAVE_UNISTD_H
2967#include <unistd.h>
2968#endif
2969int main() {
2970char *msg = *(sys_siglist + 1);
2971; return 0; }
2972EOF
bb17930d 2973if { (eval echo configure:2974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
2974 rm -rf conftest*
2975 ac_cv_decl_sys_siglist=yes
2976else
2977 echo "configure: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
2979 rm -rf conftest*
2980 ac_cv_decl_sys_siglist=no
2981fi
2982rm -f conftest*
2983fi
2984
2985echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
2986if test $ac_cv_decl_sys_siglist = yes; then
2987 cat >> confdefs.h <<\EOF
2988#define SYS_SIGLIST_DECLARED 1
2989EOF
2990
2991fi
2992
2993echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
bb17930d 2994echo "configure:2995: checking for sys/wait.h that is POSIX.1 compatible" >&5
f4988be7
GM
2995if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
2996 echo $ac_n "(cached) $ac_c" 1>&6
2997else
2998 cat > conftest.$ac_ext <<EOF
bb17930d 2999#line 3000 "configure"
f4988be7
GM
3000#include "confdefs.h"
3001#include <sys/types.h>
3002#include <sys/wait.h>
3003#ifndef WEXITSTATUS
3004#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3005#endif
3006#ifndef WIFEXITED
3007#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3008#endif
3009int main() {
3010int s;
3011wait (&s);
3012s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3013; return 0; }
3014EOF
bb17930d 3015if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
3016 rm -rf conftest*
3017 ac_cv_header_sys_wait_h=yes
3018else
3019 echo "configure: failed program was:" >&5
3020 cat conftest.$ac_ext >&5
3021 rm -rf conftest*
3022 ac_cv_header_sys_wait_h=no
3023fi
3024rm -f conftest*
3025fi
3026
3027echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
3028if test $ac_cv_header_sys_wait_h = yes; then
3029 cat >> confdefs.h <<\EOF
3030#define HAVE_SYS_WAIT_H 1
3031EOF
3032
3033fi
3034
3035
3036echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
bb17930d 3037echo "configure:3038: checking for struct utimbuf" >&5
f4988be7
GM
3038if eval "test \"`echo '$''{'emacs_cv_struct_utimbuf'+set}'`\" = set"; then
3039 echo $ac_n "(cached) $ac_c" 1>&6
3040else
3041 cat > conftest.$ac_ext <<EOF
bb17930d 3042#line 3043 "configure"
f4988be7
GM
3043#include "confdefs.h"
3044#ifdef TIME_WITH_SYS_TIME
3045#include <sys/time.h>
3046#include <time.h>
3047#else
3048#ifdef HAVE_SYS_TIME_H
3049#include <sys/time.h>
3050#else
3051#include <time.h>
3052#endif
3053#endif
3054#ifdef HAVE_UTIME_H
3055#include <utime.h>
3056#endif
3057int main() {
3058static struct utimbuf x; x.actime = x.modtime;
3059; return 0; }
3060EOF
bb17930d 3061if { (eval echo configure:3062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
3062 rm -rf conftest*
3063 emacs_cv_struct_utimbuf=yes
3064else
3065 echo "configure: failed program was:" >&5
3066 cat conftest.$ac_ext >&5
3067 rm -rf conftest*
3068 emacs_cv_struct_utimbuf=no
3069fi
3070rm -f conftest*
3071fi
3072
3073echo "$ac_t""$emacs_cv_struct_utimbuf" 1>&6
3074if test $emacs_cv_struct_utimbuf = yes; then
3075 cat >> confdefs.h <<\EOF
3076#define HAVE_STRUCT_UTIMBUF 1
3077EOF
3078
3079fi
3080
3081echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
bb17930d 3082echo "configure:3083: checking return type of signal handlers" >&5
f4988be7
GM
3083if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3084 echo $ac_n "(cached) $ac_c" 1>&6
3085else
3086 cat > conftest.$ac_ext <<EOF
bb17930d 3087#line 3088 "configure"
f4988be7
GM
3088#include "confdefs.h"
3089#include <sys/types.h>
3090#include <signal.h>
3091#ifdef signal
3092#undef signal
3093#endif
3094#ifdef __cplusplus
3095extern "C" void (*signal (int, void (*)(int)))(int);
3096#else
3097void (*signal ()) ();
3098#endif
3099
3100int main() {
3101int i;
3102; return 0; }
3103EOF
bb17930d 3104if { (eval echo configure:3105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
f4988be7
GM
3105 rm -rf conftest*
3106 ac_cv_type_signal=void
3107else
3108 echo "configure: failed program was:" >&5
3109 cat conftest.$ac_ext >&5
3110 rm -rf conftest*
3111 ac_cv_type_signal=int
3112fi
3113rm -f conftest*
3114fi
3115
3116echo "$ac_t""$ac_cv_type_signal" 1>&6
3117cat >> confdefs.h <<EOF
3118#define RETSIGTYPE $ac_cv_type_signal
ba4481b5
DL
3119EOF
3120
3121
3122
34ec9ebe 3123echo $ac_n "checking for speed_t""... $ac_c" 1>&6
bb17930d 3124echo "configure:3125: checking for speed_t" >&5
34ec9ebe
GM
3125if eval "test \"`echo '$''{'emacs_cv_speed_t'+set}'`\" = set"; then
3126 echo $ac_n "(cached) $ac_c" 1>&6
3127else
3128 cat > conftest.$ac_ext <<EOF
bb17930d 3129#line 3130 "configure"
34ec9ebe
GM
3130#include "confdefs.h"
3131#include <termios.h>
3132int main() {
3133speed_t x = 1;
3134; return 0; }
3135EOF
bb17930d 3136if { (eval echo configure:3137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
34ec9ebe
GM
3137 rm -rf conftest*
3138 emacs_cv_speed_t=yes
3139else
3140 echo "configure: failed program was:" >&5
3141 cat conftest.$ac_ext >&5
3142fi
3143rm -f conftest*
3144fi
3145
3146echo "$ac_t""$emacs_cv_speed_t" 1>&6
3147if test $emacs_cv_speed_t = yes; then
3148 cat >> confdefs.h <<\EOF
3149#define HAVE_SPEED_T 1
3150EOF
3151
3152fi
3153
ba4481b5 3154echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
bb17930d 3155echo "configure:3156: checking for struct timeval" >&5
ba4481b5
DL
3156if eval "test \"`echo '$''{'emacs_cv_struct_timeval'+set}'`\" = set"; then
3157 echo $ac_n "(cached) $ac_c" 1>&6
3158else
3159 cat > conftest.$ac_ext <<EOF
bb17930d 3160#line 3161 "configure"
ba4481b5
DL
3161#include "confdefs.h"
3162#ifdef TIME_WITH_SYS_TIME
3163#include <sys/time.h>
3164#include <time.h>
3165#else
3166#ifdef HAVE_SYS_TIME_H
3167#include <sys/time.h>
3168#else
3169#include <time.h>
3170#endif
3171#endif
3172int main() {
3173static struct timeval x; x.tv_sec = x.tv_usec;
3174; return 0; }
3175EOF
bb17930d 3176if { (eval echo configure:3177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
3177 rm -rf conftest*
3178 emacs_cv_struct_timeval=yes
3179else
3180 echo "configure: failed program was:" >&5
3181 cat conftest.$ac_ext >&5
3182 rm -rf conftest*
3183 emacs_cv_struct_timeval=no
3184fi
3185rm -f conftest*
3186fi
3187
3188echo "$ac_t""$emacs_cv_struct_timeval" 1>&6
3189HAVE_TIMEVAL=$emacs_cv_struct_timeval
3190if test $emacs_cv_struct_timeval = yes; then
3191 cat >> confdefs.h <<\EOF
3192#define HAVE_TIMEVAL 1
3193EOF
3194
3195fi
3196
d42122a3 3197echo $ac_n "checking for struct exception""... $ac_c" 1>&6
bb17930d 3198echo "configure:3199: checking for struct exception" >&5
d42122a3
DL
3199if eval "test \"`echo '$''{'emacs_cv_struct_exception'+set}'`\" = set"; then
3200 echo $ac_n "(cached) $ac_c" 1>&6
3201else
3202 cat > conftest.$ac_ext <<EOF
bb17930d 3203#line 3204 "configure"
d42122a3
DL
3204#include "confdefs.h"
3205#include <math.h>
3206int main() {
3207static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;
3208; return 0; }
3209EOF
bb17930d 3210if { (eval echo configure:3211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d42122a3
DL
3211 rm -rf conftest*
3212 emacs_cv_struct_exception=yes
3213else
3214 echo "configure: failed program was:" >&5
3215 cat conftest.$ac_ext >&5
3216 rm -rf conftest*
3217 emacs_cv_struct_exception=no
3218fi
3219rm -f conftest*
3220fi
3221
3222echo "$ac_t""$emacs_cv_struct_exception" 1>&6
3223HAVE_EXCEPTION=$emacs_cv_struct_exception
3224if test $emacs_cv_struct_exception != yes; then
3225 cat >> confdefs.h <<\EOF
3226#define NO_MATHERR 1
3227EOF
3228
3229fi
3230
ba4481b5 3231echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
bb17930d 3232echo "configure:3233: checking whether struct tm is in sys/time.h or time.h" >&5
ba4481b5
DL
3233if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
3234 echo $ac_n "(cached) $ac_c" 1>&6
3235else
3236 cat > conftest.$ac_ext <<EOF
bb17930d 3237#line 3238 "configure"
ba4481b5
DL
3238#include "confdefs.h"
3239#include <sys/types.h>
3240#include <time.h>
3241int main() {
3242struct tm *tp; tp->tm_sec;
3243; return 0; }
3244EOF
bb17930d 3245if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
3246 rm -rf conftest*
3247 ac_cv_struct_tm=time.h
3248else
3249 echo "configure: failed program was:" >&5
3250 cat conftest.$ac_ext >&5
3251 rm -rf conftest*
3252 ac_cv_struct_tm=sys/time.h
3253fi
3254rm -f conftest*
3255fi
3256
3257echo "$ac_t""$ac_cv_struct_tm" 1>&6
3258if test $ac_cv_struct_tm = sys/time.h; then
3259 cat >> confdefs.h <<\EOF
3260#define TM_IN_SYS_TIME 1
3261EOF
3262
3263fi
3264
3265echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
bb17930d 3266echo "configure:3267: checking for tm_zone in struct tm" >&5
ba4481b5
DL
3267if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
3268 echo $ac_n "(cached) $ac_c" 1>&6
3269else
3270 cat > conftest.$ac_ext <<EOF
bb17930d 3271#line 3272 "configure"
ba4481b5
DL
3272#include "confdefs.h"
3273#include <sys/types.h>
3274#include <$ac_cv_struct_tm>
3275int main() {
3276struct tm tm; tm.tm_zone;
3277; return 0; }
3278EOF
bb17930d 3279if { (eval echo configure:3280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
3280 rm -rf conftest*
3281 ac_cv_struct_tm_zone=yes
3282else
3283 echo "configure: failed program was:" >&5
3284 cat conftest.$ac_ext >&5
3285 rm -rf conftest*
3286 ac_cv_struct_tm_zone=no
3287fi
3288rm -f conftest*
3289fi
3290
3291echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3292if test "$ac_cv_struct_tm_zone" = yes; then
3293 cat >> confdefs.h <<\EOF
3294#define HAVE_TM_ZONE 1
3295EOF
3296
3297else
3298 echo $ac_n "checking for tzname""... $ac_c" 1>&6
bb17930d 3299echo "configure:3300: checking for tzname" >&5
ba4481b5
DL
3300if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
3301 echo $ac_n "(cached) $ac_c" 1>&6
3302else
3303 cat > conftest.$ac_ext <<EOF
bb17930d 3304#line 3305 "configure"
ba4481b5
DL
3305#include "confdefs.h"
3306#include <time.h>
3307#ifndef tzname /* For SGI. */
3308extern char *tzname[]; /* RS6000 and others reject char **tzname. */
3309#endif
3310int main() {
3311atoi(*tzname);
3312; return 0; }
3313EOF
bb17930d 3314if { (eval echo configure:3315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
3315 rm -rf conftest*
3316 ac_cv_var_tzname=yes
3317else
3318 echo "configure: failed program was:" >&5
3319 cat conftest.$ac_ext >&5
3320 rm -rf conftest*
3321 ac_cv_var_tzname=no
3322fi
3323rm -f conftest*
3324fi
3325
3326echo "$ac_t""$ac_cv_var_tzname" 1>&6
3327 if test $ac_cv_var_tzname = yes; then
3328 cat >> confdefs.h <<\EOF
3329#define HAVE_TZNAME 1
3330EOF
3331
3332 fi
3333fi
3334
1113b624 3335echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
bb17930d 3336echo "configure:3337: checking for tm_gmtoff in struct tm" >&5
1113b624
PE
3337if eval "test \"`echo '$''{'emacs_cv_tm_gmtoff'+set}'`\" = set"; then
3338 echo $ac_n "(cached) $ac_c" 1>&6
3339else
3340 cat > conftest.$ac_ext <<EOF
bb17930d 3341#line 3342 "configure"
1113b624
PE
3342#include "confdefs.h"
3343#include <time.h>
3344int main() {
3345struct tm t; t.tm_gmtoff = 0
3346; return 0; }
3347EOF
bb17930d 3348if { (eval echo configure:3349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1113b624
PE
3349 rm -rf conftest*
3350 emacs_cv_tm_gmtoff=yes
3351else
3352 echo "configure: failed program was:" >&5
3353 cat conftest.$ac_ext >&5
3354 rm -rf conftest*
3355 emacs_cv_tm_gmtoff=no
3356fi
3357rm -f conftest*
3358fi
3359
3360echo "$ac_t""$emacs_cv_tm_gmtoff" 1>&6
3361if test $emacs_cv_tm_gmtoff = yes; then
3362 cat >> confdefs.h <<\EOF
3363#define HAVE_TM_GMTOFF 1
3364EOF
3365
3366fi
ba4481b5 3367
7397acc4
DL
3368
3369echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
bb17930d 3370echo "configure:3371: checking for ${CC-cc} option to accept ANSI C" >&5
7397acc4
DL
3371if eval "test \"`echo '$''{'ac_cv_prog_cc_stdc'+set}'`\" = set"; then
3372 echo $ac_n "(cached) $ac_c" 1>&6
3373else
3374 ac_cv_prog_cc_stdc=no
3375ac_save_CC="$CC"
3376# Don't try gcc -ansi; that turns off useful extensions and
3377# breaks some systems' header files.
3378# AIX -qlanglvl=ansi
3379# Ultrix and OSF/1 -std1
3380# HP-UX 10.20 and later -Ae
3381# HP-UX older versions -Aa -D_HPUX_SOURCE
3382# SVR4 -Xc -D__EXTENSIONS__
3383for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3384do
3385 CC="$ac_save_CC $ac_arg"
3386 cat > conftest.$ac_ext <<EOF
bb17930d 3387#line 3388 "configure"
7397acc4
DL
3388#include "confdefs.h"
3389#include <stdarg.h>
3390#include <stdio.h>
3391#include <sys/types.h>
3392#include <sys/stat.h>
3393/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3394struct buf { int x; };
3395FILE * (*rcsopen) (struct buf *, struct stat *, int);
3396static char *e (p, i)
3397 char **p;
3398 int i;
3399{
3400 return p[i];
3401}
3402static char *f (char * (*g) (char **, int), char **p, ...)
3403{
3404 char *s;
3405 va_list v;
3406 va_start (v,p);
3407 s = g (p, va_arg (v,int));
3408 va_end (v);
3409 return s;
3410}
3411int test (int i, double x);
3412struct s1 {int (*f) (int a);};
3413struct s2 {int (*f) (double a);};
3414int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3415int argc;
3416char **argv;
3417int main() {
3418return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3419; return 0; }
3420EOF
bb17930d 3421if { (eval echo configure:3422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7397acc4
DL
3422 rm -rf conftest*
3423 ac_cv_prog_cc_stdc="$ac_arg"; break
3424else
3425 echo "configure: failed program was:" >&5
3426 cat conftest.$ac_ext >&5
3427fi
3428rm -f conftest*
3429done
3430CC="$ac_save_CC"
3431
3432fi
3433
3434case "x$ac_cv_prog_cc_stdc" in
3435 x|xno)
3436 echo "$ac_t""none needed" 1>&6 ;;
3437 *)
3438 echo "$ac_t""$ac_cv_prog_cc_stdc" 1>&6
3439 CC="$CC $ac_cv_prog_cc_stdc" ;;
3440esac
3441
3442echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
bb17930d 3443echo "configure:3444: checking for function prototypes" >&5
7397acc4
DL
3444if test "$ac_cv_prog_cc_stdc" != no; then
3445 echo "$ac_t""yes" 1>&6
3446 cat >> confdefs.h <<\EOF
3447#define PROTOTYPES 1
3448EOF
3449
3450else
3451 echo "$ac_t""no" 1>&6
3452fi
3453
3454echo $ac_n "checking for working volatile""... $ac_c" 1>&6
bb17930d 3455echo "configure:3456: checking for working volatile" >&5
7397acc4
DL
3456if eval "test \"`echo '$''{'ac_cv_c_volatile'+set}'`\" = set"; then
3457 echo $ac_n "(cached) $ac_c" 1>&6
3458else
3459 cat > conftest.$ac_ext <<EOF
bb17930d 3460#line 3461 "configure"
7397acc4
DL
3461#include "confdefs.h"
3462
3463int main() {
3464
3465volatile int x;
3466int * volatile y;
3467; return 0; }
3468EOF
bb17930d 3469if { (eval echo configure:3470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7397acc4
DL
3470 rm -rf conftest*
3471 ac_cv_c_volatile=yes
3472else
3473 echo "configure: failed program was:" >&5
3474 cat conftest.$ac_ext >&5
3475 rm -rf conftest*
3476 ac_cv_c_volatile=no
3477fi
3478rm -f conftest*
3479fi
3480
3481echo "$ac_t""$ac_cv_c_volatile" 1>&6
3482if test $ac_cv_c_volatile = no; then
3483 cat >> confdefs.h <<\EOF
3484#define volatile
3485EOF
3486
3487fi
3488
ba4481b5 3489echo $ac_n "checking for working const""... $ac_c" 1>&6
bb17930d 3490echo "configure:3491: checking for working const" >&5
ba4481b5
DL
3491if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
3492 echo $ac_n "(cached) $ac_c" 1>&6
3493else
3494 cat > conftest.$ac_ext <<EOF
bb17930d 3495#line 3496 "configure"
ba4481b5
DL
3496#include "confdefs.h"
3497
3498int main() {
3499
3500/* Ultrix mips cc rejects this. */
f4988be7 3501typedef int charset[2]; const charset x;
ba4481b5
DL
3502/* SunOS 4.1.1 cc rejects this. */
3503char const *const *ccp;
3504char **p;
3505/* NEC SVR4.0.2 mips cc rejects this. */
3506struct point {int x, y;};
3507static struct point const zero = {0,0};
3508/* AIX XL C 1.02.0.0 rejects this.
3509 It does not let you subtract one const X* pointer from another in an arm
3510 of an if-expression whose if-part is not a constant expression */
3511const char *g = "string";
3512ccp = &g + (g ? g-g : 0);
3513/* HPUX 7.0 cc rejects these. */
3514++ccp;
3515p = (char**) ccp;
3516ccp = (char const *const *) p;
3517{ /* SCO 3.2v4 cc rejects this. */
3518 char *t;
3519 char const *s = 0 ? (char *) 0 : (char const *) 0;
3520
3521 *t++ = 0;
3522}
3523{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
3524 int x[] = {25, 17};
3525 const int *foo = &x[0];
3526 ++foo;
3527}
3528{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3529 typedef const int *iptr;
3530 iptr p = 0;
3531 ++p;
3532}
3533{ /* AIX XL C 1.02.0.0 rejects this saying
3534 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3535 struct s { int j; const int *ap[3]; };
3536 struct s *b; b->j = 5;
3537}
3538{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3539 const int foo = 10;
3540}
3541
3542; return 0; }
3543EOF
bb17930d 3544if { (eval echo configure:3545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
3545 rm -rf conftest*
3546 ac_cv_c_const=yes
3547else
3548 echo "configure: failed program was:" >&5
3549 cat conftest.$ac_ext >&5
3550 rm -rf conftest*
3551 ac_cv_c_const=no
3552fi
3553rm -f conftest*
3554fi
3555
3556echo "$ac_t""$ac_cv_c_const" 1>&6
3557if test $ac_cv_c_const = no; then
3558 cat >> confdefs.h <<\EOF
3559#define const
3560EOF
3561
3562fi
3563
7397acc4 3564echo $ac_n "checking for void * support""... $ac_c" 1>&6
bb17930d 3565echo "configure:3566: checking for void * support" >&5
7397acc4
DL
3566if eval "test \"`echo '$''{'emacs_cv_void_star'+set}'`\" = set"; then
3567 echo $ac_n "(cached) $ac_c" 1>&6
3568else
3569 cat > conftest.$ac_ext <<EOF
bb17930d 3570#line 3571 "configure"
7397acc4
DL
3571#include "confdefs.h"
3572
3573int main() {
3574void * foo;
3575; return 0; }
3576EOF
bb17930d 3577if { (eval echo configure:3578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7397acc4
DL
3578 rm -rf conftest*
3579 emacs_cv_void_star=yes
3580else
3581 echo "configure: failed program was:" >&5
3582 cat conftest.$ac_ext >&5
3583 rm -rf conftest*
3584 emacs_cv_void_star=no
3585fi
3586rm -f conftest*
3587fi
3588
3589echo "$ac_t""$emacs_cv_void_star" 1>&6
3590if test $emacs_cv_void_star = yes; then
3591 cat >> confdefs.h <<\EOF
3592#define POINTER_TYPE void
3593EOF
3594
3595else
3596 cat >> confdefs.h <<\EOF
3597#define POINTER_TYPE char
3598EOF
3599
3600fi
ba4481b5
DL
3601
3602echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
bb17930d 3603echo "configure:3604: checking whether ${MAKE-make} sets \${MAKE}" >&5
ba4481b5
DL
3604set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3605if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
3606 echo $ac_n "(cached) $ac_c" 1>&6
3607else
3608 cat > conftestmake <<\EOF
3609all:
3610 @echo 'ac_maketemp="${MAKE}"'
3611EOF
3612# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3613eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3614if test -n "$ac_maketemp"; then
3615 eval ac_cv_prog_make_${ac_make}_set=yes
3616else
3617 eval ac_cv_prog_make_${ac_make}_set=no
3618fi
3619rm -f conftestmake
3620fi
3621if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3622 echo "$ac_t""yes" 1>&6
3623 SET_MAKE=
3624else
3625 echo "$ac_t""no" 1>&6
3626 SET_MAKE="MAKE=${MAKE-make}"
3627fi
3628
3629
3630echo $ac_n "checking for long file names""... $ac_c" 1>&6
bb17930d 3631echo "configure:3632: checking for long file names" >&5
ba4481b5
DL
3632if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
3633 echo $ac_n "(cached) $ac_c" 1>&6
3634else
3635 ac_cv_sys_long_file_names=yes
3636# Test for long file names in all the places we know might matter:
3637# . the current directory, where building will happen
3638# $prefix/lib where we will be installing things
3639# $exec_prefix/lib likewise
3640# eval it to expand exec_prefix.
3641# $TMPDIR if set, where it might want to write temporary files
3642# if $TMPDIR is not set:
3643# /tmp where it might want to write temporary files
3644# /var/tmp likewise
3645# /usr/tmp likewise
3646if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3647 ac_tmpdirs="$TMPDIR"
3648else
3649 ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3650fi
3651for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
3652 test -d $ac_dir || continue
3653 test -w $ac_dir || continue # It is less confusing to not echo anything here.
3654 (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
3655 (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
3656 val=`cat $ac_dir/conftest9012345 2>/dev/null`
3657 if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
3658 ac_cv_sys_long_file_names=no
3659 rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
3660 break
3661 fi
3662 rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
3663done
3664fi
3665
3666echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
3667if test $ac_cv_sys_long_file_names = yes; then
3668 cat >> confdefs.h <<\EOF
3669#define HAVE_LONG_FILE_NAMES 1
3670EOF
3671
3672fi
3673
3674
3675#### Choose a window system.
3676
3677# If we find X, set shell vars x_includes and x_libraries to the
3678# paths, otherwise set no_x=yes.
3679# Uses ac_ vars as temps to allow command line to override cache and checks.
3680# --without-x overrides everything else, but does not touch the cache.
3681echo $ac_n "checking for X""... $ac_c" 1>&6
bb17930d 3682echo "configure:3683: checking for X" >&5
ba4481b5
DL
3683
3684# Check whether --with-x or --without-x was given.
3685if test "${with_x+set}" = set; then
3686 withval="$with_x"
3687 :
3688fi
3689
3690# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
3691if test "x$with_x" = xno; then
3692 # The user explicitly disabled X.
3693 have_x=disabled
3694else
3695 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
3696 # Both variables are already set.
3697 have_x=yes
3698 else
3699if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
3700 echo $ac_n "(cached) $ac_c" 1>&6
3701else
3702 # One or both of the vars are not set, and there is no cached value.
3703ac_x_includes=NO ac_x_libraries=NO
3704rm -fr conftestdir
3705if mkdir conftestdir; then
3706 cd conftestdir
3707 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
3708 cat > Imakefile <<'EOF'
3709acfindx:
3710 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
3711EOF
3712 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
3713 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3714 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
3715 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
3716 for ac_extension in a so sl; do
3717 if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
3718 test -f $ac_im_libdir/libX11.$ac_extension; then
3719 ac_im_usrlibdir=$ac_im_libdir; break
3720 fi
3721 done
3722 # Screen out bogus values from the imake configuration. They are
3723 # bogus both because they are the default anyway, and because
3724 # using them would break gcc on systems where it needs fixed includes.
3725 case "$ac_im_incroot" in
3726 /usr/include) ;;
3727 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
3728 esac
3729 case "$ac_im_usrlibdir" in
3730 /usr/lib | /lib) ;;
3731 *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
3732 esac
3733 fi
3734 cd ..
3735 rm -fr conftestdir
3736fi
3737
3738if test "$ac_x_includes" = NO; then
3739 # Guess where to find include files, by looking for this one X11 .h file.
3740 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
3741
3742 # First, try using that file with no special directory specified.
3743cat > conftest.$ac_ext <<EOF
bb17930d 3744#line 3745 "configure"
ba4481b5
DL
3745#include "confdefs.h"
3746#include <$x_direct_test_include>
3747EOF
3748ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 3749{ (eval echo configure:3750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 3750ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
3751if test -z "$ac_err"; then
3752 rm -rf conftest*
3753 # We can compile using X headers with no special include directory.
3754ac_x_includes=
3755else
3756 echo "$ac_err" >&5
3757 echo "configure: failed program was:" >&5
3758 cat conftest.$ac_ext >&5
3759 rm -rf conftest*
3760 # Look for the header file in a standard set of common directories.
3761# Check X11 before X11Rn because it is often a symlink to the current release.
3762 for ac_dir in \
3763 /usr/X11/include \
3764 /usr/X11R6/include \
3765 /usr/X11R5/include \
3766 /usr/X11R4/include \
3767 \
3768 /usr/include/X11 \
3769 /usr/include/X11R6 \
3770 /usr/include/X11R5 \
3771 /usr/include/X11R4 \
3772 \
3773 /usr/local/X11/include \
3774 /usr/local/X11R6/include \
3775 /usr/local/X11R5/include \
3776 /usr/local/X11R4/include \
3777 \
3778 /usr/local/include/X11 \
3779 /usr/local/include/X11R6 \
3780 /usr/local/include/X11R5 \
3781 /usr/local/include/X11R4 \
3782 \
3783 /usr/X386/include \
3784 /usr/x386/include \
3785 /usr/XFree86/include/X11 \
3786 \
3787 /usr/include \
3788 /usr/local/include \
3789 /usr/unsupported/include \
3790 /usr/athena/include \
3791 /usr/local/x11r5/include \
3792 /usr/lpp/Xamples/include \
3793 \
3794 /usr/openwin/include \
3795 /usr/openwin/share/include \
3796 ; \
3797 do
3798 if test -r "$ac_dir/$x_direct_test_include"; then
3799 ac_x_includes=$ac_dir
3800 break
3801 fi
3802 done
3803fi
3804rm -f conftest*
3805fi # $ac_x_includes = NO
3806
3807if test "$ac_x_libraries" = NO; then
3808 # Check for the libraries.
3809
3810 test -z "$x_direct_test_library" && x_direct_test_library=Xt
3811 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
3812
3813 # See if we find them without any special options.
3814 # Don't add to $LIBS permanently.
3815 ac_save_LIBS="$LIBS"
3816 LIBS="-l$x_direct_test_library $LIBS"
3817cat > conftest.$ac_ext <<EOF
bb17930d 3818#line 3819 "configure"
ba4481b5
DL
3819#include "confdefs.h"
3820
3821int main() {
3822${x_direct_test_function}()
3823; return 0; }
3824EOF
bb17930d 3825if { (eval echo configure:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
3826 rm -rf conftest*
3827 LIBS="$ac_save_LIBS"
3828# We can link X programs with no special library path.
3829ac_x_libraries=
3830else
3831 echo "configure: failed program was:" >&5
3832 cat conftest.$ac_ext >&5
3833 rm -rf conftest*
3834 LIBS="$ac_save_LIBS"
3835# First see if replacing the include by lib works.
3836# Check X11 before X11Rn because it is often a symlink to the current release.
3837for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
3838 /usr/X11/lib \
3839 /usr/X11R6/lib \
3840 /usr/X11R5/lib \
3841 /usr/X11R4/lib \
3842 \
3843 /usr/lib/X11 \
3844 /usr/lib/X11R6 \
3845 /usr/lib/X11R5 \
3846 /usr/lib/X11R4 \
3847 \
3848 /usr/local/X11/lib \
3849 /usr/local/X11R6/lib \
3850 /usr/local/X11R5/lib \
3851 /usr/local/X11R4/lib \
3852 \
3853 /usr/local/lib/X11 \
3854 /usr/local/lib/X11R6 \
3855 /usr/local/lib/X11R5 \
3856 /usr/local/lib/X11R4 \
3857 \
3858 /usr/X386/lib \
3859 /usr/x386/lib \
3860 /usr/XFree86/lib/X11 \
3861 \
3862 /usr/lib \
3863 /usr/local/lib \
3864 /usr/unsupported/lib \
3865 /usr/athena/lib \
3866 /usr/local/x11r5/lib \
3867 /usr/lpp/Xamples/lib \
3868 /lib/usr/lib/X11 \
3869 \
3870 /usr/openwin/lib \
3871 /usr/openwin/share/lib \
3872 ; \
3873do
3874 for ac_extension in a so sl; do
3875 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
3876 ac_x_libraries=$ac_dir
3877 break 2
3878 fi
3879 done
3880done
3881fi
3882rm -f conftest*
3883fi # $ac_x_libraries = NO
3884
3885if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
3886 # Didn't find X anywhere. Cache the known absence of X.
3887 ac_cv_have_x="have_x=no"
3888else
3889 # Record where we found X for the cache.
3890 ac_cv_have_x="have_x=yes \
3891 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
3892fi
3893fi
3894 fi
3895 eval "$ac_cv_have_x"
3896fi # $with_x != no
3897
3898if test "$have_x" != yes; then
3899 echo "$ac_t""$have_x" 1>&6
3900 no_x=yes
3901else
3902 # If each of the values was on the command line, it overrides each guess.
3903 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
3904 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
3905 # Update the cache value to reflect the command line values.
3906 ac_cv_have_x="have_x=yes \
3907 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
3908 echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
3909fi
3910
3911if test "$no_x" = yes; then
3912 window_system=none
3913else
3914 window_system=x11
3915fi
3916
3917if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
3918 LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
3919 LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
3920 x_default_search_path=""
3921 for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
3922 x_search_path="${x_library}/X11/%L/%T/%N%C%S:\
3923${x_library}/X11/%L/%T/%N%C%S:${x_libary}/X11/%l/%T/%N%C%S:\
3924${x_library}/X11/%T/%N%C%S:${x_library}/X11/%L/%T/%N%S:\
3925${x_library}/X11/%l/%T/%N%S:${x_library}/X11/%T/%N%S"
3926 if test x"${x_default_search_path}" = x; then
3927 x_default_search_path=${x_search_path}
3928 else
3929 x_default_search_path="${x_search_path}:${x_default_search_path}"
3930 fi
3931 done
3932fi
3933if test "${x_includes}" != NONE && test -n "${x_includes}"; then
3934 C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
3935fi
3936
3937if test x"${x_includes}" = x; then
3938 bitmapdir=/usr/include/X11/bitmaps
3939else
3940 # accumulate include directories that have X11 bitmap subdirectories
3941 bmd_acc="dummyval"
3942 for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do
3943 if test -d "${bmd}/X11/bitmaps"; then
3944 bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
946173ad
DL
3945 fi
3946 if test -d "${bmd}/bitmaps"; then
ba4481b5
DL
3947 bmd_acc="${bmd_acc}:${bmd}/bitmaps"
3948 fi
3949 done
3950 if test ${bmd_acc} != "dummyval"; then
3951 bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
3952 fi
3953fi
3954
3955case "${window_system}" in
3956 x11 )
3957 HAVE_X_WINDOWS=yes
3958 HAVE_X11=yes
3959 case "${with_x_toolkit}" in
3960 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
3961 motif ) USE_X_TOOLKIT=MOTIF ;;
3962 no ) USE_X_TOOLKIT=none ;;
3963 * ) USE_X_TOOLKIT=maybe ;;
3964 esac
3965 ;;
3966 none )
3967 HAVE_X_WINDOWS=no
3968 HAVE_X11=no
3969 USE_X_TOOLKIT=none
3970 ;;
3971esac
3972
3973### If we're using X11, we should use the X menu package.
3974HAVE_MENUS=no
3975case ${HAVE_X11} in
3976 yes ) HAVE_MENUS=yes ;;
3977esac
3978
3979if test "${opsys}" = "hpux9"; then
3980 case "${x_libraries}" in
3981 *X11R4* )
3982 opsysfile="s/hpux9-x11r4.h"
3983 ;;
3984 esac
3985fi
3986
3987if test "${opsys}" = "hpux9shr"; then
3988 case "${x_libraries}" in
3989 *X11R4* )
3990 opsysfile="s/hpux9shxr4.h"
3991 ;;
3992 esac
3993fi
3994
ba4481b5
DL
3995### Compute the unexec source name from the object name.
3996UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
3997
3998# Do the opsystem or machine files prohibit the use of the GNU malloc?
3999# Assume not, until told otherwise.
4000GNU_MALLOC=yes
4001doug_lea_malloc=yes
4002echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
bb17930d 4003echo "configure:4004: checking for malloc_get_state" >&5
ba4481b5
DL
4004if eval "test \"`echo '$''{'ac_cv_func_malloc_get_state'+set}'`\" = set"; then
4005 echo $ac_n "(cached) $ac_c" 1>&6
4006else
4007 cat > conftest.$ac_ext <<EOF
bb17930d 4008#line 4009 "configure"
ba4481b5
DL
4009#include "confdefs.h"
4010/* System header to define __stub macros and hopefully few prototypes,
4011 which can conflict with char malloc_get_state(); below. */
4012#include <assert.h>
4013/* Override any gcc2 internal prototype to avoid an error. */
4014/* We use char because int might match the return type of a gcc2
4015 builtin and then its argument prototype would still apply. */
4016char malloc_get_state();
4017
4018int main() {
4019
4020/* The GNU C library defines this for functions which it implements
4021 to always fail with ENOSYS. Some functions are actually named
4022 something starting with __ and the normal name is an alias. */
4023#if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
4024choke me
4025#else
a21616bd 4026malloc_get_state();
ba4481b5
DL
4027#endif
4028
4029; return 0; }
4030EOF
bb17930d 4031if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4032 rm -rf conftest*
4033 eval "ac_cv_func_malloc_get_state=yes"
4034else
4035 echo "configure: failed program was:" >&5
4036 cat conftest.$ac_ext >&5
4037 rm -rf conftest*
4038 eval "ac_cv_func_malloc_get_state=no"
4039fi
4040rm -f conftest*
4041fi
4042
4043if eval "test \"`echo '$ac_cv_func_'malloc_get_state`\" = yes"; then
4044 echo "$ac_t""yes" 1>&6
4045 :
4046else
4047 echo "$ac_t""no" 1>&6
4048doug_lea_malloc=no
4049fi
4050
4051echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
bb17930d 4052echo "configure:4053: checking for malloc_set_state" >&5
ba4481b5
DL
4053if eval "test \"`echo '$''{'ac_cv_func_malloc_set_state'+set}'`\" = set"; then
4054 echo $ac_n "(cached) $ac_c" 1>&6
4055else
4056 cat > conftest.$ac_ext <<EOF
bb17930d 4057#line 4058 "configure"
ba4481b5
DL
4058#include "confdefs.h"
4059/* System header to define __stub macros and hopefully few prototypes,
4060 which can conflict with char malloc_set_state(); below. */
4061#include <assert.h>
4062/* Override any gcc2 internal prototype to avoid an error. */
4063/* We use char because int might match the return type of a gcc2
4064 builtin and then its argument prototype would still apply. */
4065char malloc_set_state();
4066
4067int main() {
4068
4069/* The GNU C library defines this for functions which it implements
4070 to always fail with ENOSYS. Some functions are actually named
4071 something starting with __ and the normal name is an alias. */
4072#if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
4073choke me
4074#else
a21616bd 4075malloc_set_state();
ba4481b5
DL
4076#endif
4077
4078; return 0; }
4079EOF
bb17930d 4080if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4081 rm -rf conftest*
4082 eval "ac_cv_func_malloc_set_state=yes"
4083else
4084 echo "configure: failed program was:" >&5
4085 cat conftest.$ac_ext >&5
4086 rm -rf conftest*
4087 eval "ac_cv_func_malloc_set_state=no"
4088fi
4089rm -f conftest*
4090fi
4091
4092if eval "test \"`echo '$ac_cv_func_'malloc_set_state`\" = yes"; then
4093 echo "$ac_t""yes" 1>&6
4094 :
4095else
4096 echo "$ac_t""no" 1>&6
4097doug_lea_malloc=no
4098fi
4099
4100echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
bb17930d 4101echo "configure:4102: checking whether __after_morecore_hook exists" >&5
ba4481b5
DL
4102if eval "test \"`echo '$''{'emacs_cv_var___after_morecore_hook'+set}'`\" = set"; then
4103 echo $ac_n "(cached) $ac_c" 1>&6
4104else
4105 cat > conftest.$ac_ext <<EOF
bb17930d 4106#line 4107 "configure"
ba4481b5
DL
4107#include "confdefs.h"
4108extern void (* __after_morecore_hook)();
4109int main() {
4110__after_morecore_hook = 0
4111; return 0; }
4112EOF
bb17930d 4113if { (eval echo configure:4114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4114 rm -rf conftest*
4115 emacs_cv_var___after_morecore_hook=yes
4116else
4117 echo "configure: failed program was:" >&5
4118 cat conftest.$ac_ext >&5
4119 rm -rf conftest*
4120 emacs_cv_var___after_morecore_hook=no
4121fi
4122rm -f conftest*
4123fi
4124
4125echo "$ac_t""$emacs_cv_var___after_morecore_hook" 1>&6
4126if test $emacs_cv_var___after_morecore_hook = no; then
4127 doug_lea_malloc=no
4128fi
4129if test "${system_malloc}" = "yes"; then
4130 GNU_MALLOC=no
4131 GNU_MALLOC_reason="
4132 (The GNU allocators don't work with this system configuration.)"
4133fi
4134if test "$doug_lea_malloc" = "yes" ; then
4135 if test "$GNU_MALLOC" = yes ; then
4136 GNU_MALLOC_reason="
4137 (Using Doug Lea's new malloc from the GNU C Library.)"
4138 fi
4139 cat >> confdefs.h <<\EOF
4140#define DOUG_LEA_MALLOC 1
4141EOF
4142
4143fi
4144
4145if test x"${REL_ALLOC}" = x; then
4146 REL_ALLOC=${GNU_MALLOC}
4147fi
4148
ba4481b5
DL
4149LIBS="$libsrc_libs $LIBS"
4150
4151echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
bb17930d 4152echo "configure:4153: checking for dnet_ntoa in -ldnet" >&5
ba4481b5
DL
4153ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4154if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4155 echo $ac_n "(cached) $ac_c" 1>&6
4156else
4157 ac_save_LIBS="$LIBS"
4158LIBS="-ldnet $LIBS"
4159cat > conftest.$ac_ext <<EOF
bb17930d 4160#line 4161 "configure"
ba4481b5
DL
4161#include "confdefs.h"
4162/* Override any gcc2 internal prototype to avoid an error. */
4163/* We use char because int might match the return type of a gcc2
4164 builtin and then its argument prototype would still apply. */
4165char dnet_ntoa();
4166
4167int main() {
4168dnet_ntoa()
4169; return 0; }
4170EOF
bb17930d 4171if { (eval echo configure:4172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4172 rm -rf conftest*
4173 eval "ac_cv_lib_$ac_lib_var=yes"
4174else
4175 echo "configure: failed program was:" >&5
4176 cat conftest.$ac_ext >&5
4177 rm -rf conftest*
4178 eval "ac_cv_lib_$ac_lib_var=no"
4179fi
4180rm -f conftest*
4181LIBS="$ac_save_LIBS"
4182
4183fi
4184if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4185 echo "$ac_t""yes" 1>&6
4186 ac_tr_lib=HAVE_LIB`echo dnet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4187 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4188 cat >> confdefs.h <<EOF
4189#define $ac_tr_lib 1
4190EOF
4191
4192 LIBS="-ldnet $LIBS"
4193
4194else
4195 echo "$ac_t""no" 1>&6
4196fi
4197
4198
4199echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
bb17930d 4200echo "configure:4201: checking for main in -lXbsd" >&5
ba4481b5
DL
4201ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
4202if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4203 echo $ac_n "(cached) $ac_c" 1>&6
4204else
4205 ac_save_LIBS="$LIBS"
4206LIBS="-lXbsd $LIBS"
4207cat > conftest.$ac_ext <<EOF
bb17930d 4208#line 4209 "configure"
ba4481b5
DL
4209#include "confdefs.h"
4210
4211int main() {
4212main()
4213; return 0; }
4214EOF
bb17930d 4215if { (eval echo configure:4216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4216 rm -rf conftest*
4217 eval "ac_cv_lib_$ac_lib_var=yes"
4218else
4219 echo "configure: failed program was:" >&5
4220 cat conftest.$ac_ext >&5
4221 rm -rf conftest*
4222 eval "ac_cv_lib_$ac_lib_var=no"
4223fi
4224rm -f conftest*
4225LIBS="$ac_save_LIBS"
4226
4227fi
4228if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4229 echo "$ac_t""yes" 1>&6
4230 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"
4231else
4232 echo "$ac_t""no" 1>&6
4233fi
4234
4235
4236echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
bb17930d 4237echo "configure:4238: checking for cma_open in -lpthreads" >&5
ba4481b5
DL
4238ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
4239if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4240 echo $ac_n "(cached) $ac_c" 1>&6
4241else
4242 ac_save_LIBS="$LIBS"
4243LIBS="-lpthreads $LIBS"
4244cat > conftest.$ac_ext <<EOF
bb17930d 4245#line 4246 "configure"
ba4481b5
DL
4246#include "confdefs.h"
4247/* Override any gcc2 internal prototype to avoid an error. */
4248/* We use char because int might match the return type of a gcc2
4249 builtin and then its argument prototype would still apply. */
4250char cma_open();
4251
4252int main() {
4253cma_open()
4254; return 0; }
4255EOF
bb17930d 4256if { (eval echo configure:4257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4257 rm -rf conftest*
4258 eval "ac_cv_lib_$ac_lib_var=yes"
4259else
4260 echo "configure: failed program was:" >&5
4261 cat conftest.$ac_ext >&5
4262 rm -rf conftest*
4263 eval "ac_cv_lib_$ac_lib_var=no"
4264fi
4265rm -f conftest*
4266LIBS="$ac_save_LIBS"
4267
4268fi
4269if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4270 echo "$ac_t""yes" 1>&6
4271 ac_tr_lib=HAVE_LIB`echo pthreads | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4272 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4273 cat >> confdefs.h <<EOF
4274#define $ac_tr_lib 1
4275EOF
4276
4277 LIBS="-lpthreads $LIBS"
4278
4279else
4280 echo "$ac_t""no" 1>&6
4281fi
4282
4283
4284echo $ac_n "checking for XFree86 in /usr/X386""... $ac_c" 1>&6
bb17930d 4285echo "configure:4286: checking for XFree86 in /usr/X386" >&5
ba4481b5
DL
4286if test -d /usr/X386/include; then
4287 HAVE_XFREE386=yes
4288 : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
4289else
4290 HAVE_XFREE386=no
4291fi
4292echo "$ac_t""$HAVE_XFREE386" 1>&6
4293
4294# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
4295# for the tests that follow. We set it back to REAL_CFLAGS later on.
4296
5a9bf171
KR
4297REAL_CPPFLAGS="$CPPFLAGS"
4298
ba4481b5
DL
4299if test "${HAVE_X11}" = "yes"; then
4300 DEFS="$C_SWITCH_X_SITE $DEFS"
4301 LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
4302 LIBS="$LIBX $LIBS"
4303 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
5a9bf171 4304 CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
ba4481b5
DL
4305
4306 # On Solaris, arrange for LD_RUN_PATH to point to the X libraries for tests.
4307 # This is handled by LD_SWITCH_X_SITE_AUX during the real build,
4308 # but it's more convenient here to set LD_RUN_PATH
4309 # since this also works on hosts that don't understand LD_SWITCH_X_SITE_AUX.
4310 if test "${x_libraries}" != NONE && test -n "${x_libraries}"; then
4311 LD_RUN_PATH=$x_libraries${LD_RUN_PATH+:}$LD_RUN_PATH
4312 export LD_RUN_PATH
4313 fi
4314
4315 if test "${opsys}" = "gnu-linux"; then
4316 echo $ac_n "checking whether X on GNU/Linux needs -b to link""... $ac_c" 1>&6
bb17930d 4317echo "configure:4318: checking whether X on GNU/Linux needs -b to link" >&5
ba4481b5 4318 cat > conftest.$ac_ext <<EOF
bb17930d 4319#line 4320 "configure"
ba4481b5
DL
4320#include "confdefs.h"
4321
4322int main() {
4323XOpenDisplay ("foo");
4324; return 0; }
4325EOF
bb17930d 4326if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4327 rm -rf conftest*
4328 xlinux_first_failure=no
4329else
4330 echo "configure: failed program was:" >&5
4331 cat conftest.$ac_ext >&5
4332 rm -rf conftest*
4333 xlinux_first_failure=yes
4334fi
4335rm -f conftest*
4336 if test "${xlinux_first_failure}" = "yes"; then
4337 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
4338 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
4339 OLD_CPPFLAGS="$CPPFLAGS"
4340 OLD_LIBS="$LIBS"
4341 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
4342 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
4343 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
4344 LIBS="$LIBS -b i486-linuxaout"
4345 cat > conftest.$ac_ext <<EOF
bb17930d 4346#line 4347 "configure"
ba4481b5
DL
4347#include "confdefs.h"
4348
4349int main() {
4350XOpenDisplay ("foo");
4351; return 0; }
4352EOF
bb17930d 4353if { (eval echo configure:4354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4354 rm -rf conftest*
4355 xlinux_second_failure=no
4356else
4357 echo "configure: failed program was:" >&5
4358 cat conftest.$ac_ext >&5
4359 rm -rf conftest*
4360 xlinux_second_failure=yes
4361fi
4362rm -f conftest*
4363 if test "${xlinux_second_failure}" = "yes"; then
4364 # If we get the same failure with -b, there is no use adding -b.
4365 # So take it out. This plays safe.
4366 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
4367 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
4368 CPPFLAGS="$OLD_CPPFLAGS"
4369 LIBS="$OLD_LIBS"
4370 echo "$ac_t""no" 1>&6
4371 else
4372 echo "$ac_t""yes" 1>&6
4373 fi
4374 else
4375 echo "$ac_t""no" 1>&6
4376 fi
4377 fi
4378
4379 for ac_func in XrmSetDatabase XScreenResourceString \
4380XScreenNumberOfScreen XSetWMProtocols
4381do
4382echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 4383echo "configure:4384: checking for $ac_func" >&5
ba4481b5
DL
4384if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4385 echo $ac_n "(cached) $ac_c" 1>&6
4386else
4387 cat > conftest.$ac_ext <<EOF
bb17930d 4388#line 4389 "configure"
ba4481b5
DL
4389#include "confdefs.h"
4390/* System header to define __stub macros and hopefully few prototypes,
4391 which can conflict with char $ac_func(); below. */
4392#include <assert.h>
4393/* Override any gcc2 internal prototype to avoid an error. */
4394/* We use char because int might match the return type of a gcc2
4395 builtin and then its argument prototype would still apply. */
4396char $ac_func();
4397
4398int main() {
4399
4400/* The GNU C library defines this for functions which it implements
4401 to always fail with ENOSYS. Some functions are actually named
4402 something starting with __ and the normal name is an alias. */
4403#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4404choke me
4405#else
a21616bd 4406$ac_func();
ba4481b5
DL
4407#endif
4408
4409; return 0; }
4410EOF
bb17930d 4411if { (eval echo configure:4412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4412 rm -rf conftest*
4413 eval "ac_cv_func_$ac_func=yes"
4414else
4415 echo "configure: failed program was:" >&5
4416 cat conftest.$ac_ext >&5
4417 rm -rf conftest*
4418 eval "ac_cv_func_$ac_func=no"
4419fi
4420rm -f conftest*
4421fi
4422
4423if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4424 echo "$ac_t""yes" 1>&6
4425 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4426 cat >> confdefs.h <<EOF
4427#define $ac_tr_func 1
4428EOF
4429
4430else
4431 echo "$ac_t""no" 1>&6
4432fi
4433done
4434
4435fi
4436
4437if test "${window_system}" = "x11"; then
4438 echo $ac_n "checking X11 version 6""... $ac_c" 1>&6
bb17930d 4439echo "configure:4440: checking X11 version 6" >&5
ba4481b5
DL
4440 if eval "test \"`echo '$''{'emacs_cv_x11_version_6'+set}'`\" = set"; then
4441 echo $ac_n "(cached) $ac_c" 1>&6
4442else
4443 cat > conftest.$ac_ext <<EOF
bb17930d 4444#line 4445 "configure"
ba4481b5
DL
4445#include "confdefs.h"
4446#include <X11/Xlib.h>
4447int main() {
4448#if XlibSpecificationRelease < 6
4449fail;
4450#endif
4451
4452; return 0; }
4453EOF
bb17930d 4454if { (eval echo configure:4455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4455 rm -rf conftest*
4456 emacs_cv_x11_version_6=yes
4457else
4458 echo "configure: failed program was:" >&5
4459 cat conftest.$ac_ext >&5
4460 rm -rf conftest*
4461 emacs_cv_x11_version_6=no
4462fi
4463rm -f conftest*
4464fi
4465
4466 if test $emacs_cv_x11_version_6 = yes; then
4467 echo "$ac_t""6 or newer" 1>&6
4468 cat >> confdefs.h <<\EOF
4469#define HAVE_X11R6 1
4470EOF
4471
4472 else
4473 echo "$ac_t""before 6" 1>&6
4474 fi
4475fi
4476
4477if test "${window_system}" = "x11"; then
4478 echo $ac_n "checking X11 version 5""... $ac_c" 1>&6
bb17930d 4479echo "configure:4480: checking X11 version 5" >&5
ba4481b5
DL
4480 if eval "test \"`echo '$''{'emacs_cv_x11_version_5'+set}'`\" = set"; then
4481 echo $ac_n "(cached) $ac_c" 1>&6
4482else
4483 cat > conftest.$ac_ext <<EOF
bb17930d 4484#line 4485 "configure"
ba4481b5
DL
4485#include "confdefs.h"
4486#include <X11/Xlib.h>
4487int main() {
4488#if XlibSpecificationRelease < 5
4489fail;
4490#endif
4491
4492; return 0; }
4493EOF
bb17930d 4494if { (eval echo configure:4495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4495 rm -rf conftest*
4496 emacs_cv_x11_version_5=yes
4497else
4498 echo "configure: failed program was:" >&5
4499 cat conftest.$ac_ext >&5
4500 rm -rf conftest*
4501 emacs_cv_x11_version_5=no
4502fi
4503rm -f conftest*
4504fi
4505
4506 if test $emacs_cv_x11_version_5 = yes; then
4507 echo "$ac_t""5 or newer" 1>&6
4508 HAVE_X11R5=yes
4509 cat >> confdefs.h <<\EOF
4510#define HAVE_X11R5 1
4511EOF
4512
4513 else
4514 HAVE_X11R5=no
4515 echo "$ac_t""before 5" 1>&6
4516 fi
4517fi
4518
4519if test x"${USE_X_TOOLKIT}" = xmaybe; then
4520 if test x"${HAVE_X11R5}" = xyes; then
4521 echo $ac_n "checking X11 version 5 with Xaw""... $ac_c" 1>&6
bb17930d 4522echo "configure:4523: checking X11 version 5 with Xaw" >&5
ba4481b5
DL
4523 if eval "test \"`echo '$''{'emacs_cv_x11_version_5_with_xaw'+set}'`\" = set"; then
4524 echo $ac_n "(cached) $ac_c" 1>&6
4525else
4526 cat > conftest.$ac_ext <<EOF
bb17930d 4527#line 4528 "configure"
ba4481b5
DL
4528#include "confdefs.h"
4529
4530#include <X11/Intrinsic.h>
4531#include <X11/Xaw/Simple.h>
4532int main() {
4533
4534; return 0; }
4535EOF
bb17930d 4536if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4537 rm -rf conftest*
4538 emacs_cv_x11_version_5_with_xaw=yes
4539else
4540 echo "configure: failed program was:" >&5
4541 cat conftest.$ac_ext >&5
4542 rm -rf conftest*
4543 emacs_cv_x11_version_5_with_xaw=no
4544fi
4545rm -f conftest*
4546fi
4547
4548 if test $emacs_cv_x11_version_5_with_xaw = yes; then
4549 echo "$ac_t""5 or newer, with Xaw; use toolkit by default" 1>&6
4550 USE_X_TOOLKIT=LUCID
4551 else
4552 echo "$ac_t""before 5 or no Xaw; do not use toolkit by default" 1>&6
4553 USE_X_TOOLKIT=none
4554 fi
4555 else
4556 USE_X_TOOLKIT=none
4557 fi
4558fi
4559
4560X_TOOLKIT_TYPE=$USE_X_TOOLKIT
4561
4562if test "${USE_X_TOOLKIT}" != "none"; then
4563 echo $ac_n "checking X11 toolkit version""... $ac_c" 1>&6
bb17930d 4564echo "configure:4565: checking X11 toolkit version" >&5
ba4481b5
DL
4565 if eval "test \"`echo '$''{'emacs_cv_x11_toolkit_version_6'+set}'`\" = set"; then
4566 echo $ac_n "(cached) $ac_c" 1>&6
4567else
4568 cat > conftest.$ac_ext <<EOF
bb17930d 4569#line 4570 "configure"
ba4481b5
DL
4570#include "confdefs.h"
4571#include <X11/Intrinsic.h>
4572int main() {
4573#if XtSpecificationRelease < 6
4574fail;
4575#endif
4576
4577; return 0; }
4578EOF
bb17930d 4579if { (eval echo configure:4580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4580 rm -rf conftest*
4581 emacs_cv_x11_toolkit_version_6=yes
4582else
4583 echo "configure: failed program was:" >&5
4584 cat conftest.$ac_ext >&5
4585 rm -rf conftest*
4586 emacs_cv_x11_toolkit_version_6=no
4587fi
4588rm -f conftest*
4589fi
4590
4591 HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
4592 if test $emacs_cv_x11_toolkit_version_6 = yes; then
4593 echo "$ac_t""6 or newer" 1>&6
4594 cat >> confdefs.h <<\EOF
4595#define HAVE_X11XTR6 1
4596EOF
4597
4598 else
4599 echo "$ac_t""before 6" 1>&6
4600 fi
4601
4602 OLDLIBS="$LIBS"
4603 if test x$HAVE_X11XTR6 = xyes; then
4604 LIBS="-lXt -lSM -lICE $LIBS"
4605 else
4606 LIBS="-lXt $LIBS"
4607 fi
4608 echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6
bb17930d 4609echo "configure:4610: checking for XmuConvertStandardSelection in -lXmu" >&5
ba4481b5
DL
4610ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'`
4611if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4612 echo $ac_n "(cached) $ac_c" 1>&6
4613else
4614 ac_save_LIBS="$LIBS"
4615LIBS="-lXmu $LIBS"
4616cat > conftest.$ac_ext <<EOF
bb17930d 4617#line 4618 "configure"
ba4481b5
DL
4618#include "confdefs.h"
4619/* Override any gcc2 internal prototype to avoid an error. */
4620/* We use char because int might match the return type of a gcc2
4621 builtin and then its argument prototype would still apply. */
4622char XmuConvertStandardSelection();
4623
4624int main() {
4625XmuConvertStandardSelection()
4626; return 0; }
4627EOF
bb17930d 4628if { (eval echo configure:4629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4629 rm -rf conftest*
4630 eval "ac_cv_lib_$ac_lib_var=yes"
4631else
4632 echo "configure: failed program was:" >&5
4633 cat conftest.$ac_ext >&5
4634 rm -rf conftest*
4635 eval "ac_cv_lib_$ac_lib_var=no"
4636fi
4637rm -f conftest*
4638LIBS="$ac_save_LIBS"
4639
4640fi
4641if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4642 echo "$ac_t""yes" 1>&6
4643 ac_tr_lib=HAVE_LIB`echo Xmu | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4644 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4645 cat >> confdefs.h <<EOF
4646#define $ac_tr_lib 1
4647EOF
4648
4649 LIBS="-lXmu $LIBS"
4650
4651else
4652 echo "$ac_t""no" 1>&6
4653fi
4654
4655 LIBS="$OLDLIBS"
4656fi
4657
4658if test "${USE_X_TOOLKIT}" = "MOTIF"; then
4659 echo $ac_n "checking for Motif version 2.1""... $ac_c" 1>&6
bb17930d 4660echo "configure:4661: checking for Motif version 2.1" >&5
ba4481b5
DL
4661if eval "test \"`echo '$''{'emacs_cv_motif_version_2_1'+set}'`\" = set"; then
4662 echo $ac_n "(cached) $ac_c" 1>&6
4663else
4664 cat > conftest.$ac_ext <<EOF
bb17930d 4665#line 4666 "configure"
ba4481b5
DL
4666#include "confdefs.h"
4667#include <Xm/Xm.h>
4668int main() {
4669#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
4670int x = 5;
4671#else
4672Motif version prior to 2.1.
4673#endif
4674; return 0; }
4675EOF
bb17930d 4676if { (eval echo configure:4677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
4677 rm -rf conftest*
4678 emacs_cv_motif_version_2_1=yes
4679else
4680 echo "configure: failed program was:" >&5
4681 cat conftest.$ac_ext >&5
4682 rm -rf conftest*
4683 emacs_cv_motif_version_2_1=no
4684fi
4685rm -f conftest*
4686fi
4687
4688echo "$ac_t""$emacs_cv_motif_version_2_1" 1>&6
4689 HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
4690 if test $emacs_cv_motif_version_2_1 = yes; then
4691 cat >> confdefs.h <<\EOF
4692#define HAVE_MOTIF_2_1 1
4693EOF
4694
4695 echo $ac_n "checking for XpCreateContext in -lXp""... $ac_c" 1>&6
bb17930d 4696echo "configure:4697: checking for XpCreateContext in -lXp" >&5
ba4481b5
DL
4697ac_lib_var=`echo Xp'_'XpCreateContext | sed 'y%./+-%__p_%'`
4698if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4699 echo $ac_n "(cached) $ac_c" 1>&6
4700else
4701 ac_save_LIBS="$LIBS"
48d4b120 4702LIBS="-lXp -lXext $LIBS"
ba4481b5 4703cat > conftest.$ac_ext <<EOF
bb17930d 4704#line 4705 "configure"
ba4481b5
DL
4705#include "confdefs.h"
4706/* Override any gcc2 internal prototype to avoid an error. */
4707/* We use char because int might match the return type of a gcc2
4708 builtin and then its argument prototype would still apply. */
4709char XpCreateContext();
4710
4711int main() {
4712XpCreateContext()
4713; return 0; }
4714EOF
bb17930d 4715if { (eval echo configure:4716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4716 rm -rf conftest*
4717 eval "ac_cv_lib_$ac_lib_var=yes"
4718else
4719 echo "configure: failed program was:" >&5
4720 cat conftest.$ac_ext >&5
4721 rm -rf conftest*
4722 eval "ac_cv_lib_$ac_lib_var=no"
4723fi
4724rm -f conftest*
4725LIBS="$ac_save_LIBS"
4726
4727fi
4728if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4729 echo "$ac_t""yes" 1>&6
48d4b120 4730 HAVE_LIBXP=yes
ba4481b5
DL
4731else
4732 echo "$ac_t""no" 1>&6
4733fi
4734
48d4b120
DL
4735 if test ${HAVE_LIBXP} = yes; then
4736 cat >> confdefs.h <<\EOF
4737#define HAVE_LIBXP 1
4738EOF
4739
4740 fi
ba4481b5
DL
4741 fi
4742fi
4743
4744### Is -lXaw3d available?
4745HAVE_XAW3D=no
4746if test "${HAVE_X11}" = "yes"; then
4747 if test "${USE_X_TOOLKIT}" != "none"; then
4748 old_c_flags="${CFLAGS}"
4749 CFLAGS="${LD_SWITCH_X_SITE}"
4750 ac_safe=`echo "X11/Xaw3d/Scrollbar.h" | sed 'y%./+-%__p_%'`
4751echo $ac_n "checking for X11/Xaw3d/Scrollbar.h""... $ac_c" 1>&6
bb17930d 4752echo "configure:4753: checking for X11/Xaw3d/Scrollbar.h" >&5
ba4481b5
DL
4753if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4754 echo $ac_n "(cached) $ac_c" 1>&6
4755else
4756 cat > conftest.$ac_ext <<EOF
bb17930d 4757#line 4758 "configure"
ba4481b5
DL
4758#include "confdefs.h"
4759#include <X11/Xaw3d/Scrollbar.h>
4760EOF
4761ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 4762{ (eval echo configure:4763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 4763ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
4764if test -z "$ac_err"; then
4765 rm -rf conftest*
4766 eval "ac_cv_header_$ac_safe=yes"
4767else
4768 echo "$ac_err" >&5
4769 echo "configure: failed program was:" >&5
4770 cat conftest.$ac_ext >&5
4771 rm -rf conftest*
4772 eval "ac_cv_header_$ac_safe=no"
4773fi
4774rm -f conftest*
4775fi
4776if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4777 echo "$ac_t""yes" 1>&6
4778 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw3d""... $ac_c" 1>&6
bb17930d 4779echo "configure:4780: checking for XawScrollbarSetThumb in -lXaw3d" >&5
ba4481b5
DL
4780ac_lib_var=`echo Xaw3d'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
4781if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4782 echo $ac_n "(cached) $ac_c" 1>&6
4783else
4784 ac_save_LIBS="$LIBS"
4785LIBS="-lXaw3d -lX11 $LIBS"
4786cat > conftest.$ac_ext <<EOF
bb17930d 4787#line 4788 "configure"
ba4481b5
DL
4788#include "confdefs.h"
4789/* Override any gcc2 internal prototype to avoid an error. */
4790/* We use char because int might match the return type of a gcc2
4791 builtin and then its argument prototype would still apply. */
4792char XawScrollbarSetThumb();
4793
4794int main() {
4795XawScrollbarSetThumb()
4796; return 0; }
4797EOF
bb17930d 4798if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4799 rm -rf conftest*
4800 eval "ac_cv_lib_$ac_lib_var=yes"
4801else
4802 echo "configure: failed program was:" >&5
4803 cat conftest.$ac_ext >&5
4804 rm -rf conftest*
4805 eval "ac_cv_lib_$ac_lib_var=no"
4806fi
4807rm -f conftest*
4808LIBS="$ac_save_LIBS"
4809
4810fi
4811if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4812 echo "$ac_t""yes" 1>&6
4813 HAVE_XAW3D=yes
4814else
4815 echo "$ac_t""no" 1>&6
4816fi
4817
4818else
4819 echo "$ac_t""no" 1>&6
4820fi
4821
4822 CFLAGS="${old_c_flags}"
4823
4824 if test "${HAVE_XAW3D}" = "yes"; then
4825 cat >> confdefs.h <<\EOF
4826#define HAVE_XAW3D 1
4827EOF
4828
4829 fi
4830 fi
4831fi
4832
4833
4834USE_TOOLKIT_SCROLL_BARS=no
4835if test "${with_toolkit_scroll_bars}" != "no"; then
4836 if test "${USE_X_TOOLKIT}" != "none"; then
4837 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
4838 cat >> confdefs.h <<\EOF
4839#define USE_TOOLKIT_SCROLL_BARS 1
4840EOF
4841
4842 HAVE_XAW3D=no
4843 USE_TOOLKIT_SCROLL_BARS=yes
4844 elif test "${HAVE_XAW3D}" = "yes"; then
4845 cat >> confdefs.h <<\EOF
4846#define USE_TOOLKIT_SCROLL_BARS 1
4847EOF
4848
4849 USE_TOOLKIT_SCROLL_BARS=yes
4850 fi
4851 fi
4852fi
4853
1d36487c
GM
4854
4855if test "${with_xim}" != "no"; then
4856 cat >> confdefs.h <<\EOF
4857#define USE_XIM 1
4858EOF
4859
4860fi
4861
ba4481b5
DL
4862### Use -lXpm if available, unless `--with-xpm=no'.
4863HAVE_XPM=no
4864if test "${HAVE_X11}" = "yes"; then
4865 if test "${with_xpm}" != "no"; then
4866 old_c_flags="${CFLAGS}"
4867 CFLAGS="${LD_SWITCH_X_SITE}"
4868 ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
4869echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
bb17930d 4870echo "configure:4871: checking for X11/xpm.h" >&5
ba4481b5
DL
4871if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4872 echo $ac_n "(cached) $ac_c" 1>&6
4873else
4874 cat > conftest.$ac_ext <<EOF
bb17930d 4875#line 4876 "configure"
ba4481b5
DL
4876#include "confdefs.h"
4877#include <X11/xpm.h>
4878EOF
4879ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 4880{ (eval echo configure:4881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 4881ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
4882if test -z "$ac_err"; then
4883 rm -rf conftest*
4884 eval "ac_cv_header_$ac_safe=yes"
4885else
4886 echo "$ac_err" >&5
4887 echo "configure: failed program was:" >&5
4888 cat conftest.$ac_ext >&5
4889 rm -rf conftest*
4890 eval "ac_cv_header_$ac_safe=no"
4891fi
4892rm -f conftest*
4893fi
4894if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4895 echo "$ac_t""yes" 1>&6
4b92c49a 4896 echo $ac_n "checking for XpmReadFileToPixmap in -lXpm""... $ac_c" 1>&6
bb17930d 4897echo "configure:4898: checking for XpmReadFileToPixmap in -lXpm" >&5
4b92c49a 4898ac_lib_var=`echo Xpm'_'XpmReadFileToPixmap | sed 'y%./+-%__p_%'`
ba4481b5
DL
4899if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4900 echo $ac_n "(cached) $ac_c" 1>&6
4901else
4902 ac_save_LIBS="$LIBS"
4903LIBS="-lXpm -lX11 $LIBS"
4904cat > conftest.$ac_ext <<EOF
bb17930d 4905#line 4906 "configure"
ba4481b5
DL
4906#include "confdefs.h"
4907/* Override any gcc2 internal prototype to avoid an error. */
4908/* We use char because int might match the return type of a gcc2
4909 builtin and then its argument prototype would still apply. */
4b92c49a 4910char XpmReadFileToPixmap();
ba4481b5
DL
4911
4912int main() {
4b92c49a 4913XpmReadFileToPixmap()
ba4481b5
DL
4914; return 0; }
4915EOF
bb17930d 4916if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
4917 rm -rf conftest*
4918 eval "ac_cv_lib_$ac_lib_var=yes"
4919else
4920 echo "configure: failed program was:" >&5
4921 cat conftest.$ac_ext >&5
4922 rm -rf conftest*
4923 eval "ac_cv_lib_$ac_lib_var=no"
4924fi
4925rm -f conftest*
4926LIBS="$ac_save_LIBS"
4927
4928fi
4929if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4930 echo "$ac_t""yes" 1>&6
4931 HAVE_XPM=yes
4932else
4933 echo "$ac_t""no" 1>&6
4934fi
4935
4936else
4937 echo "$ac_t""no" 1>&6
4938fi
4939
4b92c49a
GM
4940 if test "${HAVE_XPM}" = "yes"; then
4941 cat > conftest.$ac_ext <<EOF
bb17930d 4942#line 4943 "configure"
4b92c49a
GM
4943#include "confdefs.h"
4944#include "X11/xpm.h"
4945#ifndef XpmReturnAllocPixels
4946no_return_alloc_pixels
4947#endif
4948
4949EOF
4950if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4951 egrep "no_return_alloc_pixels" >/dev/null 2>&1; then
4952 rm -rf conftest*
4953 HAVE_XPM=no
4954else
4955 rm -rf conftest*
4956 HAVE_XPM=yes
4957fi
4958rm -f conftest*
4959
4960 fi
ba4481b5
DL
4961 CFLAGS="${old_c_flags}"
4962 fi
4963
4964 if test "${HAVE_XPM}" = "yes"; then
4965 cat >> confdefs.h <<\EOF
4966#define HAVE_XPM 1
4967EOF
4968
4969 fi
4970fi
4971
4972### Use -ljpeg if available, unless `--with-jpeg=no'.
4973HAVE_JPEG=no
4974if test "${HAVE_X11}" = "yes"; then
4975 if test "${with_jpeg}" != "no"; then
4976 old_c_flags="${CFLAGS}"
4977 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
ffe36136
GM
4978 ac_safe=`echo "jerror.h" | sed 'y%./+-%__p_%'`
4979echo $ac_n "checking for jerror.h""... $ac_c" 1>&6
bb17930d 4980echo "configure:4981: checking for jerror.h" >&5
ffe36136
GM
4981if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4982 echo $ac_n "(cached) $ac_c" 1>&6
4983else
4984 cat > conftest.$ac_ext <<EOF
bb17930d 4985#line 4986 "configure"
ffe36136
GM
4986#include "confdefs.h"
4987#include <jerror.h>
4988EOF
4989ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 4990{ (eval echo configure:4991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ffe36136
GM
4991ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4992if test -z "$ac_err"; then
4993 rm -rf conftest*
4994 eval "ac_cv_header_$ac_safe=yes"
4995else
4996 echo "$ac_err" >&5
4997 echo "configure: failed program was:" >&5
4998 cat conftest.$ac_ext >&5
4999 rm -rf conftest*
5000 eval "ac_cv_header_$ac_safe=no"
5001fi
5002rm -f conftest*
5003fi
5004if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5005 echo "$ac_t""yes" 1>&6
5006 echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6
bb17930d 5007echo "configure:5008: checking for jpeg_destroy_compress in -ljpeg" >&5
ba4481b5
DL
5008ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'`
5009if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5010 echo $ac_n "(cached) $ac_c" 1>&6
5011else
5012 ac_save_LIBS="$LIBS"
5013LIBS="-ljpeg -lX11 $LIBS"
5014cat > conftest.$ac_ext <<EOF
bb17930d 5015#line 5016 "configure"
ba4481b5
DL
5016#include "confdefs.h"
5017/* Override any gcc2 internal prototype to avoid an error. */
5018/* We use char because int might match the return type of a gcc2
5019 builtin and then its argument prototype would still apply. */
5020char jpeg_destroy_compress();
5021
5022int main() {
5023jpeg_destroy_compress()
5024; return 0; }
5025EOF
bb17930d 5026if { (eval echo configure:5027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5027 rm -rf conftest*
5028 eval "ac_cv_lib_$ac_lib_var=yes"
5029else
5030 echo "configure: failed program was:" >&5
5031 cat conftest.$ac_ext >&5
5032 rm -rf conftest*
5033 eval "ac_cv_lib_$ac_lib_var=no"
5034fi
5035rm -f conftest*
5036LIBS="$ac_save_LIBS"
5037
5038fi
5039if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5040 echo "$ac_t""yes" 1>&6
5041 HAVE_JPEG=yes
ffe36136
GM
5042else
5043 echo "$ac_t""no" 1>&6
5044fi
5045
ba4481b5
DL
5046else
5047 echo "$ac_t""no" 1>&6
5048fi
5049
5050 CFLAGS="${old_c_flags}"
5051 fi
5052
5053 if test "${HAVE_JPEG}" = "yes"; then
5054 cat >> confdefs.h <<\EOF
5055#define HAVE_JPEG 1
5056EOF
5057
5058 fi
5059fi
5060
5061### Use -lpng if available, unless `--with-png=no'.
5062HAVE_PNG=no
5063if test "${HAVE_X11}" = "yes"; then
5064 if test "${with_png}" != "no"; then
5065 old_c_flags="${CFLAGS}"
5066 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
5067 ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
5068echo $ac_n "checking for png.h""... $ac_c" 1>&6
bb17930d 5069echo "configure:5070: checking for png.h" >&5
ba4481b5
DL
5070if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5071 echo $ac_n "(cached) $ac_c" 1>&6
5072else
5073 cat > conftest.$ac_ext <<EOF
bb17930d 5074#line 5075 "configure"
ba4481b5
DL
5075#include "confdefs.h"
5076#include <png.h>
5077EOF
5078ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 5079{ (eval echo configure:5080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 5080ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
5081if test -z "$ac_err"; then
5082 rm -rf conftest*
5083 eval "ac_cv_header_$ac_safe=yes"
5084else
5085 echo "$ac_err" >&5
5086 echo "configure: failed program was:" >&5
5087 cat conftest.$ac_ext >&5
5088 rm -rf conftest*
5089 eval "ac_cv_header_$ac_safe=no"
5090fi
5091rm -f conftest*
5092fi
5093if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5094 echo "$ac_t""yes" 1>&6
5095 echo $ac_n "checking for png_set_expand in -lpng""... $ac_c" 1>&6
bb17930d 5096echo "configure:5097: checking for png_set_expand in -lpng" >&5
ba4481b5
DL
5097ac_lib_var=`echo png'_'png_set_expand | sed 'y%./+-%__p_%'`
5098if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5099 echo $ac_n "(cached) $ac_c" 1>&6
5100else
5101 ac_save_LIBS="$LIBS"
5102LIBS="-lpng -lX11 -lz -lm $LIBS"
5103cat > conftest.$ac_ext <<EOF
bb17930d 5104#line 5105 "configure"
ba4481b5
DL
5105#include "confdefs.h"
5106/* Override any gcc2 internal prototype to avoid an error. */
5107/* We use char because int might match the return type of a gcc2
5108 builtin and then its argument prototype would still apply. */
5109char png_set_expand();
5110
5111int main() {
5112png_set_expand()
5113; return 0; }
5114EOF
bb17930d 5115if { (eval echo configure:5116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5116 rm -rf conftest*
5117 eval "ac_cv_lib_$ac_lib_var=yes"
5118else
5119 echo "configure: failed program was:" >&5
5120 cat conftest.$ac_ext >&5
5121 rm -rf conftest*
5122 eval "ac_cv_lib_$ac_lib_var=no"
5123fi
5124rm -f conftest*
5125LIBS="$ac_save_LIBS"
5126
5127fi
5128if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5129 echo "$ac_t""yes" 1>&6
5130 HAVE_PNG=yes
5131else
5132 echo "$ac_t""no" 1>&6
5133fi
5134
5135else
5136 echo "$ac_t""no" 1>&6
5137fi
5138
5139 CFLAGS="${old_c_flags}"
5140 fi
5141
5142 if test "${HAVE_PNG}" = "yes"; then
5143 cat >> confdefs.h <<\EOF
5144#define HAVE_PNG 1
5145EOF
5146
5147 fi
5148fi
5149
5150### Use -ltiff if available, unless `--with-tiff=no'.
5151HAVE_TIFF=no
5152if test "${HAVE_X11}" = "yes"; then
5153 if test "${with_tiff}" != "no"; then
5154 old_c_flags="${CFLAGS}"
5155 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
5156 ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
5157echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
bb17930d 5158echo "configure:5159: checking for tiffio.h" >&5
ba4481b5
DL
5159if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5160 echo $ac_n "(cached) $ac_c" 1>&6
5161else
5162 cat > conftest.$ac_ext <<EOF
bb17930d 5163#line 5164 "configure"
ba4481b5
DL
5164#include "confdefs.h"
5165#include <tiffio.h>
5166EOF
5167ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 5168{ (eval echo configure:5169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 5169ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
5170if test -z "$ac_err"; then
5171 rm -rf conftest*
5172 eval "ac_cv_header_$ac_safe=yes"
5173else
5174 echo "$ac_err" >&5
5175 echo "configure: failed program was:" >&5
5176 cat conftest.$ac_ext >&5
5177 rm -rf conftest*
5178 eval "ac_cv_header_$ac_safe=no"
5179fi
5180rm -f conftest*
5181fi
5182if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5183 echo "$ac_t""yes" 1>&6
3b3cc4a4
KR
5184 tifflibs="-lX11 -lz -lm"
5185 # At least one tiff package requires the jpeg library.
5186 if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
5187 echo $ac_n "checking for TIFFGetVersion in -ltiff""... $ac_c" 1>&6
bb17930d 5188echo "configure:5189: checking for TIFFGetVersion in -ltiff" >&5
ba4481b5
DL
5189ac_lib_var=`echo tiff'_'TIFFGetVersion | sed 'y%./+-%__p_%'`
5190if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5191 echo $ac_n "(cached) $ac_c" 1>&6
5192else
5193 ac_save_LIBS="$LIBS"
3b3cc4a4 5194LIBS="-ltiff $tifflibs $LIBS"
ba4481b5 5195cat > conftest.$ac_ext <<EOF
bb17930d 5196#line 5197 "configure"
ba4481b5
DL
5197#include "confdefs.h"
5198/* Override any gcc2 internal prototype to avoid an error. */
5199/* We use char because int might match the return type of a gcc2
5200 builtin and then its argument prototype would still apply. */
5201char TIFFGetVersion();
5202
5203int main() {
5204TIFFGetVersion()
5205; return 0; }
5206EOF
bb17930d 5207if { (eval echo configure:5208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5208 rm -rf conftest*
5209 eval "ac_cv_lib_$ac_lib_var=yes"
5210else
5211 echo "configure: failed program was:" >&5
5212 cat conftest.$ac_ext >&5
5213 rm -rf conftest*
5214 eval "ac_cv_lib_$ac_lib_var=no"
5215fi
5216rm -f conftest*
5217LIBS="$ac_save_LIBS"
5218
5219fi
5220if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5221 echo "$ac_t""yes" 1>&6
5222 HAVE_TIFF=yes
5223else
5224 echo "$ac_t""no" 1>&6
5225fi
5226
5227else
5228 echo "$ac_t""no" 1>&6
5229fi
5230
5231 CFLAGS="${old_c_flags}"
5232 fi
5233
5234 if test "${HAVE_TIFF}" = "yes"; then
5235 cat >> confdefs.h <<\EOF
5236#define HAVE_TIFF 1
5237EOF
5238
5239 fi
5240fi
5241
5242### Use -lgif if available, unless `--with-gif=no'.
5243HAVE_GIF=no
5244if test "${HAVE_X11}" = "yes"; then
5245 if test "${with_gif}" != "no"; then
5246 old_c_flags="${CFLAGS}"
5247 CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
5248 ac_safe=`echo "gif_lib.h" | sed 'y%./+-%__p_%'`
5249echo $ac_n "checking for gif_lib.h""... $ac_c" 1>&6
bb17930d 5250echo "configure:5251: checking for gif_lib.h" >&5
ba4481b5
DL
5251if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5252 echo $ac_n "(cached) $ac_c" 1>&6
5253else
5254 cat > conftest.$ac_ext <<EOF
bb17930d 5255#line 5256 "configure"
ba4481b5
DL
5256#include "confdefs.h"
5257#include <gif_lib.h>
5258EOF
5259ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 5260{ (eval echo configure:5261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 5261ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
5262if test -z "$ac_err"; then
5263 rm -rf conftest*
5264 eval "ac_cv_header_$ac_safe=yes"
5265else
5266 echo "$ac_err" >&5
5267 echo "configure: failed program was:" >&5
5268 cat conftest.$ac_ext >&5
5269 rm -rf conftest*
5270 eval "ac_cv_header_$ac_safe=no"
5271fi
5272rm -f conftest*
5273fi
5274if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5275 echo "$ac_t""yes" 1>&6
ffe36136 5276 echo $ac_n "checking for DGifOpen in -lungif""... $ac_c" 1>&6
bb17930d 5277echo "configure:5278: checking for DGifOpen in -lungif" >&5
ffe36136 5278ac_lib_var=`echo ungif'_'DGifOpen | sed 'y%./+-%__p_%'`
ba4481b5
DL
5279if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5280 echo $ac_n "(cached) $ac_c" 1>&6
5281else
5282 ac_save_LIBS="$LIBS"
5283LIBS="-lungif -lX11 $LIBS"
5284cat > conftest.$ac_ext <<EOF
bb17930d 5285#line 5286 "configure"
ba4481b5
DL
5286#include "confdefs.h"
5287/* Override any gcc2 internal prototype to avoid an error. */
5288/* We use char because int might match the return type of a gcc2
5289 builtin and then its argument prototype would still apply. */
ffe36136 5290char DGifOpen();
ba4481b5
DL
5291
5292int main() {
ffe36136 5293DGifOpen()
ba4481b5
DL
5294; return 0; }
5295EOF
bb17930d 5296if { (eval echo configure:5297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5297 rm -rf conftest*
5298 eval "ac_cv_lib_$ac_lib_var=yes"
5299else
5300 echo "configure: failed program was:" >&5
5301 cat conftest.$ac_ext >&5
5302 rm -rf conftest*
5303 eval "ac_cv_lib_$ac_lib_var=no"
5304fi
5305rm -f conftest*
5306LIBS="$ac_save_LIBS"
5307
5308fi
5309if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5310 echo "$ac_t""yes" 1>&6
5311 HAVE_GIF=yes
5312else
5313 echo "$ac_t""no" 1>&6
5314fi
5315
5316else
5317 echo "$ac_t""no" 1>&6
5318fi
5319
5320 CFLAGS="${old_c_flags}"
5321 fi
5322
5323 if test "${HAVE_GIF}" = "yes"; then
5324 cat >> confdefs.h <<\EOF
5325#define HAVE_GIF 1
5326EOF
5327
5328 fi
5329fi
5330
5331# If netdb.h doesn't declare h_errno, we must declare it by hand.
5332echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
bb17930d 5333echo "configure:5334: checking whether netdb declares h_errno" >&5
ba4481b5
DL
5334if eval "test \"`echo '$''{'emacs_cv_netdb_declares_h_errno'+set}'`\" = set"; then
5335 echo $ac_n "(cached) $ac_c" 1>&6
5336else
5337 cat > conftest.$ac_ext <<EOF
bb17930d 5338#line 5339 "configure"
ba4481b5
DL
5339#include "confdefs.h"
5340#include <netdb.h>
5341int main() {
5342return h_errno;
5343; return 0; }
5344EOF
bb17930d 5345if { (eval echo configure:5346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5346 rm -rf conftest*
5347 emacs_cv_netdb_declares_h_errno=yes
5348else
5349 echo "configure: failed program was:" >&5
5350 cat conftest.$ac_ext >&5
5351 rm -rf conftest*
5352 emacs_cv_netdb_declares_h_errno=no
5353fi
5354rm -f conftest*
5355fi
5356
5357echo "$ac_t""$emacs_cv_netdb_declares_h_errno" 1>&6
5358if test $emacs_cv_netdb_declares_h_errno = yes; then
5359 cat >> confdefs.h <<\EOF
5360#define HAVE_H_ERRNO 1
5361EOF
5362
5363fi
5364
5365# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
5366# for constant arguments. Useless!
5367echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
bb17930d 5368echo "configure:5369: checking for working alloca.h" >&5
ba4481b5
DL
5369if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
5370 echo $ac_n "(cached) $ac_c" 1>&6
5371else
5372 cat > conftest.$ac_ext <<EOF
bb17930d 5373#line 5374 "configure"
ba4481b5
DL
5374#include "confdefs.h"
5375#include <alloca.h>
5376int main() {
f4988be7 5377char *p = alloca(2 * sizeof(int));
ba4481b5
DL
5378; return 0; }
5379EOF
bb17930d 5380if { (eval echo configure:5381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5381 rm -rf conftest*
5382 ac_cv_header_alloca_h=yes
5383else
5384 echo "configure: failed program was:" >&5
5385 cat conftest.$ac_ext >&5
5386 rm -rf conftest*
5387 ac_cv_header_alloca_h=no
5388fi
5389rm -f conftest*
5390fi
5391
5392echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
5393if test $ac_cv_header_alloca_h = yes; then
5394 cat >> confdefs.h <<\EOF
5395#define HAVE_ALLOCA_H 1
5396EOF
5397
5398fi
5399
5400echo $ac_n "checking for alloca""... $ac_c" 1>&6
bb17930d 5401echo "configure:5402: checking for alloca" >&5
ba4481b5
DL
5402if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
5403 echo $ac_n "(cached) $ac_c" 1>&6
5404else
5405 cat > conftest.$ac_ext <<EOF
bb17930d 5406#line 5407 "configure"
ba4481b5
DL
5407#include "confdefs.h"
5408
5409#ifdef __GNUC__
5410# define alloca __builtin_alloca
5411#else
c4bb2108
DL
5412# ifdef _MSC_VER
5413# include <malloc.h>
5414# define alloca _alloca
ba4481b5 5415# else
c4bb2108
DL
5416# if HAVE_ALLOCA_H
5417# include <alloca.h>
22afa6e8 5418# else
c4bb2108
DL
5419# ifdef _AIX
5420 #pragma alloca
5421# else
5422# ifndef alloca /* predefined by HP cc +Olibcalls */
ba4481b5 5423char *alloca ();
c4bb2108 5424# endif
ba4481b5
DL
5425# endif
5426# endif
5427# endif
5428#endif
5429
5430int main() {
5431char *p = (char *) alloca(1);
5432; return 0; }
5433EOF
bb17930d 5434if { (eval echo configure:5435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5435 rm -rf conftest*
5436 ac_cv_func_alloca_works=yes
5437else
5438 echo "configure: failed program was:" >&5
5439 cat conftest.$ac_ext >&5
5440 rm -rf conftest*
5441 ac_cv_func_alloca_works=no
5442fi
5443rm -f conftest*
5444fi
5445
5446echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
5447if test $ac_cv_func_alloca_works = yes; then
5448 cat >> confdefs.h <<\EOF
5449#define HAVE_ALLOCA 1
5450EOF
5451
5452fi
5453
5454if test $ac_cv_func_alloca_works = no; then
5455 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
5456 # that cause trouble. Some versions do not even contain alloca or
5457 # contain a buggy version. If you still want to use their alloca,
5458 # use ar to extract alloca.o from them instead of compiling alloca.c.
c4bb2108 5459 ALLOCA=alloca.${ac_objext}
ba4481b5
DL
5460 cat >> confdefs.h <<\EOF
5461#define C_ALLOCA 1
5462EOF
5463
5464
5465echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
bb17930d 5466echo "configure:5467: checking whether alloca needs Cray hooks" >&5
ba4481b5
DL
5467if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
5468 echo $ac_n "(cached) $ac_c" 1>&6
5469else
5470 cat > conftest.$ac_ext <<EOF
bb17930d 5471#line 5472 "configure"
ba4481b5
DL
5472#include "confdefs.h"
5473#if defined(CRAY) && ! defined(CRAY2)
5474webecray
5475#else
5476wenotbecray
5477#endif
5478
5479EOF
5480if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5481 egrep "webecray" >/dev/null 2>&1; then
5482 rm -rf conftest*
5483 ac_cv_os_cray=yes
5484else
5485 rm -rf conftest*
5486 ac_cv_os_cray=no
5487fi
5488rm -f conftest*
5489
5490fi
5491
5492echo "$ac_t""$ac_cv_os_cray" 1>&6
5493if test $ac_cv_os_cray = yes; then
5494for ac_func in _getb67 GETB67 getb67; do
5495 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 5496echo "configure:5497: checking for $ac_func" >&5
ba4481b5
DL
5497if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5498 echo $ac_n "(cached) $ac_c" 1>&6
5499else
5500 cat > conftest.$ac_ext <<EOF
bb17930d 5501#line 5502 "configure"
ba4481b5
DL
5502#include "confdefs.h"
5503/* System header to define __stub macros and hopefully few prototypes,
5504 which can conflict with char $ac_func(); below. */
5505#include <assert.h>
5506/* Override any gcc2 internal prototype to avoid an error. */
5507/* We use char because int might match the return type of a gcc2
5508 builtin and then its argument prototype would still apply. */
5509char $ac_func();
5510
5511int main() {
5512
5513/* The GNU C library defines this for functions which it implements
5514 to always fail with ENOSYS. Some functions are actually named
5515 something starting with __ and the normal name is an alias. */
5516#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5517choke me
5518#else
a21616bd 5519$ac_func();
ba4481b5
DL
5520#endif
5521
5522; return 0; }
5523EOF
bb17930d 5524if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5525 rm -rf conftest*
5526 eval "ac_cv_func_$ac_func=yes"
5527else
5528 echo "configure: failed program was:" >&5
5529 cat conftest.$ac_ext >&5
5530 rm -rf conftest*
5531 eval "ac_cv_func_$ac_func=no"
5532fi
5533rm -f conftest*
5534fi
5535
5536if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5537 echo "$ac_t""yes" 1>&6
5538 cat >> confdefs.h <<EOF
5539#define CRAY_STACKSEG_END $ac_func
5540EOF
5541
5542 break
5543else
5544 echo "$ac_t""no" 1>&6
5545fi
5546
5547done
5548fi
5549
5550echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
bb17930d 5551echo "configure:5552: checking stack direction for C alloca" >&5
ba4481b5
DL
5552if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
5553 echo $ac_n "(cached) $ac_c" 1>&6
5554else
5555 if test "$cross_compiling" = yes; then
5556 ac_cv_c_stack_direction=0
5557else
5558 cat > conftest.$ac_ext <<EOF
bb17930d 5559#line 5560 "configure"
ba4481b5
DL
5560#include "confdefs.h"
5561find_stack_direction ()
5562{
5563 static char *addr = 0;
5564 auto char dummy;
5565 if (addr == 0)
5566 {
5567 addr = &dummy;
5568 return find_stack_direction ();
5569 }
5570 else
5571 return (&dummy > addr) ? 1 : -1;
5572}
5573main ()
5574{
5575 exit (find_stack_direction() < 0);
5576}
5577EOF
bb17930d 5578if { (eval echo configure:5579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
ba4481b5
DL
5579then
5580 ac_cv_c_stack_direction=1
5581else
5582 echo "configure: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584 rm -fr conftest*
5585 ac_cv_c_stack_direction=-1
5586fi
5587rm -fr conftest*
5588fi
5589
5590fi
5591
5592echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
5593cat >> confdefs.h <<EOF
5594#define STACK_DIRECTION $ac_cv_c_stack_direction
5595EOF
5596
5597fi
5598
5599
5600# fmod, logb, and frexp are found in -lm on most systems.
5601# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
5602echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
bb17930d 5603echo "configure:5604: checking for sqrt in -lm" >&5
ba4481b5
DL
5604ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
5605if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5606 echo $ac_n "(cached) $ac_c" 1>&6
5607else
5608 ac_save_LIBS="$LIBS"
5609LIBS="-lm $LIBS"
5610cat > conftest.$ac_ext <<EOF
bb17930d 5611#line 5612 "configure"
ba4481b5
DL
5612#include "confdefs.h"
5613/* Override any gcc2 internal prototype to avoid an error. */
5614/* We use char because int might match the return type of a gcc2
5615 builtin and then its argument prototype would still apply. */
5616char sqrt();
5617
5618int main() {
5619sqrt()
5620; return 0; }
5621EOF
bb17930d 5622if { (eval echo configure:5623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5623 rm -rf conftest*
5624 eval "ac_cv_lib_$ac_lib_var=yes"
5625else
5626 echo "configure: failed program was:" >&5
5627 cat conftest.$ac_ext >&5
5628 rm -rf conftest*
5629 eval "ac_cv_lib_$ac_lib_var=no"
5630fi
5631rm -f conftest*
5632LIBS="$ac_save_LIBS"
5633
5634fi
5635if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5636 echo "$ac_t""yes" 1>&6
5637 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5638 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5639 cat >> confdefs.h <<EOF
5640#define $ac_tr_lib 1
5641EOF
5642
5643 LIBS="-lm $LIBS"
5644
5645else
5646 echo "$ac_t""no" 1>&6
5647fi
5648
5649
5650# Check for mail-locking functions in a "mail" library
5651echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6
bb17930d 5652echo "configure:5653: checking for maillock in -lmail" >&5
ba4481b5
DL
5653ac_lib_var=`echo mail'_'maillock | sed 'y%./+-%__p_%'`
5654if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5655 echo $ac_n "(cached) $ac_c" 1>&6
5656else
5657 ac_save_LIBS="$LIBS"
5658LIBS="-lmail $LIBS"
5659cat > conftest.$ac_ext <<EOF
bb17930d 5660#line 5661 "configure"
ba4481b5
DL
5661#include "confdefs.h"
5662/* Override any gcc2 internal prototype to avoid an error. */
5663/* We use char because int might match the return type of a gcc2
5664 builtin and then its argument prototype would still apply. */
5665char maillock();
5666
5667int main() {
5668maillock()
5669; return 0; }
5670EOF
bb17930d 5671if { (eval echo configure:5672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5672 rm -rf conftest*
5673 eval "ac_cv_lib_$ac_lib_var=yes"
5674else
5675 echo "configure: failed program was:" >&5
5676 cat conftest.$ac_ext >&5
5677 rm -rf conftest*
5678 eval "ac_cv_lib_$ac_lib_var=no"
5679fi
5680rm -f conftest*
5681LIBS="$ac_save_LIBS"
5682
5683fi
5684if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5685 echo "$ac_t""yes" 1>&6
5686 ac_tr_lib=HAVE_LIB`echo mail | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5687 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5688 cat >> confdefs.h <<EOF
5689#define $ac_tr_lib 1
5690EOF
5691
5692 LIBS="-lmail $LIBS"
5693
5694else
5695 echo "$ac_t""no" 1>&6
5696fi
5697
5698echo $ac_n "checking for maillock in -llockfile""... $ac_c" 1>&6
bb17930d 5699echo "configure:5700: checking for maillock in -llockfile" >&5
ba4481b5
DL
5700ac_lib_var=`echo lockfile'_'maillock | sed 'y%./+-%__p_%'`
5701if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5702 echo $ac_n "(cached) $ac_c" 1>&6
5703else
5704 ac_save_LIBS="$LIBS"
5705LIBS="-llockfile $LIBS"
5706cat > conftest.$ac_ext <<EOF
bb17930d 5707#line 5708 "configure"
ba4481b5
DL
5708#include "confdefs.h"
5709/* Override any gcc2 internal prototype to avoid an error. */
5710/* We use char because int might match the return type of a gcc2
5711 builtin and then its argument prototype would still apply. */
5712char maillock();
5713
5714int main() {
5715maillock()
5716; return 0; }
5717EOF
bb17930d 5718if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5719 rm -rf conftest*
5720 eval "ac_cv_lib_$ac_lib_var=yes"
5721else
5722 echo "configure: failed program was:" >&5
5723 cat conftest.$ac_ext >&5
5724 rm -rf conftest*
5725 eval "ac_cv_lib_$ac_lib_var=no"
5726fi
5727rm -f conftest*
5728LIBS="$ac_save_LIBS"
5729
5730fi
5731if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5732 echo "$ac_t""yes" 1>&6
5733 ac_tr_lib=HAVE_LIB`echo lockfile | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5734 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5735 cat >> confdefs.h <<EOF
5736#define $ac_tr_lib 1
5737EOF
5738
5739 LIBS="-llockfile $LIBS"
5740
5741else
5742 echo "$ac_t""no" 1>&6
5743fi
5744
5745# If we have the shared liblockfile, assume we must use it for mail
5746# locking (e.g. Debian). If we couldn't link against liblockfile
5747# (no liblockfile.a installed), ensure that we don't need to.
5748if test "$ac_cv_lib_lockfile_maillock" = no; then
5749 # Extract the first word of "liblockfile.so", so it can be a program name with args.
5750set dummy liblockfile.so; ac_word=$2
5751echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
bb17930d 5752echo "configure:5753: checking for $ac_word" >&5
ba4481b5
DL
5753if eval "test \"`echo '$''{'ac_cv_prog_liblockfile'+set}'`\" = set"; then
5754 echo $ac_n "(cached) $ac_c" 1>&6
5755else
5756 if test -n "$liblockfile"; then
5757 ac_cv_prog_liblockfile="$liblockfile" # Let the user override the test.
5758else
c4bb2108
DL
5759 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
5760 ac_dummy="/usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH"
5761 for ac_dir in $ac_dummy; do
ba4481b5
DL
5762 test -z "$ac_dir" && ac_dir=.
5763 if test -f $ac_dir/$ac_word; then
5764 ac_cv_prog_liblockfile="yes"
5765 break
5766 fi
5767 done
5768 IFS="$ac_save_ifs"
5769 test -z "$ac_cv_prog_liblockfile" && ac_cv_prog_liblockfile="no"
5770fi
5771fi
5772liblockfile="$ac_cv_prog_liblockfile"
5773if test -n "$liblockfile"; then
5774 echo "$ac_t""$liblockfile" 1>&6
5775else
5776 echo "$ac_t""no" 1>&6
5777fi
5778
5779 if test $ac_cv_prog_liblockfile = yes; then
5780 { echo "configure: error: Shared liblockfile found but can't link against it.
5781This probably means that movemail could lose mail.
5782There may be a \`development' package to install containing liblockfile." 1>&2; exit 1; }
5783 else cat >> confdefs.h <<\EOF
5784#define LIBMAIL -llockfile
5785EOF
5786
5787 fi
5788 else :
5789fi
5790for ac_func in touchlock
5791do
5792echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 5793echo "configure:5794: checking for $ac_func" >&5
ba4481b5
DL
5794if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5795 echo $ac_n "(cached) $ac_c" 1>&6
5796else
5797 cat > conftest.$ac_ext <<EOF
bb17930d 5798#line 5799 "configure"
ba4481b5
DL
5799#include "confdefs.h"
5800/* System header to define __stub macros and hopefully few prototypes,
5801 which can conflict with char $ac_func(); below. */
5802#include <assert.h>
5803/* Override any gcc2 internal prototype to avoid an error. */
5804/* We use char because int might match the return type of a gcc2
5805 builtin and then its argument prototype would still apply. */
5806char $ac_func();
5807
5808int main() {
5809
5810/* The GNU C library defines this for functions which it implements
5811 to always fail with ENOSYS. Some functions are actually named
5812 something starting with __ and the normal name is an alias. */
5813#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5814choke me
5815#else
a21616bd 5816$ac_func();
ba4481b5
DL
5817#endif
5818
5819; return 0; }
5820EOF
bb17930d 5821if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5822 rm -rf conftest*
5823 eval "ac_cv_func_$ac_func=yes"
5824else
5825 echo "configure: failed program was:" >&5
5826 cat conftest.$ac_ext >&5
5827 rm -rf conftest*
5828 eval "ac_cv_func_$ac_func=no"
5829fi
5830rm -f conftest*
5831fi
5832
5833if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5834 echo "$ac_t""yes" 1>&6
5835 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5836 cat >> confdefs.h <<EOF
5837#define $ac_tr_func 1
5838EOF
5839
5840else
5841 echo "$ac_t""no" 1>&6
5842fi
5843done
5844
5845for ac_hdr in maillock.h
5846do
5847ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5848echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 5849echo "configure:5850: checking for $ac_hdr" >&5
ba4481b5
DL
5850if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5851 echo $ac_n "(cached) $ac_c" 1>&6
5852else
5853 cat > conftest.$ac_ext <<EOF
bb17930d 5854#line 5855 "configure"
ba4481b5
DL
5855#include "confdefs.h"
5856#include <$ac_hdr>
5857EOF
5858ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 5859{ (eval echo configure:5860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 5860ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
5861if test -z "$ac_err"; then
5862 rm -rf conftest*
5863 eval "ac_cv_header_$ac_safe=yes"
5864else
5865 echo "$ac_err" >&5
5866 echo "configure: failed program was:" >&5
5867 cat conftest.$ac_ext >&5
5868 rm -rf conftest*
5869 eval "ac_cv_header_$ac_safe=no"
5870fi
5871rm -f conftest*
5872fi
5873if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5874 echo "$ac_t""yes" 1>&6
5875 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5876 cat >> confdefs.h <<EOF
5877#define $ac_tr_hdr 1
5878EOF
5879
5880else
5881 echo "$ac_t""no" 1>&6
5882fi
5883done
5884
5885
48d4b120 5886for ac_func in gethostname getdomainname dup2 \
ba4481b5
DL
5887rename closedir mkdir rmdir sysinfo \
5888random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
5889strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
a3f08d9e 5890utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
bb17930d 5891__fpending mblen mbrlen strsignal setitimer ualarm index rindex
ba4481b5
DL
5892do
5893echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 5894echo "configure:5895: checking for $ac_func" >&5
ba4481b5
DL
5895if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5896 echo $ac_n "(cached) $ac_c" 1>&6
5897else
5898 cat > conftest.$ac_ext <<EOF
bb17930d 5899#line 5900 "configure"
ba4481b5
DL
5900#include "confdefs.h"
5901/* System header to define __stub macros and hopefully few prototypes,
5902 which can conflict with char $ac_func(); below. */
5903#include <assert.h>
5904/* Override any gcc2 internal prototype to avoid an error. */
5905/* We use char because int might match the return type of a gcc2
5906 builtin and then its argument prototype would still apply. */
5907char $ac_func();
5908
5909int main() {
5910
5911/* The GNU C library defines this for functions which it implements
5912 to always fail with ENOSYS. Some functions are actually named
5913 something starting with __ and the normal name is an alias. */
5914#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5915choke me
5916#else
a21616bd 5917$ac_func();
ba4481b5
DL
5918#endif
5919
5920; return 0; }
5921EOF
bb17930d 5922if { (eval echo configure:5923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
5923 rm -rf conftest*
5924 eval "ac_cv_func_$ac_func=yes"
5925else
5926 echo "configure: failed program was:" >&5
5927 cat conftest.$ac_ext >&5
5928 rm -rf conftest*
5929 eval "ac_cv_func_$ac_func=no"
5930fi
5931rm -f conftest*
5932fi
5933
5934if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5935 echo "$ac_t""yes" 1>&6
5936 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5937 cat >> confdefs.h <<EOF
5938#define $ac_tr_func 1
5939EOF
5940
5941else
5942 echo "$ac_t""no" 1>&6
5943fi
5944done
5945
5946
b5de8dc0
DL
5947for ac_hdr in sys/time.h unistd.h
5948do
5949ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5950echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 5951echo "configure:5952: checking for $ac_hdr" >&5
b5de8dc0
DL
5952if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5953 echo $ac_n "(cached) $ac_c" 1>&6
5954else
5955 cat > conftest.$ac_ext <<EOF
bb17930d 5956#line 5957 "configure"
b5de8dc0
DL
5957#include "confdefs.h"
5958#include <$ac_hdr>
5959EOF
5960ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 5961{ (eval echo configure:5962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
b5de8dc0
DL
5962ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5963if test -z "$ac_err"; then
5964 rm -rf conftest*
5965 eval "ac_cv_header_$ac_safe=yes"
5966else
5967 echo "$ac_err" >&5
5968 echo "configure: failed program was:" >&5
5969 cat conftest.$ac_ext >&5
5970 rm -rf conftest*
5971 eval "ac_cv_header_$ac_safe=no"
5972fi
5973rm -f conftest*
5974fi
5975if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5976 echo "$ac_t""yes" 1>&6
5977 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5978 cat >> confdefs.h <<EOF
5979#define $ac_tr_hdr 1
5980EOF
5981
5982else
5983 echo "$ac_t""no" 1>&6
5984fi
5985done
5986
5987for ac_func in alarm
5988do
5989echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 5990echo "configure:5991: checking for $ac_func" >&5
b5de8dc0
DL
5991if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5992 echo $ac_n "(cached) $ac_c" 1>&6
5993else
5994 cat > conftest.$ac_ext <<EOF
bb17930d 5995#line 5996 "configure"
b5de8dc0
DL
5996#include "confdefs.h"
5997/* System header to define __stub macros and hopefully few prototypes,
5998 which can conflict with char $ac_func(); below. */
5999#include <assert.h>
6000/* Override any gcc2 internal prototype to avoid an error. */
6001/* We use char because int might match the return type of a gcc2
6002 builtin and then its argument prototype would still apply. */
6003char $ac_func();
6004
6005int main() {
6006
6007/* The GNU C library defines this for functions which it implements
6008 to always fail with ENOSYS. Some functions are actually named
6009 something starting with __ and the normal name is an alias. */
6010#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6011choke me
6012#else
6013$ac_func();
6014#endif
6015
6016; return 0; }
6017EOF
bb17930d 6018if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
b5de8dc0
DL
6019 rm -rf conftest*
6020 eval "ac_cv_func_$ac_func=yes"
6021else
6022 echo "configure: failed program was:" >&5
6023 cat conftest.$ac_ext >&5
6024 rm -rf conftest*
6025 eval "ac_cv_func_$ac_func=no"
6026fi
6027rm -f conftest*
6028fi
6029
6030if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6031 echo "$ac_t""yes" 1>&6
6032 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6033 cat >> confdefs.h <<EOF
6034#define $ac_tr_func 1
6035EOF
6036
6037else
6038 echo "$ac_t""no" 1>&6
6039fi
6040done
6041
6042echo $ac_n "checking for working mktime""... $ac_c" 1>&6
bb17930d 6043echo "configure:6044: checking for working mktime" >&5
b5de8dc0
DL
6044if eval "test \"`echo '$''{'ac_cv_func_working_mktime'+set}'`\" = set"; then
6045 echo $ac_n "(cached) $ac_c" 1>&6
6046else
6047 if test "$cross_compiling" = yes; then
6048 ac_cv_func_working_mktime=no
6049else
6050 cat > conftest.$ac_ext <<EOF
bb17930d 6051#line 6052 "configure"
b5de8dc0
DL
6052#include "confdefs.h"
6053/* Test program from Paul Eggert (eggert@twinsun.com)
6054 and Tony Leneis (tony@plaza.ds.adp.com). */
6055#if TIME_WITH_SYS_TIME
6056# include <sys/time.h>
6057# include <time.h>
6058#else
6059# if HAVE_SYS_TIME_H
6060# include <sys/time.h>
6061# else
6062# include <time.h>
6063# endif
6064#endif
6065
6066#if HAVE_UNISTD_H
6067# include <unistd.h>
6068#endif
6069
6070#if !HAVE_ALARM
6071# define alarm(X) /* empty */
6072#endif
6073
6074/* Work around redefinition to rpl_putenv by other config tests. */
6075#undef putenv
6076
6077static time_t time_t_max;
6078
6079/* Values we'll use to set the TZ environment variable. */
6080static const char *const tz_strings[] = {
6081 (const char *) 0, "TZ=GMT0", "TZ=JST-9",
6082 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
6083};
6084#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
6085
6086/* Fail if mktime fails to convert a date in the spring-forward gap.
6087 Based on a problem report from Andreas Jaeger. */
6088static void
6089spring_forward_gap ()
6090{
6091 /* glibc (up to about 1998-10-07) failed this test) */
6092 struct tm tm;
6093
6094 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
6095 instead of "TZ=America/Vancouver" in order to detect the bug even
6096 on systems that don't support the Olson extension, or don't have the
6097 full zoneinfo tables installed. */
6098 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
6099
6100 tm.tm_year = 98;
6101 tm.tm_mon = 3;
6102 tm.tm_mday = 5;
6103 tm.tm_hour = 2;
6104 tm.tm_min = 0;
6105 tm.tm_sec = 0;
6106 tm.tm_isdst = -1;
6107 if (mktime (&tm) == (time_t)-1)
6108 exit (1);
6109}
6110
6111static void
6112mktime_test (now)
6113 time_t now;
6114{
6115 struct tm *lt;
6116 if ((lt = localtime (&now)) && mktime (lt) != now)
6117 exit (1);
6118 now = time_t_max - now;
6119 if ((lt = localtime (&now)) && mktime (lt) != now)
6120 exit (1);
6121}
6122
6123static void
6124irix_6_4_bug ()
6125{
6126 /* Based on code from Ariel Faigon. */
6127 struct tm tm;
6128 tm.tm_year = 96;
6129 tm.tm_mon = 3;
6130 tm.tm_mday = 0;
6131 tm.tm_hour = 0;
6132 tm.tm_min = 0;
6133 tm.tm_sec = 0;
6134 tm.tm_isdst = -1;
6135 mktime (&tm);
6136 if (tm.tm_mon != 2 || tm.tm_mday != 31)
6137 exit (1);
6138}
6139
6140static void
6141bigtime_test (j)
6142 int j;
6143{
6144 struct tm tm;
6145 time_t now;
6146 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
6147 now = mktime (&tm);
6148 if (now != (time_t) -1)
6149 {
6150 struct tm *lt = localtime (&now);
6151 if (! (lt
6152 && lt->tm_year == tm.tm_year
6153 && lt->tm_mon == tm.tm_mon
6154 && lt->tm_mday == tm.tm_mday
6155 && lt->tm_hour == tm.tm_hour
6156 && lt->tm_min == tm.tm_min
6157 && lt->tm_sec == tm.tm_sec
6158 && lt->tm_yday == tm.tm_yday
6159 && lt->tm_wday == tm.tm_wday
6160 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
6161 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
6162 exit (1);
6163 }
6164}
6165
6166int
6167main ()
6168{
6169 time_t t, delta;
6170 int i, j;
6171
6172 /* This test makes some buggy mktime implementations loop.
6173 Give up after 60 seconds; a mktime slower than that
6174 isn't worth using anyway. */
6175 alarm (60);
6176
6177 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
6178 continue;
6179 time_t_max--;
6180 delta = time_t_max / 997; /* a suitable prime number */
6181 for (i = 0; i < N_STRINGS; i++)
6182 {
6183 if (tz_strings[i])
6184 putenv (tz_strings[i]);
6185
6186 for (t = 0; t <= time_t_max - delta; t += delta)
6187 mktime_test (t);
6188 mktime_test ((time_t) 60 * 60);
6189 mktime_test ((time_t) 60 * 60 * 24);
6190
6191 for (j = 1; 0 < j; j *= 2)
6192 bigtime_test (j);
6193 bigtime_test (j - 1);
6194 }
6195 irix_6_4_bug ();
6196 spring_forward_gap ();
6197 exit (0);
6198}
6199EOF
bb17930d 6200if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
b5de8dc0
DL
6201then
6202 ac_cv_func_working_mktime=yes
6203else
6204 echo "configure: failed program was:" >&5
6205 cat conftest.$ac_ext >&5
6206 rm -fr conftest*
6207 ac_cv_func_working_mktime=no
6208fi
6209rm -fr conftest*
6210fi
6211
6212fi
6213
6214echo "$ac_t""$ac_cv_func_working_mktime" 1>&6
6215if test $ac_cv_func_working_mktime = no; then
6216 LIBOBJS="$LIBOBJS mktime.${ac_objext}"
6217fi
6218
6219if test "$ac_cv_func_working_mktime" = no; then
6220 cat >> confdefs.h <<\EOF
6221#define BROKEN_MKTIME 1
6222EOF
6223
6224fi
6225
4c343001
DL
6226ac_have_func=no # yes means we've found a way to get the load average.
6227
6228# Some systems with -lutil have (and need) -lkvm as well, some do not.
6229# On Solaris, -lkvm requires nlist from -lelf, so check that first
6230# to get the right answer into the cache.
6231echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6
bb17930d 6232echo "configure:6233: checking for elf_begin in -lelf" >&5
4c343001
DL
6233ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'`
6234if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6235 echo $ac_n "(cached) $ac_c" 1>&6
6236else
6237 ac_save_LIBS="$LIBS"
6238LIBS="-lelf $LIBS"
6239cat > conftest.$ac_ext <<EOF
bb17930d 6240#line 6241 "configure"
4c343001
DL
6241#include "confdefs.h"
6242/* Override any gcc2 internal prototype to avoid an error. */
6243/* We use char because int might match the return type of a gcc2
6244 builtin and then its argument prototype would still apply. */
6245char elf_begin();
6246
6247int main() {
6248elf_begin()
6249; return 0; }
6250EOF
bb17930d 6251if { (eval echo configure:6252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6252 rm -rf conftest*
6253 eval "ac_cv_lib_$ac_lib_var=yes"
6254else
6255 echo "configure: failed program was:" >&5
6256 cat conftest.$ac_ext >&5
6257 rm -rf conftest*
6258 eval "ac_cv_lib_$ac_lib_var=no"
6259fi
6260rm -f conftest*
6261LIBS="$ac_save_LIBS"
6262
6263fi
6264if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6265 echo "$ac_t""yes" 1>&6
6266 LIBS="-lelf $LIBS"
6267else
6268 echo "$ac_t""no" 1>&6
6269fi
6270
6271echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6
bb17930d 6272echo "configure:6273: checking for kvm_open in -lkvm" >&5
4c343001
DL
6273ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'`
6274if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6275 echo $ac_n "(cached) $ac_c" 1>&6
6276else
6277 ac_save_LIBS="$LIBS"
6278LIBS="-lkvm $LIBS"
6279cat > conftest.$ac_ext <<EOF
bb17930d 6280#line 6281 "configure"
4c343001
DL
6281#include "confdefs.h"
6282/* Override any gcc2 internal prototype to avoid an error. */
6283/* We use char because int might match the return type of a gcc2
6284 builtin and then its argument prototype would still apply. */
6285char kvm_open();
6286
6287int main() {
6288kvm_open()
6289; return 0; }
6290EOF
bb17930d 6291if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6292 rm -rf conftest*
6293 eval "ac_cv_lib_$ac_lib_var=yes"
6294else
6295 echo "configure: failed program was:" >&5
6296 cat conftest.$ac_ext >&5
6297 rm -rf conftest*
6298 eval "ac_cv_lib_$ac_lib_var=no"
6299fi
6300rm -f conftest*
6301LIBS="$ac_save_LIBS"
6302
6303fi
6304if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6305 echo "$ac_t""yes" 1>&6
6306 LIBS="-lkvm $LIBS"
6307else
6308 echo "$ac_t""no" 1>&6
6309fi
6310
6311# Check for the 4.4BSD definition of getloadavg.
6312echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6
bb17930d 6313echo "configure:6314: checking for getloadavg in -lutil" >&5
4c343001
DL
6314ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'`
6315if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6316 echo $ac_n "(cached) $ac_c" 1>&6
6317else
6318 ac_save_LIBS="$LIBS"
6319LIBS="-lutil $LIBS"
6320cat > conftest.$ac_ext <<EOF
bb17930d 6321#line 6322 "configure"
4c343001
DL
6322#include "confdefs.h"
6323/* Override any gcc2 internal prototype to avoid an error. */
6324/* We use char because int might match the return type of a gcc2
6325 builtin and then its argument prototype would still apply. */
6326char getloadavg();
6327
6328int main() {
6329getloadavg()
6330; return 0; }
6331EOF
bb17930d 6332if { (eval echo configure:6333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6333 rm -rf conftest*
6334 eval "ac_cv_lib_$ac_lib_var=yes"
6335else
6336 echo "configure: failed program was:" >&5
6337 cat conftest.$ac_ext >&5
6338 rm -rf conftest*
6339 eval "ac_cv_lib_$ac_lib_var=no"
6340fi
6341rm -f conftest*
6342LIBS="$ac_save_LIBS"
6343
6344fi
6345if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6346 echo "$ac_t""yes" 1>&6
6347 LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
6348else
6349 echo "$ac_t""no" 1>&6
6350fi
6351
6352
6353if test $ac_have_func = no; then
6354 # There is a commonly available library for RS/6000 AIX.
6355 # Since it is not a standard part of AIX, it might be installed locally.
6356 ac_getloadavg_LIBS="$LIBS"; LIBS="-L/usr/local/lib $LIBS"
6357 echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6
bb17930d 6358echo "configure:6359: checking for getloadavg in -lgetloadavg" >&5
4c343001
DL
6359ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'`
6360if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6361 echo $ac_n "(cached) $ac_c" 1>&6
6362else
6363 ac_save_LIBS="$LIBS"
6364LIBS="-lgetloadavg $LIBS"
6365cat > conftest.$ac_ext <<EOF
bb17930d 6366#line 6367 "configure"
4c343001
DL
6367#include "confdefs.h"
6368/* Override any gcc2 internal prototype to avoid an error. */
6369/* We use char because int might match the return type of a gcc2
6370 builtin and then its argument prototype would still apply. */
6371char getloadavg();
6372
6373int main() {
6374getloadavg()
6375; return 0; }
6376EOF
bb17930d 6377if { (eval echo configure:6378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6378 rm -rf conftest*
6379 eval "ac_cv_lib_$ac_lib_var=yes"
6380else
6381 echo "configure: failed program was:" >&5
6382 cat conftest.$ac_ext >&5
6383 rm -rf conftest*
6384 eval "ac_cv_lib_$ac_lib_var=no"
6385fi
6386rm -f conftest*
6387LIBS="$ac_save_LIBS"
6388
6389fi
6390if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6391 echo "$ac_t""yes" 1>&6
6392 LIBS="-lgetloadavg $LIBS"
6393else
6394 echo "$ac_t""no" 1>&6
6395LIBS="$ac_getloadavg_LIBS"
6396fi
6397
6398fi
6399
6400# Make sure it is really in the library, if we think we found it.
6401for ac_func in getloadavg
6402do
6403echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 6404echo "configure:6405: checking for $ac_func" >&5
4c343001
DL
6405if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6406 echo $ac_n "(cached) $ac_c" 1>&6
6407else
6408 cat > conftest.$ac_ext <<EOF
bb17930d 6409#line 6410 "configure"
4c343001
DL
6410#include "confdefs.h"
6411/* System header to define __stub macros and hopefully few prototypes,
6412 which can conflict with char $ac_func(); below. */
6413#include <assert.h>
6414/* Override any gcc2 internal prototype to avoid an error. */
6415/* We use char because int might match the return type of a gcc2
6416 builtin and then its argument prototype would still apply. */
6417char $ac_func();
6418
6419int main() {
6420
6421/* The GNU C library defines this for functions which it implements
6422 to always fail with ENOSYS. Some functions are actually named
6423 something starting with __ and the normal name is an alias. */
6424#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6425choke me
6426#else
6427$ac_func();
6428#endif
6429
6430; return 0; }
6431EOF
bb17930d 6432if { (eval echo configure:6433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6433 rm -rf conftest*
6434 eval "ac_cv_func_$ac_func=yes"
6435else
6436 echo "configure: failed program was:" >&5
6437 cat conftest.$ac_ext >&5
6438 rm -rf conftest*
6439 eval "ac_cv_func_$ac_func=no"
6440fi
6441rm -f conftest*
6442fi
6443
6444if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6445 echo "$ac_t""yes" 1>&6
6446 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6447 cat >> confdefs.h <<EOF
6448#define $ac_tr_func 1
6449EOF
6450
6451else
6452 echo "$ac_t""no" 1>&6
6453LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
6454fi
6455done
6456
6457
6458
6459if test $ac_cv_func_getloadavg = yes; then
6460 cat >> confdefs.h <<\EOF
6461#define HAVE_GETLOADAVG 1
6462EOF
6463
6464 ac_have_func=yes
6465else
6466 # Figure out what our getloadavg.c needs.
6467 ac_have_func=no
6468 ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'`
6469echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6
bb17930d 6470echo "configure:6471: checking for sys/dg_sys_info.h" >&5
4c343001
DL
6471if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6472 echo $ac_n "(cached) $ac_c" 1>&6
6473else
6474 cat > conftest.$ac_ext <<EOF
bb17930d 6475#line 6476 "configure"
4c343001
DL
6476#include "confdefs.h"
6477#include <sys/dg_sys_info.h>
6478EOF
6479ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 6480{ (eval echo configure:6481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4c343001
DL
6481ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6482if test -z "$ac_err"; then
6483 rm -rf conftest*
6484 eval "ac_cv_header_$ac_safe=yes"
6485else
6486 echo "$ac_err" >&5
6487 echo "configure: failed program was:" >&5
6488 cat conftest.$ac_ext >&5
6489 rm -rf conftest*
6490 eval "ac_cv_header_$ac_safe=no"
6491fi
6492rm -f conftest*
6493fi
6494if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6495 echo "$ac_t""yes" 1>&6
6496 ac_have_func=yes; cat >> confdefs.h <<\EOF
6497#define DGUX 1
6498EOF
6499
6500 echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6
bb17930d 6501echo "configure:6502: checking for dg_sys_info in -ldgc" >&5
4c343001
DL
6502ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'`
6503if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6504 echo $ac_n "(cached) $ac_c" 1>&6
6505else
6506 ac_save_LIBS="$LIBS"
6507LIBS="-ldgc $LIBS"
6508cat > conftest.$ac_ext <<EOF
bb17930d 6509#line 6510 "configure"
4c343001
DL
6510#include "confdefs.h"
6511/* Override any gcc2 internal prototype to avoid an error. */
6512/* We use char because int might match the return type of a gcc2
6513 builtin and then its argument prototype would still apply. */
6514char dg_sys_info();
6515
6516int main() {
6517dg_sys_info()
6518; return 0; }
6519EOF
bb17930d 6520if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4c343001
DL
6521 rm -rf conftest*
6522 eval "ac_cv_lib_$ac_lib_var=yes"
6523else
6524 echo "configure: failed program was:" >&5
6525 cat conftest.$ac_ext >&5
6526 rm -rf conftest*
6527 eval "ac_cv_lib_$ac_lib_var=no"
6528fi
6529rm -f conftest*
6530LIBS="$ac_save_LIBS"
6531
6532fi
6533if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6534 echo "$ac_t""yes" 1>&6
6535 ac_tr_lib=HAVE_LIB`echo dgc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6536 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6537 cat >> confdefs.h <<EOF
6538#define $ac_tr_lib 1
6539EOF
6540
6541 LIBS="-ldgc $LIBS"
6542
6543else
6544 echo "$ac_t""no" 1>&6
6545fi
6546
6547else
6548 echo "$ac_t""no" 1>&6
6549fi
6550
6551
6552 # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
6553 # uses stabs), but it is still SVR4. We cannot check for <elf.h> because
6554 # Irix 4.0.5F has the header but not the library.
6555 if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then
6556 ac_have_func=yes; cat >> confdefs.h <<\EOF
6557#define SVR4 1
6558EOF
6559
6560 fi
6561
6562 if test $ac_have_func = no; then
6563 ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'`
6564echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6
bb17930d 6565echo "configure:6566: checking for inq_stats/cpustats.h" >&5
4c343001
DL
6566if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6567 echo $ac_n "(cached) $ac_c" 1>&6
6568else
6569 cat > conftest.$ac_ext <<EOF
bb17930d 6570#line 6571 "configure"
4c343001
DL
6571#include "confdefs.h"
6572#include <inq_stats/cpustats.h>
6573EOF
6574ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 6575{ (eval echo configure:6576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4c343001
DL
6576ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6577if test -z "$ac_err"; then
6578 rm -rf conftest*
6579 eval "ac_cv_header_$ac_safe=yes"
6580else
6581 echo "$ac_err" >&5
6582 echo "configure: failed program was:" >&5
6583 cat conftest.$ac_ext >&5
6584 rm -rf conftest*
6585 eval "ac_cv_header_$ac_safe=no"
6586fi
6587rm -f conftest*
6588fi
6589if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6590 echo "$ac_t""yes" 1>&6
6591 ac_have_func=yes; cat >> confdefs.h <<\EOF
6592#define UMAX 1
6593EOF
6594
6595 cat >> confdefs.h <<\EOF
6596#define UMAX4_3 1
6597EOF
6598
6599else
6600 echo "$ac_t""no" 1>&6
6601fi
6602
6603 fi
6604
6605 if test $ac_have_func = no; then
6606 ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'`
6607echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6
bb17930d 6608echo "configure:6609: checking for sys/cpustats.h" >&5
4c343001
DL
6609if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6610 echo $ac_n "(cached) $ac_c" 1>&6
6611else
6612 cat > conftest.$ac_ext <<EOF
bb17930d 6613#line 6614 "configure"
4c343001
DL
6614#include "confdefs.h"
6615#include <sys/cpustats.h>
6616EOF
6617ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 6618{ (eval echo configure:6619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4c343001
DL
6619ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6620if test -z "$ac_err"; then
6621 rm -rf conftest*
6622 eval "ac_cv_header_$ac_safe=yes"
6623else
6624 echo "$ac_err" >&5
6625 echo "configure: failed program was:" >&5
6626 cat conftest.$ac_ext >&5
6627 rm -rf conftest*
6628 eval "ac_cv_header_$ac_safe=no"
6629fi
6630rm -f conftest*
6631fi
6632if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6633 echo "$ac_t""yes" 1>&6
6634 ac_have_func=yes; cat >> confdefs.h <<\EOF
6635#define UMAX 1
6636EOF
6637
6638else
6639 echo "$ac_t""no" 1>&6
6640fi
6641
6642 fi
6643
6644 if test $ac_have_func = no; then
6645 for ac_hdr in mach/mach.h
6646do
6647ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6648echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 6649echo "configure:6650: checking for $ac_hdr" >&5
4c343001
DL
6650if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6651 echo $ac_n "(cached) $ac_c" 1>&6
6652else
6653 cat > conftest.$ac_ext <<EOF
bb17930d 6654#line 6655 "configure"
4c343001
DL
6655#include "confdefs.h"
6656#include <$ac_hdr>
6657EOF
6658ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 6659{ (eval echo configure:6660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4c343001
DL
6660ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6661if test -z "$ac_err"; then
6662 rm -rf conftest*
6663 eval "ac_cv_header_$ac_safe=yes"
6664else
6665 echo "$ac_err" >&5
6666 echo "configure: failed program was:" >&5
6667 cat conftest.$ac_ext >&5
6668 rm -rf conftest*
6669 eval "ac_cv_header_$ac_safe=no"
6670fi
6671rm -f conftest*
6672fi
6673if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6674 echo "$ac_t""yes" 1>&6
6675 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6676 cat >> confdefs.h <<EOF
6677#define $ac_tr_hdr 1
6678EOF
6679
6680else
6681 echo "$ac_t""no" 1>&6
6682fi
6683done
6684
6685 fi
6686
6687 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
6688echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
bb17930d 6689echo "configure:6690: checking for nlist.h" >&5
4c343001
DL
6690if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6691 echo $ac_n "(cached) $ac_c" 1>&6
6692else
6693 cat > conftest.$ac_ext <<EOF
bb17930d 6694#line 6695 "configure"
4c343001
DL
6695#include "confdefs.h"
6696#include <nlist.h>
6697EOF
6698ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 6699{ (eval echo configure:6700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4c343001
DL
6700ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6701if test -z "$ac_err"; then
6702 rm -rf conftest*
6703 eval "ac_cv_header_$ac_safe=yes"
6704else
6705 echo "$ac_err" >&5
6706 echo "configure: failed program was:" >&5
6707 cat conftest.$ac_ext >&5
6708 rm -rf conftest*
6709 eval "ac_cv_header_$ac_safe=no"
6710fi
6711rm -f conftest*
6712fi
6713if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6714 echo "$ac_t""yes" 1>&6
6715 cat >> confdefs.h <<\EOF
6716#define NLIST_STRUCT 1
6717EOF
6718
6719 echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6
bb17930d 6720echo "configure:6721: checking for n_un in struct nlist" >&5
4c343001
DL
6721if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then
6722 echo $ac_n "(cached) $ac_c" 1>&6
6723else
6724 cat > conftest.$ac_ext <<EOF
bb17930d 6725#line 6726 "configure"
4c343001
DL
6726#include "confdefs.h"
6727#include <nlist.h>
6728int main() {
6729struct nlist n; n.n_un.n_name = 0;
6730; return 0; }
6731EOF
bb17930d 6732if { (eval echo configure:6733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4c343001
DL
6733 rm -rf conftest*
6734 ac_cv_struct_nlist_n_un=yes
6735else
6736 echo "configure: failed program was:" >&5
6737 cat conftest.$ac_ext >&5
6738 rm -rf conftest*
6739 ac_cv_struct_nlist_n_un=no
6740fi
6741rm -f conftest*
6742fi
6743
6744echo "$ac_t""$ac_cv_struct_nlist_n_un" 1>&6
6745 if test $ac_cv_struct_nlist_n_un = yes; then
6746 cat >> confdefs.h <<\EOF
6747#define NLIST_NAME_UNION 1
6748EOF
6749
6750 fi
6751
6752else
6753 echo "$ac_t""no" 1>&6
6754fi
6755fi # Do not have getloadavg in system libraries.
6756
6757# Some definitions of getloadavg require that the program be installed setgid.
6758echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6
bb17930d 6759echo "configure:6760: checking whether getloadavg requires setgid" >&5
4c343001
DL
6760if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then
6761 echo $ac_n "(cached) $ac_c" 1>&6
6762else
6763 cat > conftest.$ac_ext <<EOF
bb17930d 6764#line 6765 "configure"
4c343001
DL
6765#include "confdefs.h"
6766#include "$srcdir/getloadavg.c"
6767#ifdef LDAV_PRIVILEGED
6768Yowza Am I SETGID yet
6769#endif
6770EOF
6771if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6772 egrep "Yowza Am I SETGID yet" >/dev/null 2>&1; then
6773 rm -rf conftest*
6774 ac_cv_func_getloadavg_setgid=yes
6775else
6776 rm -rf conftest*
6777 ac_cv_func_getloadavg_setgid=no
6778fi
6779rm -f conftest*
6780
6781fi
6782
6783echo "$ac_t""$ac_cv_func_getloadavg_setgid" 1>&6
6784if test $ac_cv_func_getloadavg_setgid = yes; then
6785 NEED_SETGID=true; cat >> confdefs.h <<\EOF
6786#define GETLOADAVG_PRIVILEGED 1
6787EOF
6788
6789else
6790 NEED_SETGID=false
6791fi
6792
6793if test $ac_cv_func_getloadavg_setgid = yes; then
6794 echo $ac_n "checking group of /dev/kmem""... $ac_c" 1>&6
bb17930d 6795echo "configure:6796: checking group of /dev/kmem" >&5
4c343001
DL
6796if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then
6797 echo $ac_n "(cached) $ac_c" 1>&6
6798else
6799 # On Solaris, /dev/kmem is a symlink. Get info on the real file.
6800 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
6801 # If we got an error (system does not support symlinks), try without -L.
6802 test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
6803 ac_cv_group_kmem=`echo $ac_ls_output \
6804 | sed -ne 's/[ ][ ]*/ /g;
6805 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
6806 / /s/.* //;p;'`
6807
6808fi
6809
6810echo "$ac_t""$ac_cv_group_kmem" 1>&6
6811 KMEM_GROUP=$ac_cv_group_kmem
6812fi
6813
6814
d42122a3
DL
6815for ac_func in ftello
6816do
6817echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 6818echo "configure:6819: checking for $ac_func" >&5
d42122a3
DL
6819if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6820 echo $ac_n "(cached) $ac_c" 1>&6
6821else
6822 cat > conftest.$ac_ext <<EOF
bb17930d 6823#line 6824 "configure"
d42122a3
DL
6824#include "confdefs.h"
6825/* System header to define __stub macros and hopefully few prototypes,
6826 which can conflict with char $ac_func(); below. */
6827#include <assert.h>
6828/* Override any gcc2 internal prototype to avoid an error. */
6829/* We use char because int might match the return type of a gcc2
6830 builtin and then its argument prototype would still apply. */
6831char $ac_func();
6832
6833int main() {
6834
6835/* The GNU C library defines this for functions which it implements
6836 to always fail with ENOSYS. Some functions are actually named
6837 something starting with __ and the normal name is an alias. */
6838#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6839choke me
6840#else
6841$ac_func();
6842#endif
6843
6844; return 0; }
6845EOF
bb17930d 6846if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
d42122a3
DL
6847 rm -rf conftest*
6848 eval "ac_cv_func_$ac_func=yes"
6849else
6850 echo "configure: failed program was:" >&5
6851 cat conftest.$ac_ext >&5
6852 rm -rf conftest*
6853 eval "ac_cv_func_$ac_func=no"
6854fi
6855rm -f conftest*
6856fi
6857
6858if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6859 echo "$ac_t""yes" 1>&6
6860 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6861 cat >> confdefs.h <<EOF
6862#define $ac_tr_func 1
6863EOF
6864
6865else
6866 echo "$ac_t""no" 1>&6
6867fi
6868done
6869
6870
6871# UNIX98 PTYs. AC_SYS_LARGEFILE should have defined _XOPEN_SOURCE
6872# if we need it.
087121cc
GM
6873for ac_func in grantpt
6874do
6875echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 6876echo "configure:6877: checking for $ac_func" >&5
087121cc
GM
6877if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6878 echo $ac_n "(cached) $ac_c" 1>&6
6879else
6880 cat > conftest.$ac_ext <<EOF
bb17930d 6881#line 6882 "configure"
087121cc
GM
6882#include "confdefs.h"
6883/* System header to define __stub macros and hopefully few prototypes,
6884 which can conflict with char $ac_func(); below. */
6885#include <assert.h>
6886/* Override any gcc2 internal prototype to avoid an error. */
6887/* We use char because int might match the return type of a gcc2
6888 builtin and then its argument prototype would still apply. */
6889char $ac_func();
6890
6891int main() {
6892
6893/* The GNU C library defines this for functions which it implements
6894 to always fail with ENOSYS. Some functions are actually named
6895 something starting with __ and the normal name is an alias. */
6896#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6897choke me
6898#else
6899$ac_func();
6900#endif
6901
6902; return 0; }
6903EOF
bb17930d 6904if { (eval echo configure:6905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
087121cc
GM
6905 rm -rf conftest*
6906 eval "ac_cv_func_$ac_func=yes"
6907else
6908 echo "configure: failed program was:" >&5
6909 cat conftest.$ac_ext >&5
6910 rm -rf conftest*
6911 eval "ac_cv_func_$ac_func=no"
6912fi
6913rm -f conftest*
6914fi
6915
6916if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6917 echo "$ac_t""yes" 1>&6
6918 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6919 cat >> confdefs.h <<EOF
6920#define $ac_tr_func 1
6921EOF
6922
6923else
6924 echo "$ac_t""no" 1>&6
6925fi
6926done
6927
6928
6929# PTY-related GNU extensions.
6930for ac_func in getpt
6931do
6932echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 6933echo "configure:6934: checking for $ac_func" >&5
087121cc
GM
6934if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6935 echo $ac_n "(cached) $ac_c" 1>&6
6936else
6937 cat > conftest.$ac_ext <<EOF
bb17930d 6938#line 6939 "configure"
087121cc
GM
6939#include "confdefs.h"
6940/* System header to define __stub macros and hopefully few prototypes,
6941 which can conflict with char $ac_func(); below. */
6942#include <assert.h>
6943/* Override any gcc2 internal prototype to avoid an error. */
6944/* We use char because int might match the return type of a gcc2
6945 builtin and then its argument prototype would still apply. */
6946char $ac_func();
6947
6948int main() {
6949
6950/* The GNU C library defines this for functions which it implements
6951 to always fail with ENOSYS. Some functions are actually named
6952 something starting with __ and the normal name is an alias. */
6953#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6954choke me
6955#else
6956$ac_func();
6957#endif
6958
6959; return 0; }
6960EOF
bb17930d 6961if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
087121cc
GM
6962 rm -rf conftest*
6963 eval "ac_cv_func_$ac_func=yes"
6964else
6965 echo "configure: failed program was:" >&5
6966 cat conftest.$ac_ext >&5
6967 rm -rf conftest*
6968 eval "ac_cv_func_$ac_func=no"
6969fi
6970rm -f conftest*
6971fi
6972
6973if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6974 echo "$ac_t""yes" 1>&6
6975 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6976 cat >> confdefs.h <<EOF
6977#define $ac_tr_func 1
6978EOF
6979
6980else
6981 echo "$ac_t""no" 1>&6
6982fi
6983done
6984
6985
ba4481b5
DL
6986# Check this now, so that we will NOT find the above functions in ncurses.
6987# That is because we have not set up to link ncurses in lib-src.
6988# It's better to believe a function is not available
6989# than to expect to find it in ncurses.
6990echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6
bb17930d 6991echo "configure:6992: checking for tparm in -lncurses" >&5
ba4481b5
DL
6992ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'`
6993if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6994 echo $ac_n "(cached) $ac_c" 1>&6
6995else
6996 ac_save_LIBS="$LIBS"
6997LIBS="-lncurses $LIBS"
6998cat > conftest.$ac_ext <<EOF
bb17930d 6999#line 7000 "configure"
ba4481b5
DL
7000#include "confdefs.h"
7001/* Override any gcc2 internal prototype to avoid an error. */
7002/* We use char because int might match the return type of a gcc2
7003 builtin and then its argument prototype would still apply. */
7004char tparm();
7005
7006int main() {
7007tparm()
7008; return 0; }
7009EOF
bb17930d 7010if { (eval echo configure:7011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
7011 rm -rf conftest*
7012 eval "ac_cv_lib_$ac_lib_var=yes"
7013else
7014 echo "configure: failed program was:" >&5
7015 cat conftest.$ac_ext >&5
7016 rm -rf conftest*
7017 eval "ac_cv_lib_$ac_lib_var=no"
7018fi
7019rm -f conftest*
7020LIBS="$ac_save_LIBS"
7021
7022fi
7023if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7024 echo "$ac_t""yes" 1>&6
7025 ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7026 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7027 cat >> confdefs.h <<EOF
7028#define $ac_tr_lib 1
7029EOF
7030
7031 LIBS="-lncurses $LIBS"
7032
7033else
7034 echo "$ac_t""no" 1>&6
7035fi
7036
7037
a21616bd
KR
7038# These tell us which Kerberos-related libraries to use.
7039if test "${with_kerberos+set}" = set; then
7040 echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6
bb17930d 7041echo "configure:7042: checking for com_err in -lcom_err" >&5
a21616bd
KR
7042ac_lib_var=`echo com_err'_'com_err | sed 'y%./+-%__p_%'`
7043if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7044 echo $ac_n "(cached) $ac_c" 1>&6
7045else
7046 ac_save_LIBS="$LIBS"
7047LIBS="-lcom_err $LIBS"
7048cat > conftest.$ac_ext <<EOF
bb17930d 7049#line 7050 "configure"
a21616bd
KR
7050#include "confdefs.h"
7051/* Override any gcc2 internal prototype to avoid an error. */
7052/* We use char because int might match the return type of a gcc2
7053 builtin and then its argument prototype would still apply. */
7054char com_err();
7055
7056int main() {
7057com_err()
7058; return 0; }
7059EOF
bb17930d 7060if { (eval echo configure:7061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7061 rm -rf conftest*
7062 eval "ac_cv_lib_$ac_lib_var=yes"
7063else
7064 echo "configure: failed program was:" >&5
7065 cat conftest.$ac_ext >&5
7066 rm -rf conftest*
7067 eval "ac_cv_lib_$ac_lib_var=no"
7068fi
7069rm -f conftest*
7070LIBS="$ac_save_LIBS"
7071
7072fi
7073if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7074 echo "$ac_t""yes" 1>&6
7075 ac_tr_lib=HAVE_LIB`echo com_err | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7076 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7077 cat >> confdefs.h <<EOF
7078#define $ac_tr_lib 1
7079EOF
7080
7081 LIBS="-lcom_err $LIBS"
7082
7083else
7084 echo "$ac_t""no" 1>&6
7085fi
7086
7087 echo $ac_n "checking for mit_des_cbc_encrypt in -lk5crypto""... $ac_c" 1>&6
bb17930d 7088echo "configure:7089: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
a21616bd
KR
7089ac_lib_var=`echo k5crypto'_'mit_des_cbc_encrypt | sed 'y%./+-%__p_%'`
7090if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7091 echo $ac_n "(cached) $ac_c" 1>&6
7092else
7093 ac_save_LIBS="$LIBS"
7094LIBS="-lk5crypto $LIBS"
7095cat > conftest.$ac_ext <<EOF
bb17930d 7096#line 7097 "configure"
a21616bd
KR
7097#include "confdefs.h"
7098/* Override any gcc2 internal prototype to avoid an error. */
7099/* We use char because int might match the return type of a gcc2
7100 builtin and then its argument prototype would still apply. */
7101char mit_des_cbc_encrypt();
7102
7103int main() {
7104mit_des_cbc_encrypt()
7105; return 0; }
7106EOF
bb17930d 7107if { (eval echo configure:7108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7108 rm -rf conftest*
7109 eval "ac_cv_lib_$ac_lib_var=yes"
7110else
7111 echo "configure: failed program was:" >&5
7112 cat conftest.$ac_ext >&5
7113 rm -rf conftest*
7114 eval "ac_cv_lib_$ac_lib_var=no"
7115fi
7116rm -f conftest*
7117LIBS="$ac_save_LIBS"
7118
7119fi
7120if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7121 echo "$ac_t""yes" 1>&6
7122 ac_tr_lib=HAVE_LIB`echo k5crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7123 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7124 cat >> confdefs.h <<EOF
7125#define $ac_tr_lib 1
7126EOF
7127
7128 LIBS="-lk5crypto $LIBS"
7129
7130else
7131 echo "$ac_t""no" 1>&6
7132fi
7133
7134 echo $ac_n "checking for mit_des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6
bb17930d 7135echo "configure:7136: checking for mit_des_cbc_encrypt in -lcrypto" >&5
a21616bd
KR
7136ac_lib_var=`echo crypto'_'mit_des_cbc_encrypt | sed 'y%./+-%__p_%'`
7137if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7138 echo $ac_n "(cached) $ac_c" 1>&6
7139else
7140 ac_save_LIBS="$LIBS"
7141LIBS="-lcrypto $LIBS"
7142cat > conftest.$ac_ext <<EOF
bb17930d 7143#line 7144 "configure"
a21616bd
KR
7144#include "confdefs.h"
7145/* Override any gcc2 internal prototype to avoid an error. */
7146/* We use char because int might match the return type of a gcc2
7147 builtin and then its argument prototype would still apply. */
7148char mit_des_cbc_encrypt();
7149
7150int main() {
7151mit_des_cbc_encrypt()
7152; return 0; }
7153EOF
bb17930d 7154if { (eval echo configure:7155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7155 rm -rf conftest*
7156 eval "ac_cv_lib_$ac_lib_var=yes"
7157else
7158 echo "configure: failed program was:" >&5
7159 cat conftest.$ac_ext >&5
7160 rm -rf conftest*
7161 eval "ac_cv_lib_$ac_lib_var=no"
7162fi
7163rm -f conftest*
7164LIBS="$ac_save_LIBS"
7165
7166fi
7167if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7168 echo "$ac_t""yes" 1>&6
7169 ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7170 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7171 cat >> confdefs.h <<EOF
7172#define $ac_tr_lib 1
7173EOF
7174
7175 LIBS="-lcrypto $LIBS"
7176
7177else
7178 echo "$ac_t""no" 1>&6
7179fi
7180
7181 echo $ac_n "checking for krb5_init_context in -lkrb5""... $ac_c" 1>&6
bb17930d 7182echo "configure:7183: checking for krb5_init_context in -lkrb5" >&5
a21616bd
KR
7183ac_lib_var=`echo krb5'_'krb5_init_context | sed 'y%./+-%__p_%'`
7184if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7185 echo $ac_n "(cached) $ac_c" 1>&6
7186else
7187 ac_save_LIBS="$LIBS"
7188LIBS="-lkrb5 $LIBS"
7189cat > conftest.$ac_ext <<EOF
bb17930d 7190#line 7191 "configure"
a21616bd
KR
7191#include "confdefs.h"
7192/* Override any gcc2 internal prototype to avoid an error. */
7193/* We use char because int might match the return type of a gcc2
7194 builtin and then its argument prototype would still apply. */
7195char krb5_init_context();
7196
7197int main() {
7198krb5_init_context()
7199; return 0; }
7200EOF
bb17930d 7201if { (eval echo configure:7202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7202 rm -rf conftest*
7203 eval "ac_cv_lib_$ac_lib_var=yes"
7204else
7205 echo "configure: failed program was:" >&5
7206 cat conftest.$ac_ext >&5
7207 rm -rf conftest*
7208 eval "ac_cv_lib_$ac_lib_var=no"
7209fi
7210rm -f conftest*
7211LIBS="$ac_save_LIBS"
7212
7213fi
7214if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7215 echo "$ac_t""yes" 1>&6
7216 ac_tr_lib=HAVE_LIB`echo krb5 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7217 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7218 cat >> confdefs.h <<EOF
7219#define $ac_tr_lib 1
7220EOF
7221
7222 LIBS="-lkrb5 $LIBS"
7223
7224else
7225 echo "$ac_t""no" 1>&6
7226fi
7227
7228 if test "${with_kerberos5+set}" != set; then
7229 echo $ac_n "checking for des_cbc_encrypt in -ldes425""... $ac_c" 1>&6
bb17930d 7230echo "configure:7231: checking for des_cbc_encrypt in -ldes425" >&5
a21616bd
KR
7231ac_lib_var=`echo des425'_'des_cbc_encrypt | sed 'y%./+-%__p_%'`
7232if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7233 echo $ac_n "(cached) $ac_c" 1>&6
7234else
7235 ac_save_LIBS="$LIBS"
7236LIBS="-ldes425 $LIBS"
7237cat > conftest.$ac_ext <<EOF
bb17930d 7238#line 7239 "configure"
a21616bd
KR
7239#include "confdefs.h"
7240/* Override any gcc2 internal prototype to avoid an error. */
7241/* We use char because int might match the return type of a gcc2
7242 builtin and then its argument prototype would still apply. */
7243char des_cbc_encrypt();
7244
7245int main() {
7246des_cbc_encrypt()
7247; return 0; }
7248EOF
bb17930d 7249if { (eval echo configure:7250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7250 rm -rf conftest*
7251 eval "ac_cv_lib_$ac_lib_var=yes"
7252else
7253 echo "configure: failed program was:" >&5
7254 cat conftest.$ac_ext >&5
7255 rm -rf conftest*
7256 eval "ac_cv_lib_$ac_lib_var=no"
7257fi
7258rm -f conftest*
7259LIBS="$ac_save_LIBS"
7260
7261fi
7262if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7263 echo "$ac_t""yes" 1>&6
7264 ac_tr_lib=HAVE_LIB`echo des425 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7265 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7266 cat >> confdefs.h <<EOF
7267#define $ac_tr_lib 1
7268EOF
7269
7270 LIBS="-ldes425 $LIBS"
7271
7272else
7273 echo "$ac_t""no" 1>&6
7274echo $ac_n "checking for des_cbc_encrypt in -ldes""... $ac_c" 1>&6
bb17930d 7275echo "configure:7276: checking for des_cbc_encrypt in -ldes" >&5
a21616bd
KR
7276ac_lib_var=`echo des'_'des_cbc_encrypt | sed 'y%./+-%__p_%'`
7277if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7278 echo $ac_n "(cached) $ac_c" 1>&6
7279else
7280 ac_save_LIBS="$LIBS"
7281LIBS="-ldes $LIBS"
7282cat > conftest.$ac_ext <<EOF
bb17930d 7283#line 7284 "configure"
a21616bd
KR
7284#include "confdefs.h"
7285/* Override any gcc2 internal prototype to avoid an error. */
7286/* We use char because int might match the return type of a gcc2
7287 builtin and then its argument prototype would still apply. */
7288char des_cbc_encrypt();
7289
7290int main() {
7291des_cbc_encrypt()
7292; return 0; }
7293EOF
bb17930d 7294if { (eval echo configure:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7295 rm -rf conftest*
7296 eval "ac_cv_lib_$ac_lib_var=yes"
7297else
7298 echo "configure: failed program was:" >&5
7299 cat conftest.$ac_ext >&5
7300 rm -rf conftest*
7301 eval "ac_cv_lib_$ac_lib_var=no"
7302fi
7303rm -f conftest*
7304LIBS="$ac_save_LIBS"
7305
7306fi
7307if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7308 echo "$ac_t""yes" 1>&6
7309 ac_tr_lib=HAVE_LIB`echo des | sed -e 's/^a-zA-Z0-9_/_/g' \
7310 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7311 cat >> confdefs.h <<EOF
7312#define $ac_tr_lib 1
7313EOF
7314
7315 LIBS="-ldes $LIBS"
7316
7317else
7318 echo "$ac_t""no" 1>&6
7319fi
7320
7321fi
7322
7323 echo $ac_n "checking for krb_get_cred in -lkrb4""... $ac_c" 1>&6
bb17930d 7324echo "configure:7325: checking for krb_get_cred in -lkrb4" >&5
a21616bd
KR
7325ac_lib_var=`echo krb4'_'krb_get_cred | sed 'y%./+-%__p_%'`
7326if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7327 echo $ac_n "(cached) $ac_c" 1>&6
7328else
7329 ac_save_LIBS="$LIBS"
7330LIBS="-lkrb4 $LIBS"
7331cat > conftest.$ac_ext <<EOF
bb17930d 7332#line 7333 "configure"
a21616bd
KR
7333#include "confdefs.h"
7334/* Override any gcc2 internal prototype to avoid an error. */
7335/* We use char because int might match the return type of a gcc2
7336 builtin and then its argument prototype would still apply. */
7337char krb_get_cred();
7338
7339int main() {
7340krb_get_cred()
7341; return 0; }
7342EOF
bb17930d 7343if { (eval echo configure:7344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7344 rm -rf conftest*
7345 eval "ac_cv_lib_$ac_lib_var=yes"
7346else
7347 echo "configure: failed program was:" >&5
7348 cat conftest.$ac_ext >&5
7349 rm -rf conftest*
7350 eval "ac_cv_lib_$ac_lib_var=no"
7351fi
7352rm -f conftest*
7353LIBS="$ac_save_LIBS"
7354
7355fi
7356if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7357 echo "$ac_t""yes" 1>&6
7358 ac_tr_lib=HAVE_LIB`echo krb4 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7359 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7360 cat >> confdefs.h <<EOF
7361#define $ac_tr_lib 1
7362EOF
7363
7364 LIBS="-lkrb4 $LIBS"
7365
7366else
7367 echo "$ac_t""no" 1>&6
7368echo $ac_n "checking for krb_get_cred in -lkrb""... $ac_c" 1>&6
bb17930d 7369echo "configure:7370: checking for krb_get_cred in -lkrb" >&5
a21616bd
KR
7370ac_lib_var=`echo krb'_'krb_get_cred | sed 'y%./+-%__p_%'`
7371if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7372 echo $ac_n "(cached) $ac_c" 1>&6
7373else
7374 ac_save_LIBS="$LIBS"
7375LIBS="-lkrb $LIBS"
7376cat > conftest.$ac_ext <<EOF
bb17930d 7377#line 7378 "configure"
a21616bd
KR
7378#include "confdefs.h"
7379/* Override any gcc2 internal prototype to avoid an error. */
7380/* We use char because int might match the return type of a gcc2
7381 builtin and then its argument prototype would still apply. */
7382char krb_get_cred();
7383
7384int main() {
7385krb_get_cred()
7386; return 0; }
7387EOF
bb17930d 7388if { (eval echo configure:7389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a21616bd
KR
7389 rm -rf conftest*
7390 eval "ac_cv_lib_$ac_lib_var=yes"
7391else
7392 echo "configure: failed program was:" >&5
7393 cat conftest.$ac_ext >&5
7394 rm -rf conftest*
7395 eval "ac_cv_lib_$ac_lib_var=no"
7396fi
7397rm -f conftest*
7398LIBS="$ac_save_LIBS"
7399
7400fi
7401if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7402 echo "$ac_t""yes" 1>&6
7403 ac_tr_lib=HAVE_LIB`echo krb | sed -e 's/^a-zA-Z0-9_/_/g' \
7404 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7405 cat >> confdefs.h <<EOF
7406#define $ac_tr_lib 1
7407EOF
7408
7409 LIBS="-lkrb $LIBS"
7410
7411else
7412 echo "$ac_t""no" 1>&6
7413fi
7414
7415fi
7416
7417 fi
7418
7419 if test "${with_kerberos5+set}" = set; then
7420 for ac_hdr in krb5.h
7421do
7422ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7423echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7424echo "configure:7425: checking for $ac_hdr" >&5
a21616bd
KR
7425if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7426 echo $ac_n "(cached) $ac_c" 1>&6
7427else
7428 cat > conftest.$ac_ext <<EOF
bb17930d 7429#line 7430 "configure"
a21616bd
KR
7430#include "confdefs.h"
7431#include <$ac_hdr>
7432EOF
7433ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7434{ (eval echo configure:7435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7435ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7436if test -z "$ac_err"; then
7437 rm -rf conftest*
7438 eval "ac_cv_header_$ac_safe=yes"
7439else
7440 echo "$ac_err" >&5
7441 echo "configure: failed program was:" >&5
7442 cat conftest.$ac_ext >&5
7443 rm -rf conftest*
7444 eval "ac_cv_header_$ac_safe=no"
7445fi
7446rm -f conftest*
7447fi
7448if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7449 echo "$ac_t""yes" 1>&6
7450 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7451 cat >> confdefs.h <<EOF
7452#define $ac_tr_hdr 1
7453EOF
7454
7455else
7456 echo "$ac_t""no" 1>&6
7457fi
7458done
7459
7460 else
7461 for ac_hdr in des.h
7462do
7463ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7464echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7465echo "configure:7466: checking for $ac_hdr" >&5
a21616bd
KR
7466if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7467 echo $ac_n "(cached) $ac_c" 1>&6
7468else
7469 cat > conftest.$ac_ext <<EOF
bb17930d 7470#line 7471 "configure"
a21616bd
KR
7471#include "confdefs.h"
7472#include <$ac_hdr>
7473EOF
7474ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7475{ (eval echo configure:7476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7476ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7477if test -z "$ac_err"; then
7478 rm -rf conftest*
7479 eval "ac_cv_header_$ac_safe=yes"
7480else
7481 echo "$ac_err" >&5
7482 echo "configure: failed program was:" >&5
7483 cat conftest.$ac_ext >&5
7484 rm -rf conftest*
7485 eval "ac_cv_header_$ac_safe=no"
7486fi
7487rm -f conftest*
7488fi
7489if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7490 echo "$ac_t""yes" 1>&6
7491 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7492 cat >> confdefs.h <<EOF
7493#define $ac_tr_hdr 1
7494EOF
7495
7496else
7497 echo "$ac_t""no" 1>&6
7498for ac_hdr in kerberosIV/des.h
7499do
7500ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7501echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7502echo "configure:7503: checking for $ac_hdr" >&5
a21616bd
KR
7503if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7504 echo $ac_n "(cached) $ac_c" 1>&6
7505else
7506 cat > conftest.$ac_ext <<EOF
bb17930d 7507#line 7508 "configure"
a21616bd
KR
7508#include "confdefs.h"
7509#include <$ac_hdr>
7510EOF
7511ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7512{ (eval echo configure:7513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7513ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7514if test -z "$ac_err"; then
7515 rm -rf conftest*
7516 eval "ac_cv_header_$ac_safe=yes"
7517else
7518 echo "$ac_err" >&5
7519 echo "configure: failed program was:" >&5
7520 cat conftest.$ac_ext >&5
7521 rm -rf conftest*
7522 eval "ac_cv_header_$ac_safe=no"
7523fi
7524rm -f conftest*
7525fi
7526if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7527 echo "$ac_t""yes" 1>&6
7528 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7529 cat >> confdefs.h <<EOF
7530#define $ac_tr_hdr 1
7531EOF
7532
7533else
7534 echo "$ac_t""no" 1>&6
7535for ac_hdr in kerberos/des.h
7536do
7537ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7538echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7539echo "configure:7540: checking for $ac_hdr" >&5
a21616bd
KR
7540if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7541 echo $ac_n "(cached) $ac_c" 1>&6
7542else
7543 cat > conftest.$ac_ext <<EOF
bb17930d 7544#line 7545 "configure"
a21616bd
KR
7545#include "confdefs.h"
7546#include <$ac_hdr>
7547EOF
7548ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7549{ (eval echo configure:7550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7550ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7551if test -z "$ac_err"; then
7552 rm -rf conftest*
7553 eval "ac_cv_header_$ac_safe=yes"
7554else
7555 echo "$ac_err" >&5
7556 echo "configure: failed program was:" >&5
7557 cat conftest.$ac_ext >&5
7558 rm -rf conftest*
7559 eval "ac_cv_header_$ac_safe=no"
7560fi
7561rm -f conftest*
7562fi
7563if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7564 echo "$ac_t""yes" 1>&6
7565 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7566 cat >> confdefs.h <<EOF
7567#define $ac_tr_hdr 1
7568EOF
7569
7570else
7571 echo "$ac_t""no" 1>&6
7572fi
7573done
7574
7575fi
7576done
7577
7578fi
7579done
7580
7581 for ac_hdr in krb.h
7582do
7583ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7584echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7585echo "configure:7586: checking for $ac_hdr" >&5
a21616bd
KR
7586if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7587 echo $ac_n "(cached) $ac_c" 1>&6
7588else
7589 cat > conftest.$ac_ext <<EOF
bb17930d 7590#line 7591 "configure"
a21616bd
KR
7591#include "confdefs.h"
7592#include <$ac_hdr>
7593EOF
7594ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7595{ (eval echo configure:7596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7596ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7597if test -z "$ac_err"; then
7598 rm -rf conftest*
7599 eval "ac_cv_header_$ac_safe=yes"
7600else
7601 echo "$ac_err" >&5
7602 echo "configure: failed program was:" >&5
7603 cat conftest.$ac_ext >&5
7604 rm -rf conftest*
7605 eval "ac_cv_header_$ac_safe=no"
7606fi
7607rm -f conftest*
7608fi
7609if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7610 echo "$ac_t""yes" 1>&6
7611 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7612 cat >> confdefs.h <<EOF
7613#define $ac_tr_hdr 1
7614EOF
7615
7616else
7617 echo "$ac_t""no" 1>&6
7618for ac_hdr in kerberosIV/krb.h
7619do
7620ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7621echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7622echo "configure:7623: checking for $ac_hdr" >&5
a21616bd
KR
7623if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7624 echo $ac_n "(cached) $ac_c" 1>&6
7625else
7626 cat > conftest.$ac_ext <<EOF
bb17930d 7627#line 7628 "configure"
a21616bd
KR
7628#include "confdefs.h"
7629#include <$ac_hdr>
7630EOF
7631ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7632{ (eval echo configure:7633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7633ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7634if test -z "$ac_err"; then
7635 rm -rf conftest*
7636 eval "ac_cv_header_$ac_safe=yes"
7637else
7638 echo "$ac_err" >&5
7639 echo "configure: failed program was:" >&5
7640 cat conftest.$ac_ext >&5
7641 rm -rf conftest*
7642 eval "ac_cv_header_$ac_safe=no"
7643fi
7644rm -f conftest*
7645fi
7646if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7647 echo "$ac_t""yes" 1>&6
7648 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7649 cat >> confdefs.h <<EOF
7650#define $ac_tr_hdr 1
7651EOF
7652
7653else
7654 echo "$ac_t""no" 1>&6
7655for ac_hdr in kerberos/krb.h
7656do
7657ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7658echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7659echo "configure:7660: checking for $ac_hdr" >&5
a21616bd
KR
7660if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7661 echo $ac_n "(cached) $ac_c" 1>&6
7662else
7663 cat > conftest.$ac_ext <<EOF
bb17930d 7664#line 7665 "configure"
a21616bd
KR
7665#include "confdefs.h"
7666#include <$ac_hdr>
7667EOF
7668ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7669{ (eval echo configure:7670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7670ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7671if test -z "$ac_err"; then
7672 rm -rf conftest*
7673 eval "ac_cv_header_$ac_safe=yes"
7674else
7675 echo "$ac_err" >&5
7676 echo "configure: failed program was:" >&5
7677 cat conftest.$ac_ext >&5
7678 rm -rf conftest*
7679 eval "ac_cv_header_$ac_safe=no"
7680fi
7681rm -f conftest*
7682fi
7683if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7684 echo "$ac_t""yes" 1>&6
7685 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7686 cat >> confdefs.h <<EOF
7687#define $ac_tr_hdr 1
7688EOF
7689
7690else
7691 echo "$ac_t""no" 1>&6
7692fi
7693done
7694
7695fi
7696done
7697
7698fi
7699done
7700
7701 fi
7702 for ac_hdr in com_err.h
7703do
7704ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7705echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
bb17930d 7706echo "configure:7707: checking for $ac_hdr" >&5
a21616bd
KR
7707if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7708 echo $ac_n "(cached) $ac_c" 1>&6
7709else
7710 cat > conftest.$ac_ext <<EOF
bb17930d 7711#line 7712 "configure"
a21616bd
KR
7712#include "confdefs.h"
7713#include <$ac_hdr>
7714EOF
7715ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 7716{ (eval echo configure:7717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 7717ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
a21616bd
KR
7718if test -z "$ac_err"; then
7719 rm -rf conftest*
7720 eval "ac_cv_header_$ac_safe=yes"
7721else
7722 echo "$ac_err" >&5
7723 echo "configure: failed program was:" >&5
7724 cat conftest.$ac_ext >&5
7725 rm -rf conftest*
7726 eval "ac_cv_header_$ac_safe=no"
7727fi
7728rm -f conftest*
7729fi
7730if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7731 echo "$ac_t""yes" 1>&6
7732 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7733 cat >> confdefs.h <<EOF
7734#define $ac_tr_hdr 1
7735EOF
7736
7737else
7738 echo "$ac_t""no" 1>&6
7739fi
7740done
7741
7742fi
7743
ba4481b5
DL
7744# Solaris requires -lintl if you want strerror (which calls dgettext)
7745# to return localized messages.
7746echo $ac_n "checking for dgettext in -lintl""... $ac_c" 1>&6
bb17930d 7747echo "configure:7748: checking for dgettext in -lintl" >&5
ba4481b5
DL
7748ac_lib_var=`echo intl'_'dgettext | sed 'y%./+-%__p_%'`
7749if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7750 echo $ac_n "(cached) $ac_c" 1>&6
7751else
7752 ac_save_LIBS="$LIBS"
7753LIBS="-lintl $LIBS"
7754cat > conftest.$ac_ext <<EOF
bb17930d 7755#line 7756 "configure"
ba4481b5
DL
7756#include "confdefs.h"
7757/* Override any gcc2 internal prototype to avoid an error. */
7758/* We use char because int might match the return type of a gcc2
7759 builtin and then its argument prototype would still apply. */
7760char dgettext();
7761
7762int main() {
7763dgettext()
7764; return 0; }
7765EOF
bb17930d 7766if { (eval echo configure:7767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
7767 rm -rf conftest*
7768 eval "ac_cv_lib_$ac_lib_var=yes"
7769else
7770 echo "configure: failed program was:" >&5
7771 cat conftest.$ac_ext >&5
7772 rm -rf conftest*
7773 eval "ac_cv_lib_$ac_lib_var=no"
7774fi
7775rm -f conftest*
7776LIBS="$ac_save_LIBS"
7777
7778fi
7779if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7780 echo "$ac_t""yes" 1>&6
7781 ac_tr_lib=HAVE_LIB`echo intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7782 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7783 cat >> confdefs.h <<EOF
7784#define $ac_tr_lib 1
7785EOF
7786
7787 LIBS="-lintl $LIBS"
7788
7789else
7790 echo "$ac_t""no" 1>&6
7791fi
7792
7793
7794echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
bb17930d 7795echo "configure:7796: checking whether localtime caches TZ" >&5
ba4481b5
DL
7796if eval "test \"`echo '$''{'emacs_cv_localtime_cache'+set}'`\" = set"; then
7797 echo $ac_n "(cached) $ac_c" 1>&6
7798else
7799 if test x$ac_cv_func_tzset = xyes; then
7800if test "$cross_compiling" = yes; then
7801 # If we have tzset, assume the worst when cross-compiling.
7802emacs_cv_localtime_cache=yes
7803else
7804 cat > conftest.$ac_ext <<EOF
bb17930d 7805#line 7806 "configure"
ba4481b5
DL
7806#include "confdefs.h"
7807#include <time.h>
ba4481b5
DL
7808extern char **environ;
7809unset_TZ ()
7810{
7811 char **from, **to;
7812 for (to = from = environ; (*to = *from); from++)
7813 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
7814 to++;
7815}
7816char TZ_GMT0[] = "TZ=GMT0";
7817char TZ_PST8[] = "TZ=PST8";
7818main()
7819{
7820 time_t now = time ((time_t *) 0);
7821 int hour_GMT0, hour_unset;
7822 if (putenv (TZ_GMT0) != 0)
7823 exit (1);
7824 hour_GMT0 = localtime (&now)->tm_hour;
7825 unset_TZ ();
7826 hour_unset = localtime (&now)->tm_hour;
7827 if (putenv (TZ_PST8) != 0)
7828 exit (1);
7829 if (localtime (&now)->tm_hour == hour_GMT0)
7830 exit (1);
7831 unset_TZ ();
7832 if (localtime (&now)->tm_hour != hour_unset)
7833 exit (1);
7834 exit (0);
7835}
7836EOF
bb17930d 7837if { (eval echo configure:7838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
ba4481b5
DL
7838then
7839 emacs_cv_localtime_cache=no
7840else
7841 echo "configure: failed program was:" >&5
7842 cat conftest.$ac_ext >&5
7843 rm -fr conftest*
7844 emacs_cv_localtime_cache=yes
7845fi
7846rm -fr conftest*
7847fi
7848
7849else
7850 # If we lack tzset, report that localtime does not cache TZ,
7851 # since we can't invalidate the cache if we don't have tzset.
7852 emacs_cv_localtime_cache=no
7853fi
7854fi
7855echo "$ac_t""$emacs_cv_localtime_cache" 1>&6
7856if test $emacs_cv_localtime_cache = yes; then
7857 cat >> confdefs.h <<\EOF
7858#define LOCALTIME_CACHE 1
7859EOF
7860
7861fi
7862
7863if test "x$HAVE_TIMEVAL" = xyes; then
48d4b120
DL
7864 for ac_func in gettimeofday
7865do
7866echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
bb17930d 7867echo "configure:7868: checking for $ac_func" >&5
48d4b120
DL
7868if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7869 echo $ac_n "(cached) $ac_c" 1>&6
7870else
7871 cat > conftest.$ac_ext <<EOF
bb17930d 7872#line 7873 "configure"
48d4b120
DL
7873#include "confdefs.h"
7874/* System header to define __stub macros and hopefully few prototypes,
7875 which can conflict with char $ac_func(); below. */
7876#include <assert.h>
7877/* Override any gcc2 internal prototype to avoid an error. */
7878/* We use char because int might match the return type of a gcc2
7879 builtin and then its argument prototype would still apply. */
7880char $ac_func();
7881
7882int main() {
7883
7884/* The GNU C library defines this for functions which it implements
7885 to always fail with ENOSYS. Some functions are actually named
7886 something starting with __ and the normal name is an alias. */
7887#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7888choke me
7889#else
7890$ac_func();
7891#endif
7892
7893; return 0; }
7894EOF
bb17930d 7895if { (eval echo configure:7896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
48d4b120
DL
7896 rm -rf conftest*
7897 eval "ac_cv_func_$ac_func=yes"
7898else
7899 echo "configure: failed program was:" >&5
7900 cat conftest.$ac_ext >&5
7901 rm -rf conftest*
7902 eval "ac_cv_func_$ac_func=no"
7903fi
7904rm -f conftest*
7905fi
7906
7907if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7908 echo "$ac_t""yes" 1>&6
7909 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7910 cat >> confdefs.h <<EOF
7911#define $ac_tr_func 1
7912EOF
7913
7914else
7915 echo "$ac_t""no" 1>&6
7916fi
7917done
7918
7919 echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6
bb17930d 7920echo "configure:7921: checking whether gettimeofday can accept two arguments" >&5
ba4481b5
DL
7921if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then
7922 echo $ac_n "(cached) $ac_c" 1>&6
7923else
7924 cat > conftest.$ac_ext <<EOF
bb17930d 7925#line 7926 "configure"
a3f08d9e 7926#include "confdefs.h"
ba4481b5 7927
a3f08d9e
DL
7928#ifdef TIME_WITH_SYS_TIME
7929#include <sys/time.h>
7930#include <time.h>
7931#else
7932#ifdef HAVE_SYS_TIME_H
7933#include <sys/time.h>
7934#else
7935#include <time.h>
7936#endif
7937#endif
7938int main() {
7939struct timeval time;
48d4b120 7940 gettimeofday (&time, 0);
ba4481b5
DL
7941; return 0; }
7942EOF
bb17930d 7943if { (eval echo configure:7944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ba4481b5
DL
7944 rm -rf conftest*
7945 emacs_cv_gettimeofday_two_arguments=yes
7946else
7947 echo "configure: failed program was:" >&5
7948 cat conftest.$ac_ext >&5
7949 rm -rf conftest*
7950 emacs_cv_gettimeofday_two_arguments=no
7951fi
7952rm -f conftest*
7953fi
7954
7955echo "$ac_t""$emacs_cv_gettimeofday_two_arguments" 1>&6
7956 if test $emacs_cv_gettimeofday_two_arguments = no; then
7957 cat >> confdefs.h <<\EOF
7958#define GETTIMEOFDAY_ONE_ARGUMENT 1
7959EOF
7960
7961 fi
7962fi
7963
48d4b120
DL
7964if test "$ac_cv_func_gettimeofday" = yes; then
7965 echo $ac_n "checking for struct timezone""... $ac_c" 1>&6
bb17930d 7966echo "configure:7967: checking for struct timezone" >&5
48d4b120
DL
7967if eval "test \"`echo '$''{'emacs_cv_struct_timezone'+set}'`\" = set"; then
7968 echo $ac_n "(cached) $ac_c" 1>&6
7969else
7970 cat > conftest.$ac_ext <<EOF
bb17930d 7971#line 7972 "configure"
48d4b120
DL
7972#include "confdefs.h"
7973#include <sys/time.h>
7974int main() {
7975struct timezone tz;
7976; return 0; }
7977EOF
bb17930d 7978if { (eval echo configure:7979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
48d4b120
DL
7979 rm -rf conftest*
7980 if test "$cross_compiling" = yes; then
7981 emacs_cv_struct_timezone=yes
7982else
7983 cat > conftest.$ac_ext <<EOF
bb17930d 7984#line 7985 "configure"
48d4b120
DL
7985#include "confdefs.h"
7986
7987#ifdef TIME_WITH_SYS_TIME
7988#include <sys/time.h>
7989#include <time.h>
7990#else
7991#ifdef HAVE_SYS_TIME_H
7992#include <sys/time.h>
7993#else
7994#include <time.h>
7995#endif
7996#endif
7997main () {
7998 struct timeval time;
7999 struct timezone dummy;
8000 exit (gettimeofday (&time, &dummy));
8001}
8002EOF
bb17930d 8003if { (eval echo configure:8004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
48d4b120
DL
8004then
8005 emacs_cv_struct_timezone=yes
8006else
8007 echo "configure: failed program was:" >&5
8008 cat conftest.$ac_ext >&5
8009 rm -fr conftest*
8010 emacs_cv_struct_timezone=no
8011fi
8012rm -fr conftest*
8013fi
8014
8015else
8016 echo "configure: failed program was:" >&5
8017 cat conftest.$ac_ext >&5
8018 rm -rf conftest*
8019 emacs_cv_struct_timezone=no
8020fi
8021rm -f conftest*
8022fi
8023
8024echo "$ac_t""$emacs_cv_struct_timezone" 1>&6
8025fi
8026
ba4481b5
DL
8027ok_so_far=yes
8028echo $ac_n "checking for socket""... $ac_c" 1>&6
bb17930d 8029echo "configure:8030: checking for socket" >&5
ba4481b5
DL
8030if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
8031 echo $ac_n "(cached) $ac_c" 1>&6
8032else
8033 cat > conftest.$ac_ext <<EOF
bb17930d 8034#line 8035 "configure"
ba4481b5
DL
8035#include "confdefs.h"
8036/* System header to define __stub macros and hopefully few prototypes,
8037 which can conflict with char socket(); below. */
8038#include <assert.h>
8039/* Override any gcc2 internal prototype to avoid an error. */
8040/* We use char because int might match the return type of a gcc2
8041 builtin and then its argument prototype would still apply. */
8042char socket();
8043
8044int main() {
8045
8046/* The GNU C library defines this for functions which it implements
8047 to always fail with ENOSYS. Some functions are actually named
8048 something starting with __ and the normal name is an alias. */
8049#if defined (__stub_socket) || defined (__stub___socket)
8050choke me
8051#else
a21616bd 8052socket();
ba4481b5
DL
8053#endif
8054
8055; return 0; }
8056EOF
bb17930d 8057if { (eval echo configure:8058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ba4481b5
DL
8058 rm -rf conftest*
8059 eval "ac_cv_func_socket=yes"
8060else
8061 echo "configure: failed program was:" >&5
8062 cat conftest.$ac_ext >&5
8063 rm -rf conftest*
8064 eval "ac_cv_func_socket=no"
8065fi
8066rm -f conftest*
8067fi
8068
8069if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
8070 echo "$ac_t""yes" 1>&6
8071 :
8072else
8073 echo "$ac_t""no" 1>&6
8074ok_so_far=no
8075fi
8076
8077if test $ok_so_far = yes; then
8078 ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
8079echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
bb17930d 8080echo "configure:8081: checking for netinet/in.h" >&5
ba4481b5
DL
8081if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8082 echo $ac_n "(cached) $ac_c" 1>&6
8083else
8084 cat > conftest.$ac_ext <<EOF
bb17930d 8085#line 8086 "configure"
ba4481b5
DL
8086#include "confdefs.h"
8087#include <netinet/in.h>
8088EOF
8089ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 8090{ (eval echo configure:8091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 8091ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
8092if test -z "$ac_err"; then
8093 rm -rf conftest*
8094 eval "ac_cv_header_$ac_safe=yes"
8095else
8096 echo "$ac_err" >&5
8097 echo "configure: failed program was:" >&5
8098 cat conftest.$ac_ext >&5
8099 rm -rf conftest*
8100 eval "ac_cv_header_$ac_safe=no"
8101fi
8102rm -f conftest*
8103fi
8104if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8105 echo "$ac_t""yes" 1>&6
8106 :
8107else
8108 echo "$ac_t""no" 1>&6
8109ok_so_far=no
8110fi
8111
8112fi
8113if test $ok_so_far = yes; then
8114 ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
8115echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
bb17930d 8116echo "configure:8117: checking for arpa/inet.h" >&5
ba4481b5
DL
8117if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8118 echo $ac_n "(cached) $ac_c" 1>&6
8119else
8120 cat > conftest.$ac_ext <<EOF
bb17930d 8121#line 8122 "configure"
ba4481b5
DL
8122#include "confdefs.h"
8123#include <arpa/inet.h>
8124EOF
8125ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 8126{ (eval echo configure:8127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c4bb2108 8127ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ba4481b5
DL
8128if test -z "$ac_err"; then
8129 rm -rf conftest*
8130 eval "ac_cv_header_$ac_safe=yes"
8131else
8132 echo "$ac_err" >&5
8133 echo "configure: failed program was:" >&5
8134 cat conftest.$ac_ext >&5
8135 rm -rf conftest*
8136 eval "ac_cv_header_$ac_safe=no"
8137fi
8138rm -f conftest*
8139fi
8140if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8141 echo "$ac_t""yes" 1>&6
8142 :
8143else
8144 echo "$ac_t""no" 1>&6
8145ok_so_far=no
8146fi
8147
8148fi
8149if test $ok_so_far = yes; then
8150 cat >> confdefs.h <<\EOF
8151#define HAVE_INET_SOCKETS 1
8152EOF
8153
8154fi
8155
8156if test -f /usr/lpp/X11/bin/smt.exp; then
8157 cat >> confdefs.h <<\EOF
8158#define HAVE_AIX_SMT_EXP 1
8159EOF
8160
8161fi
8162
3d9fec71 8163echo $ac_n "checking whether system supports dynamic ptys""... $ac_c" 1>&6
bb17930d 8164echo "configure:8165: checking whether system supports dynamic ptys" >&5
3d9fec71
DL
8165if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
8166 echo "$ac_t""yes" 1>&6
8167 cat >> confdefs.h <<\EOF
8168#define HAVE_DEV_PTMX 1
8169EOF
8170
8171else
8172 echo "$ac_t""no" 1>&6
8173fi
8174
647847ea 8175echo $ac_n "checking for pid_t""... $ac_c" 1>&6
bb17930d 8176echo "configure:8177: checking for pid_t" >&5
647847ea
DL
8177if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
8178 echo $ac_n "(cached) $ac_c" 1>&6
8179else
8180 cat > conftest.$ac_ext <<EOF
bb17930d 8181#line 8182 "configure"
647847ea
DL
8182#include "confdefs.h"
8183#include <sys/types.h>
8184#if STDC_HEADERS
8185#include <stdlib.h>
8186#include <stddef.h>
8187#endif
8188EOF
8189if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8190 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8191 rm -rf conftest*
8192 ac_cv_type_pid_t=yes
8193else
8194 rm -rf conftest*
8195 ac_cv_type_pid_t=no
8196fi
8197rm -f conftest*
8198
8199fi
8200echo "$ac_t""$ac_cv_type_pid_t" 1>&6
8201if test $ac_cv_type_pid_t = no; then
8202 cat >> confdefs.h <<\EOF
8203#define pid_t int
8204EOF
8205
8206fi
8207
8208ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
8209echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
bb17930d 8210echo "configure:8211: checking for vfork.h" >&5
647847ea
DL
8211if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8212 echo $ac_n "(cached) $ac_c" 1>&6
8213else
8214 cat > conftest.$ac_ext <<EOF
bb17930d 8215#line 8216 "configure"
647847ea
DL
8216#include "confdefs.h"
8217#include <vfork.h>
8218EOF
8219ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
bb17930d 8220{ (eval echo configure:8221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
647847ea
DL
8221ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8222if test -z "$ac_err"; then
8223 rm -rf conftest*
8224 eval "ac_cv_header_$ac_safe=yes"
8225else
8226 echo "$ac_err" >&5
8227 echo "configure: failed program was:" >&5
8228 cat conftest.$ac_ext >&5
8229 rm -rf conftest*
8230 eval "ac_cv_header_$ac_safe=no"
8231fi
8232rm -f conftest*
8233fi
8234if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8235 echo "$ac_t""yes" 1>&6
8236 cat >> confdefs.h <<\EOF
8237#define HAVE_VFORK_H 1
8238EOF
8239
8240else
8241 echo "$ac_t""no" 1>&6
8242fi
8243
8244echo $ac_n "checking for working vfork""... $ac_c" 1>&6
bb17930d 8245echo "configure:8246: checking for working vfork" >&5
647847ea
DL
8246if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
8247 echo $ac_n "(cached) $ac_c" 1>&6
8248else
8249 if test "$cross_compiling" = yes; then
8250 echo $ac_n "checking for vfork""... $ac_c" 1>&6
bb17930d 8251echo "configure:8252: checking for vfork" >&5
647847ea
DL
8252if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
8253 echo $ac_n "(cached) $ac_c" 1>&6
8254else
8255 cat > conftest.$ac_ext <<EOF
bb17930d 8256#line 8257 "configure"
647847ea
DL
8257#include "confdefs.h"
8258/* System header to define __stub macros and hopefully few prototypes,
8259 which can conflict with char vfork(); below. */
8260#include <assert.h>
8261/* Override any gcc2 internal prototype to avoid an error. */
8262/* We use char because int might match the return type of a gcc2
8263 builtin and then its argument prototype would still apply. */
8264char vfork();
8265
8266int main() {
8267
8268/* The GNU C library defines this for functions which it implements
8269 to always fail with ENOSYS. Some functions are actually named
8270 something starting with __ and the normal name is an alias. */
8271#if defined (__stub_vfork) || defined (__stub___vfork)
8272choke me
8273#else
8274vfork();
8275#endif
8276
8277; return 0; }
8278EOF
bb17930d 8279if { (eval echo configure:8280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
647847ea
DL
8280 rm -rf conftest*
8281 eval "ac_cv_func_vfork=yes"
8282else
8283 echo "configure: failed program was:" >&5
8284 cat conftest.$ac_ext >&5
8285 rm -rf conftest*
8286 eval "ac_cv_func_vfork=no"
8287fi
8288rm -f conftest*
8289fi
8290
8291if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
8292 echo "$ac_t""yes" 1>&6
8293 :
8294else
8295 echo "$ac_t""no" 1>&6
8296fi
8297
8298ac_cv_func_vfork_works=$ac_cv_func_vfork
8299else
8300 cat > conftest.$ac_ext <<EOF
bb17930d 8301#line 8302 "configure"
647847ea
DL
8302#include "confdefs.h"
8303/* Thanks to Paul Eggert for this test. */
8304#include <stdio.h>
8305#include <sys/types.h>
8306#include <sys/stat.h>
8307#ifdef HAVE_UNISTD_H
8308#include <unistd.h>
8309#endif
8310#ifdef HAVE_VFORK_H
8311#include <vfork.h>
8312#endif
8313/* On some sparc systems, changes by the child to local and incoming
8314 argument registers are propagated back to the parent.
8315 The compiler is told about this with #include <vfork.h>,
8316 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
8317 Test for this by using a static variable whose address
8318 is put into a register that is clobbered by the vfork. */
8319static
8320#ifdef __cplusplus
8321sparc_address_test (int arg)
8322#else
8323sparc_address_test (arg) int arg;
8324#endif
8325{
8326 static pid_t child;
8327 if (!child) {
8328 child = vfork ();
8329 if (child < 0) {
8330 perror ("vfork");
8331 _exit(2);
8332 }
8333 if (!child) {
8334 arg = getpid();
8335 write(-1, "", 0);
8336 _exit (arg);
8337 }
8338 }
8339}
8340main() {
8341 pid_t parent = getpid ();
8342 pid_t child;
8343
8344 sparc_address_test ();
8345
8346 child = vfork ();
8347
8348 if (child == 0) {
8349 /* Here is another test for sparc vfork register problems.
8350 This test uses lots of local variables, at least
8351 as many local variables as main has allocated so far
8352 including compiler temporaries. 4 locals are enough for
8353 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
8354 A buggy compiler should reuse the register of parent
8355 for one of the local variables, since it will think that
8356 parent can't possibly be used any more in this routine.
8357 Assigning to the local variable will thus munge parent
8358 in the parent process. */
8359 pid_t
8360 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
8361 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
8362 /* Convince the compiler that p..p7 are live; otherwise, it might
8363 use the same hardware register for all 8 local variables. */
8364 if (p != p1 || p != p2 || p != p3 || p != p4
8365 || p != p5 || p != p6 || p != p7)
8366 _exit(1);
8367
8368 /* On some systems (e.g. IRIX 3.3),
8369 vfork doesn't separate parent from child file descriptors.
8370 If the child closes a descriptor before it execs or exits,
8371 this munges the parent's descriptor as well.
8372 Test for this by closing stdout in the child. */
8373 _exit(close(fileno(stdout)) != 0);
8374 } else {
8375 int status;
8376 struct stat st;
8377
8378 while (wait(&status) != child)
8379 ;
8380 exit(
8381 /* Was there some problem with vforking? */
8382 child < 0
8383
8384 /* Did the child fail? (This shouldn't happen.) */
8385 || status
8386
8387 /* Did the vfork/compiler bug occur? */
8388 || parent != getpid()
8389
8390 /* Did the file descriptor bug occur? */
8391 || fstat(fileno(stdout), &st) != 0
8392 );
8393 }
8394}
8395EOF
bb17930d 8396if { (eval echo configure:8397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
647847ea
DL
8397then
8398 ac_cv_func_vfork_works=yes
8399else
8400 echo "configure: failed program was:" >&5
8401 cat conftest.$ac_ext >&5
8402 rm -fr conftest*
8403 ac_cv_func_vfork_works=no
8404fi
8405rm -fr conftest*
8406fi
8407
8408fi
8409
8410echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
8411if test $ac_cv_func_vfork_works = no; then
8412 cat >> confdefs.h <<\EOF
8413#define vfork fork
8414EOF
8415
8416fi
8417
8418
8730a8da
DL
8419# Fixme: This should be replaced when we have autoconf 2.14.
8420echo $ac_n "checking for size_t""... $ac_c" 1>&6
bb17930d 8421echo "configure:8422: checking for size_t" >&5
8730a8da
DL
8422if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
8423 echo $ac_n "(cached) $ac_c" 1>&6
8424else
8425 cat > conftest.$ac_ext <<EOF
bb17930d 8426#line 8427 "configure"
8730a8da
DL
8427#include "confdefs.h"
8428#include <sys/types.h>
8429#if STDC_HEADERS
8430#include <stdlib.h>
8431#include <stddef.h>
8432#endif
8433EOF
8434if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8435 egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8436 rm -rf conftest*
8437 ac_cv_type_size_t=yes
8438else
8439 rm -rf conftest*
8440 ac_cv_type_size_t=no
8441fi
8442rm -f conftest*
8443
8444fi
8445echo "$ac_t""$ac_cv_type_size_t" 1>&6
8446if test $ac_cv_type_size_t = no; then
8447 cat >> confdefs.h <<\EOF
8448#define size_t unsigned
8449EOF
8450
8451fi
8452
8453
ba4481b5
DL
8454# Set up the CFLAGS for real compilation, so we can substitute it.
8455CFLAGS="$REAL_CFLAGS"
5a9bf171 8456CPPFLAGS="$REAL_CPPFLAGS"
ba4481b5
DL
8457
8458#### Find out which version of Emacs this is.
8459version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
8460 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
8461if test x"${version}" = x; then
8462 { echo "configure: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." 1>&2; exit 1; }
8463fi
8464
8465### Specify what sort of things we'll be editing into Makefile and config.h.
8466### Use configuration here uncanonicalized to avoid exceeding size limits.
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
4c343001 8495
ba4481b5
DL
8496
8497
8498cat >> confdefs.h <<EOF
8499#define EMACS_CONFIGURATION "${canonical}"
8500EOF
8501
8502cat >> confdefs.h <<EOF
8503#define EMACS_CONFIG_OPTIONS "${ac_configure_args}"
8504EOF
8505
8506cat >> confdefs.h <<EOF
8507#define config_machfile "${machfile}"
8508EOF
8509
8510cat >> confdefs.h <<EOF
8511#define config_opsysfile "${opsysfile}"
8512EOF
8513
8514cat >> confdefs.h <<EOF
8515#define LD_SWITCH_X_SITE ${LD_SWITCH_X_SITE}
8516EOF
8517
8518cat >> confdefs.h <<EOF
8519#define LD_SWITCH_X_SITE_AUX ${LD_SWITCH_X_SITE_AUX}
8520EOF
8521
8522cat >> confdefs.h <<EOF
8523#define C_SWITCH_X_SITE ${C_SWITCH_X_SITE}
8524EOF
8525
8526cat >> confdefs.h <<EOF
8527#define UNEXEC_SRC ${UNEXEC_SRC}
8528EOF
8529
8530
8531if test "${HAVE_X_WINDOWS}" = "yes" ; then
8532 cat >> confdefs.h <<\EOF
8533#define HAVE_X_WINDOWS 1
8534EOF
8535
8536fi
8537if test "${USE_X_TOOLKIT}" != "none" ; then
8538 cat >> confdefs.h <<\EOF
8539#define USE_X_TOOLKIT 1
8540EOF
8541
8542fi
8543if test "${HAVE_X11}" = "yes" ; then
8544 cat >> confdefs.h <<\EOF
8545#define HAVE_X11 1
8546EOF
8547
8548fi
8549if test "${HAVE_XFREE386}" = "yes" ; then
8550 cat >> confdefs.h <<\EOF
8551#define HAVE_XFREE386 1
8552EOF
8553
8554fi
8555if test "${HAVE_MENUS}" = "yes" ; then
8556 cat >> confdefs.h <<\EOF
8557#define HAVE_MENUS 1
8558EOF
8559
8560fi
8561if test "${GNU_MALLOC}" = "yes" ; then
8562 cat >> confdefs.h <<\EOF
8563#define GNU_MALLOC 1
8564EOF
8565
8566fi
8567if test "${REL_ALLOC}" = "yes" ; then
8568 cat >> confdefs.h <<\EOF
8569#define REL_ALLOC 1
8570EOF
8571
ba4481b5
DL
8572fi
8573
8574#### Report on what we decided to do.
8575echo "
8576Configured for \`${canonical}'.
8577
8578 Where should the build process find the source code? ${srcdir}
8579 What operating system and machine description files should Emacs use?
8580 \`${opsysfile}' and \`${machfile}'
8581 What compiler should emacs be built with? ${CC} ${CFLAGS}
8582 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
8583 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
8584 What window system should Emacs use? ${window_system}
8585 What toolkit should Emacs use? ${USE_X_TOOLKIT}"
8586
8587if test -n "${x_includes}"; then
8588echo " Where do we find X Windows header files? ${x_includes}"
8589else
8590echo " Where do we find X Windows header files? Standard dirs"
8591fi
8592if test -n "${x_libraries}"; then
8593echo " Where do we find X Windows libraries? ${x_libraries}"
8594else
8595echo " Where do we find X Windows libraries? Standard dirs"
8596fi
8597
8598echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
8599echo " Does Emacs use -lXpm? ${HAVE_XPM}"
8600echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
8601echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
8602echo " Does Emacs use -lungif? ${HAVE_GIF}"
8603echo " Does Emacs use -lpng? ${HAVE_PNG}"
8604echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
8605echo
8606
8607# Remove any trailing slashes in these variables.
8608test "${prefix}" != NONE &&
8609 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
8610test "${exec_prefix}" != NONE &&
8611 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
8612
8613trap '' 1 2 15
8614cat > confcache <<\EOF
8615# This file is a shell script that caches the results of configure
8616# tests run on this system so they can be shared between configure
8617# scripts and configure runs. It is not useful on other systems.
8618# If it contains results you don't want to keep, you may remove or edit it.
8619#
8620# By default, configure uses ./config.cache as the cache file,
8621# creating it if it does not exist already. You can give configure
8622# the --cache-file=FILE option to use a different cache file; that is
8623# what configure does when it calls configure scripts in
8624# subdirectories, so they share the cache.
8625# Giving --cache-file=/dev/null disables caching, for debugging configure.
8626# config.status only pays attention to the cache file if you give it the
8627# --recheck option to rerun configure.
8628#
8629EOF
8630# The following way of writing the cache mishandles newlines in values,
8631# but we know of no workaround that is simple, portable, and efficient.
8632# So, don't put newlines in cache variables' values.
8633# Ultrix sh set writes to stderr and can't be redirected directly,
8634# and sets the high bit in the cache file unless we assign to the vars.
8635(set) 2>&1 |
8636 case `(ac_space=' '; set | grep ac_space) 2>&1` in
8637 *ac_space=\ *)
8638 # `set' does not quote correctly, so add quotes (double-quote substitution
8639 # turns \\\\ into \\, and sed turns \\ into \).
8640 sed -n \
8641 -e "s/'/'\\\\''/g" \
8642 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8643 ;;
8644 *)
8645 # `set' quotes correctly as required by POSIX, so do not add quotes.
8646 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8647 ;;
8648 esac >> confcache
8649if cmp -s $cache_file confcache; then
8650 :
8651else
8652 if test -w $cache_file; then
8653 echo "updating cache $cache_file"
8654 cat confcache > $cache_file
8655 else
8656 echo "not updating unwritable cache $cache_file"
8657 fi
8658fi
8659rm -f confcache
8660
8661trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8662
8663test "x$prefix" = xNONE && prefix=$ac_default_prefix
8664# Let make expand exec_prefix.
8665test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8666
8667# Any assignment to VPATH causes Sun make to only execute
8668# the first set of double-colon rules, so remove it if not needed.
8669# If there is a colon in the path, we need to keep it.
8670if test "x$srcdir" = x.; then
8671 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
8672fi
8673
8674trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8675
8676DEFS=-DHAVE_CONFIG_H
8677
8678# Without the "./", some shells look in PATH for config.status.
8679: ${CONFIG_STATUS=./config.status}
8680
8681echo creating $CONFIG_STATUS
8682rm -f $CONFIG_STATUS
8683cat > $CONFIG_STATUS <<EOF
8684#! /bin/sh
8685# Generated automatically by configure.
8686# Run this file to recreate the current configuration.
8687# This directory was configured as follows,
8688# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8689#
8690# $0 $ac_configure_args
8691#
8692# Compiler output produced by configure, useful for debugging
8693# configure, is in ./config.log if it exists.
8694
8695ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8696for ac_option
8697do
8698 case "\$ac_option" in
8699 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8700 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8701 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8702 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
c4bb2108 8703 echo "$CONFIG_STATUS generated by autoconf version 2.13"
ba4481b5
DL
8704 exit 0 ;;
8705 -help | --help | --hel | --he | --h)
8706 echo "\$ac_cs_usage"; exit 0 ;;
8707 *) echo "\$ac_cs_usage"; exit 1 ;;
8708 esac
8709done
8710
8711ac_given_srcdir=$srcdir
8712ac_given_INSTALL="$INSTALL"
8713
8714trap 'rm -fr `echo "Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
8715 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
dce6b995 8716 lisp/Makefile leim/Makefile src/config.h:src/config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
ba4481b5
DL
8717EOF
8718cat >> $CONFIG_STATUS <<EOF
8719
8720# Protect against being on the right side of a sed subst in config.status.
8721sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8722 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8723$ac_vpsub
8724$extrasub
c4bb2108 8725s%@SHELL@%$SHELL%g
ba4481b5
DL
8726s%@CFLAGS@%$CFLAGS%g
8727s%@CPPFLAGS@%$CPPFLAGS%g
8728s%@CXXFLAGS@%$CXXFLAGS%g
c4bb2108 8729s%@FFLAGS@%$FFLAGS%g
ba4481b5
DL
8730s%@DEFS@%$DEFS%g
8731s%@LDFLAGS@%$LDFLAGS%g
8732s%@LIBS@%$LIBS%g
8733s%@exec_prefix@%$exec_prefix%g
8734s%@prefix@%$prefix%g
8735s%@program_transform_name@%$program_transform_name%g
8736s%@bindir@%$bindir%g
8737s%@sbindir@%$sbindir%g
8738s%@libexecdir@%$libexecdir%g
8739s%@datadir@%$datadir%g
8740s%@sysconfdir@%$sysconfdir%g
8741s%@sharedstatedir@%$sharedstatedir%g
8742s%@localstatedir@%$localstatedir%g
8743s%@libdir@%$libdir%g
8744s%@includedir@%$includedir%g
8745s%@oldincludedir@%$oldincludedir%g
8746s%@infodir@%$infodir%g
8747s%@mandir@%$mandir%g
8748s%@host@%$host%g
8749s%@host_alias@%$host_alias%g
8750s%@host_cpu@%$host_cpu%g
8751s%@host_vendor@%$host_vendor%g
8752s%@host_os@%$host_os%g
8753s%@CC@%$CC%g
8754s%@LN_S@%$LN_S%g
8755s%@CPP@%$CPP%g
8756s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
c4bb2108 8757s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
ba4481b5
DL
8758s%@INSTALL_DATA@%$INSTALL_DATA%g
8759s%@YACC@%$YACC%g
7397acc4 8760s%@RANLIB@%$RANLIB%g
b192d653 8761s%@LIBSOUND@%$LIBSOUND%g
ba4481b5
DL
8762s%@SET_MAKE@%$SET_MAKE%g
8763s%@ALLOCA@%$ALLOCA%g
8764s%@liblockfile@%$liblockfile%g
b5de8dc0 8765s%@LIBOBJS@%$LIBOBJS%g
4c343001
DL
8766s%@NEED_SETGID@%$NEED_SETGID%g
8767s%@KMEM_GROUP@%$KMEM_GROUP%g
ba4481b5
DL
8768s%@version@%$version%g
8769s%@configuration@%$configuration%g
8770s%@canonical@%$canonical%g
8771s%@srcdir@%$srcdir%g
8772s%@lispdir@%$lispdir%g
8773s%@locallisppath@%$locallisppath%g
8774s%@lisppath@%$lisppath%g
8775s%@x_default_search_path@%$x_default_search_path%g
8776s%@etcdir@%$etcdir%g
8777s%@archlibdir@%$archlibdir%g
8778s%@docdir@%$docdir%g
8779s%@bitmapdir@%$bitmapdir%g
8780s%@c_switch_system@%$c_switch_system%g
8781s%@c_switch_machine@%$c_switch_machine%g
8782s%@LD_SWITCH_X_SITE@%$LD_SWITCH_X_SITE%g
8783s%@LD_SWITCH_X_SITE_AUX@%$LD_SWITCH_X_SITE_AUX%g
8784s%@C_SWITCH_X_SITE@%$C_SWITCH_X_SITE%g
8785s%@X_TOOLKIT_TYPE@%$X_TOOLKIT_TYPE%g
8786s%@machfile@%$machfile%g
8787s%@opsysfile@%$opsysfile%g
4c343001 8788s%@GETLOADAVG_LIBS@%$GETLOADAVG_LIBS%g
ba4481b5
DL
8789
8790CEOF
8791EOF
8792
8793cat >> $CONFIG_STATUS <<\EOF
8794
8795# Split the substitutions into bite-sized pieces for seds with
8796# small command number limits, like on Digital OSF/1 and HP-UX.
8797ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8798ac_file=1 # Number of current file.
8799ac_beg=1 # First line for current file.
8800ac_end=$ac_max_sed_cmds # Line after last line for current file.
8801ac_more_lines=:
8802ac_sed_cmds=""
8803while $ac_more_lines; do
8804 if test $ac_beg -gt 1; then
8805 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8806 else
8807 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8808 fi
8809 if test ! -s conftest.s$ac_file; then
8810 ac_more_lines=false
8811 rm -f conftest.s$ac_file
8812 else
8813 if test -z "$ac_sed_cmds"; then
8814 ac_sed_cmds="sed -f conftest.s$ac_file"
8815 else
8816 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8817 fi
8818 ac_file=`expr $ac_file + 1`
8819 ac_beg=$ac_end
8820 ac_end=`expr $ac_end + $ac_max_sed_cmds`
8821 fi
8822done
8823if test -z "$ac_sed_cmds"; then
8824 ac_sed_cmds=cat
8825fi
8826EOF
8827
8828cat >> $CONFIG_STATUS <<EOF
8829
8830CONFIG_FILES=\${CONFIG_FILES-"Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
8831 man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
dce6b995 8832 lisp/Makefile leim/Makefile"}
ba4481b5
DL
8833EOF
8834cat >> $CONFIG_STATUS <<\EOF
8835for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8836 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8837 case "$ac_file" in
8838 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8839 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8840 *) ac_file_in="${ac_file}.in" ;;
8841 esac
8842
8843 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8844
8845 # Remove last slash and all that follows it. Not all systems have dirname.
8846 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8847 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8848 # The file is in a subdirectory.
8849 test ! -d "$ac_dir" && mkdir "$ac_dir"
8850 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8851 # A "../" for each directory in $ac_dir_suffix.
8852 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8853 else
8854 ac_dir_suffix= ac_dots=
8855 fi
8856
8857 case "$ac_given_srcdir" in
8858 .) srcdir=.
8859 if test -z "$ac_dots"; then top_srcdir=.
8860 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8861 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8862 *) # Relative path.
8863 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8864 top_srcdir="$ac_dots$ac_given_srcdir" ;;
8865 esac
8866
8867 case "$ac_given_INSTALL" in
8868 [/$]*) INSTALL="$ac_given_INSTALL" ;;
8869 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
8870 esac
8871
8872 echo creating "$ac_file"
8873 rm -f "$ac_file"
8874 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8875 case "$ac_file" in
8876 *Makefile*) ac_comsub="1i\\
8877# $configure_input" ;;
8878 *) ac_comsub= ;;
8879 esac
8880
8881 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8882 sed -e "$ac_comsub
8883s%@configure_input@%$configure_input%g
8884s%@srcdir@%$srcdir%g
8885s%@top_srcdir@%$top_srcdir%g
8886s%@INSTALL@%$INSTALL%g
8887" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8888fi; done
8889rm -f conftest.s*
8890
8891# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8892# NAME is the cpp macro being defined and VALUE is the value it is being given.
8893#
8894# ac_d sets the value in "#define NAME VALUE" lines.
8895ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
8896ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
8897ac_dC='\3'
8898ac_dD='%g'
8899# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8900ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
8901ac_uB='\([ ]\)%\1#\2define\3'
8902ac_uC=' '
8903ac_uD='\4%g'
8904# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8905ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
8906ac_eB='$%\1#\2define\3'
8907ac_eC=' '
8908ac_eD='%g'
8909
8910if test "${CONFIG_HEADERS+set}" != set; then
8911EOF
8912cat >> $CONFIG_STATUS <<EOF
8913 CONFIG_HEADERS="src/config.h:src/config.in"
8914EOF
8915cat >> $CONFIG_STATUS <<\EOF
8916fi
8917for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8918 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8919 case "$ac_file" in
8920 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8921 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8922 *) ac_file_in="${ac_file}.in" ;;
8923 esac
8924
8925 echo creating $ac_file
8926
8927 rm -f conftest.frag conftest.in conftest.out
8928 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8929 cat $ac_file_inputs > conftest.in
8930
8931EOF
8932
8933# Transform confdefs.h into a sed script conftest.vals that substitutes
8934# the proper values into config.h.in to produce config.h. And first:
8935# Protect against being on the right side of a sed subst in config.status.
8936# Protect against being in an unquoted here document in config.status.
8937rm -f conftest.vals
8938cat > conftest.hdr <<\EOF
8939s/[\\&%]/\\&/g
8940s%[\\$`]%\\&%g
8941s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8942s%ac_d%ac_u%gp
8943s%ac_u%ac_e%gp
8944EOF
8945sed -n -f conftest.hdr confdefs.h > conftest.vals
8946rm -f conftest.hdr
8947
8948# This sed command replaces #undef with comments. This is necessary, for
8949# example, in the case of _POSIX_SOURCE, which is predefined and required
8950# on some systems where configure will not decide to define it.
8951cat >> conftest.vals <<\EOF
8952s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8953EOF
8954
8955# Break up conftest.vals because some shells have a limit on
8956# the size of here documents, and old seds have small limits too.
8957
8958rm -f conftest.tail
8959while :
8960do
8961 ac_lines=`grep -c . conftest.vals`
8962 # grep -c gives empty output for an empty file on some AIX systems.
8963 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8964 # Write a limited-size here document to conftest.frag.
8965 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8966 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8967 echo 'CEOF
8968 sed -f conftest.frag conftest.in > conftest.out
8969 rm -f conftest.in
8970 mv conftest.out conftest.in
8971' >> $CONFIG_STATUS
8972 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8973 rm -f conftest.vals
8974 mv conftest.tail conftest.vals
8975done
8976rm -f conftest.vals
8977
8978cat >> $CONFIG_STATUS <<\EOF
8979 rm -f conftest.frag conftest.h
8980 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
8981 cat conftest.in >> conftest.h
8982 rm -f conftest.in
8983 if cmp -s $ac_file conftest.h 2>/dev/null; then
8984 echo "$ac_file is unchanged"
8985 rm -f conftest.h
8986 else
8987 # Remove last slash and all that follows it. Not all systems have dirname.
8988 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8989 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8990 # The file is in a subdirectory.
8991 test ! -d "$ac_dir" && mkdir "$ac_dir"
8992 fi
8993 rm -f $ac_file
8994 mv conftest.h $ac_file
8995 fi
8996fi; done
8997
8998EOF
8999cat >> $CONFIG_STATUS <<EOF
9000CPP="$CPP" CPPFLAGS="$CPPFLAGS"
9001EOF
9002cat >> $CONFIG_STATUS <<\EOF
9003
9004
9005### Make the necessary directories, if they don't exist.
9006for dir in etc lisp ; do
9007 test -d ${dir} || mkdir ${dir}
9008done
9009
9010# Build src/Makefile from ${srcdir}/src/Makefile.c
9011# and lib-src/Makefile from ${srcdir}/lib-src/Makefile.c
9012# This must be done after src/config.h is built, since we rely on that file.
9013
9014# Now get this: Some word that is part of the ${srcdir} directory name
9015# or the ${configuration} value might, just might, happen to be an
9016# identifier like `sun4' or `i386' or something, and be predefined by
9017# the C preprocessor to some helpful value like 1, or maybe the empty
9018# string. Needless to say consequent macro substitutions are less
9019# than conducive to the makefile finding the correct directory.
9020undefs="`echo $top_srcdir $configuration $canonical |
9021sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
9022 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
9023`"
9024
9025echo creating src/epaths.h
9026make epaths-force
9027
9028echo creating lib-src/Makefile
9029( cd lib-src
9030 rm -f junk.c junk1.c junk2.c
9031 sed -e '/start of cpp stuff/q' \
9032 < Makefile.c > junk1.c
9033 sed -e '1,/start of cpp stuff/d'\
9034 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
9035 < Makefile.c > junk.c
9036 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
9037 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
9038 cat junk1.c junk2.c > Makefile.new
9039 rm -f junk.c junk1.c junk2.c
9040 chmod 444 Makefile.new
9041 mv -f Makefile.new Makefile
9042)
9043
9044echo creating src/Makefile
9045( cd src
9046 rm -f junk.c junk1.c junk2.c
9047 sed -e '/start of cpp stuff/q' \
9048 < Makefile.c > junk1.c
9049 sed -e '1,/start of cpp stuff/d'\
9050 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
9051 < Makefile.c > junk.c
9052 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
9053 sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
9054 cat junk1.c junk2.c > Makefile.new
9055 rm -f junk.c junk1.c junk2.c
9056 chmod 444 Makefile.new
9057 mv -f Makefile.new Makefile
9058)
9059
9060if test ! -f src/.gdbinit && test -f $top_srcdir/src/.gdbinit; then
9061 echo creating src/.gdbinit
9062 echo source $top_srcdir/src/.gdbinit > src/.gdbinit
9063fi
9064
9065# This is how we know whether to re-run configure in certain cases.
9066touch src/config.stamp
9067
9068
9069exit 0
9070EOF
9071chmod +x $CONFIG_STATUS
9072rm -fr confdefs* $ac_clean_files
9073test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9074