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