The base/count bounds checking was insufficient, leading to a kernel memory
[dragonfly.git] / contrib / awk / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
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:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --enable-bitops       Enable Octal and Hex constants and bit functions"
16 ac_help="$ac_help
17   --enable-non-decimal-data     Enable Octal and Hex constants as valid input data"
18 ac_help="$ac_help
19   --disable-largefile     omit support for large files"
20
21 # Initialize some variables set by options.
22 # The variables have the same names as the options, with
23 # dashes changed to underlines.
24 build=NONE
25 cache_file=./config.cache
26 exec_prefix=NONE
27 host=NONE
28 no_create=
29 nonopt=NONE
30 no_recursion=
31 prefix=NONE
32 program_prefix=NONE
33 program_suffix=NONE
34 program_transform_name=s,x,x,
35 silent=
36 site=
37 srcdir=
38 target=NONE
39 verbose=
40 x_includes=NONE
41 x_libraries=NONE
42 bindir='${exec_prefix}/bin'
43 sbindir='${exec_prefix}/sbin'
44 libexecdir='${exec_prefix}/libexec'
45 datadir='${prefix}/share'
46 sysconfdir='${prefix}/etc'
47 sharedstatedir='${prefix}/com'
48 localstatedir='${prefix}/var'
49 libdir='${exec_prefix}/lib'
50 includedir='${prefix}/include'
51 oldincludedir='/usr/include'
52 infodir='${prefix}/info'
53 mandir='${prefix}/man'
54
55 # Initialize some other variables.
56 subdirs=
57 MFLAGS= MAKEFLAGS=
58 SHELL=${CONFIG_SHELL-/bin/sh}
59 # Maximum number of lines to put in a shell here document.
60 ac_max_here_lines=12
61
62 ac_prev=
63 for ac_option
64 do
65
66   # If the previous option needs an argument, assign it.
67   if test -n "$ac_prev"; then
68     eval "$ac_prev=\$ac_option"
69     ac_prev=
70     continue
71   fi
72
73   case "$ac_option" in
74   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
75   *) ac_optarg= ;;
76   esac
77
78   # Accept the important Cygnus configure options, so we can diagnose typos.
79
80   case "$ac_option" in
81
82   -bindir | --bindir | --bindi | --bind | --bin | --bi)
83     ac_prev=bindir ;;
84   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
85     bindir="$ac_optarg" ;;
86
87   -build | --build | --buil | --bui | --bu)
88     ac_prev=build ;;
89   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
90     build="$ac_optarg" ;;
91
92   -cache-file | --cache-file | --cache-fil | --cache-fi \
93   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
94     ac_prev=cache_file ;;
95   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
96   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
97     cache_file="$ac_optarg" ;;
98
99   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
100     ac_prev=datadir ;;
101   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
102   | --da=*)
103     datadir="$ac_optarg" ;;
104
105   -disable-* | --disable-*)
106     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
107     # Reject names that are not valid shell variable names.
108     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
109       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
110     fi
111     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
112     eval "enable_${ac_feature}=no" ;;
113
114   -enable-* | --enable-*)
115     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
116     # Reject names that are not valid shell variable names.
117     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
118       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
119     fi
120     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
121     case "$ac_option" in
122       *=*) ;;
123       *) ac_optarg=yes ;;
124     esac
125     eval "enable_${ac_feature}='$ac_optarg'" ;;
126
127   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
128   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
129   | --exec | --exe | --ex)
130     ac_prev=exec_prefix ;;
131   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
132   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
133   | --exec=* | --exe=* | --ex=*)
134     exec_prefix="$ac_optarg" ;;
135
136   -gas | --gas | --ga | --g)
137     # Obsolete; use --with-gas.
138     with_gas=yes ;;
139
140   -help | --help | --hel | --he)
141     # Omit some internal or obsolete options to make the list less imposing.
142     # This message is too long to be a string in the A/UX 3.1 sh.
143     cat << EOF
144 Usage: configure [options] [host]
145 Options: [defaults in brackets after descriptions]
146 Configuration:
147   --cache-file=FILE       cache test results in FILE
148   --help                  print this message
149   --no-create             do not create output files
150   --quiet, --silent       do not print \`checking...' messages
151   --version               print the version of autoconf that created configure
152 Directory and file names:
153   --prefix=PREFIX         install architecture-independent files in PREFIX
154                           [$ac_default_prefix]
155   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
156                           [same as prefix]
157   --bindir=DIR            user executables in DIR [EPREFIX/bin]
158   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
159   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
160   --datadir=DIR           read-only architecture-independent data in DIR
161                           [PREFIX/share]
162   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
163   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
164                           [PREFIX/com]
165   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
166   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
167   --includedir=DIR        C header files in DIR [PREFIX/include]
168   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
169   --infodir=DIR           info documentation in DIR [PREFIX/info]
170   --mandir=DIR            man documentation in DIR [PREFIX/man]
171   --srcdir=DIR            find the sources in DIR [configure dir or ..]
172   --program-prefix=PREFIX prepend PREFIX to installed program names
173   --program-suffix=SUFFIX append SUFFIX to installed program names
174   --program-transform-name=PROGRAM
175                           run sed PROGRAM on installed program names
176 EOF
177     cat << EOF
178 Host type:
179   --build=BUILD           configure for building on BUILD [BUILD=HOST]
180   --host=HOST             configure for HOST [guessed]
181   --target=TARGET         configure for TARGET [TARGET=HOST]
182 Features and packages:
183   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
184   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
185   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
186   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
187   --x-includes=DIR        X include files are in DIR
188   --x-libraries=DIR       X library files are in DIR
189 EOF
190     if test -n "$ac_help"; then
191       echo "--enable and --with options recognized:$ac_help"
192     fi
193     exit 0 ;;
194
195   -host | --host | --hos | --ho)
196     ac_prev=host ;;
197   -host=* | --host=* | --hos=* | --ho=*)
198     host="$ac_optarg" ;;
199
200   -includedir | --includedir | --includedi | --included | --include \
201   | --includ | --inclu | --incl | --inc)
202     ac_prev=includedir ;;
203   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
204   | --includ=* | --inclu=* | --incl=* | --inc=*)
205     includedir="$ac_optarg" ;;
206
207   -infodir | --infodir | --infodi | --infod | --info | --inf)
208     ac_prev=infodir ;;
209   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
210     infodir="$ac_optarg" ;;
211
212   -libdir | --libdir | --libdi | --libd)
213     ac_prev=libdir ;;
214   -libdir=* | --libdir=* | --libdi=* | --libd=*)
215     libdir="$ac_optarg" ;;
216
217   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
218   | --libexe | --libex | --libe)
219     ac_prev=libexecdir ;;
220   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
221   | --libexe=* | --libex=* | --libe=*)
222     libexecdir="$ac_optarg" ;;
223
224   -localstatedir | --localstatedir | --localstatedi | --localstated \
225   | --localstate | --localstat | --localsta | --localst \
226   | --locals | --local | --loca | --loc | --lo)
227     ac_prev=localstatedir ;;
228   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
229   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
230   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
231     localstatedir="$ac_optarg" ;;
232
233   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
234     ac_prev=mandir ;;
235   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
236     mandir="$ac_optarg" ;;
237
238   -nfp | --nfp | --nf)
239     # Obsolete; use --without-fp.
240     with_fp=no ;;
241
242   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
243   | --no-cr | --no-c)
244     no_create=yes ;;
245
246   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
247   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
248     no_recursion=yes ;;
249
250   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
251   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
252   | --oldin | --oldi | --old | --ol | --o)
253     ac_prev=oldincludedir ;;
254   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
255   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
256   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
257     oldincludedir="$ac_optarg" ;;
258
259   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
260     ac_prev=prefix ;;
261   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
262     prefix="$ac_optarg" ;;
263
264   -program-prefix | --program-prefix | --program-prefi | --program-pref \
265   | --program-pre | --program-pr | --program-p)
266     ac_prev=program_prefix ;;
267   -program-prefix=* | --program-prefix=* | --program-prefi=* \
268   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
269     program_prefix="$ac_optarg" ;;
270
271   -program-suffix | --program-suffix | --program-suffi | --program-suff \
272   | --program-suf | --program-su | --program-s)
273     ac_prev=program_suffix ;;
274   -program-suffix=* | --program-suffix=* | --program-suffi=* \
275   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
276     program_suffix="$ac_optarg" ;;
277
278   -program-transform-name | --program-transform-name \
279   | --program-transform-nam | --program-transform-na \
280   | --program-transform-n | --program-transform- \
281   | --program-transform | --program-transfor \
282   | --program-transfo | --program-transf \
283   | --program-trans | --program-tran \
284   | --progr-tra | --program-tr | --program-t)
285     ac_prev=program_transform_name ;;
286   -program-transform-name=* | --program-transform-name=* \
287   | --program-transform-nam=* | --program-transform-na=* \
288   | --program-transform-n=* | --program-transform-=* \
289   | --program-transform=* | --program-transfor=* \
290   | --program-transfo=* | --program-transf=* \
291   | --program-trans=* | --program-tran=* \
292   | --progr-tra=* | --program-tr=* | --program-t=*)
293     program_transform_name="$ac_optarg" ;;
294
295   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
296   | -silent | --silent | --silen | --sile | --sil)
297     silent=yes ;;
298
299   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
300     ac_prev=sbindir ;;
301   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
302   | --sbi=* | --sb=*)
303     sbindir="$ac_optarg" ;;
304
305   -sharedstatedir | --sharedstatedir | --sharedstatedi \
306   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
307   | --sharedst | --shareds | --shared | --share | --shar \
308   | --sha | --sh)
309     ac_prev=sharedstatedir ;;
310   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
311   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
312   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
313   | --sha=* | --sh=*)
314     sharedstatedir="$ac_optarg" ;;
315
316   -site | --site | --sit)
317     ac_prev=site ;;
318   -site=* | --site=* | --sit=*)
319     site="$ac_optarg" ;;
320
321   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
322     ac_prev=srcdir ;;
323   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
324     srcdir="$ac_optarg" ;;
325
326   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
327   | --syscon | --sysco | --sysc | --sys | --sy)
328     ac_prev=sysconfdir ;;
329   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
330   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
331     sysconfdir="$ac_optarg" ;;
332
333   -target | --target | --targe | --targ | --tar | --ta | --t)
334     ac_prev=target ;;
335   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
336     target="$ac_optarg" ;;
337
338   -v | -verbose | --verbose | --verbos | --verbo | --verb)
339     verbose=yes ;;
340
341   -version | --version | --versio | --versi | --vers)
342     echo "configure generated by autoconf version 2.13"
343     exit 0 ;;
344
345   -with-* | --with-*)
346     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
347     # Reject names that are not valid shell variable names.
348     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
349       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
350     fi
351     ac_package=`echo $ac_package| sed 's/-/_/g'`
352     case "$ac_option" in
353       *=*) ;;
354       *) ac_optarg=yes ;;
355     esac
356     eval "with_${ac_package}='$ac_optarg'" ;;
357
358   -without-* | --without-*)
359     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
360     # Reject names that are not valid shell variable names.
361     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
362       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
363     fi
364     ac_package=`echo $ac_package| sed 's/-/_/g'`
365     eval "with_${ac_package}=no" ;;
366
367   --x)
368     # Obsolete; use --with-x.
369     with_x=yes ;;
370
371   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
372   | --x-incl | --x-inc | --x-in | --x-i)
373     ac_prev=x_includes ;;
374   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
375   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
376     x_includes="$ac_optarg" ;;
377
378   -x-libraries | --x-libraries | --x-librarie | --x-librari \
379   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
380     ac_prev=x_libraries ;;
381   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
382   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
383     x_libraries="$ac_optarg" ;;
384
385   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
386     ;;
387
388   *)
389     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
390       echo "configure: warning: $ac_option: invalid host type" 1>&2
391     fi
392     if test "x$nonopt" != xNONE; then
393       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
394     fi
395     nonopt="$ac_option"
396     ;;
397
398   esac
399 done
400
401 if test -n "$ac_prev"; then
402   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
403 fi
404
405 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
406
407 # File descriptor usage:
408 # 0 standard input
409 # 1 file creation
410 # 2 errors and warnings
411 # 3 some systems may open it to /dev/tty
412 # 4 used on the Kubota Titan
413 # 6 checking for... messages and results
414 # 5 compiler messages saved in config.log
415 if test "$silent" = yes; then
416   exec 6>/dev/null
417 else
418   exec 6>&1
419 fi
420 exec 5>./config.log
421
422 echo "\
423 This file contains any messages produced by compilers while
424 running configure, to aid debugging if configure makes a mistake.
425 " 1>&5
426
427 # Strip out --no-create and --no-recursion so they do not pile up.
428 # Also quote any args containing shell metacharacters.
429 ac_configure_args=
430 for ac_arg
431 do
432   case "$ac_arg" in
433   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
434   | --no-cr | --no-c) ;;
435   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
436   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
437   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
438   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
439   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
440   esac
441 done
442
443 # NLS nuisances.
444 # Only set these to C if already set.  These must not be set unconditionally
445 # because not all systems understand e.g. LANG=C (notably SCO).
446 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
447 # Non-C LC_CTYPE values break the ctype check.
448 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
449 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
450 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
451 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
452
453 # confdefs.h avoids OS command line length limits that DEFS can exceed.
454 rm -rf conftest* confdefs.h
455 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
456 echo > confdefs.h
457
458 # A filename unique to this package, relative to the directory that
459 # configure is in, which we can look for to find out if srcdir is correct.
460 ac_unique_file=awk.h
461
462 # Find the source files, if location was not specified.
463 if test -z "$srcdir"; then
464   ac_srcdir_defaulted=yes
465   # Try the directory containing this script, then its parent.
466   ac_prog=$0
467   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
468   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
469   srcdir=$ac_confdir
470   if test ! -r $srcdir/$ac_unique_file; then
471     srcdir=..
472   fi
473 else
474   ac_srcdir_defaulted=no
475 fi
476 if test ! -r $srcdir/$ac_unique_file; then
477   if test "$ac_srcdir_defaulted" = yes; then
478     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
479   else
480     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
481   fi
482 fi
483 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
484
485 # Prefer explicitly selected file to automatically selected ones.
486 if test -z "$CONFIG_SITE"; then
487   if test "x$prefix" != xNONE; then
488     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
489   else
490     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
491   fi
492 fi
493 for ac_site_file in $CONFIG_SITE; do
494   if test -r "$ac_site_file"; then
495     echo "loading site script $ac_site_file"
496     . "$ac_site_file"
497   fi
498 done
499
500 if test -r "$cache_file"; then
501   echo "loading cache $cache_file"
502   . $cache_file
503 else
504   echo "creating cache $cache_file"
505   > $cache_file
506 fi
507
508 ac_ext=c
509 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
510 ac_cpp='$CPP $CPPFLAGS'
511 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
512 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
513 cross_compiling=$ac_cv_prog_cc_cross
514
515 ac_exeext=
516 ac_objext=o
517 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
518   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
519   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
520     ac_n= ac_c='
521 ' ac_t='        '
522   else
523     ac_n=-n ac_c= ac_t=
524   fi
525 else
526   ac_n= ac_c='\c' ac_t=
527 fi
528
529
530
531
532
533 # Check whether --enable-bitops or --disable-bitops was given.
534 if test "${enable_bitops+set}" = set; then
535   enableval="$enable_bitops"
536   cat >> confdefs.h <<\EOF
537 #define BITOPS 1
538 EOF
539
540 fi
541
542 # Check whether --enable-non-decimal-data or --disable-non-decimal-data was given.
543 if test "${enable_non_decimal_data+set}" = set; then
544   enableval="$enable_non_decimal_data"
545   cat >> confdefs.h <<\EOF
546 #define NONDECDATA 1
547 EOF
548
549 fi
550
551
552 for ac_prog in 'bison -y' byacc
553 do
554 # Extract the first word of "$ac_prog", so it can be a program name with args.
555 set dummy $ac_prog; ac_word=$2
556 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
557 echo "configure:558: checking for $ac_word" >&5
558 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
559   echo $ac_n "(cached) $ac_c" 1>&6
560 else
561   if test -n "$YACC"; then
562   ac_cv_prog_YACC="$YACC" # Let the user override the test.
563 else
564   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
565   ac_dummy="$PATH"
566   for ac_dir in $ac_dummy; do
567     test -z "$ac_dir" && ac_dir=.
568     if test -f $ac_dir/$ac_word; then
569       ac_cv_prog_YACC="$ac_prog"
570       break
571     fi
572   done
573   IFS="$ac_save_ifs"
574 fi
575 fi
576 YACC="$ac_cv_prog_YACC"
577 if test -n "$YACC"; then
578   echo "$ac_t""$YACC" 1>&6
579 else
580   echo "$ac_t""no" 1>&6
581 fi
582
583 test -n "$YACC" && break
584 done
585 test -n "$YACC" || YACC="yacc"
586
587 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
588 echo "configure:589: checking whether ln -s works" >&5
589 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
590   echo $ac_n "(cached) $ac_c" 1>&6
591 else
592   rm -f conftestdata
593 if ln -s X conftestdata 2>/dev/null
594 then
595   rm -f conftestdata
596   ac_cv_prog_LN_S="ln -s"
597 else
598   ac_cv_prog_LN_S=ln
599 fi
600 fi
601 LN_S="$ac_cv_prog_LN_S"
602 if test "$ac_cv_prog_LN_S" = "ln -s"; then
603   echo "$ac_t""yes" 1>&6
604 else
605   echo "$ac_t""no" 1>&6
606 fi
607
608 # Extract the first word of "gcc", so it can be a program name with args.
609 set dummy gcc; ac_word=$2
610 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
611 echo "configure:612: checking for $ac_word" >&5
612 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
613   echo $ac_n "(cached) $ac_c" 1>&6
614 else
615   if test -n "$CC"; then
616   ac_cv_prog_CC="$CC" # Let the user override the test.
617 else
618   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
619   ac_dummy="$PATH"
620   for ac_dir in $ac_dummy; do
621     test -z "$ac_dir" && ac_dir=.
622     if test -f $ac_dir/$ac_word; then
623       ac_cv_prog_CC="gcc"
624       break
625     fi
626   done
627   IFS="$ac_save_ifs"
628 fi
629 fi
630 CC="$ac_cv_prog_CC"
631 if test -n "$CC"; then
632   echo "$ac_t""$CC" 1>&6
633 else
634   echo "$ac_t""no" 1>&6
635 fi
636
637 if test -z "$CC"; then
638   # Extract the first word of "cc", so it can be a program name with args.
639 set dummy cc; ac_word=$2
640 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
641 echo "configure:642: checking for $ac_word" >&5
642 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
643   echo $ac_n "(cached) $ac_c" 1>&6
644 else
645   if test -n "$CC"; then
646   ac_cv_prog_CC="$CC" # Let the user override the test.
647 else
648   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
649   ac_prog_rejected=no
650   ac_dummy="$PATH"
651   for ac_dir in $ac_dummy; do
652     test -z "$ac_dir" && ac_dir=.
653     if test -f $ac_dir/$ac_word; then
654       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
655         ac_prog_rejected=yes
656         continue
657       fi
658       ac_cv_prog_CC="cc"
659       break
660     fi
661   done
662   IFS="$ac_save_ifs"
663 if test $ac_prog_rejected = yes; then
664   # We found a bogon in the path, so make sure we never use it.
665   set dummy $ac_cv_prog_CC
666   shift
667   if test $# -gt 0; then
668     # We chose a different compiler from the bogus one.
669     # However, it has the same basename, so the bogon will be chosen
670     # first if we set CC to just the basename; use the full file name.
671     shift
672     set dummy "$ac_dir/$ac_word" "$@"
673     shift
674     ac_cv_prog_CC="$@"
675   fi
676 fi
677 fi
678 fi
679 CC="$ac_cv_prog_CC"
680 if test -n "$CC"; then
681   echo "$ac_t""$CC" 1>&6
682 else
683   echo "$ac_t""no" 1>&6
684 fi
685
686   if test -z "$CC"; then
687     case "`uname -s`" in
688     *win32* | *WIN32*)
689       # Extract the first word of "cl", so it can be a program name with args.
690 set dummy cl; ac_word=$2
691 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
692 echo "configure:693: checking for $ac_word" >&5
693 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
694   echo $ac_n "(cached) $ac_c" 1>&6
695 else
696   if test -n "$CC"; then
697   ac_cv_prog_CC="$CC" # Let the user override the test.
698 else
699   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
700   ac_dummy="$PATH"
701   for ac_dir in $ac_dummy; do
702     test -z "$ac_dir" && ac_dir=.
703     if test -f $ac_dir/$ac_word; then
704       ac_cv_prog_CC="cl"
705       break
706     fi
707   done
708   IFS="$ac_save_ifs"
709 fi
710 fi
711 CC="$ac_cv_prog_CC"
712 if test -n "$CC"; then
713   echo "$ac_t""$CC" 1>&6
714 else
715   echo "$ac_t""no" 1>&6
716 fi
717  ;;
718     esac
719   fi
720   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
721 fi
722
723 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
724 echo "configure:725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
725
726 ac_ext=c
727 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
728 ac_cpp='$CPP $CPPFLAGS'
729 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
730 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
731 cross_compiling=$ac_cv_prog_cc_cross
732
733 cat > conftest.$ac_ext << EOF
734
735 #line 736 "configure"
736 #include "confdefs.h"
737
738 main(){return(0);}
739 EOF
740 if { (eval echo configure:741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
741   ac_cv_prog_cc_works=yes
742   # If we can't run a trivial program, we are probably using a cross compiler.
743   if (./conftest; exit) 2>/dev/null; then
744     ac_cv_prog_cc_cross=no
745   else
746     ac_cv_prog_cc_cross=yes
747   fi
748 else
749   echo "configure: failed program was:" >&5
750   cat conftest.$ac_ext >&5
751   ac_cv_prog_cc_works=no
752 fi
753 rm -fr conftest*
754 ac_ext=c
755 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
756 ac_cpp='$CPP $CPPFLAGS'
757 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
758 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
759 cross_compiling=$ac_cv_prog_cc_cross
760
761 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
762 if test $ac_cv_prog_cc_works = no; then
763   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
764 fi
765 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
766 echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
767 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
768 cross_compiling=$ac_cv_prog_cc_cross
769
770 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
771 echo "configure:772: checking whether we are using GNU C" >&5
772 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
773   echo $ac_n "(cached) $ac_c" 1>&6
774 else
775   cat > conftest.c <<EOF
776 #ifdef __GNUC__
777   yes;
778 #endif
779 EOF
780 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
781   ac_cv_prog_gcc=yes
782 else
783   ac_cv_prog_gcc=no
784 fi
785 fi
786
787 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
788
789 if test $ac_cv_prog_gcc = yes; then
790   GCC=yes
791 else
792   GCC=
793 fi
794
795 ac_test_CFLAGS="${CFLAGS+set}"
796 ac_save_CFLAGS="$CFLAGS"
797 CFLAGS=
798 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
799 echo "configure:800: checking whether ${CC-cc} accepts -g" >&5
800 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
801   echo $ac_n "(cached) $ac_c" 1>&6
802 else
803   echo 'void f(){}' > conftest.c
804 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
805   ac_cv_prog_cc_g=yes
806 else
807   ac_cv_prog_cc_g=no
808 fi
809 rm -f conftest*
810
811 fi
812
813 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
814 if test "$ac_test_CFLAGS" = set; then
815   CFLAGS="$ac_save_CFLAGS"
816 elif test $ac_cv_prog_cc_g = yes; then
817   if test "$GCC" = yes; then
818     CFLAGS="-g -O2"
819   else
820     CFLAGS="-g"
821   fi
822 else
823   if test "$GCC" = yes; then
824     CFLAGS="-O2"
825   else
826     CFLAGS=
827   fi
828 fi
829
830 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
831 echo "configure:832: checking how to run the C preprocessor" >&5
832 # On Suns, sometimes $CPP names a directory.
833 if test -n "$CPP" && test -d "$CPP"; then
834   CPP=
835 fi
836 if test -z "$CPP"; then
837 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
838   echo $ac_n "(cached) $ac_c" 1>&6
839 else
840     # This must be in double quotes, not single quotes, because CPP may get
841   # substituted into the Makefile and "${CC-cc}" will confuse make.
842   CPP="${CC-cc} -E"
843   # On the NeXT, cc -E runs the code through the compiler's parser,
844   # not just through cpp.
845   cat > conftest.$ac_ext <<EOF
846 #line 847 "configure"
847 #include "confdefs.h"
848 #include <assert.h>
849 Syntax Error
850 EOF
851 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
852 { (eval echo configure:853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
853 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
854 if test -z "$ac_err"; then
855   :
856 else
857   echo "$ac_err" >&5
858   echo "configure: failed program was:" >&5
859   cat conftest.$ac_ext >&5
860   rm -rf conftest*
861   CPP="${CC-cc} -E -traditional-cpp"
862   cat > conftest.$ac_ext <<EOF
863 #line 864 "configure"
864 #include "confdefs.h"
865 #include <assert.h>
866 Syntax Error
867 EOF
868 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
869 { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
870 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
871 if test -z "$ac_err"; then
872   :
873 else
874   echo "$ac_err" >&5
875   echo "configure: failed program was:" >&5
876   cat conftest.$ac_ext >&5
877   rm -rf conftest*
878   CPP="${CC-cc} -nologo -E"
879   cat > conftest.$ac_ext <<EOF
880 #line 881 "configure"
881 #include "confdefs.h"
882 #include <assert.h>
883 Syntax Error
884 EOF
885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
886 { (eval echo configure:887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
887 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
888 if test -z "$ac_err"; then
889   :
890 else
891   echo "$ac_err" >&5
892   echo "configure: failed program was:" >&5
893   cat conftest.$ac_ext >&5
894   rm -rf conftest*
895   CPP=/lib/cpp
896 fi
897 rm -f conftest*
898 fi
899 rm -f conftest*
900 fi
901 rm -f conftest*
902   ac_cv_prog_CPP="$CPP"
903 fi
904   CPP="$ac_cv_prog_CPP"
905 else
906   ac_cv_prog_CPP="$CPP"
907 fi
908 echo "$ac_t""$CPP" 1>&6
909
910
911 # This is a hack. Different versions of install on different systems
912 # are just too different. Chuck it and use install-sh.
913 INSTALL="$srcdir/install-sh -c"; export INSTALL
914 ac_aux_dir=
915 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
916   if test -f $ac_dir/install-sh; then
917     ac_aux_dir=$ac_dir
918     ac_install_sh="$ac_aux_dir/install-sh -c"
919     break
920   elif test -f $ac_dir/install.sh; then
921     ac_aux_dir=$ac_dir
922     ac_install_sh="$ac_aux_dir/install.sh -c"
923     break
924   fi
925 done
926 if test -z "$ac_aux_dir"; then
927   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
928 fi
929 ac_config_guess=$ac_aux_dir/config.guess
930 ac_config_sub=$ac_aux_dir/config.sub
931 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
932
933 # Find a good install program.  We prefer a C program (faster),
934 # so one script is as good as another.  But avoid the broken or
935 # incompatible versions:
936 # SysV /etc/install, /usr/sbin/install
937 # SunOS /usr/etc/install
938 # IRIX /sbin/install
939 # AIX /bin/install
940 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
941 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
942 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
943 # ./install, which can be erroneously created by make from ./install.sh.
944 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
945 echo "configure:946: checking for a BSD compatible install" >&5
946 if test -z "$INSTALL"; then
947 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
948   echo $ac_n "(cached) $ac_c" 1>&6
949 else
950     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
951   for ac_dir in $PATH; do
952     # Account for people who put trailing slashes in PATH elements.
953     case "$ac_dir/" in
954     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
955     *)
956       # OSF1 and SCO ODT 3.0 have their own names for install.
957       # Don't use installbsd from OSF since it installs stuff as root
958       # by default.
959       for ac_prog in ginstall scoinst install; do
960         if test -f $ac_dir/$ac_prog; then
961           if test $ac_prog = install &&
962             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
963             # AIX install.  It has an incompatible calling convention.
964             :
965           else
966             ac_cv_path_install="$ac_dir/$ac_prog -c"
967             break 2
968           fi
969         fi
970       done
971       ;;
972     esac
973   done
974   IFS="$ac_save_IFS"
975
976 fi
977   if test "${ac_cv_path_install+set}" = set; then
978     INSTALL="$ac_cv_path_install"
979   else
980     # As a last resort, use the slow shell script.  We don't cache a
981     # path for INSTALL within a source directory, because that will
982     # break other packages using the cache if that directory is
983     # removed, or if the path is relative.
984     INSTALL="$ac_install_sh"
985   fi
986 fi
987 echo "$ac_t""$INSTALL" 1>&6
988
989 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
990 # It thinks the first close brace ends the variable substitution.
991 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
992
993 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
994
995 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
996
997
998 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
999 echo "configure:1000: checking whether ${MAKE-make} sets \${MAKE}" >&5
1000 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1001 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1002   echo $ac_n "(cached) $ac_c" 1>&6
1003 else
1004   cat > conftestmake <<\EOF
1005 all:
1006         @echo 'ac_maketemp="${MAKE}"'
1007 EOF
1008 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1009 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1010 if test -n "$ac_maketemp"; then
1011   eval ac_cv_prog_make_${ac_make}_set=yes
1012 else
1013   eval ac_cv_prog_make_${ac_make}_set=no
1014 fi
1015 rm -f conftestmake
1016 fi
1017 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1018   echo "$ac_t""yes" 1>&6
1019   SET_MAKE=
1020 else
1021   echo "$ac_t""no" 1>&6
1022   SET_MAKE="MAKE=${MAKE-make}"
1023 fi
1024
1025
1026 if test "$CFLAGS" = ""
1027 then
1028         if test "$GCC" = yes
1029         then
1030                 CFLAGS="-g -O"
1031         else
1032                 CFLAGS="-O"
1033         fi
1034 fi
1035
1036 # This is mainly for my use during testing and development.
1037 # Yes, it's a bit of a hack.
1038 if test -f $srcdir/.developing
1039 then
1040         cat >> confdefs.h <<\EOF
1041 #define BITOPS 1
1042 EOF
1043
1044         cat >> confdefs.h <<\EOF
1045 #define NONDECDATA 1
1046 EOF
1047
1048         CFLAGS="$CFLAGS -DARRAYDEBUG"
1049 fi
1050
1051
1052
1053 echo $ac_n "checking for AIX""... $ac_c" 1>&6
1054 echo "configure:1055: checking for AIX" >&5
1055 cat > conftest.$ac_ext <<EOF
1056 #line 1057 "configure"
1057 #include "confdefs.h"
1058 #ifdef _AIX
1059   yes
1060 #endif
1061
1062 EOF
1063 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1064   egrep "yes" >/dev/null 2>&1; then
1065   rm -rf conftest*
1066   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
1067 #define _ALL_SOURCE 1
1068 EOF
1069
1070 else
1071   rm -rf conftest*
1072   echo "$ac_t""no" 1>&6
1073 fi
1074 rm -f conftest*
1075
1076
1077 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1078 echo "configure:1079: checking for POSIXized ISC" >&5
1079 if test -d /etc/conf/kconfig.d &&
1080   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1081 then
1082   echo "$ac_t""yes" 1>&6
1083   ISC=yes # If later tests want to check for ISC.
1084   cat >> confdefs.h <<\EOF
1085 #define _POSIX_SOURCE 1
1086 EOF
1087
1088   if test "$GCC" = yes; then
1089     CC="$CC -posix"
1090   else
1091     CC="$CC -Xp"
1092   fi
1093 else
1094   echo "$ac_t""no" 1>&6
1095   ISC=
1096 fi
1097
1098 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
1099 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
1100 echo "configure:1101: checking for minix/config.h" >&5
1101 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1102   echo $ac_n "(cached) $ac_c" 1>&6
1103 else
1104   cat > conftest.$ac_ext <<EOF
1105 #line 1106 "configure"
1106 #include "confdefs.h"
1107 #include <minix/config.h>
1108 EOF
1109 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1110 { (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1111 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1112 if test -z "$ac_err"; then
1113   rm -rf conftest*
1114   eval "ac_cv_header_$ac_safe=yes"
1115 else
1116   echo "$ac_err" >&5
1117   echo "configure: failed program was:" >&5
1118   cat conftest.$ac_ext >&5
1119   rm -rf conftest*
1120   eval "ac_cv_header_$ac_safe=no"
1121 fi
1122 rm -f conftest*
1123 fi
1124 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1125   echo "$ac_t""yes" 1>&6
1126   MINIX=yes
1127 else
1128   echo "$ac_t""no" 1>&6
1129 MINIX=
1130 fi
1131
1132 if test "$MINIX" = yes; then
1133   cat >> confdefs.h <<\EOF
1134 #define _POSIX_SOURCE 1
1135 EOF
1136
1137   cat >> confdefs.h <<\EOF
1138 #define _POSIX_1_SOURCE 2
1139 EOF
1140
1141   cat >> confdefs.h <<\EOF
1142 #define _MINIX 1
1143 EOF
1144
1145 fi
1146
1147 # Check whether --enable-largefile or --disable-largefile was given.
1148 if test "${enable_largefile+set}" = set; then
1149   enableval="$enable_largefile"
1150   :
1151 fi
1152
1153    if test "$enable_largefile" != no; then
1154
1155      echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6
1156 echo "configure:1157: checking for special C compiler options needed for large files" >&5
1157 if eval "test \"`echo '$''{'gawk_cv_sys_largefile_CC'+set}'`\" = set"; then
1158   echo $ac_n "(cached) $ac_c" 1>&6
1159 else
1160   gawk_cv_sys_largefile_CC=no
1161         if test "$GCC" != yes; then
1162           # IRIX 6.2 and later do not support large files by default,
1163           # so use the C compiler's -n32 option if that helps.
1164           cat > conftest.$ac_ext <<EOF
1165 #line 1166 "configure"
1166 #include "confdefs.h"
1167 #include <sys/types.h>
1168     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1169   
1170 int main() {
1171
1172 ; return 0; }
1173 EOF
1174 if { (eval echo configure:1175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1175   :
1176 else
1177   echo "configure: failed program was:" >&5
1178   cat conftest.$ac_ext >&5
1179   rm -rf conftest*
1180   ac_save_CC="$CC"
1181              CC="$CC -n32"
1182              cat > conftest.$ac_ext <<EOF
1183 #line 1184 "configure"
1184 #include "confdefs.h"
1185 #include <sys/types.h>
1186     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1187   
1188 int main() {
1189
1190 ; return 0; }
1191 EOF
1192 if { (eval echo configure:1193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1193   rm -rf conftest*
1194   gawk_cv_sys_largefile_CC=' -n32'
1195 else
1196   echo "configure: failed program was:" >&5
1197   cat conftest.$ac_ext >&5
1198 fi
1199 rm -f conftest*
1200              CC="$ac_save_CC"
1201 fi
1202 rm -f conftest*
1203         fi
1204 fi
1205
1206 echo "$ac_t""$gawk_cv_sys_largefile_CC" 1>&6
1207      if test "$gawk_cv_sys_largefile_CC" != no; then
1208        CC="$CC$gawk_cv_sys_largefile_CC"
1209      fi
1210
1211      echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6
1212 echo "configure:1213: checking for _FILE_OFFSET_BITS value needed for large files" >&5
1213 if eval "test \"`echo '$''{'gawk_cv_sys_file_offset_bits'+set}'`\" = set"; then
1214   echo $ac_n "(cached) $ac_c" 1>&6
1215 else
1216   gawk_cv_sys_file_offset_bits=no
1217       cat > conftest.$ac_ext <<EOF
1218 #line 1219 "configure"
1219 #include "confdefs.h"
1220 #include <sys/types.h>
1221     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1222   
1223
1224         
1225 int main() {
1226
1227 ; return 0; }
1228 EOF
1229 if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1230   :
1231 else
1232   echo "configure: failed program was:" >&5
1233   cat conftest.$ac_ext >&5
1234   rm -rf conftest*
1235   cat > conftest.$ac_ext <<EOF
1236 #line 1237 "configure"
1237 #include "confdefs.h"
1238 #define _FILE_OFFSET_BITS 64
1239 #include <sys/types.h>
1240     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1241   
1242
1243            
1244 int main() {
1245
1246 ; return 0; }
1247 EOF
1248 if { (eval echo configure:1249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1249   rm -rf conftest*
1250   gawk_cv_sys_file_offset_bits=64
1251 else
1252   echo "configure: failed program was:" >&5
1253   cat conftest.$ac_ext >&5
1254 fi
1255 rm -f conftest*
1256 fi
1257 rm -f conftest*
1258 fi
1259
1260 echo "$ac_t""$gawk_cv_sys_file_offset_bits" 1>&6
1261    if test "$gawk_cv_sys_file_offset_bits" != no; then
1262      cat >> confdefs.h <<EOF
1263 #define _FILE_OFFSET_BITS $gawk_cv_sys_file_offset_bits
1264 EOF
1265
1266    fi
1267      echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6
1268 echo "configure:1269: checking for _LARGEFILE_SOURCE value needed for large files" >&5
1269 if eval "test \"`echo '$''{'gawk_cv_sys_largefile_source'+set}'`\" = set"; then
1270   echo $ac_n "(cached) $ac_c" 1>&6
1271 else
1272   gawk_cv_sys_largefile_source=no
1273       cat > conftest.$ac_ext <<EOF
1274 #line 1275 "configure"
1275 #include "confdefs.h"
1276 #include <sys/types.h>
1277     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1278   
1279 #include <stdio.h>
1280         
1281 int main() {
1282 return !ftello;
1283 ; return 0; }
1284 EOF
1285 if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1286   :
1287 else
1288   echo "configure: failed program was:" >&5
1289   cat conftest.$ac_ext >&5
1290   rm -rf conftest*
1291   cat > conftest.$ac_ext <<EOF
1292 #line 1293 "configure"
1293 #include "confdefs.h"
1294 #define _LARGEFILE_SOURCE 1
1295 #include <sys/types.h>
1296     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1297   
1298 #include <stdio.h>
1299            
1300 int main() {
1301 return !ftello;
1302 ; return 0; }
1303 EOF
1304 if { (eval echo configure:1305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1305   rm -rf conftest*
1306   gawk_cv_sys_largefile_source=1
1307 else
1308   echo "configure: failed program was:" >&5
1309   cat conftest.$ac_ext >&5
1310 fi
1311 rm -f conftest*
1312 fi
1313 rm -f conftest*
1314 fi
1315
1316 echo "$ac_t""$gawk_cv_sys_largefile_source" 1>&6
1317    if test "$gawk_cv_sys_largefile_source" != no; then
1318      cat >> confdefs.h <<EOF
1319 #define _LARGEFILE_SOURCE $gawk_cv_sys_largefile_source
1320 EOF
1321
1322    fi
1323      echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6
1324 echo "configure:1325: checking for _LARGE_FILES value needed for large files" >&5
1325 if eval "test \"`echo '$''{'gawk_cv_sys_large_files'+set}'`\" = set"; then
1326   echo $ac_n "(cached) $ac_c" 1>&6
1327 else
1328   gawk_cv_sys_large_files=no
1329       cat > conftest.$ac_ext <<EOF
1330 #line 1331 "configure"
1331 #include "confdefs.h"
1332 #include <sys/types.h>
1333     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1334   
1335
1336         
1337 int main() {
1338
1339 ; return 0; }
1340 EOF
1341 if { (eval echo configure:1342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1342   :
1343 else
1344   echo "configure: failed program was:" >&5
1345   cat conftest.$ac_ext >&5
1346   rm -rf conftest*
1347   cat > conftest.$ac_ext <<EOF
1348 #line 1349 "configure"
1349 #include "confdefs.h"
1350 #define _LARGE_FILES 1
1351 #include <sys/types.h>
1352     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1353   
1354
1355            
1356 int main() {
1357
1358 ; return 0; }
1359 EOF
1360 if { (eval echo configure:1361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1361   rm -rf conftest*
1362   gawk_cv_sys_large_files=1
1363 else
1364   echo "configure: failed program was:" >&5
1365   cat conftest.$ac_ext >&5
1366 fi
1367 rm -f conftest*
1368 fi
1369 rm -f conftest*
1370 fi
1371
1372 echo "$ac_t""$gawk_cv_sys_large_files" 1>&6
1373    if test "$gawk_cv_sys_large_files" != no; then
1374      cat >> confdefs.h <<EOF
1375 #define _LARGE_FILES $gawk_cv_sys_large_files
1376 EOF
1377
1378    fi
1379      echo $ac_n "checking for _XOPEN_SOURCE value needed for large files""... $ac_c" 1>&6
1380 echo "configure:1381: checking for _XOPEN_SOURCE value needed for large files" >&5
1381 if eval "test \"`echo '$''{'gawk_cv_sys_xopen_source'+set}'`\" = set"; then
1382   echo $ac_n "(cached) $ac_c" 1>&6
1383 else
1384   gawk_cv_sys_xopen_source=no
1385       cat > conftest.$ac_ext <<EOF
1386 #line 1387 "configure"
1387 #include "confdefs.h"
1388 #include <sys/types.h>
1389     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1390   
1391 #include <stdio.h>
1392         
1393 int main() {
1394 return !ftello;
1395 ; return 0; }
1396 EOF
1397 if { (eval echo configure:1398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1398   :
1399 else
1400   echo "configure: failed program was:" >&5
1401   cat conftest.$ac_ext >&5
1402   rm -rf conftest*
1403   cat > conftest.$ac_ext <<EOF
1404 #line 1405 "configure"
1405 #include "confdefs.h"
1406 #define _XOPEN_SOURCE 500
1407 #include <sys/types.h>
1408     int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
1409   
1410 #include <stdio.h>
1411            
1412 int main() {
1413 return !ftello;
1414 ; return 0; }
1415 EOF
1416 if { (eval echo configure:1417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1417   rm -rf conftest*
1418   gawk_cv_sys_xopen_source=500
1419 else
1420   echo "configure: failed program was:" >&5
1421   cat conftest.$ac_ext >&5
1422 fi
1423 rm -f conftest*
1424 fi
1425 rm -f conftest*
1426 fi
1427
1428 echo "$ac_t""$gawk_cv_sys_xopen_source" 1>&6
1429    if test "$gawk_cv_sys_xopen_source" != no; then
1430      cat >> confdefs.h <<EOF
1431 #define _XOPEN_SOURCE $gawk_cv_sys_xopen_source
1432 EOF
1433
1434    fi
1435    fi
1436   
1437
1438 echo $ac_n "checking for AIX compilation hacks""... $ac_c" 1>&6
1439 echo "configure:1440: checking for AIX compilation hacks" >&5
1440 if eval "test \"`echo '$''{'gawk_cv_aix_hack'+set}'`\" = set"; then
1441   echo $ac_n "(cached) $ac_c" 1>&6
1442 else
1443   
1444 if test -d /lpp/bos
1445 then
1446         CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
1447         gawk_cv_aix_hack=yes
1448 else
1449         gawk_cv_aix_hack=no
1450 fi
1451
1452 fi
1453 echo "$ac_t""${gawk_cv_aix_hack}" 1>&6
1454
1455
1456 if test "$ISC" = 1      # will be set by test for ISC
1457 then
1458         CFLAGS="$CFLAGS -D_SYSV3"
1459 fi
1460
1461 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1462 echo "configure:1463: checking for ANSI C header files" >&5
1463 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1464   echo $ac_n "(cached) $ac_c" 1>&6
1465 else
1466   cat > conftest.$ac_ext <<EOF
1467 #line 1468 "configure"
1468 #include "confdefs.h"
1469 #include <stdlib.h>
1470 #include <stdarg.h>
1471 #include <string.h>
1472 #include <float.h>
1473 EOF
1474 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1475 { (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1476 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1477 if test -z "$ac_err"; then
1478   rm -rf conftest*
1479   ac_cv_header_stdc=yes
1480 else
1481   echo "$ac_err" >&5
1482   echo "configure: failed program was:" >&5
1483   cat conftest.$ac_ext >&5
1484   rm -rf conftest*
1485   ac_cv_header_stdc=no
1486 fi
1487 rm -f conftest*
1488
1489 if test $ac_cv_header_stdc = yes; then
1490   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1491 cat > conftest.$ac_ext <<EOF
1492 #line 1493 "configure"
1493 #include "confdefs.h"
1494 #include <string.h>
1495 EOF
1496 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1497   egrep "memchr" >/dev/null 2>&1; then
1498   :
1499 else
1500   rm -rf conftest*
1501   ac_cv_header_stdc=no
1502 fi
1503 rm -f conftest*
1504
1505 fi
1506
1507 if test $ac_cv_header_stdc = yes; then
1508   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1509 cat > conftest.$ac_ext <<EOF
1510 #line 1511 "configure"
1511 #include "confdefs.h"
1512 #include <stdlib.h>
1513 EOF
1514 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1515   egrep "free" >/dev/null 2>&1; then
1516   :
1517 else
1518   rm -rf conftest*
1519   ac_cv_header_stdc=no
1520 fi
1521 rm -f conftest*
1522
1523 fi
1524
1525 if test $ac_cv_header_stdc = yes; then
1526   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1527 if test "$cross_compiling" = yes; then
1528   :
1529 else
1530   cat > conftest.$ac_ext <<EOF
1531 #line 1532 "configure"
1532 #include "confdefs.h"
1533 #include <ctype.h>
1534 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1535 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1536 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1537 int main () { int i; for (i = 0; i < 256; i++)
1538 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1539 exit (0); }
1540
1541 EOF
1542 if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1543 then
1544   :
1545 else
1546   echo "configure: failed program was:" >&5
1547   cat conftest.$ac_ext >&5
1548   rm -fr conftest*
1549   ac_cv_header_stdc=no
1550 fi
1551 rm -fr conftest*
1552 fi
1553
1554 fi
1555 fi
1556
1557 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1558 if test $ac_cv_header_stdc = yes; then
1559   cat >> confdefs.h <<\EOF
1560 #define STDC_HEADERS 1
1561 EOF
1562
1563 fi
1564
1565 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1566 echo "configure:1567: checking for sys/wait.h that is POSIX.1 compatible" >&5
1567 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1568   echo $ac_n "(cached) $ac_c" 1>&6
1569 else
1570   cat > conftest.$ac_ext <<EOF
1571 #line 1572 "configure"
1572 #include "confdefs.h"
1573 #include <sys/types.h>
1574 #include <sys/wait.h>
1575 #ifndef WEXITSTATUS
1576 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1577 #endif
1578 #ifndef WIFEXITED
1579 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1580 #endif
1581 int main() {
1582 int s;
1583 wait (&s);
1584 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1585 ; return 0; }
1586 EOF
1587 if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1588   rm -rf conftest*
1589   ac_cv_header_sys_wait_h=yes
1590 else
1591   echo "configure: failed program was:" >&5
1592   cat conftest.$ac_ext >&5
1593   rm -rf conftest*
1594   ac_cv_header_sys_wait_h=no
1595 fi
1596 rm -f conftest*
1597 fi
1598
1599 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1600 if test $ac_cv_header_sys_wait_h = yes; then
1601   cat >> confdefs.h <<\EOF
1602 #define HAVE_SYS_WAIT_H 1
1603 EOF
1604
1605 fi
1606
1607 for ac_hdr in limits.h locale.h stdarg.h unistd.h signum.h sys/param.h string.h
1608 do
1609 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1610 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1611 echo "configure:1612: checking for $ac_hdr" >&5
1612 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1613   echo $ac_n "(cached) $ac_c" 1>&6
1614 else
1615   cat > conftest.$ac_ext <<EOF
1616 #line 1617 "configure"
1617 #include "confdefs.h"
1618 #include <$ac_hdr>
1619 EOF
1620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1621 { (eval echo configure:1622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1622 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1623 if test -z "$ac_err"; then
1624   rm -rf conftest*
1625   eval "ac_cv_header_$ac_safe=yes"
1626 else
1627   echo "$ac_err" >&5
1628   echo "configure: failed program was:" >&5
1629   cat conftest.$ac_ext >&5
1630   rm -rf conftest*
1631   eval "ac_cv_header_$ac_safe=no"
1632 fi
1633 rm -f conftest*
1634 fi
1635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1636   echo "$ac_t""yes" 1>&6
1637     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1638   cat >> confdefs.h <<EOF
1639 #define $ac_tr_hdr 1
1640 EOF
1641  
1642 else
1643   echo "$ac_t""no" 1>&6
1644 fi
1645 done
1646
1647 if test "$ac_cv_header_string_h" = yes
1648 then
1649         for ac_hdr in memory.h
1650 do
1651 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1652 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1653 echo "configure:1654: checking for $ac_hdr" >&5
1654 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1655   echo $ac_n "(cached) $ac_c" 1>&6
1656 else
1657   cat > conftest.$ac_ext <<EOF
1658 #line 1659 "configure"
1659 #include "confdefs.h"
1660 #include <$ac_hdr>
1661 EOF
1662 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1663 { (eval echo configure:1664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1664 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1665 if test -z "$ac_err"; then
1666   rm -rf conftest*
1667   eval "ac_cv_header_$ac_safe=yes"
1668 else
1669   echo "$ac_err" >&5
1670   echo "configure: failed program was:" >&5
1671   cat conftest.$ac_ext >&5
1672   rm -rf conftest*
1673   eval "ac_cv_header_$ac_safe=no"
1674 fi
1675 rm -f conftest*
1676 fi
1677 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1678   echo "$ac_t""yes" 1>&6
1679     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1680   cat >> confdefs.h <<EOF
1681 #define $ac_tr_hdr 1
1682 EOF
1683  
1684 else
1685   echo "$ac_t""no" 1>&6
1686 fi
1687 done
1688
1689 else
1690         for ac_hdr in strings.h
1691 do
1692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1693 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1694 echo "configure:1695: checking for $ac_hdr" >&5
1695 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1696   echo $ac_n "(cached) $ac_c" 1>&6
1697 else
1698   cat > conftest.$ac_ext <<EOF
1699 #line 1700 "configure"
1700 #include "confdefs.h"
1701 #include <$ac_hdr>
1702 EOF
1703 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1704 { (eval echo configure:1705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1705 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1706 if test -z "$ac_err"; then
1707   rm -rf conftest*
1708   eval "ac_cv_header_$ac_safe=yes"
1709 else
1710   echo "$ac_err" >&5
1711   echo "configure: failed program was:" >&5
1712   cat conftest.$ac_ext >&5
1713   rm -rf conftest*
1714   eval "ac_cv_header_$ac_safe=no"
1715 fi
1716 rm -f conftest*
1717 fi
1718 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1719   echo "$ac_t""yes" 1>&6
1720     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1721   cat >> confdefs.h <<EOF
1722 #define $ac_tr_hdr 1
1723 EOF
1724  
1725 else
1726   echo "$ac_t""no" 1>&6
1727 fi
1728 done
1729
1730 fi
1731
1732 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1733 echo "configure:1734: checking for pid_t" >&5
1734 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1735   echo $ac_n "(cached) $ac_c" 1>&6
1736 else
1737   cat > conftest.$ac_ext <<EOF
1738 #line 1739 "configure"
1739 #include "confdefs.h"
1740 #include <sys/types.h>
1741 #if STDC_HEADERS
1742 #include <stdlib.h>
1743 #include <stddef.h>
1744 #endif
1745 EOF
1746 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1747   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1748   rm -rf conftest*
1749   ac_cv_type_pid_t=yes
1750 else
1751   rm -rf conftest*
1752   ac_cv_type_pid_t=no
1753 fi
1754 rm -f conftest*
1755
1756 fi
1757 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1758 if test $ac_cv_type_pid_t = no; then
1759   cat >> confdefs.h <<\EOF
1760 #define pid_t int
1761 EOF
1762
1763 fi
1764
1765 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1766 echo "configure:1767: checking return type of signal handlers" >&5
1767 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1768   echo $ac_n "(cached) $ac_c" 1>&6
1769 else
1770   cat > conftest.$ac_ext <<EOF
1771 #line 1772 "configure"
1772 #include "confdefs.h"
1773 #include <sys/types.h>
1774 #include <signal.h>
1775 #ifdef signal
1776 #undef signal
1777 #endif
1778 #ifdef __cplusplus
1779 extern "C" void (*signal (int, void (*)(int)))(int);
1780 #else
1781 void (*signal ()) ();
1782 #endif
1783
1784 int main() {
1785 int i;
1786 ; return 0; }
1787 EOF
1788 if { (eval echo configure:1789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1789   rm -rf conftest*
1790   ac_cv_type_signal=void
1791 else
1792   echo "configure: failed program was:" >&5
1793   cat conftest.$ac_ext >&5
1794   rm -rf conftest*
1795   ac_cv_type_signal=int
1796 fi
1797 rm -f conftest*
1798 fi
1799
1800 echo "$ac_t""$ac_cv_type_signal" 1>&6
1801 cat >> confdefs.h <<EOF
1802 #define RETSIGTYPE $ac_cv_type_signal
1803 EOF
1804
1805
1806 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1807 echo "configure:1808: checking for size_t" >&5
1808 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1809   echo $ac_n "(cached) $ac_c" 1>&6
1810 else
1811   cat > conftest.$ac_ext <<EOF
1812 #line 1813 "configure"
1813 #include "confdefs.h"
1814 #include <sys/types.h>
1815 #if STDC_HEADERS
1816 #include <stdlib.h>
1817 #include <stddef.h>
1818 #endif
1819 EOF
1820 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1821   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1822   rm -rf conftest*
1823   ac_cv_type_size_t=yes
1824 else
1825   rm -rf conftest*
1826   ac_cv_type_size_t=no
1827 fi
1828 rm -f conftest*
1829
1830 fi
1831 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1832 if test $ac_cv_type_size_t = no; then
1833   cat >> confdefs.h <<\EOF
1834 #define size_t unsigned
1835 EOF
1836
1837 fi
1838
1839 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
1840 echo "configure:1841: checking for uid_t in sys/types.h" >&5
1841 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
1842   echo $ac_n "(cached) $ac_c" 1>&6
1843 else
1844   cat > conftest.$ac_ext <<EOF
1845 #line 1846 "configure"
1846 #include "confdefs.h"
1847 #include <sys/types.h>
1848 EOF
1849 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1850   egrep "uid_t" >/dev/null 2>&1; then
1851   rm -rf conftest*
1852   ac_cv_type_uid_t=yes
1853 else
1854   rm -rf conftest*
1855   ac_cv_type_uid_t=no
1856 fi
1857 rm -f conftest*
1858
1859 fi
1860
1861 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
1862 if test $ac_cv_type_uid_t = no; then
1863   cat >> confdefs.h <<\EOF
1864 #define uid_t int
1865 EOF
1866
1867   cat >> confdefs.h <<\EOF
1868 #define gid_t int
1869 EOF
1870
1871 fi
1872
1873 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
1874 echo "configure:1875: checking type of array argument to getgroups" >&5
1875 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
1876   echo $ac_n "(cached) $ac_c" 1>&6
1877 else
1878   if test "$cross_compiling" = yes; then
1879   ac_cv_type_getgroups=cross
1880 else
1881   cat > conftest.$ac_ext <<EOF
1882 #line 1883 "configure"
1883 #include "confdefs.h"
1884
1885 /* Thanks to Mike Rendell for this test.  */
1886 #include <sys/types.h>
1887 #define NGID 256
1888 #undef MAX
1889 #define MAX(x, y) ((x) > (y) ? (x) : (y))
1890 main()
1891 {
1892   gid_t gidset[NGID];
1893   int i, n;
1894   union { gid_t gval; long lval; }  val;
1895
1896   val.lval = -1;
1897   for (i = 0; i < NGID; i++)
1898     gidset[i] = val.gval;
1899   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
1900                  gidset);
1901   /* Exit non-zero if getgroups seems to require an array of ints.  This
1902      happens when gid_t is short but getgroups modifies an array of ints.  */
1903   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
1904 }
1905
1906 EOF
1907 if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1908 then
1909     ac_cv_type_getgroups=gid_t
1910 else
1911   echo "configure: failed program was:" >&5
1912   cat conftest.$ac_ext >&5
1913   rm -fr conftest*
1914   ac_cv_type_getgroups=int
1915 fi
1916 rm -fr conftest*
1917 fi
1918
1919 if test $ac_cv_type_getgroups = cross; then
1920         cat > conftest.$ac_ext <<EOF
1921 #line 1922 "configure"
1922 #include "confdefs.h"
1923 #include <unistd.h>
1924 EOF
1925 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1926   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
1927   rm -rf conftest*
1928   ac_cv_type_getgroups=gid_t
1929 else
1930   rm -rf conftest*
1931   ac_cv_type_getgroups=int
1932 fi
1933 rm -f conftest*
1934
1935 fi
1936 fi
1937
1938 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
1939 cat >> confdefs.h <<EOF
1940 #define GETGROUPS_T $ac_cv_type_getgroups
1941 EOF
1942
1943
1944 cat > conftest.$ac_ext <<EOF
1945 #line 1946 "configure"
1946 #include "confdefs.h"
1947 #include <stdio.h>
1948 EOF
1949 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1950   egrep "int.*sprintf" >/dev/null 2>&1; then
1951   rm -rf conftest*
1952   cat >> confdefs.h <<\EOF
1953 #define SPRINTF_RET int
1954 EOF
1955
1956 else
1957   rm -rf conftest*
1958   cat >> confdefs.h <<\EOF
1959 #define SPRINTF_RET char *
1960 EOF
1961
1962 fi
1963 rm -f conftest*
1964
1965
1966 if test "$YACC" = "bison -y" ||
1967  { test -f $srcdir/awktab.c && grep 'alloca *(' $srcdir/awktab.c > /dev/null; }
1968 then
1969         # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1970 # for constant arguments.  Useless!
1971 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1972 echo "configure:1973: checking for working alloca.h" >&5
1973 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1974   echo $ac_n "(cached) $ac_c" 1>&6
1975 else
1976   cat > conftest.$ac_ext <<EOF
1977 #line 1978 "configure"
1978 #include "confdefs.h"
1979 #include <alloca.h>
1980 int main() {
1981 char *p = alloca(2 * sizeof(int));
1982 ; return 0; }
1983 EOF
1984 if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1985   rm -rf conftest*
1986   ac_cv_header_alloca_h=yes
1987 else
1988   echo "configure: failed program was:" >&5
1989   cat conftest.$ac_ext >&5
1990   rm -rf conftest*
1991   ac_cv_header_alloca_h=no
1992 fi
1993 rm -f conftest*
1994 fi
1995
1996 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1997 if test $ac_cv_header_alloca_h = yes; then
1998   cat >> confdefs.h <<\EOF
1999 #define HAVE_ALLOCA_H 1
2000 EOF
2001
2002 fi
2003
2004 echo $ac_n "checking for alloca""... $ac_c" 1>&6
2005 echo "configure:2006: checking for alloca" >&5
2006 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
2007   echo $ac_n "(cached) $ac_c" 1>&6
2008 else
2009   cat > conftest.$ac_ext <<EOF
2010 #line 2011 "configure"
2011 #include "confdefs.h"
2012
2013 #ifdef __GNUC__
2014 # define alloca __builtin_alloca
2015 #else
2016 # ifdef _MSC_VER
2017 #  include <malloc.h>
2018 #  define alloca _alloca
2019 # else
2020 #  if HAVE_ALLOCA_H
2021 #   include <alloca.h>
2022 #  else
2023 #   ifdef _AIX
2024  #pragma alloca
2025 #   else
2026 #    ifndef alloca /* predefined by HP cc +Olibcalls */
2027 char *alloca ();
2028 #    endif
2029 #   endif
2030 #  endif
2031 # endif
2032 #endif
2033
2034 int main() {
2035 char *p = (char *) alloca(1);
2036 ; return 0; }
2037 EOF
2038 if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2039   rm -rf conftest*
2040   ac_cv_func_alloca_works=yes
2041 else
2042   echo "configure: failed program was:" >&5
2043   cat conftest.$ac_ext >&5
2044   rm -rf conftest*
2045   ac_cv_func_alloca_works=no
2046 fi
2047 rm -f conftest*
2048 fi
2049
2050 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
2051 if test $ac_cv_func_alloca_works = yes; then
2052   cat >> confdefs.h <<\EOF
2053 #define HAVE_ALLOCA 1
2054 EOF
2055
2056 fi
2057
2058 if test $ac_cv_func_alloca_works = no; then
2059   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
2060   # that cause trouble.  Some versions do not even contain alloca or
2061   # contain a buggy version.  If you still want to use their alloca,
2062   # use ar to extract alloca.o from them instead of compiling alloca.c.
2063   ALLOCA=alloca.${ac_objext}
2064   cat >> confdefs.h <<\EOF
2065 #define C_ALLOCA 1
2066 EOF
2067
2068
2069 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
2070 echo "configure:2071: checking whether alloca needs Cray hooks" >&5
2071 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
2072   echo $ac_n "(cached) $ac_c" 1>&6
2073 else
2074   cat > conftest.$ac_ext <<EOF
2075 #line 2076 "configure"
2076 #include "confdefs.h"
2077 #if defined(CRAY) && ! defined(CRAY2)
2078 webecray
2079 #else
2080 wenotbecray
2081 #endif
2082
2083 EOF
2084 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2085   egrep "webecray" >/dev/null 2>&1; then
2086   rm -rf conftest*
2087   ac_cv_os_cray=yes
2088 else
2089   rm -rf conftest*
2090   ac_cv_os_cray=no
2091 fi
2092 rm -f conftest*
2093
2094 fi
2095
2096 echo "$ac_t""$ac_cv_os_cray" 1>&6
2097 if test $ac_cv_os_cray = yes; then
2098 for ac_func in _getb67 GETB67 getb67; do
2099   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2100 echo "configure:2101: checking for $ac_func" >&5
2101 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2102   echo $ac_n "(cached) $ac_c" 1>&6
2103 else
2104   cat > conftest.$ac_ext <<EOF
2105 #line 2106 "configure"
2106 #include "confdefs.h"
2107 /* System header to define __stub macros and hopefully few prototypes,
2108     which can conflict with char $ac_func(); below.  */
2109 #include <assert.h>
2110 /* Override any gcc2 internal prototype to avoid an error.  */
2111 /* We use char because int might match the return type of a gcc2
2112     builtin and then its argument prototype would still apply.  */
2113 char $ac_func();
2114
2115 int main() {
2116
2117 /* The GNU C library defines this for functions which it implements
2118     to always fail with ENOSYS.  Some functions are actually named
2119     something starting with __ and the normal name is an alias.  */
2120 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2121 choke me
2122 #else
2123 $ac_func();
2124 #endif
2125
2126 ; return 0; }
2127 EOF
2128 if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2129   rm -rf conftest*
2130   eval "ac_cv_func_$ac_func=yes"
2131 else
2132   echo "configure: failed program was:" >&5
2133   cat conftest.$ac_ext >&5
2134   rm -rf conftest*
2135   eval "ac_cv_func_$ac_func=no"
2136 fi
2137 rm -f conftest*
2138 fi
2139
2140 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2141   echo "$ac_t""yes" 1>&6
2142   cat >> confdefs.h <<EOF
2143 #define CRAY_STACKSEG_END $ac_func
2144 EOF
2145
2146   break
2147 else
2148   echo "$ac_t""no" 1>&6
2149 fi
2150
2151 done
2152 fi
2153
2154 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
2155 echo "configure:2156: checking stack direction for C alloca" >&5
2156 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
2157   echo $ac_n "(cached) $ac_c" 1>&6
2158 else
2159   if test "$cross_compiling" = yes; then
2160   ac_cv_c_stack_direction=0
2161 else
2162   cat > conftest.$ac_ext <<EOF
2163 #line 2164 "configure"
2164 #include "confdefs.h"
2165 find_stack_direction ()
2166 {
2167   static char *addr = 0;
2168   auto char dummy;
2169   if (addr == 0)
2170     {
2171       addr = &dummy;
2172       return find_stack_direction ();
2173     }
2174   else
2175     return (&dummy > addr) ? 1 : -1;
2176 }
2177 main ()
2178 {
2179   exit (find_stack_direction() < 0);
2180 }
2181 EOF
2182 if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2183 then
2184   ac_cv_c_stack_direction=1
2185 else
2186   echo "configure: failed program was:" >&5
2187   cat conftest.$ac_ext >&5
2188   rm -fr conftest*
2189   ac_cv_c_stack_direction=-1
2190 fi
2191 rm -fr conftest*
2192 fi
2193
2194 fi
2195
2196 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
2197 cat >> confdefs.h <<EOF
2198 #define STACK_DIRECTION $ac_cv_c_stack_direction
2199 EOF
2200
2201 fi
2202
2203 fi
2204 cat >> confdefs.h <<\EOF
2205 #define REGEX_MALLOC 1
2206 EOF
2207
2208 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
2209 echo "configure:2210: checking for vprintf" >&5
2210 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
2211   echo $ac_n "(cached) $ac_c" 1>&6
2212 else
2213   cat > conftest.$ac_ext <<EOF
2214 #line 2215 "configure"
2215 #include "confdefs.h"
2216 /* System header to define __stub macros and hopefully few prototypes,
2217     which can conflict with char vprintf(); below.  */
2218 #include <assert.h>
2219 /* Override any gcc2 internal prototype to avoid an error.  */
2220 /* We use char because int might match the return type of a gcc2
2221     builtin and then its argument prototype would still apply.  */
2222 char vprintf();
2223
2224 int main() {
2225
2226 /* The GNU C library defines this for functions which it implements
2227     to always fail with ENOSYS.  Some functions are actually named
2228     something starting with __ and the normal name is an alias.  */
2229 #if defined (__stub_vprintf) || defined (__stub___vprintf)
2230 choke me
2231 #else
2232 vprintf();
2233 #endif
2234
2235 ; return 0; }
2236 EOF
2237 if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2238   rm -rf conftest*
2239   eval "ac_cv_func_vprintf=yes"
2240 else
2241   echo "configure: failed program was:" >&5
2242   cat conftest.$ac_ext >&5
2243   rm -rf conftest*
2244   eval "ac_cv_func_vprintf=no"
2245 fi
2246 rm -f conftest*
2247 fi
2248
2249 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
2250   echo "$ac_t""yes" 1>&6
2251   cat >> confdefs.h <<\EOF
2252 #define HAVE_VPRINTF 1
2253 EOF
2254
2255 else
2256   echo "$ac_t""no" 1>&6
2257 fi
2258
2259 if test "$ac_cv_func_vprintf" != yes; then
2260 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
2261 echo "configure:2262: checking for _doprnt" >&5
2262 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
2263   echo $ac_n "(cached) $ac_c" 1>&6
2264 else
2265   cat > conftest.$ac_ext <<EOF
2266 #line 2267 "configure"
2267 #include "confdefs.h"
2268 /* System header to define __stub macros and hopefully few prototypes,
2269     which can conflict with char _doprnt(); below.  */
2270 #include <assert.h>
2271 /* Override any gcc2 internal prototype to avoid an error.  */
2272 /* We use char because int might match the return type of a gcc2
2273     builtin and then its argument prototype would still apply.  */
2274 char _doprnt();
2275
2276 int main() {
2277
2278 /* The GNU C library defines this for functions which it implements
2279     to always fail with ENOSYS.  Some functions are actually named
2280     something starting with __ and the normal name is an alias.  */
2281 #if defined (__stub__doprnt) || defined (__stub____doprnt)
2282 choke me
2283 #else
2284 _doprnt();
2285 #endif
2286
2287 ; return 0; }
2288 EOF
2289 if { (eval echo configure:2290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2290   rm -rf conftest*
2291   eval "ac_cv_func__doprnt=yes"
2292 else
2293   echo "configure: failed program was:" >&5
2294   cat conftest.$ac_ext >&5
2295   rm -rf conftest*
2296   eval "ac_cv_func__doprnt=no"
2297 fi
2298 rm -f conftest*
2299 fi
2300
2301 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
2302   echo "$ac_t""yes" 1>&6
2303   cat >> confdefs.h <<\EOF
2304 #define HAVE_DOPRNT 1
2305 EOF
2306
2307 else
2308   echo "$ac_t""no" 1>&6
2309 fi
2310
2311 fi
2312
2313
2314 echo $ac_n "checking for fmod in -lm""... $ac_c" 1>&6
2315 echo "configure:2316: checking for fmod in -lm" >&5
2316 ac_lib_var=`echo m'_'fmod | sed 'y%./+-%__p_%'`
2317 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2318   echo $ac_n "(cached) $ac_c" 1>&6
2319 else
2320   ac_save_LIBS="$LIBS"
2321 LIBS="-lm  $LIBS"
2322 cat > conftest.$ac_ext <<EOF
2323 #line 2324 "configure"
2324 #include "confdefs.h"
2325 /* Override any gcc2 internal prototype to avoid an error.  */
2326 /* We use char because int might match the return type of a gcc2
2327     builtin and then its argument prototype would still apply.  */
2328 char fmod();
2329
2330 int main() {
2331 fmod()
2332 ; return 0; }
2333 EOF
2334 if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2335   rm -rf conftest*
2336   eval "ac_cv_lib_$ac_lib_var=yes"
2337 else
2338   echo "configure: failed program was:" >&5
2339   cat conftest.$ac_ext >&5
2340   rm -rf conftest*
2341   eval "ac_cv_lib_$ac_lib_var=no"
2342 fi
2343 rm -f conftest*
2344 LIBS="$ac_save_LIBS"
2345
2346 fi
2347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2348   echo "$ac_t""yes" 1>&6
2349     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2350     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2351   cat >> confdefs.h <<EOF
2352 #define $ac_tr_lib 1
2353 EOF
2354
2355   LIBS="-lm $LIBS"
2356
2357 else
2358   echo "$ac_t""no" 1>&6
2359 fi
2360
2361 for ac_func in madvise memset memcpy memcmp fmod setlocale strchr strerror \
2362                 strftime strncasecmp strtod system tzset
2363 do
2364 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2365 echo "configure:2366: checking for $ac_func" >&5
2366 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2367   echo $ac_n "(cached) $ac_c" 1>&6
2368 else
2369   cat > conftest.$ac_ext <<EOF
2370 #line 2371 "configure"
2371 #include "confdefs.h"
2372 /* System header to define __stub macros and hopefully few prototypes,
2373     which can conflict with char $ac_func(); below.  */
2374 #include <assert.h>
2375 /* Override any gcc2 internal prototype to avoid an error.  */
2376 /* We use char because int might match the return type of a gcc2
2377     builtin and then its argument prototype would still apply.  */
2378 char $ac_func();
2379
2380 int main() {
2381
2382 /* The GNU C library defines this for functions which it implements
2383     to always fail with ENOSYS.  Some functions are actually named
2384     something starting with __ and the normal name is an alias.  */
2385 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2386 choke me
2387 #else
2388 $ac_func();
2389 #endif
2390
2391 ; return 0; }
2392 EOF
2393 if { (eval echo configure:2394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2394   rm -rf conftest*
2395   eval "ac_cv_func_$ac_func=yes"
2396 else
2397   echo "configure: failed program was:" >&5
2398   cat conftest.$ac_ext >&5
2399   rm -rf conftest*
2400   eval "ac_cv_func_$ac_func=no"
2401 fi
2402 rm -f conftest*
2403 fi
2404
2405 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2406   echo "$ac_t""yes" 1>&6
2407     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2408   cat >> confdefs.h <<EOF
2409 #define $ac_tr_func 1
2410 EOF
2411  
2412 else
2413   echo "$ac_t""no" 1>&6
2414 fi
2415 done
2416
2417
2418 for ac_hdr in unistd.h
2419 do
2420 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2421 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2422 echo "configure:2423: checking for $ac_hdr" >&5
2423 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2424   echo $ac_n "(cached) $ac_c" 1>&6
2425 else
2426   cat > conftest.$ac_ext <<EOF
2427 #line 2428 "configure"
2428 #include "confdefs.h"
2429 #include <$ac_hdr>
2430 EOF
2431 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2432 { (eval echo configure:2433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2433 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2434 if test -z "$ac_err"; then
2435   rm -rf conftest*
2436   eval "ac_cv_header_$ac_safe=yes"
2437 else
2438   echo "$ac_err" >&5
2439   echo "configure: failed program was:" >&5
2440   cat conftest.$ac_ext >&5
2441   rm -rf conftest*
2442   eval "ac_cv_header_$ac_safe=no"
2443 fi
2444 rm -f conftest*
2445 fi
2446 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2447   echo "$ac_t""yes" 1>&6
2448     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2449   cat >> confdefs.h <<EOF
2450 #define $ac_tr_hdr 1
2451 EOF
2452  
2453 else
2454   echo "$ac_t""no" 1>&6
2455 fi
2456 done
2457
2458 for ac_func in getpagesize
2459 do
2460 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2461 echo "configure:2462: checking for $ac_func" >&5
2462 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2463   echo $ac_n "(cached) $ac_c" 1>&6
2464 else
2465   cat > conftest.$ac_ext <<EOF
2466 #line 2467 "configure"
2467 #include "confdefs.h"
2468 /* System header to define __stub macros and hopefully few prototypes,
2469     which can conflict with char $ac_func(); below.  */
2470 #include <assert.h>
2471 /* Override any gcc2 internal prototype to avoid an error.  */
2472 /* We use char because int might match the return type of a gcc2
2473     builtin and then its argument prototype would still apply.  */
2474 char $ac_func();
2475
2476 int main() {
2477
2478 /* The GNU C library defines this for functions which it implements
2479     to always fail with ENOSYS.  Some functions are actually named
2480     something starting with __ and the normal name is an alias.  */
2481 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2482 choke me
2483 #else
2484 $ac_func();
2485 #endif
2486
2487 ; return 0; }
2488 EOF
2489 if { (eval echo configure:2490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2490   rm -rf conftest*
2491   eval "ac_cv_func_$ac_func=yes"
2492 else
2493   echo "configure: failed program was:" >&5
2494   cat conftest.$ac_ext >&5
2495   rm -rf conftest*
2496   eval "ac_cv_func_$ac_func=no"
2497 fi
2498 rm -f conftest*
2499 fi
2500
2501 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2502   echo "$ac_t""yes" 1>&6
2503     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2504   cat >> confdefs.h <<EOF
2505 #define $ac_tr_func 1
2506 EOF
2507  
2508 else
2509   echo "$ac_t""no" 1>&6
2510 fi
2511 done
2512
2513 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
2514 echo "configure:2515: checking for working mmap" >&5
2515 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
2516   echo $ac_n "(cached) $ac_c" 1>&6
2517 else
2518   if test "$cross_compiling" = yes; then
2519   ac_cv_func_mmap_fixed_mapped=no
2520 else
2521   cat > conftest.$ac_ext <<EOF
2522 #line 2523 "configure"
2523 #include "confdefs.h"
2524
2525 /* Thanks to Mike Haertel and Jim Avera for this test.
2526    Here is a matrix of mmap possibilities:
2527         mmap private not fixed
2528         mmap private fixed at somewhere currently unmapped
2529         mmap private fixed at somewhere already mapped
2530         mmap shared not fixed
2531         mmap shared fixed at somewhere currently unmapped
2532         mmap shared fixed at somewhere already mapped
2533    For private mappings, we should verify that changes cannot be read()
2534    back from the file, nor mmap's back from the file at a different
2535    address.  (There have been systems where private was not correctly
2536    implemented like the infamous i386 svr4.0, and systems where the
2537    VM page cache was not coherent with the filesystem buffer cache
2538    like early versions of FreeBSD and possibly contemporary NetBSD.)
2539    For shared mappings, we should conversely verify that changes get
2540    propogated back to all the places they're supposed to be.
2541
2542    Grep wants private fixed already mapped.
2543    The main things grep needs to know about mmap are:
2544    * does it exist and is it safe to write into the mmap'd area
2545    * how to use it (BSD variants)  */
2546 #include <sys/types.h>
2547 #include <fcntl.h>
2548 #include <sys/mman.h>
2549
2550 /* This mess was copied from the GNU getpagesize.h.  */
2551 #ifndef HAVE_GETPAGESIZE
2552 # ifdef HAVE_UNISTD_H
2553 #  include <unistd.h>
2554 # endif
2555
2556 /* Assume that all systems that can run configure have sys/param.h.  */
2557 # ifndef HAVE_SYS_PARAM_H
2558 #  define HAVE_SYS_PARAM_H 1
2559 # endif
2560
2561 # ifdef _SC_PAGESIZE
2562 #  define getpagesize() sysconf(_SC_PAGESIZE)
2563 # else /* no _SC_PAGESIZE */
2564 #  ifdef HAVE_SYS_PARAM_H
2565 #   include <sys/param.h>
2566 #   ifdef EXEC_PAGESIZE
2567 #    define getpagesize() EXEC_PAGESIZE
2568 #   else /* no EXEC_PAGESIZE */
2569 #    ifdef NBPG
2570 #     define getpagesize() NBPG * CLSIZE
2571 #     ifndef CLSIZE
2572 #      define CLSIZE 1
2573 #     endif /* no CLSIZE */
2574 #    else /* no NBPG */
2575 #     ifdef NBPC
2576 #      define getpagesize() NBPC
2577 #     else /* no NBPC */
2578 #      ifdef PAGESIZE
2579 #       define getpagesize() PAGESIZE
2580 #      endif /* PAGESIZE */
2581 #     endif /* no NBPC */
2582 #    endif /* no NBPG */
2583 #   endif /* no EXEC_PAGESIZE */
2584 #  else /* no HAVE_SYS_PARAM_H */
2585 #   define getpagesize() 8192   /* punt totally */
2586 #  endif /* no HAVE_SYS_PARAM_H */
2587 # endif /* no _SC_PAGESIZE */
2588
2589 #endif /* no HAVE_GETPAGESIZE */
2590
2591 #ifdef __cplusplus
2592 extern "C" { void *malloc(unsigned); }
2593 #else
2594 char *malloc();
2595 #endif
2596
2597 int
2598 main()
2599 {
2600         char *data, *data2, *data3;
2601         int i, pagesize;
2602         int fd;
2603
2604         pagesize = getpagesize();
2605
2606         /*
2607          * First, make a file with some known garbage in it.
2608          */
2609         data = malloc(pagesize);
2610         if (!data)
2611                 exit(1);
2612         for (i = 0; i < pagesize; ++i)
2613                 *(data + i) = rand();
2614         umask(0);
2615         fd = creat("conftestmmap", 0600);
2616         if (fd < 0)
2617                 exit(1);
2618         if (write(fd, data, pagesize) != pagesize)
2619                 exit(1);
2620         close(fd);
2621
2622         /*
2623          * Next, try to mmap the file at a fixed address which
2624          * already has something else allocated at it.  If we can,
2625          * also make sure that we see the same garbage.
2626          */
2627         fd = open("conftestmmap", O_RDWR);
2628         if (fd < 0)
2629                 exit(1);
2630         data2 = malloc(2 * pagesize);
2631         if (!data2)
2632                 exit(1);
2633         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
2634         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
2635             MAP_PRIVATE | MAP_FIXED, fd, 0L))
2636                 exit(1);
2637         for (i = 0; i < pagesize; ++i)
2638                 if (*(data + i) != *(data2 + i))
2639                         exit(1);
2640
2641         /*
2642          * Finally, make sure that changes to the mapped area
2643          * do not percolate back to the file as seen by read().
2644          * (This is a bug on some variants of i386 svr4.0.)
2645          */
2646         for (i = 0; i < pagesize; ++i)
2647                 *(data2 + i) = *(data2 + i) + 1;
2648         data3 = malloc(pagesize);
2649         if (!data3)
2650                 exit(1);
2651         if (read(fd, data3, pagesize) != pagesize)
2652                 exit(1);
2653         for (i = 0; i < pagesize; ++i)
2654                 if (*(data + i) != *(data3 + i))
2655                         exit(1);
2656         close(fd);
2657         unlink("conftestmmap");
2658         exit(0);
2659 }
2660
2661 EOF
2662 if { (eval echo configure:2663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2663 then
2664   ac_cv_func_mmap_fixed_mapped=yes
2665 else
2666   echo "configure: failed program was:" >&5
2667   cat conftest.$ac_ext >&5
2668   rm -fr conftest*
2669   ac_cv_func_mmap_fixed_mapped=no
2670 fi
2671 rm -fr conftest*
2672 fi
2673
2674 fi
2675
2676 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
2677 if test $ac_cv_func_mmap_fixed_mapped = yes; then
2678   cat >> confdefs.h <<\EOF
2679 #define HAVE_MMAP 1
2680 EOF
2681
2682 fi
2683
2684
2685 if (uname) > /dev/null 2>&1
2686 then
2687         case `uname` in
2688         *VMS*|*BeOS*)
2689                 cat >> confdefs.h <<\EOF
2690 #define GETPGRP_VOID 1
2691 EOF
2692
2693                 ;;
2694         *HP-UX*)        # not getpgrp related
2695                 if test "$GCC" = yes
2696                 then
2697                         :
2698                 else
2699                         # stupid HP linker leaves the output file
2700                         # around even when a link fails. This confuses
2701                         # the alloca tests, so we have to do this
2702                         # manually. Sucks big time.
2703                         LIBS="$LIBS -lPW"
2704                 fi
2705
2706                 # have to do the getpgrp test since won't
2707                 # fall into the default
2708                 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
2709 echo "configure:2710: checking whether getpgrp takes no argument" >&5
2710 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
2711   echo $ac_n "(cached) $ac_c" 1>&6
2712 else
2713   if test "$cross_compiling" = yes; then
2714   { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
2715 else
2716   cat > conftest.$ac_ext <<EOF
2717 #line 2718 "configure"
2718 #include "confdefs.h"
2719
2720 /*
2721  * If this system has a BSD-style getpgrp(),
2722  * which takes a pid argument, exit unsuccessfully.
2723  *
2724  * Snarfed from Chet Ramey's bash pgrp.c test program
2725  */
2726 #include <stdio.h>
2727 #include <sys/types.h>
2728
2729 int     pid;
2730 int     pg1, pg2, pg3, pg4;
2731 int     ng, np, s, child;
2732
2733 main()
2734 {
2735         pid = getpid();
2736         pg1 = getpgrp(0);
2737         pg2 = getpgrp();
2738         pg3 = getpgrp(pid);
2739         pg4 = getpgrp(1);
2740
2741         /*
2742          * If all of these values are the same, it's pretty sure that
2743          * we're on a system that ignores getpgrp's first argument.
2744          */
2745         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
2746                 exit(0);
2747
2748         child = fork();
2749         if (child < 0)
2750                 exit(1);
2751         else if (child == 0) {
2752                 np = getpid();
2753                 /*
2754                  * If this is Sys V, this will not work; pgrp will be
2755                  * set to np because setpgrp just changes a pgrp to be
2756                  * the same as the pid.
2757                  */
2758                 setpgrp(np, pg1);
2759                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
2760                 if (ng == pg1) {
2761                         exit(1);
2762                 } else {
2763                         exit(0);
2764                 }
2765         } else {
2766                 wait(&s);
2767                 exit(s>>8);
2768         }
2769 }
2770
2771 EOF
2772 if { (eval echo configure:2773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2773 then
2774   ac_cv_func_getpgrp_void=yes
2775 else
2776   echo "configure: failed program was:" >&5
2777   cat conftest.$ac_ext >&5
2778   rm -fr conftest*
2779   ac_cv_func_getpgrp_void=no
2780 fi
2781 rm -fr conftest*
2782 fi
2783
2784
2785 fi
2786
2787 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
2788 if test $ac_cv_func_getpgrp_void = yes; then
2789   cat >> confdefs.h <<\EOF
2790 #define GETPGRP_VOID 1
2791 EOF
2792
2793 fi
2794
2795                 ;;
2796         *)      echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
2797 echo "configure:2798: checking whether getpgrp takes no argument" >&5
2798 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
2799   echo $ac_n "(cached) $ac_c" 1>&6
2800 else
2801   if test "$cross_compiling" = yes; then
2802   { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
2803 else
2804   cat > conftest.$ac_ext <<EOF
2805 #line 2806 "configure"
2806 #include "confdefs.h"
2807
2808 /*
2809  * If this system has a BSD-style getpgrp(),
2810  * which takes a pid argument, exit unsuccessfully.
2811  *
2812  * Snarfed from Chet Ramey's bash pgrp.c test program
2813  */
2814 #include <stdio.h>
2815 #include <sys/types.h>
2816
2817 int     pid;
2818 int     pg1, pg2, pg3, pg4;
2819 int     ng, np, s, child;
2820
2821 main()
2822 {
2823         pid = getpid();
2824         pg1 = getpgrp(0);
2825         pg2 = getpgrp();
2826         pg3 = getpgrp(pid);
2827         pg4 = getpgrp(1);
2828
2829         /*
2830          * If all of these values are the same, it's pretty sure that
2831          * we're on a system that ignores getpgrp's first argument.
2832          */
2833         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
2834                 exit(0);
2835
2836         child = fork();
2837         if (child < 0)
2838                 exit(1);
2839         else if (child == 0) {
2840                 np = getpid();
2841                 /*
2842                  * If this is Sys V, this will not work; pgrp will be
2843                  * set to np because setpgrp just changes a pgrp to be
2844                  * the same as the pid.
2845                  */
2846                 setpgrp(np, pg1);
2847                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
2848                 if (ng == pg1) {
2849                         exit(1);
2850                 } else {
2851                         exit(0);
2852                 }
2853         } else {
2854                 wait(&s);
2855                 exit(s>>8);
2856         }
2857 }
2858
2859 EOF
2860 if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2861 then
2862   ac_cv_func_getpgrp_void=yes
2863 else
2864   echo "configure: failed program was:" >&5
2865   cat conftest.$ac_ext >&5
2866   rm -fr conftest*
2867   ac_cv_func_getpgrp_void=no
2868 fi
2869 rm -fr conftest*
2870 fi
2871
2872
2873 fi
2874
2875 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
2876 if test $ac_cv_func_getpgrp_void = yes; then
2877   cat >> confdefs.h <<\EOF
2878 #define GETPGRP_VOID 1
2879 EOF
2880
2881 fi
2882
2883                 ;;
2884         esac
2885 else
2886         echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
2887 echo "configure:2888: checking whether getpgrp takes no argument" >&5
2888 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
2889   echo $ac_n "(cached) $ac_c" 1>&6
2890 else
2891   if test "$cross_compiling" = yes; then
2892   { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
2893 else
2894   cat > conftest.$ac_ext <<EOF
2895 #line 2896 "configure"
2896 #include "confdefs.h"
2897
2898 /*
2899  * If this system has a BSD-style getpgrp(),
2900  * which takes a pid argument, exit unsuccessfully.
2901  *
2902  * Snarfed from Chet Ramey's bash pgrp.c test program
2903  */
2904 #include <stdio.h>
2905 #include <sys/types.h>
2906
2907 int     pid;
2908 int     pg1, pg2, pg3, pg4;
2909 int     ng, np, s, child;
2910
2911 main()
2912 {
2913         pid = getpid();
2914         pg1 = getpgrp(0);
2915         pg2 = getpgrp();
2916         pg3 = getpgrp(pid);
2917         pg4 = getpgrp(1);
2918
2919         /*
2920          * If all of these values are the same, it's pretty sure that
2921          * we're on a system that ignores getpgrp's first argument.
2922          */
2923         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
2924                 exit(0);
2925
2926         child = fork();
2927         if (child < 0)
2928                 exit(1);
2929         else if (child == 0) {
2930                 np = getpid();
2931                 /*
2932                  * If this is Sys V, this will not work; pgrp will be
2933                  * set to np because setpgrp just changes a pgrp to be
2934                  * the same as the pid.
2935                  */
2936                 setpgrp(np, pg1);
2937                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
2938                 if (ng == pg1) {
2939                         exit(1);
2940                 } else {
2941                         exit(0);
2942                 }
2943         } else {
2944                 wait(&s);
2945                 exit(s>>8);
2946         }
2947 }
2948
2949 EOF
2950 if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2951 then
2952   ac_cv_func_getpgrp_void=yes
2953 else
2954   echo "configure: failed program was:" >&5
2955   cat conftest.$ac_ext >&5
2956   rm -fr conftest*
2957   ac_cv_func_getpgrp_void=no
2958 fi
2959 rm -fr conftest*
2960 fi
2961
2962
2963 fi
2964
2965 echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
2966 if test $ac_cv_func_getpgrp_void = yes; then
2967   cat >> confdefs.h <<\EOF
2968 #define GETPGRP_VOID 1
2969 EOF
2970
2971 fi
2972
2973 fi
2974
2975 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
2976 echo "configure:2977: checking for st_blksize in struct stat" >&5
2977 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
2978   echo $ac_n "(cached) $ac_c" 1>&6
2979 else
2980   cat > conftest.$ac_ext <<EOF
2981 #line 2982 "configure"
2982 #include "confdefs.h"
2983 #include <sys/types.h>
2984 #include <sys/stat.h>
2985 int main() {
2986 struct stat s; s.st_blksize;
2987 ; return 0; }
2988 EOF
2989 if { (eval echo configure:2990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2990   rm -rf conftest*
2991   ac_cv_struct_st_blksize=yes
2992 else
2993   echo "configure: failed program was:" >&5
2994   cat conftest.$ac_ext >&5
2995   rm -rf conftest*
2996   ac_cv_struct_st_blksize=no
2997 fi
2998 rm -f conftest*
2999 fi
3000
3001 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
3002 if test $ac_cv_struct_st_blksize = yes; then
3003   cat >> confdefs.h <<\EOF
3004 #define HAVE_ST_BLKSIZE 1
3005 EOF
3006
3007 fi
3008
3009 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
3010 echo "configure:3011: checking whether time.h and sys/time.h may both be included" >&5
3011 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
3012   echo $ac_n "(cached) $ac_c" 1>&6
3013 else
3014   cat > conftest.$ac_ext <<EOF
3015 #line 3016 "configure"
3016 #include "confdefs.h"
3017 #include <sys/types.h>
3018 #include <sys/time.h>
3019 #include <time.h>
3020 int main() {
3021 struct tm *tp;
3022 ; return 0; }
3023 EOF
3024 if { (eval echo configure:3025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3025   rm -rf conftest*
3026   ac_cv_header_time=yes
3027 else
3028   echo "configure: failed program was:" >&5
3029   cat conftest.$ac_ext >&5
3030   rm -rf conftest*
3031   ac_cv_header_time=no
3032 fi
3033 rm -f conftest*
3034 fi
3035
3036 echo "$ac_t""$ac_cv_header_time" 1>&6
3037 if test $ac_cv_header_time = yes; then
3038   cat >> confdefs.h <<\EOF
3039 #define TIME_WITH_SYS_TIME 1
3040 EOF
3041
3042 fi
3043
3044 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
3045 echo "configure:3046: checking whether struct tm is in sys/time.h or time.h" >&5
3046 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
3047   echo $ac_n "(cached) $ac_c" 1>&6
3048 else
3049   cat > conftest.$ac_ext <<EOF
3050 #line 3051 "configure"
3051 #include "confdefs.h"
3052 #include <sys/types.h>
3053 #include <time.h>
3054 int main() {
3055 struct tm *tp; tp->tm_sec;
3056 ; return 0; }
3057 EOF
3058 if { (eval echo configure:3059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3059   rm -rf conftest*
3060   ac_cv_struct_tm=time.h
3061 else
3062   echo "configure: failed program was:" >&5
3063   cat conftest.$ac_ext >&5
3064   rm -rf conftest*
3065   ac_cv_struct_tm=sys/time.h
3066 fi
3067 rm -f conftest*
3068 fi
3069
3070 echo "$ac_t""$ac_cv_struct_tm" 1>&6
3071 if test $ac_cv_struct_tm = sys/time.h; then
3072   cat >> confdefs.h <<\EOF
3073 #define TM_IN_SYS_TIME 1
3074 EOF
3075
3076 fi
3077
3078 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
3079 echo "configure:3080: checking for tm_zone in struct tm" >&5
3080 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
3081   echo $ac_n "(cached) $ac_c" 1>&6
3082 else
3083   cat > conftest.$ac_ext <<EOF
3084 #line 3085 "configure"
3085 #include "confdefs.h"
3086 #include <sys/types.h>
3087 #include <$ac_cv_struct_tm>
3088 int main() {
3089 struct tm tm; tm.tm_zone;
3090 ; return 0; }
3091 EOF
3092 if { (eval echo configure:3093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3093   rm -rf conftest*
3094   ac_cv_struct_tm_zone=yes
3095 else
3096   echo "configure: failed program was:" >&5
3097   cat conftest.$ac_ext >&5
3098   rm -rf conftest*
3099   ac_cv_struct_tm_zone=no
3100 fi
3101 rm -f conftest*
3102 fi
3103
3104 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
3105 if test "$ac_cv_struct_tm_zone" = yes; then
3106   cat >> confdefs.h <<\EOF
3107 #define HAVE_TM_ZONE 1
3108 EOF
3109
3110 else
3111   echo $ac_n "checking for tzname""... $ac_c" 1>&6
3112 echo "configure:3113: checking for tzname" >&5
3113 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
3114   echo $ac_n "(cached) $ac_c" 1>&6
3115 else
3116   cat > conftest.$ac_ext <<EOF
3117 #line 3118 "configure"
3118 #include "confdefs.h"
3119 #include <time.h>
3120 #ifndef tzname /* For SGI.  */
3121 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
3122 #endif
3123 int main() {
3124 atoi(*tzname);
3125 ; return 0; }
3126 EOF
3127 if { (eval echo configure:3128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3128   rm -rf conftest*
3129   ac_cv_var_tzname=yes
3130 else
3131   echo "configure: failed program was:" >&5
3132   cat conftest.$ac_ext >&5
3133   rm -rf conftest*
3134   ac_cv_var_tzname=no
3135 fi
3136 rm -f conftest*
3137 fi
3138
3139 echo "$ac_t""$ac_cv_var_tzname" 1>&6
3140   if test $ac_cv_var_tzname = yes; then
3141     cat >> confdefs.h <<\EOF
3142 #define HAVE_TZNAME 1
3143 EOF
3144
3145   fi
3146 fi
3147
3148
3149 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
3150 echo "configure:3151: checking whether char is unsigned" >&5
3151 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
3152   echo $ac_n "(cached) $ac_c" 1>&6
3153 else
3154   if test "$GCC" = yes; then
3155   # GCC predefines this symbol on systems where it applies.
3156 cat > conftest.$ac_ext <<EOF
3157 #line 3158 "configure"
3158 #include "confdefs.h"
3159 #ifdef __CHAR_UNSIGNED__
3160   yes
3161 #endif
3162
3163 EOF
3164 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3165   egrep "yes" >/dev/null 2>&1; then
3166   rm -rf conftest*
3167   ac_cv_c_char_unsigned=yes
3168 else
3169   rm -rf conftest*
3170   ac_cv_c_char_unsigned=no
3171 fi
3172 rm -f conftest*
3173
3174 else
3175 if test "$cross_compiling" = yes; then
3176     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3177 else
3178   cat > conftest.$ac_ext <<EOF
3179 #line 3180 "configure"
3180 #include "confdefs.h"
3181 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
3182 #if !defined(__STDC__) || __STDC__ != 1
3183 #define volatile
3184 #endif
3185 main() {
3186   volatile char c = 255; exit(c < 0);
3187 }
3188 EOF
3189 if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3190 then
3191   ac_cv_c_char_unsigned=yes
3192 else
3193   echo "configure: failed program was:" >&5
3194   cat conftest.$ac_ext >&5
3195   rm -fr conftest*
3196   ac_cv_c_char_unsigned=no
3197 fi
3198 rm -fr conftest*
3199 fi
3200
3201 fi
3202 fi
3203
3204 echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
3205 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
3206   cat >> confdefs.h <<\EOF
3207 #define __CHAR_UNSIGNED__ 1
3208 EOF
3209
3210 fi
3211
3212 echo $ac_n "checking for working const""... $ac_c" 1>&6
3213 echo "configure:3214: checking for working const" >&5
3214 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
3215   echo $ac_n "(cached) $ac_c" 1>&6
3216 else
3217   cat > conftest.$ac_ext <<EOF
3218 #line 3219 "configure"
3219 #include "confdefs.h"
3220
3221 int main() {
3222
3223 /* Ultrix mips cc rejects this.  */
3224 typedef int charset[2]; const charset x;
3225 /* SunOS 4.1.1 cc rejects this.  */
3226 char const *const *ccp;
3227 char **p;
3228 /* NEC SVR4.0.2 mips cc rejects this.  */
3229 struct point {int x, y;};
3230 static struct point const zero = {0,0};
3231 /* AIX XL C 1.02.0.0 rejects this.
3232    It does not let you subtract one const X* pointer from another in an arm
3233    of an if-expression whose if-part is not a constant expression */
3234 const char *g = "string";
3235 ccp = &g + (g ? g-g : 0);
3236 /* HPUX 7.0 cc rejects these. */
3237 ++ccp;
3238 p = (char**) ccp;
3239 ccp = (char const *const *) p;
3240 { /* SCO 3.2v4 cc rejects this.  */
3241   char *t;
3242   char const *s = 0 ? (char *) 0 : (char const *) 0;
3243
3244   *t++ = 0;
3245 }
3246 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3247   int x[] = {25, 17};
3248   const int *foo = &x[0];
3249   ++foo;
3250 }
3251 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3252   typedef const int *iptr;
3253   iptr p = 0;
3254   ++p;
3255 }
3256 { /* AIX XL C 1.02.0.0 rejects this saying
3257      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3258   struct s { int j; const int *ap[3]; };
3259   struct s *b; b->j = 5;
3260 }
3261 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3262   const int foo = 10;
3263 }
3264
3265 ; return 0; }
3266 EOF
3267 if { (eval echo configure:3268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3268   rm -rf conftest*
3269   ac_cv_c_const=yes
3270 else
3271   echo "configure: failed program was:" >&5
3272   cat conftest.$ac_ext >&5
3273   rm -rf conftest*
3274   ac_cv_c_const=no
3275 fi
3276 rm -f conftest*
3277 fi
3278
3279 echo "$ac_t""$ac_cv_c_const" 1>&6
3280 if test $ac_cv_c_const = no; then
3281   cat >> confdefs.h <<\EOF
3282 #define const 
3283 EOF
3284
3285 fi
3286
3287
3288
3289 echo $ac_n "checking for ANSI stringizing capability""... $ac_c" 1>&6
3290 echo "configure:3291: checking for ANSI stringizing capability" >&5
3291 if eval "test \"`echo '$''{'gawk_cv_c_stringize'+set}'`\" = set"; then
3292   echo $ac_n "(cached) $ac_c" 1>&6
3293 else
3294   cat > conftest.$ac_ext <<EOF
3295 #line 3296 "configure"
3296 #include "confdefs.h"
3297
3298 #define x(y) #y
3299
3300 char *s = x(teststring);
3301
3302 EOF
3303 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3304   egrep "#teststring" >/dev/null 2>&1; then
3305   rm -rf conftest*
3306   gawk_cv_c_stringize=no
3307 else
3308   rm -rf conftest*
3309   gawk_cv_c_stringize=yes
3310 fi
3311 rm -f conftest*
3312
3313 fi
3314
3315 if test "${gawk_cv_c_stringize}" = yes
3316 then
3317         cat >> confdefs.h <<\EOF
3318 #define HAVE_STRINGIZE 1
3319 EOF
3320
3321 fi
3322 echo "$ac_t""${gawk_cv_c_stringize}" 1>&6
3323
3324
3325 trap '' 1 2 15
3326 cat > confcache <<\EOF
3327 # This file is a shell script that caches the results of configure
3328 # tests run on this system so they can be shared between configure
3329 # scripts and configure runs.  It is not useful on other systems.
3330 # If it contains results you don't want to keep, you may remove or edit it.
3331 #
3332 # By default, configure uses ./config.cache as the cache file,
3333 # creating it if it does not exist already.  You can give configure
3334 # the --cache-file=FILE option to use a different cache file; that is
3335 # what configure does when it calls configure scripts in
3336 # subdirectories, so they share the cache.
3337 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3338 # config.status only pays attention to the cache file if you give it the
3339 # --recheck option to rerun configure.
3340 #
3341 EOF
3342 # The following way of writing the cache mishandles newlines in values,
3343 # but we know of no workaround that is simple, portable, and efficient.
3344 # So, don't put newlines in cache variables' values.
3345 # Ultrix sh set writes to stderr and can't be redirected directly,
3346 # and sets the high bit in the cache file unless we assign to the vars.
3347 (set) 2>&1 |
3348   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3349   *ac_space=\ *)
3350     # `set' does not quote correctly, so add quotes (double-quote substitution
3351     # turns \\\\ into \\, and sed turns \\ into \).
3352     sed -n \
3353       -e "s/'/'\\\\''/g" \
3354       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3355     ;;
3356   *)
3357     # `set' quotes correctly as required by POSIX, so do not add quotes.
3358     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3359     ;;
3360   esac >> confcache
3361 if cmp -s $cache_file confcache; then
3362   :
3363 else
3364   if test -w $cache_file; then
3365     echo "updating cache $cache_file"
3366     cat confcache > $cache_file
3367   else
3368     echo "not updating unwritable cache $cache_file"
3369   fi
3370 fi
3371 rm -f confcache
3372
3373 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3374
3375 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3376 # Let make expand exec_prefix.
3377 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3378
3379 # Any assignment to VPATH causes Sun make to only execute
3380 # the first set of double-colon rules, so remove it if not needed.
3381 # If there is a colon in the path, we need to keep it.
3382 if test "x$srcdir" = x.; then
3383   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3384 fi
3385
3386 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3387
3388 DEFS=-DHAVE_CONFIG_H
3389
3390 # Without the "./", some shells look in PATH for config.status.
3391 : ${CONFIG_STATUS=./config.status}
3392
3393 echo creating $CONFIG_STATUS
3394 rm -f $CONFIG_STATUS
3395 cat > $CONFIG_STATUS <<EOF
3396 #! /bin/sh
3397 # Generated automatically by configure.
3398 # Run this file to recreate the current configuration.
3399 # This directory was configured as follows,
3400 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3401 #
3402 # $0 $ac_configure_args
3403 #
3404 # Compiler output produced by configure, useful for debugging
3405 # configure, is in ./config.log if it exists.
3406
3407 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3408 for ac_option
3409 do
3410   case "\$ac_option" in
3411   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3412     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3413     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3414   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3415     echo "$CONFIG_STATUS generated by autoconf version 2.13"
3416     exit 0 ;;
3417   -help | --help | --hel | --he | --h)
3418     echo "\$ac_cs_usage"; exit 0 ;;
3419   *) echo "\$ac_cs_usage"; exit 1 ;;
3420   esac
3421 done
3422
3423 ac_given_srcdir=$srcdir
3424 ac_given_INSTALL="$INSTALL"
3425
3426 trap 'rm -fr `echo "Makefile doc/Makefile test/Makefile awklib/Makefile config.h:configh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3427 EOF
3428 cat >> $CONFIG_STATUS <<EOF
3429
3430 # Protect against being on the right side of a sed subst in config.status.
3431 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3432  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3433 $ac_vpsub
3434 $extrasub
3435 s%@SHELL@%$SHELL%g
3436 s%@CFLAGS@%$CFLAGS%g
3437 s%@CPPFLAGS@%$CPPFLAGS%g
3438 s%@CXXFLAGS@%$CXXFLAGS%g
3439 s%@FFLAGS@%$FFLAGS%g
3440 s%@DEFS@%$DEFS%g
3441 s%@LDFLAGS@%$LDFLAGS%g
3442 s%@LIBS@%$LIBS%g
3443 s%@exec_prefix@%$exec_prefix%g
3444 s%@prefix@%$prefix%g
3445 s%@program_transform_name@%$program_transform_name%g
3446 s%@bindir@%$bindir%g
3447 s%@sbindir@%$sbindir%g
3448 s%@libexecdir@%$libexecdir%g
3449 s%@datadir@%$datadir%g
3450 s%@sysconfdir@%$sysconfdir%g
3451 s%@sharedstatedir@%$sharedstatedir%g
3452 s%@localstatedir@%$localstatedir%g
3453 s%@libdir@%$libdir%g
3454 s%@includedir@%$includedir%g
3455 s%@oldincludedir@%$oldincludedir%g
3456 s%@infodir@%$infodir%g
3457 s%@mandir@%$mandir%g
3458 s%@YACC@%$YACC%g
3459 s%@LN_S@%$LN_S%g
3460 s%@CC@%$CC%g
3461 s%@CPP@%$CPP%g
3462 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3463 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3464 s%@INSTALL_DATA@%$INSTALL_DATA%g
3465 s%@SET_MAKE@%$SET_MAKE%g
3466 s%@ALLOCA@%$ALLOCA%g
3467
3468 CEOF
3469 EOF
3470
3471 cat >> $CONFIG_STATUS <<\EOF
3472
3473 # Split the substitutions into bite-sized pieces for seds with
3474 # small command number limits, like on Digital OSF/1 and HP-UX.
3475 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3476 ac_file=1 # Number of current file.
3477 ac_beg=1 # First line for current file.
3478 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3479 ac_more_lines=:
3480 ac_sed_cmds=""
3481 while $ac_more_lines; do
3482   if test $ac_beg -gt 1; then
3483     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3484   else
3485     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3486   fi
3487   if test ! -s conftest.s$ac_file; then
3488     ac_more_lines=false
3489     rm -f conftest.s$ac_file
3490   else
3491     if test -z "$ac_sed_cmds"; then
3492       ac_sed_cmds="sed -f conftest.s$ac_file"
3493     else
3494       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3495     fi
3496     ac_file=`expr $ac_file + 1`
3497     ac_beg=$ac_end
3498     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3499   fi
3500 done
3501 if test -z "$ac_sed_cmds"; then
3502   ac_sed_cmds=cat
3503 fi
3504 EOF
3505
3506 cat >> $CONFIG_STATUS <<EOF
3507
3508 CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile test/Makefile awklib/Makefile"}
3509 EOF
3510 cat >> $CONFIG_STATUS <<\EOF
3511 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3512   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3513   case "$ac_file" in
3514   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3515        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3516   *) ac_file_in="${ac_file}.in" ;;
3517   esac
3518
3519   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3520
3521   # Remove last slash and all that follows it.  Not all systems have dirname.
3522   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3523   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3524     # The file is in a subdirectory.
3525     test ! -d "$ac_dir" && mkdir "$ac_dir"
3526     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3527     # A "../" for each directory in $ac_dir_suffix.
3528     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3529   else
3530     ac_dir_suffix= ac_dots=
3531   fi
3532
3533   case "$ac_given_srcdir" in
3534   .)  srcdir=.
3535       if test -z "$ac_dots"; then top_srcdir=.
3536       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3537   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3538   *) # Relative path.
3539     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3540     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3541   esac
3542
3543   case "$ac_given_INSTALL" in
3544   [/$]*) INSTALL="$ac_given_INSTALL" ;;
3545   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3546   esac
3547
3548   echo creating "$ac_file"
3549   rm -f "$ac_file"
3550   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3551   case "$ac_file" in
3552   *Makefile*) ac_comsub="1i\\
3553 # $configure_input" ;;
3554   *) ac_comsub= ;;
3555   esac
3556
3557   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3558   sed -e "$ac_comsub
3559 s%@configure_input@%$configure_input%g
3560 s%@srcdir@%$srcdir%g
3561 s%@top_srcdir@%$top_srcdir%g
3562 s%@INSTALL@%$INSTALL%g
3563 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3564 fi; done
3565 rm -f conftest.s*
3566
3567 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3568 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3569 #
3570 # ac_d sets the value in "#define NAME VALUE" lines.
3571 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3572 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3573 ac_dC='\3'
3574 ac_dD='%g'
3575 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3576 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3577 ac_uB='\([      ]\)%\1#\2define\3'
3578 ac_uC=' '
3579 ac_uD='\4%g'
3580 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3581 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3582 ac_eB='$%\1#\2define\3'
3583 ac_eC=' '
3584 ac_eD='%g'
3585
3586 if test "${CONFIG_HEADERS+set}" != set; then
3587 EOF
3588 cat >> $CONFIG_STATUS <<EOF
3589   CONFIG_HEADERS="config.h:configh.in"
3590 EOF
3591 cat >> $CONFIG_STATUS <<\EOF
3592 fi
3593 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3594   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3595   case "$ac_file" in
3596   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3597        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3598   *) ac_file_in="${ac_file}.in" ;;
3599   esac
3600
3601   echo creating $ac_file
3602
3603   rm -f conftest.frag conftest.in conftest.out
3604   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3605   cat $ac_file_inputs > conftest.in
3606
3607 EOF
3608
3609 # Transform confdefs.h into a sed script conftest.vals that substitutes
3610 # the proper values into config.h.in to produce config.h.  And first:
3611 # Protect against being on the right side of a sed subst in config.status.
3612 # Protect against being in an unquoted here document in config.status.
3613 rm -f conftest.vals
3614 cat > conftest.hdr <<\EOF
3615 s/[\\&%]/\\&/g
3616 s%[\\$`]%\\&%g
3617 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3618 s%ac_d%ac_u%gp
3619 s%ac_u%ac_e%gp
3620 EOF
3621 sed -n -f conftest.hdr confdefs.h > conftest.vals
3622 rm -f conftest.hdr
3623
3624 # This sed command replaces #undef with comments.  This is necessary, for
3625 # example, in the case of _POSIX_SOURCE, which is predefined and required
3626 # on some systems where configure will not decide to define it.
3627 cat >> conftest.vals <<\EOF
3628 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3629 EOF
3630
3631 # Break up conftest.vals because some shells have a limit on
3632 # the size of here documents, and old seds have small limits too.
3633
3634 rm -f conftest.tail
3635 while :
3636 do
3637   ac_lines=`grep -c . conftest.vals`
3638   # grep -c gives empty output for an empty file on some AIX systems.
3639   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3640   # Write a limited-size here document to conftest.frag.
3641   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3642   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3643   echo 'CEOF
3644   sed -f conftest.frag conftest.in > conftest.out
3645   rm -f conftest.in
3646   mv conftest.out conftest.in
3647 ' >> $CONFIG_STATUS
3648   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3649   rm -f conftest.vals
3650   mv conftest.tail conftest.vals
3651 done
3652 rm -f conftest.vals
3653
3654 cat >> $CONFIG_STATUS <<\EOF
3655   rm -f conftest.frag conftest.h
3656   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3657   cat conftest.in >> conftest.h
3658   rm -f conftest.in
3659   if cmp -s $ac_file conftest.h 2>/dev/null; then
3660     echo "$ac_file is unchanged"
3661     rm -f conftest.h
3662   else
3663     # Remove last slash and all that follows it.  Not all systems have dirname.
3664       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3665       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3666       # The file is in a subdirectory.
3667       test ! -d "$ac_dir" && mkdir "$ac_dir"
3668     fi
3669     rm -f $ac_file
3670     mv conftest.h $ac_file
3671   fi
3672 fi; done
3673
3674 EOF
3675 cat >> $CONFIG_STATUS <<EOF
3676
3677 EOF
3678 cat >> $CONFIG_STATUS <<\EOF
3679 date > stamp-h
3680 exit 0
3681 EOF
3682 chmod +x $CONFIG_STATUS
3683 rm -fr confdefs* $ac_clean_files
3684 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3685