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