]> git.sur5r.net Git - openldap/blob - configure
fd5b50eb5c4dd04f5170564e1bbc334ab521ddf0
[openldap] / 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_default_prefix=/usr/local
15 ac_help="$ac_help
16   --enable-debug        enable debugging (yes)"
17 ac_help="$ac_help
18   --enable-libui        enable library user interface (yes)"
19 ac_help="$ac_help
20   --enable-cache        enable caching (yes)"
21 ac_help="$ac_help
22   --enable-dns  enable dns support (no)"
23 ac_help="$ac_help
24   --enable-referrals    enable referrals (yes)"
25 ac_help="$ac_help
26   --enable-clapd        enable connectionless ldap (no)"
27 ac_help="$ac_help
28   --with-kerberos       use Kerberos (auto)"
29 ac_help="$ac_help
30   --with-threads        use threads (auto)"
31 ac_help="$ac_help
32   --with-preemptive     thread implementation is preemptive (auto)"
33 ac_help="$ac_help
34   --enable-ldapd        enable building ldapd (no)"
35 ac_help="$ac_help
36   --enable-slapd        enable building slapd (yes)"
37 ac_help="$ac_help
38     --enable-aclgroup   enable ACL group support (auto)"
39 ac_help="$ac_help
40     --enable-crypt      enable crypt(3) passwords (auto)"
41 ac_help="$ac_help
42     --enable-md5        enable MD5 passwords (auto)"
43 ac_help="$ac_help
44     --enable-sha1       enable SHA1 passwords (auto)"
45 ac_help="$ac_help
46     --enable-wrappers   enable tcp wrapper support (no)"
47 ac_help="$ac_help
48     --enable-phonetic   enable phonetic/soundex (no)"
49 ac_help="$ac_help
50     --enable-rlookups   enable reverse lookups (auto)"
51 ac_help="$ac_help
52     --enable-ldbm       enable ldbm backend (yes)"
53 ac_help="$ac_help
54       --with-ldbm-api   use LDBM API (auto)"
55 ac_help="$ac_help
56       --with-ldbm-type  use LDBM type (auto)"
57 ac_help="$ac_help
58     --enable-passwd     enable passwd backend (no)"
59 ac_help="$ac_help
60     --enable-shell      enable shell backend (no)"
61 ac_help="$ac_help
62   --enable-slurpd       enable building slurpd (auto)"
63
64 # Initialize some variables set by options.
65 # The variables have the same names as the options, with
66 # dashes changed to underlines.
67 build=NONE
68 cache_file=./config.cache
69 exec_prefix=NONE
70 host=NONE
71 no_create=
72 nonopt=NONE
73 no_recursion=
74 prefix=NONE
75 program_prefix=NONE
76 program_suffix=NONE
77 program_transform_name=s,x,x,
78 silent=
79 site=
80 srcdir=
81 target=NONE
82 verbose=
83 x_includes=NONE
84 x_libraries=NONE
85 bindir='${exec_prefix}/bin'
86 sbindir='${exec_prefix}/sbin'
87 libexecdir='${exec_prefix}/libexec'
88 datadir='${prefix}/share'
89 sysconfdir='${prefix}/etc'
90 sharedstatedir='${prefix}/com'
91 localstatedir='${prefix}/var'
92 libdir='${exec_prefix}/lib'
93 includedir='${prefix}/include'
94 oldincludedir='/usr/include'
95 infodir='${prefix}/info'
96 mandir='${prefix}/man'
97
98 # Initialize some other variables.
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 # Maximum number of lines to put in a shell here document.
102 ac_max_here_lines=12
103
104 ac_prev=
105 for ac_option
106 do
107
108   # If the previous option needs an argument, assign it.
109   if test -n "$ac_prev"; then
110     eval "$ac_prev=\$ac_option"
111     ac_prev=
112     continue
113   fi
114
115   case "$ac_option" in
116   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
117   *) ac_optarg= ;;
118   esac
119
120   # Accept the important Cygnus configure options, so we can diagnose typos.
121
122   case "$ac_option" in
123
124   -bindir | --bindir | --bindi | --bind | --bin | --bi)
125     ac_prev=bindir ;;
126   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
127     bindir="$ac_optarg" ;;
128
129   -build | --build | --buil | --bui | --bu)
130     ac_prev=build ;;
131   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
132     build="$ac_optarg" ;;
133
134   -cache-file | --cache-file | --cache-fil | --cache-fi \
135   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
136     ac_prev=cache_file ;;
137   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
138   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
139     cache_file="$ac_optarg" ;;
140
141   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
142     ac_prev=datadir ;;
143   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
144   | --da=*)
145     datadir="$ac_optarg" ;;
146
147   -disable-* | --disable-*)
148     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
149     # Reject names that are not valid shell variable names.
150     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
151       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
152     fi
153     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
154     eval "enable_${ac_feature}=no" ;;
155
156   -enable-* | --enable-*)
157     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
158     # Reject names that are not valid shell variable names.
159     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
160       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
161     fi
162     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
163     case "$ac_option" in
164       *=*) ;;
165       *) ac_optarg=yes ;;
166     esac
167     eval "enable_${ac_feature}='$ac_optarg'" ;;
168
169   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
170   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
171   | --exec | --exe | --ex)
172     ac_prev=exec_prefix ;;
173   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
174   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
175   | --exec=* | --exe=* | --ex=*)
176     exec_prefix="$ac_optarg" ;;
177
178   -gas | --gas | --ga | --g)
179     # Obsolete; use --with-gas.
180     with_gas=yes ;;
181
182   -help | --help | --hel | --he)
183     # Omit some internal or obsolete options to make the list less imposing.
184     # This message is too long to be a string in the A/UX 3.1 sh.
185     cat << EOF
186 Usage: configure [options] [host]
187 Options: [defaults in brackets after descriptions]
188 Configuration:
189   --cache-file=FILE       cache test results in FILE
190   --help                  print this message
191   --no-create             do not create output files
192   --quiet, --silent       do not print \`checking...' messages
193   --version               print the version of autoconf that created configure
194 Directory and file names:
195   --prefix=PREFIX         install architecture-independent files in PREFIX
196                           [$ac_default_prefix]
197   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
198                           [same as prefix]
199   --bindir=DIR            user executables in DIR [EPREFIX/bin]
200   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
201   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
202   --datadir=DIR           read-only architecture-independent data in DIR
203                           [PREFIX/share]
204   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
205   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
206                           [PREFIX/com]
207   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
208   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
209   --includedir=DIR        C header files in DIR [PREFIX/include]
210   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
211   --infodir=DIR           info documentation in DIR [PREFIX/info]
212   --mandir=DIR            man documentation in DIR [PREFIX/man]
213   --srcdir=DIR            find the sources in DIR [configure dir or ..]
214   --program-prefix=PREFIX prepend PREFIX to installed program names
215   --program-suffix=SUFFIX append SUFFIX to installed program names
216   --program-transform-name=PROGRAM
217                           run sed PROGRAM on installed program names
218 EOF
219     cat << EOF
220 Host type:
221   --build=BUILD           configure for building on BUILD [BUILD=HOST]
222   --host=HOST             configure for HOST [guessed]
223   --target=TARGET         configure for TARGET [TARGET=HOST]
224 Features and packages:
225   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
226   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
227   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
228   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
229   --x-includes=DIR        X include files are in DIR
230   --x-libraries=DIR       X library files are in DIR
231 EOF
232     if test -n "$ac_help"; then
233       echo "--enable and --with options recognized:$ac_help"
234     fi
235     exit 0 ;;
236
237   -host | --host | --hos | --ho)
238     ac_prev=host ;;
239   -host=* | --host=* | --hos=* | --ho=*)
240     host="$ac_optarg" ;;
241
242   -includedir | --includedir | --includedi | --included | --include \
243   | --includ | --inclu | --incl | --inc)
244     ac_prev=includedir ;;
245   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
246   | --includ=* | --inclu=* | --incl=* | --inc=*)
247     includedir="$ac_optarg" ;;
248
249   -infodir | --infodir | --infodi | --infod | --info | --inf)
250     ac_prev=infodir ;;
251   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
252     infodir="$ac_optarg" ;;
253
254   -libdir | --libdir | --libdi | --libd)
255     ac_prev=libdir ;;
256   -libdir=* | --libdir=* | --libdi=* | --libd=*)
257     libdir="$ac_optarg" ;;
258
259   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
260   | --libexe | --libex | --libe)
261     ac_prev=libexecdir ;;
262   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
263   | --libexe=* | --libex=* | --libe=*)
264     libexecdir="$ac_optarg" ;;
265
266   -localstatedir | --localstatedir | --localstatedi | --localstated \
267   | --localstate | --localstat | --localsta | --localst \
268   | --locals | --local | --loca | --loc | --lo)
269     ac_prev=localstatedir ;;
270   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
271   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
272   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
273     localstatedir="$ac_optarg" ;;
274
275   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
276     ac_prev=mandir ;;
277   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
278     mandir="$ac_optarg" ;;
279
280   -nfp | --nfp | --nf)
281     # Obsolete; use --without-fp.
282     with_fp=no ;;
283
284   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
285   | --no-cr | --no-c)
286     no_create=yes ;;
287
288   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
289   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
290     no_recursion=yes ;;
291
292   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
293   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
294   | --oldin | --oldi | --old | --ol | --o)
295     ac_prev=oldincludedir ;;
296   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
297   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
298   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
299     oldincludedir="$ac_optarg" ;;
300
301   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
302     ac_prev=prefix ;;
303   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
304     prefix="$ac_optarg" ;;
305
306   -program-prefix | --program-prefix | --program-prefi | --program-pref \
307   | --program-pre | --program-pr | --program-p)
308     ac_prev=program_prefix ;;
309   -program-prefix=* | --program-prefix=* | --program-prefi=* \
310   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
311     program_prefix="$ac_optarg" ;;
312
313   -program-suffix | --program-suffix | --program-suffi | --program-suff \
314   | --program-suf | --program-su | --program-s)
315     ac_prev=program_suffix ;;
316   -program-suffix=* | --program-suffix=* | --program-suffi=* \
317   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
318     program_suffix="$ac_optarg" ;;
319
320   -program-transform-name | --program-transform-name \
321   | --program-transform-nam | --program-transform-na \
322   | --program-transform-n | --program-transform- \
323   | --program-transform | --program-transfor \
324   | --program-transfo | --program-transf \
325   | --program-trans | --program-tran \
326   | --progr-tra | --program-tr | --program-t)
327     ac_prev=program_transform_name ;;
328   -program-transform-name=* | --program-transform-name=* \
329   | --program-transform-nam=* | --program-transform-na=* \
330   | --program-transform-n=* | --program-transform-=* \
331   | --program-transform=* | --program-transfor=* \
332   | --program-transfo=* | --program-transf=* \
333   | --program-trans=* | --program-tran=* \
334   | --progr-tra=* | --program-tr=* | --program-t=*)
335     program_transform_name="$ac_optarg" ;;
336
337   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
338   | -silent | --silent | --silen | --sile | --sil)
339     silent=yes ;;
340
341   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
342     ac_prev=sbindir ;;
343   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
344   | --sbi=* | --sb=*)
345     sbindir="$ac_optarg" ;;
346
347   -sharedstatedir | --sharedstatedir | --sharedstatedi \
348   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
349   | --sharedst | --shareds | --shared | --share | --shar \
350   | --sha | --sh)
351     ac_prev=sharedstatedir ;;
352   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
353   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
354   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
355   | --sha=* | --sh=*)
356     sharedstatedir="$ac_optarg" ;;
357
358   -site | --site | --sit)
359     ac_prev=site ;;
360   -site=* | --site=* | --sit=*)
361     site="$ac_optarg" ;;
362
363   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
364     ac_prev=srcdir ;;
365   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
366     srcdir="$ac_optarg" ;;
367
368   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
369   | --syscon | --sysco | --sysc | --sys | --sy)
370     ac_prev=sysconfdir ;;
371   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
372   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
373     sysconfdir="$ac_optarg" ;;
374
375   -target | --target | --targe | --targ | --tar | --ta | --t)
376     ac_prev=target ;;
377   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
378     target="$ac_optarg" ;;
379
380   -v | -verbose | --verbose | --verbos | --verbo | --verb)
381     verbose=yes ;;
382
383   -version | --version | --versio | --versi | --vers)
384     echo "configure generated by autoconf version 2.12"
385     exit 0 ;;
386
387   -with-* | --with-*)
388     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
389     # Reject names that are not valid shell variable names.
390     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
391       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
392     fi
393     ac_package=`echo $ac_package| sed 's/-/_/g'`
394     case "$ac_option" in
395       *=*) ;;
396       *) ac_optarg=yes ;;
397     esac
398     eval "with_${ac_package}='$ac_optarg'" ;;
399
400   -without-* | --without-*)
401     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
402     # Reject names that are not valid shell variable names.
403     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
404       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
405     fi
406     ac_package=`echo $ac_package| sed 's/-/_/g'`
407     eval "with_${ac_package}=no" ;;
408
409   --x)
410     # Obsolete; use --with-x.
411     with_x=yes ;;
412
413   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
414   | --x-incl | --x-inc | --x-in | --x-i)
415     ac_prev=x_includes ;;
416   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
417   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
418     x_includes="$ac_optarg" ;;
419
420   -x-libraries | --x-libraries | --x-librarie | --x-librari \
421   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
422     ac_prev=x_libraries ;;
423   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
424   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
425     x_libraries="$ac_optarg" ;;
426
427   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
428     ;;
429
430   *)
431     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
432       echo "configure: warning: $ac_option: invalid host type" 1>&2
433     fi
434     if test "x$nonopt" != xNONE; then
435       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
436     fi
437     nonopt="$ac_option"
438     ;;
439
440   esac
441 done
442
443 if test -n "$ac_prev"; then
444   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
445 fi
446
447 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
448
449 # File descriptor usage:
450 # 0 standard input
451 # 1 file creation
452 # 2 errors and warnings
453 # 3 some systems may open it to /dev/tty
454 # 4 used on the Kubota Titan
455 # 6 checking for... messages and results
456 # 5 compiler messages saved in config.log
457 if test "$silent" = yes; then
458   exec 6>/dev/null
459 else
460   exec 6>&1
461 fi
462 exec 5>./config.log
463
464 echo "\
465 This file contains any messages produced by compilers while
466 running configure, to aid debugging if configure makes a mistake.
467 " 1>&5
468
469 # Strip out --no-create and --no-recursion so they do not pile up.
470 # Also quote any args containing shell metacharacters.
471 ac_configure_args=
472 for ac_arg
473 do
474   case "$ac_arg" in
475   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
476   | --no-cr | --no-c) ;;
477   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
478   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
479   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
480   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
481   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
482   esac
483 done
484
485 # NLS nuisances.
486 # Only set these to C if already set.  These must not be set unconditionally
487 # because not all systems understand e.g. LANG=C (notably SCO).
488 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
489 # Non-C LC_CTYPE values break the ctype check.
490 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
491 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
492 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
493 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
494
495 # confdefs.h avoids OS command line length limits that DEFS can exceed.
496 rm -rf conftest* confdefs.h
497 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
498 echo > confdefs.h
499
500 # A filename unique to this package, relative to the directory that
501 # configure is in, which we can look for to find out if srcdir is correct.
502 ac_unique_file=include/ldap.h
503
504 # Find the source files, if location was not specified.
505 if test -z "$srcdir"; then
506   ac_srcdir_defaulted=yes
507   # Try the directory containing this script, then its parent.
508   ac_prog=$0
509   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
510   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
511   srcdir=$ac_confdir
512   if test ! -r $srcdir/$ac_unique_file; then
513     srcdir=..
514   fi
515 else
516   ac_srcdir_defaulted=no
517 fi
518 if test ! -r $srcdir/$ac_unique_file; then
519   if test "$ac_srcdir_defaulted" = yes; then
520     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
521   else
522     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
523   fi
524 fi
525 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
526
527 # Prefer explicitly selected file to automatically selected ones.
528 if test -z "$CONFIG_SITE"; then
529   if test "x$prefix" != xNONE; then
530     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
531   else
532     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
533   fi
534 fi
535 for ac_site_file in $CONFIG_SITE; do
536   if test -r "$ac_site_file"; then
537     echo "loading site script $ac_site_file"
538     . "$ac_site_file"
539   fi
540 done
541
542 if test -r "$cache_file"; then
543   echo "loading cache $cache_file"
544   . $cache_file
545 else
546   echo "creating cache $cache_file"
547   > $cache_file
548 fi
549
550 ac_ext=c
551 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
552 ac_cpp='$CPP $CPPFLAGS'
553 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
554 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
555 cross_compiling=$ac_cv_prog_cc_cross
556
557 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
558   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
559   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
560     ac_n= ac_c='
561 ' ac_t='        '
562   else
563     ac_n=-n ac_c= ac_t=
564   fi
565 else
566   ac_n= ac_c='\c' ac_t=
567 fi
568
569
570 ac_aux_dir=
571 for ac_dir in build $srcdir/build; do
572   if test -f $ac_dir/install-sh; then
573     ac_aux_dir=$ac_dir
574     ac_install_sh="$ac_aux_dir/install-sh -c"
575     break
576   elif test -f $ac_dir/install.sh; then
577     ac_aux_dir=$ac_dir
578     ac_install_sh="$ac_aux_dir/install.sh -c"
579     break
580   fi
581 done
582 if test -z "$ac_aux_dir"; then
583   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
584 fi
585 ac_config_guess=$ac_aux_dir/config.guess
586 ac_config_sub=$ac_aux_dir/config.sub
587 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
588
589 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
590 echo "configure:591: checking configure arguments" >&5
591
592
593 # OpenLDAP --enable-debug
594         # Check whether --enable-debug or --disable-debug was given.
595 if test "${enable_debug+set}" = set; then
596   enableval="$enable_debug"
597   
598         ol_arg=invalid
599         for ol_val in auto yes no ; do
600                 if test "$enableval" = "$ol_val" ; then
601                         ol_arg="$ol_val"
602                 fi
603         done
604         if test "$ol_arg" = "invalid" ; then
605                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
606         fi
607         ol_enable_debug="$ol_arg"
608
609 else
610         ol_enable_debug="yes"
611 fi
612 # end --enable-debug
613 # OpenLDAP --enable-libui
614         # Check whether --enable-libui or --disable-libui was given.
615 if test "${enable_libui+set}" = set; then
616   enableval="$enable_libui"
617   
618         ol_arg=invalid
619         for ol_val in auto yes no ; do
620                 if test "$enableval" = "$ol_val" ; then
621                         ol_arg="$ol_val"
622                 fi
623         done
624         if test "$ol_arg" = "invalid" ; then
625                 { echo "configure: error: bad value $enableval for --enable-libui" 1>&2; exit 1; }
626         fi
627         ol_enable_libui="$ol_arg"
628
629 else
630         ol_enable_libui="yes"
631 fi
632 # end --enable-libui
633 # OpenLDAP --enable-cache
634         # Check whether --enable-cache or --disable-cache was given.
635 if test "${enable_cache+set}" = set; then
636   enableval="$enable_cache"
637   
638         ol_arg=invalid
639         for ol_val in auto yes no ; do
640                 if test "$enableval" = "$ol_val" ; then
641                         ol_arg="$ol_val"
642                 fi
643         done
644         if test "$ol_arg" = "invalid" ; then
645                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
646         fi
647         ol_enable_cache="$ol_arg"
648
649 else
650         ol_enable_cache="yes"
651 fi
652 # end --enable-cache
653 # OpenLDAP --enable-dns
654         # Check whether --enable-dns or --disable-dns was given.
655 if test "${enable_dns+set}" = set; then
656   enableval="$enable_dns"
657   
658         ol_arg=invalid
659         for ol_val in auto yes no ; do
660                 if test "$enableval" = "$ol_val" ; then
661                         ol_arg="$ol_val"
662                 fi
663         done
664         if test "$ol_arg" = "invalid" ; then
665                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
666         fi
667         ol_enable_dns="$ol_arg"
668
669 else
670         ol_enable_dns="no"
671 fi
672 # end --enable-dns
673 # OpenLDAP --enable-referrals
674         # Check whether --enable-referrals or --disable-referrals was given.
675 if test "${enable_referrals+set}" = set; then
676   enableval="$enable_referrals"
677   
678         ol_arg=invalid
679         for ol_val in auto yes no ; do
680                 if test "$enableval" = "$ol_val" ; then
681                         ol_arg="$ol_val"
682                 fi
683         done
684         if test "$ol_arg" = "invalid" ; then
685                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
686         fi
687         ol_enable_referrals="$ol_arg"
688
689 else
690         ol_enable_referrals="yes"
691 fi
692 # end --enable-referrals
693 # OpenLDAP --enable-cldap
694         # Check whether --enable-cldap or --disable-cldap was given.
695 if test "${enable_cldap+set}" = set; then
696   enableval="$enable_cldap"
697   
698         ol_arg=invalid
699         for ol_val in auto yes no ; do
700                 if test "$enableval" = "$ol_val" ; then
701                         ol_arg="$ol_val"
702                 fi
703         done
704         if test "$ol_arg" = "invalid" ; then
705                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
706         fi
707         ol_enable_cldap="$ol_arg"
708
709 else
710         ol_enable_cldap="no"
711 fi
712 # end --enable-cldap
713
714 # OpenLDAP --with-kerberos
715         # Check whether --with-kerberos or --without-kerberos was given.
716 if test "${with_kerberos+set}" = set; then
717   withval="$with_kerberos"
718   
719         ol_arg=invalid
720         for ol_val in auto k5 k4 afs yes no ; do
721                 if test "$withval" = "$ol_val" ; then
722                         ol_arg="$ol_val"
723                 fi
724         done
725         if test "$ol_arg" = "invalid" ; then
726                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
727         fi
728         ol_with_kerberos="$ol_arg"
729
730 else
731         ol_with_kerberos="auto"
732 fi
733 # end --with-kerberos
734
735 # OpenLDAP --with-threads
736         # Check whether --with-threads or --without-threads was given.
737 if test "${with_threads+set}" = set; then
738   withval="$with_threads"
739   
740         ol_arg=invalid
741         for ol_val in auto posix mach lwp yes no manual  ; do
742                 if test "$withval" = "$ol_val" ; then
743                         ol_arg="$ol_val"
744                 fi
745         done
746         if test "$ol_arg" = "invalid" ; then
747                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
748         fi
749         ol_with_threads="$ol_arg"
750
751 else
752         ol_with_threads="auto"
753 fi
754 # end --with-threads
755
756 # OpenLDAP --with-preemptive
757         # Check whether --with-preemptive or --without-preemptive was given.
758 if test "${with_preemptive+set}" = set; then
759   withval="$with_preemptive"
760   
761         ol_arg=invalid
762         for ol_val in auto yes no manual  ; do
763                 if test "$withval" = "$ol_val" ; then
764                         ol_arg="$ol_val"
765                 fi
766         done
767         if test "$ol_arg" = "invalid" ; then
768                 { echo "configure: error: bad value $withval for --with-preemptive" 1>&2; exit 1; }
769         fi
770         ol_with_preemptive="$ol_arg"
771
772 else
773         ol_with_preemptive="auto"
774 fi
775 # end --with-preemptive
776
777
778
779 # OpenLDAP --enable-ldapd
780         # Check whether --enable-ldapd or --disable-ldapd was given.
781 if test "${enable_ldapd+set}" = set; then
782   enableval="$enable_ldapd"
783   
784         ol_arg=invalid
785         for ol_val in auto yes no ; do
786                 if test "$enableval" = "$ol_val" ; then
787                         ol_arg="$ol_val"
788                 fi
789         done
790         if test "$ol_arg" = "invalid" ; then
791                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
792         fi
793         ol_enable_ldapd="$ol_arg"
794
795 else
796         ol_enable_ldapd="no"
797 fi
798 # end --enable-ldapd
799
800 # OpenLDAP --enable-slapd
801         # Check whether --enable-slapd or --disable-slapd was given.
802 if test "${enable_slapd+set}" = set; then
803   enableval="$enable_slapd"
804   
805         ol_arg=invalid
806         for ol_val in auto yes no ; do
807                 if test "$enableval" = "$ol_val" ; then
808                         ol_arg="$ol_val"
809                 fi
810         done
811         if test "$ol_arg" = "invalid" ; then
812                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
813         fi
814         ol_enable_slapd="$ol_arg"
815
816 else
817         ol_enable_slapd="yes"
818 fi
819 # end --enable-slapd
820 # OpenLDAP --enable-aclgroup
821         # Check whether --enable-aclgroup or --disable-aclgroup was given.
822 if test "${enable_aclgroup+set}" = set; then
823   enableval="$enable_aclgroup"
824   
825         ol_arg=invalid
826         for ol_val in auto yes no ; do
827                 if test "$enableval" = "$ol_val" ; then
828                         ol_arg="$ol_val"
829                 fi
830         done
831         if test "$ol_arg" = "invalid" ; then
832                 { echo "configure: error: bad value $enableval for --enable-aclgroup" 1>&2; exit 1; }
833         fi
834         ol_enable_aclgroup="$ol_arg"
835
836 else
837         ol_enable_aclgroup="auto"
838 fi
839 # end --enable-aclgroup
840 # OpenLDAP --enable-crypt
841         # Check whether --enable-crypt or --disable-crypt was given.
842 if test "${enable_crypt+set}" = set; then
843   enableval="$enable_crypt"
844   
845         ol_arg=invalid
846         for ol_val in auto yes no ; do
847                 if test "$enableval" = "$ol_val" ; then
848                         ol_arg="$ol_val"
849                 fi
850         done
851         if test "$ol_arg" = "invalid" ; then
852                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
853         fi
854         ol_enable_crypt="$ol_arg"
855
856 else
857         ol_enable_crypt="auto"
858 fi
859 # end --enable-crypt
860 # OpenLDAP --enable-md5
861         # Check whether --enable-md5 or --disable-md5 was given.
862 if test "${enable_md5+set}" = set; then
863   enableval="$enable_md5"
864   
865         ol_arg=invalid
866         for ol_val in auto yes no ; do
867                 if test "$enableval" = "$ol_val" ; then
868                         ol_arg="$ol_val"
869                 fi
870         done
871         if test "$ol_arg" = "invalid" ; then
872                 { echo "configure: error: bad value $enableval for --enable-md5" 1>&2; exit 1; }
873         fi
874         ol_enable_md5="$ol_arg"
875
876 else
877         ol_enable_md5="auto"
878 fi
879 # end --enable-md5
880 # OpenLDAP --enable-sha1
881         # Check whether --enable-sha1 or --disable-sha1 was given.
882 if test "${enable_sha1+set}" = set; then
883   enableval="$enable_sha1"
884   
885         ol_arg=invalid
886         for ol_val in auto yes no ; do
887                 if test "$enableval" = "$ol_val" ; then
888                         ol_arg="$ol_val"
889                 fi
890         done
891         if test "$ol_arg" = "invalid" ; then
892                 { echo "configure: error: bad value $enableval for --enable-sha1" 1>&2; exit 1; }
893         fi
894         ol_enable_sha1="$ol_arg"
895
896 else
897         ol_enable_sha1="auto"
898 fi
899 # end --enable-sha1
900 # OpenLDAP --enable-wrappers
901         # Check whether --enable-wrappers or --disable-wrappers was given.
902 if test "${enable_wrappers+set}" = set; then
903   enableval="$enable_wrappers"
904   
905         ol_arg=invalid
906         for ol_val in auto yes no ; do
907                 if test "$enableval" = "$ol_val" ; then
908                         ol_arg="$ol_val"
909                 fi
910         done
911         if test "$ol_arg" = "invalid" ; then
912                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
913         fi
914         ol_enable_wrappers="$ol_arg"
915
916 else
917         ol_enable_wrappers="no"
918 fi
919 # end --enable-wrappers
920 # OpenLDAP --enable-phonetic
921         # Check whether --enable-phonetic or --disable-phonetic was given.
922 if test "${enable_phonetic+set}" = set; then
923   enableval="$enable_phonetic"
924   
925         ol_arg=invalid
926         for ol_val in auto yes no ; do
927                 if test "$enableval" = "$ol_val" ; then
928                         ol_arg="$ol_val"
929                 fi
930         done
931         if test "$ol_arg" = "invalid" ; then
932                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
933         fi
934         ol_enable_phonetic="$ol_arg"
935
936 else
937         ol_enable_phonetic="no"
938 fi
939 # end --enable-phonetic
940 # OpenLDAP --enable-rlookups
941         # Check whether --enable-rlookups or --disable-rlookups was given.
942 if test "${enable_rlookups+set}" = set; then
943   enableval="$enable_rlookups"
944   
945         ol_arg=invalid
946         for ol_val in auto yes no ; do
947                 if test "$enableval" = "$ol_val" ; then
948                         ol_arg="$ol_val"
949                 fi
950         done
951         if test "$ol_arg" = "invalid" ; then
952                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
953         fi
954         ol_enable_rlookups="$ol_arg"
955
956 else
957         ol_enable_rlookups="auto"
958 fi
959 # end --enable-rlookups
960
961 # OpenLDAP --enable-ldbm
962         # Check whether --enable-ldbm or --disable-ldbm was given.
963 if test "${enable_ldbm+set}" = set; then
964   enableval="$enable_ldbm"
965   
966         ol_arg=invalid
967         for ol_val in auto yes no ; do
968                 if test "$enableval" = "$ol_val" ; then
969                         ol_arg="$ol_val"
970                 fi
971         done
972         if test "$ol_arg" = "invalid" ; then
973                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
974         fi
975         ol_enable_ldbm="$ol_arg"
976
977 else
978         ol_enable_ldbm="yes"
979 fi
980 # end --enable-ldbm
981 # OpenLDAP --with-ldbm_api
982         # Check whether --with-ldbm_api or --without-ldbm_api was given.
983 if test "${with_ldbm_api+set}" = set; then
984   withval="$with_ldbm_api"
985   
986         ol_arg=invalid
987         for ol_val in auto db2 db gdbm ndbm manual ; do
988                 if test "$withval" = "$ol_val" ; then
989                         ol_arg="$ol_val"
990                 fi
991         done
992         if test "$ol_arg" = "invalid" ; then
993                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
994         fi
995         ol_with_ldbm_api="$ol_arg"
996
997 else
998         ol_with_ldbm_api="auto"
999 fi
1000 # end --with-ldbm_api
1001
1002 # OpenLDAP --with-ldbm_type
1003         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1004 if test "${with_ldbm_type+set}" = set; then
1005   withval="$with_ldbm_type"
1006   
1007         ol_arg=invalid
1008         for ol_val in auto btree hash ; do
1009                 if test "$withval" = "$ol_val" ; then
1010                         ol_arg="$ol_val"
1011                 fi
1012         done
1013         if test "$ol_arg" = "invalid" ; then
1014                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1015         fi
1016         ol_with_ldbm_type="$ol_arg"
1017
1018 else
1019         ol_with_ldbm_type="auto"
1020 fi
1021 # end --with-ldbm_type
1022
1023
1024 # OpenLDAP --enable-passwd
1025         # Check whether --enable-passwd or --disable-passwd was given.
1026 if test "${enable_passwd+set}" = set; then
1027   enableval="$enable_passwd"
1028   
1029         ol_arg=invalid
1030         for ol_val in auto yes no ; do
1031                 if test "$enableval" = "$ol_val" ; then
1032                         ol_arg="$ol_val"
1033                 fi
1034         done
1035         if test "$ol_arg" = "invalid" ; then
1036                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1037         fi
1038         ol_enable_passwd="$ol_arg"
1039
1040 else
1041         ol_enable_passwd="no"
1042 fi
1043 # end --enable-passwd
1044 # OpenLDAP --enable-shell
1045         # Check whether --enable-shell or --disable-shell was given.
1046 if test "${enable_shell+set}" = set; then
1047   enableval="$enable_shell"
1048   
1049         ol_arg=invalid
1050         for ol_val in auto yes no ; do
1051                 if test "$enableval" = "$ol_val" ; then
1052                         ol_arg="$ol_val"
1053                 fi
1054         done
1055         if test "$ol_arg" = "invalid" ; then
1056                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1057         fi
1058         ol_enable_shell="$ol_arg"
1059
1060 else
1061         ol_enable_shell="no"
1062 fi
1063 # end --enable-shell
1064
1065 # OpenLDAP --enable-slurpd
1066         # Check whether --enable-slurpd or --disable-slurpd was given.
1067 if test "${enable_slurpd+set}" = set; then
1068   enableval="$enable_slurpd"
1069   
1070         ol_arg=invalid
1071         for ol_val in auto yes no ; do
1072                 if test "$enableval" = "$ol_val" ; then
1073                         ol_arg="$ol_val"
1074                 fi
1075         done
1076         if test "$ol_arg" = "invalid" ; then
1077                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1078         fi
1079         ol_enable_slurpd="$ol_arg"
1080
1081 else
1082         ol_enable_slurpd="auto"
1083 fi
1084 # end --enable-slurpd
1085
1086 if test $ol_enable_slapd = no ; then
1087                 if test $ol_enable_ldbm = yes ; then
1088                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2;
1089         fi
1090         if test $ol_enable_passwd = yes ; then
1091                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2;
1092         fi
1093         if test $ol_enable_shell = yes ; then
1094                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2;
1095         fi
1096         if test $ol_enable_aclgroup = yes ; then
1097                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroup argument" 1>&2;
1098         fi
1099         if test $ol_enable_crypt = yes ; then
1100                 echo "configure: warning: slapd disabled, ignoring --enable_crypt argument" 1>&2;
1101         fi
1102         if test $ol_enable_md5 = yes ; then
1103                 echo "configure: warning: slapd disabled, ignoring --enable_md5 argument" 1>&2;
1104         fi
1105         if test $ol_enable_sha1 = yes ; then
1106                 echo "configure: warning: slapd disabled, ignoring --enable_sha1 argument" 1>&2;
1107         fi
1108         if test $ol_enable_wrappers = yes ; then
1109                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2;
1110         fi
1111         if test $ol_enable_phonetic = yes ; then
1112                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2;
1113         fi
1114         if test $ol_enable_rlookups = yes ; then
1115                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2;
1116         fi
1117         if test $ol_with_ldbm_api != auto ; then
1118                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2;
1119         fi
1120         if test $ol_with_ldbm_type != auto ; then
1121                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2;
1122         fi
1123         if test $ol_enable_slurpd = yes ; then
1124                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; };
1125         fi
1126
1127         # force settings to no
1128         ol_enable_ldbm=no
1129         ol_enable_shell=no
1130         ol_enable_passwd=no
1131         ol_enable_aclgroup=no
1132         ol_enable_crypt=no
1133         ol_enable_md5=no
1134         ol_enable_sha1=no
1135         ol_enable_wrappers=no
1136         ol_enable_phonetic=no
1137         ol_enable_rlookups=no
1138         ol_with_ldbm_api=no
1139         ol_with_ldbm_type=no
1140         ol_enable_slurpd=no
1141
1142 elif test $ol_enable_ldbm = no ; then
1143         
1144         if test $ol_with_ldbm_api != auto ; then
1145                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2;
1146         fi
1147
1148         if test $ol_with_ldbm_type != auto ; then
1149                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2;
1150         fi
1151
1152         if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
1153                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; };
1154         fi
1155
1156         ol_with_ldbm_api=no
1157         ol_with_ldbm_type=no
1158
1159 else
1160         
1161         if test $ol_with_ldbm_api = gdbm -a \
1162                 $ol_with_ldbm_type = btree ; then
1163                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; };
1164         fi
1165         if test $ol_with_ldbm_api = ndbm -a \
1166                 $ol_with_ldbm_type = btree ; then
1167                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; };
1168         fi
1169 fi
1170
1171 if test $ol_enable_slurpd = yes ; then
1172                 if test $ol_with_threads = no ; then
1173                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; };
1174         fi
1175 fi
1176
1177 echo "$ac_t""done" 1>&6
1178
1179 ## Initialize vars
1180 LDAP_DEFS=
1181 LDAP_LIBS=
1182 LDBM_DEFS=
1183 LDBM_LIBS=
1184 LTHREAD_DEFS=
1185 LTHREAD_LIBS=
1186 LUTIL_DEFS=
1187 LUTIL_LIBS=
1188
1189 LDAPD_DEFS=
1190 LDAPD_LIBS=
1191 SLAPD_DEFS=
1192 SLAPD_LIBS=
1193 SLURPD_DEFS=
1194 SLURPD_LIBS=
1195
1196 BUILD_LDAPD=no
1197 BUILD_SLAPD=no
1198 BUILD_SLURPD=no
1199
1200 BUILD_LDBM=no
1201 BUILD_PASSWD=no
1202 BUILD_SHELL=no
1203
1204 KRB_DEFS=
1205 KRB_LIBS=
1206 TERMCAP_DEFS=
1207 TERMCAP_LIBS=
1208
1209
1210 # Extract the first word of "gcc", so it can be a program name with args.
1211 set dummy gcc; ac_word=$2
1212 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1213 echo "configure:1214: checking for $ac_word" >&5
1214 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1215   echo $ac_n "(cached) $ac_c" 1>&6
1216 else
1217   if test -n "$CC"; then
1218   ac_cv_prog_CC="$CC" # Let the user override the test.
1219 else
1220   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1221   for ac_dir in $PATH; do
1222     test -z "$ac_dir" && ac_dir=.
1223     if test -f $ac_dir/$ac_word; then
1224       ac_cv_prog_CC="gcc"
1225       break
1226     fi
1227   done
1228   IFS="$ac_save_ifs"
1229 fi
1230 fi
1231 CC="$ac_cv_prog_CC"
1232 if test -n "$CC"; then
1233   echo "$ac_t""$CC" 1>&6
1234 else
1235   echo "$ac_t""no" 1>&6
1236 fi
1237
1238 if test -z "$CC"; then
1239   # Extract the first word of "cc", so it can be a program name with args.
1240 set dummy cc; ac_word=$2
1241 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1242 echo "configure:1243: checking for $ac_word" >&5
1243 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1244   echo $ac_n "(cached) $ac_c" 1>&6
1245 else
1246   if test -n "$CC"; then
1247   ac_cv_prog_CC="$CC" # Let the user override the test.
1248 else
1249   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1250   ac_prog_rejected=no
1251   for ac_dir in $PATH; do
1252     test -z "$ac_dir" && ac_dir=.
1253     if test -f $ac_dir/$ac_word; then
1254       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1255         ac_prog_rejected=yes
1256         continue
1257       fi
1258       ac_cv_prog_CC="cc"
1259       break
1260     fi
1261   done
1262   IFS="$ac_save_ifs"
1263 if test $ac_prog_rejected = yes; then
1264   # We found a bogon in the path, so make sure we never use it.
1265   set dummy $ac_cv_prog_CC
1266   shift
1267   if test $# -gt 0; then
1268     # We chose a different compiler from the bogus one.
1269     # However, it has the same basename, so the bogon will be chosen
1270     # first if we set CC to just the basename; use the full file name.
1271     shift
1272     set dummy "$ac_dir/$ac_word" "$@"
1273     shift
1274     ac_cv_prog_CC="$@"
1275   fi
1276 fi
1277 fi
1278 fi
1279 CC="$ac_cv_prog_CC"
1280 if test -n "$CC"; then
1281   echo "$ac_t""$CC" 1>&6
1282 else
1283   echo "$ac_t""no" 1>&6
1284 fi
1285
1286   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1287 fi
1288
1289 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1290 echo "configure:1291: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1291
1292 ac_ext=c
1293 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1294 ac_cpp='$CPP $CPPFLAGS'
1295 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1296 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1297 cross_compiling=$ac_cv_prog_cc_cross
1298
1299 cat > conftest.$ac_ext <<EOF
1300 #line 1301 "configure"
1301 #include "confdefs.h"
1302 main(){return(0);}
1303 EOF
1304 if { (eval echo configure:1305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1305   ac_cv_prog_cc_works=yes
1306   # If we can't run a trivial program, we are probably using a cross compiler.
1307   if (./conftest; exit) 2>/dev/null; then
1308     ac_cv_prog_cc_cross=no
1309   else
1310     ac_cv_prog_cc_cross=yes
1311   fi
1312 else
1313   echo "configure: failed program was:" >&5
1314   cat conftest.$ac_ext >&5
1315   ac_cv_prog_cc_works=no
1316 fi
1317 rm -fr conftest*
1318
1319 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1320 if test $ac_cv_prog_cc_works = no; then
1321   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1322 fi
1323 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1324 echo "configure:1325: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1325 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1326 cross_compiling=$ac_cv_prog_cc_cross
1327
1328 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1329 echo "configure:1330: checking whether we are using GNU C" >&5
1330 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1331   echo $ac_n "(cached) $ac_c" 1>&6
1332 else
1333   cat > conftest.c <<EOF
1334 #ifdef __GNUC__
1335   yes;
1336 #endif
1337 EOF
1338 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1339   ac_cv_prog_gcc=yes
1340 else
1341   ac_cv_prog_gcc=no
1342 fi
1343 fi
1344
1345 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1346
1347 if test $ac_cv_prog_gcc = yes; then
1348   GCC=yes
1349   ac_test_CFLAGS="${CFLAGS+set}"
1350   ac_save_CFLAGS="$CFLAGS"
1351   CFLAGS=
1352   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1353 echo "configure:1354: checking whether ${CC-cc} accepts -g" >&5
1354 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1355   echo $ac_n "(cached) $ac_c" 1>&6
1356 else
1357   echo 'void f(){}' > conftest.c
1358 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1359   ac_cv_prog_cc_g=yes
1360 else
1361   ac_cv_prog_cc_g=no
1362 fi
1363 rm -f conftest*
1364
1365 fi
1366
1367 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1368   if test "$ac_test_CFLAGS" = set; then
1369     CFLAGS="$ac_save_CFLAGS"
1370   elif test $ac_cv_prog_cc_g = yes; then
1371     CFLAGS="-g -O2"
1372   else
1373     CFLAGS="-O2"
1374   fi
1375 else
1376   GCC=
1377   test "${CFLAGS+set}" = set || CFLAGS="-g"
1378 fi
1379
1380 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1381 echo "configure:1382: checking how to run the C preprocessor" >&5
1382 # On Suns, sometimes $CPP names a directory.
1383 if test -n "$CPP" && test -d "$CPP"; then
1384   CPP=
1385 fi
1386 if test -z "$CPP"; then
1387 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1388   echo $ac_n "(cached) $ac_c" 1>&6
1389 else
1390     # This must be in double quotes, not single quotes, because CPP may get
1391   # substituted into the Makefile and "${CC-cc}" will confuse make.
1392   CPP="${CC-cc} -E"
1393   # On the NeXT, cc -E runs the code through the compiler's parser,
1394   # not just through cpp.
1395   cat > conftest.$ac_ext <<EOF
1396 #line 1397 "configure"
1397 #include "confdefs.h"
1398 #include <assert.h>
1399 Syntax Error
1400 EOF
1401 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1402 { (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1403 ac_err=`grep -v '^ *+' conftest.out`
1404 if test -z "$ac_err"; then
1405   :
1406 else
1407   echo "$ac_err" >&5
1408   echo "configure: failed program was:" >&5
1409   cat conftest.$ac_ext >&5
1410   rm -rf conftest*
1411   CPP="${CC-cc} -E -traditional-cpp"
1412   cat > conftest.$ac_ext <<EOF
1413 #line 1414 "configure"
1414 #include "confdefs.h"
1415 #include <assert.h>
1416 Syntax Error
1417 EOF
1418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1419 { (eval echo configure:1420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1420 ac_err=`grep -v '^ *+' conftest.out`
1421 if test -z "$ac_err"; then
1422   :
1423 else
1424   echo "$ac_err" >&5
1425   echo "configure: failed program was:" >&5
1426   cat conftest.$ac_ext >&5
1427   rm -rf conftest*
1428   CPP=/lib/cpp
1429 fi
1430 rm -f conftest*
1431 fi
1432 rm -f conftest*
1433   ac_cv_prog_CPP="$CPP"
1434 fi
1435   CPP="$ac_cv_prog_CPP"
1436 else
1437   ac_cv_prog_CPP="$CPP"
1438 fi
1439 echo "$ac_t""$CPP" 1>&6
1440
1441 if test $ac_cv_prog_gcc = yes; then
1442     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1443 echo "configure:1444: checking whether ${CC-cc} needs -traditional" >&5
1444 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1445   echo $ac_n "(cached) $ac_c" 1>&6
1446 else
1447     ac_pattern="Autoconf.*'x'"
1448   cat > conftest.$ac_ext <<EOF
1449 #line 1450 "configure"
1450 #include "confdefs.h"
1451 #include <sgtty.h>
1452 Autoconf TIOCGETP
1453 EOF
1454 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1455   egrep "$ac_pattern" >/dev/null 2>&1; then
1456   rm -rf conftest*
1457   ac_cv_prog_gcc_traditional=yes
1458 else
1459   rm -rf conftest*
1460   ac_cv_prog_gcc_traditional=no
1461 fi
1462 rm -f conftest*
1463
1464
1465   if test $ac_cv_prog_gcc_traditional = no; then
1466     cat > conftest.$ac_ext <<EOF
1467 #line 1468 "configure"
1468 #include "confdefs.h"
1469 #include <termio.h>
1470 Autoconf TCGETA
1471 EOF
1472 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1473   egrep "$ac_pattern" >/dev/null 2>&1; then
1474   rm -rf conftest*
1475   ac_cv_prog_gcc_traditional=yes
1476 fi
1477 rm -f conftest*
1478
1479   fi
1480 fi
1481
1482 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1483   if test $ac_cv_prog_gcc_traditional = yes; then
1484     CC="$CC -traditional"
1485   fi
1486 fi
1487
1488
1489 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1490 echo "configure:1491: checking whether ln -s works" >&5
1491 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1492   echo $ac_n "(cached) $ac_c" 1>&6
1493 else
1494   rm -f conftestdata
1495 if ln -s X conftestdata 2>/dev/null
1496 then
1497   rm -f conftestdata
1498   ac_cv_prog_LN_S="ln -s"
1499 else
1500   ac_cv_prog_LN_S=ln
1501 fi
1502 fi
1503 LN_S="$ac_cv_prog_LN_S"
1504 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1505   echo "$ac_t""yes" 1>&6
1506 else
1507   echo "$ac_t""no" 1>&6
1508 fi
1509
1510 # Find a good install program.  We prefer a C program (faster),
1511 # so one script is as good as another.  But avoid the broken or
1512 # incompatible versions:
1513 # SysV /etc/install, /usr/sbin/install
1514 # SunOS /usr/etc/install
1515 # IRIX /sbin/install
1516 # AIX /bin/install
1517 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1518 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1519 # ./install, which can be erroneously created by make from ./install.sh.
1520 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1521 echo "configure:1522: checking for a BSD compatible install" >&5
1522 if test -z "$INSTALL"; then
1523 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1524   echo $ac_n "(cached) $ac_c" 1>&6
1525 else
1526     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1527   for ac_dir in $PATH; do
1528     # Account for people who put trailing slashes in PATH elements.
1529     case "$ac_dir/" in
1530     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1531     *)
1532       # OSF1 and SCO ODT 3.0 have their own names for install.
1533       for ac_prog in ginstall installbsd scoinst install; do
1534         if test -f $ac_dir/$ac_prog; then
1535           if test $ac_prog = install &&
1536             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1537             # AIX install.  It has an incompatible calling convention.
1538             # OSF/1 installbsd also uses dspmsg, but is usable.
1539             :
1540           else
1541             ac_cv_path_install="$ac_dir/$ac_prog -c"
1542             break 2
1543           fi
1544         fi
1545       done
1546       ;;
1547     esac
1548   done
1549   IFS="$ac_save_IFS"
1550
1551 fi
1552   if test "${ac_cv_path_install+set}" = set; then
1553     INSTALL="$ac_cv_path_install"
1554   else
1555     # As a last resort, use the slow shell script.  We don't cache a
1556     # path for INSTALL within a source directory, because that will
1557     # break other packages using the cache if that directory is
1558     # removed, or if the path is relative.
1559     INSTALL="$ac_install_sh"
1560   fi
1561 fi
1562 echo "$ac_t""$INSTALL" 1>&6
1563
1564 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1565 # It thinks the first close brace ends the variable substitution.
1566 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1567
1568 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1569
1570 # Extract the first word of "ranlib", so it can be a program name with args.
1571 set dummy ranlib; ac_word=$2
1572 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1573 echo "configure:1574: checking for $ac_word" >&5
1574 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1575   echo $ac_n "(cached) $ac_c" 1>&6
1576 else
1577   if test -n "$RANLIB"; then
1578   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1579 else
1580   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1581   for ac_dir in $PATH; do
1582     test -z "$ac_dir" && ac_dir=.
1583     if test -f $ac_dir/$ac_word; then
1584       ac_cv_prog_RANLIB="ranlib"
1585       break
1586     fi
1587   done
1588   IFS="$ac_save_ifs"
1589   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1590 fi
1591 fi
1592 RANLIB="$ac_cv_prog_RANLIB"
1593 if test -n "$RANLIB"; then
1594   echo "$ac_t""$RANLIB" 1>&6
1595 else
1596   echo "$ac_t""no" 1>&6
1597 fi
1598
1599 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1600 echo "configure:1601: checking whether ${MAKE-make} sets \${MAKE}" >&5
1601 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1602 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1603   echo $ac_n "(cached) $ac_c" 1>&6
1604 else
1605   cat > conftestmake <<\EOF
1606 all:
1607         @echo 'ac_maketemp="${MAKE}"'
1608 EOF
1609 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1610 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1611 if test -n "$ac_maketemp"; then
1612   eval ac_cv_prog_make_${ac_make}_set=yes
1613 else
1614   eval ac_cv_prog_make_${ac_make}_set=no
1615 fi
1616 rm -f conftestmake
1617 fi
1618 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1619   echo "$ac_t""yes" 1>&6
1620   SET_MAKE=
1621 else
1622   echo "$ac_t""no" 1>&6
1623   SET_MAKE="MAKE=${MAKE-make}"
1624 fi
1625
1626
1627 # Extract the first word of "sendmail", so it can be a program name with args.
1628 set dummy sendmail; ac_word=$2
1629 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1630 echo "configure:1631: checking for $ac_word" >&5
1631 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
1632   echo $ac_n "(cached) $ac_c" 1>&6
1633 else
1634   case "$SENDMAIL" in
1635   /*)
1636   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
1637   ;;
1638   *)
1639   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1640   for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
1641     test -z "$ac_dir" && ac_dir=.
1642     if test -f $ac_dir/$ac_word; then
1643       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
1644       break
1645     fi
1646   done
1647   IFS="$ac_save_ifs"
1648   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
1649   ;;
1650 esac
1651 fi
1652 SENDMAIL="$ac_cv_path_SENDMAIL"
1653 if test -n "$SENDMAIL"; then
1654   echo "$ac_t""$SENDMAIL" 1>&6
1655 else
1656   echo "$ac_t""no" 1>&6
1657 fi
1658
1659 # Extract the first word of "vi", so it can be a program name with args.
1660 set dummy vi; ac_word=$2
1661 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1662 echo "configure:1663: checking for $ac_word" >&5
1663 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
1664   echo $ac_n "(cached) $ac_c" 1>&6
1665 else
1666   case "$EDITOR" in
1667   /*)
1668   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
1669   ;;
1670   *)
1671   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1672   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1673     test -z "$ac_dir" && ac_dir=.
1674     if test -f $ac_dir/$ac_word; then
1675       ac_cv_path_EDITOR="$ac_dir/$ac_word"
1676       break
1677     fi
1678   done
1679   IFS="$ac_save_ifs"
1680   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
1681   ;;
1682 esac
1683 fi
1684 EDITOR="$ac_cv_path_EDITOR"
1685 if test -n "$EDITOR"; then
1686   echo "$ac_t""$EDITOR" 1>&6
1687 else
1688   echo "$ac_t""no" 1>&6
1689 fi
1690
1691 # Extract the first word of "finger", so it can be a program name with args.
1692 set dummy finger; ac_word=$2
1693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1694 echo "configure:1695: checking for $ac_word" >&5
1695 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
1696   echo $ac_n "(cached) $ac_c" 1>&6
1697 else
1698   case "$FINGER" in
1699   /*)
1700   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
1701   ;;
1702   *)
1703   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1704   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1705     test -z "$ac_dir" && ac_dir=.
1706     if test -f $ac_dir/$ac_word; then
1707       ac_cv_path_FINGER="$ac_dir/$ac_word"
1708       break
1709     fi
1710   done
1711   IFS="$ac_save_ifs"
1712   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
1713   ;;
1714 esac
1715 fi
1716 FINGER="$ac_cv_path_FINGER"
1717 if test -n "$FINGER"; then
1718   echo "$ac_t""$FINGER" 1>&6
1719 else
1720   echo "$ac_t""no" 1>&6
1721 fi
1722
1723
1724
1725
1726 echo $ac_n "checking for socket""... $ac_c" 1>&6
1727 echo "configure:1728: checking for socket" >&5
1728 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
1729   echo $ac_n "(cached) $ac_c" 1>&6
1730 else
1731   cat > conftest.$ac_ext <<EOF
1732 #line 1733 "configure"
1733 #include "confdefs.h"
1734 /* System header to define __stub macros and hopefully few prototypes,
1735     which can conflict with char socket(); below.  */
1736 #include <assert.h>
1737 /* Override any gcc2 internal prototype to avoid an error.  */
1738 /* We use char because int might match the return type of a gcc2
1739     builtin and then its argument prototype would still apply.  */
1740 char socket();
1741
1742 int main() {
1743
1744 /* The GNU C library defines this for functions which it implements
1745     to always fail with ENOSYS.  Some functions are actually named
1746     something starting with __ and the normal name is an alias.  */
1747 #if defined (__stub_socket) || defined (__stub___socket)
1748 choke me
1749 #else
1750 socket();
1751 #endif
1752
1753 ; return 0; }
1754 EOF
1755 if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1756   rm -rf conftest*
1757   eval "ac_cv_func_socket=yes"
1758 else
1759   echo "configure: failed program was:" >&5
1760   cat conftest.$ac_ext >&5
1761   rm -rf conftest*
1762   eval "ac_cv_func_socket=no"
1763 fi
1764 rm -f conftest*
1765 fi
1766
1767 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
1768   echo "$ac_t""yes" 1>&6
1769   :
1770 else
1771   echo "$ac_t""no" 1>&6
1772         
1773         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
1774 echo "configure:1775: checking for main in -lsocket" >&5
1775 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
1776 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1777   echo $ac_n "(cached) $ac_c" 1>&6
1778 else
1779   ac_save_LIBS="$LIBS"
1780 LIBS="-lsocket  $LIBS"
1781 cat > conftest.$ac_ext <<EOF
1782 #line 1783 "configure"
1783 #include "confdefs.h"
1784
1785 int main() {
1786 main()
1787 ; return 0; }
1788 EOF
1789 if { (eval echo configure:1790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1790   rm -rf conftest*
1791   eval "ac_cv_lib_$ac_lib_var=yes"
1792 else
1793   echo "configure: failed program was:" >&5
1794   cat conftest.$ac_ext >&5
1795   rm -rf conftest*
1796   eval "ac_cv_lib_$ac_lib_var=no"
1797 fi
1798 rm -f conftest*
1799 LIBS="$ac_save_LIBS"
1800
1801 fi
1802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1803   echo "$ac_t""yes" 1>&6
1804     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1805     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1806   cat >> confdefs.h <<EOF
1807 #define $ac_tr_lib 1
1808 EOF
1809
1810   LIBS="-lsocket $LIBS"
1811
1812 else
1813   echo "$ac_t""no" 1>&6
1814 fi
1815
1816         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
1817 echo "configure:1818: checking for main in -lnet" >&5
1818 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
1819 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1820   echo $ac_n "(cached) $ac_c" 1>&6
1821 else
1822   ac_save_LIBS="$LIBS"
1823 LIBS="-lnet  $LIBS"
1824 cat > conftest.$ac_ext <<EOF
1825 #line 1826 "configure"
1826 #include "confdefs.h"
1827
1828 int main() {
1829 main()
1830 ; return 0; }
1831 EOF
1832 if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1833   rm -rf conftest*
1834   eval "ac_cv_lib_$ac_lib_var=yes"
1835 else
1836   echo "configure: failed program was:" >&5
1837   cat conftest.$ac_ext >&5
1838   rm -rf conftest*
1839   eval "ac_cv_lib_$ac_lib_var=no"
1840 fi
1841 rm -f conftest*
1842 LIBS="$ac_save_LIBS"
1843
1844 fi
1845 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1846   echo "$ac_t""yes" 1>&6
1847     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1848     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1849   cat >> confdefs.h <<EOF
1850 #define $ac_tr_lib 1
1851 EOF
1852
1853   LIBS="-lnet $LIBS"
1854
1855 else
1856   echo "$ac_t""no" 1>&6
1857 fi
1858
1859         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
1860 echo "configure:1861: checking for main in -lnsl_s" >&5
1861 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
1862 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1863   echo $ac_n "(cached) $ac_c" 1>&6
1864 else
1865   ac_save_LIBS="$LIBS"
1866 LIBS="-lnsl_s  $LIBS"
1867 cat > conftest.$ac_ext <<EOF
1868 #line 1869 "configure"
1869 #include "confdefs.h"
1870
1871 int main() {
1872 main()
1873 ; return 0; }
1874 EOF
1875 if { (eval echo configure:1876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1876   rm -rf conftest*
1877   eval "ac_cv_lib_$ac_lib_var=yes"
1878 else
1879   echo "configure: failed program was:" >&5
1880   cat conftest.$ac_ext >&5
1881   rm -rf conftest*
1882   eval "ac_cv_lib_$ac_lib_var=no"
1883 fi
1884 rm -f conftest*
1885 LIBS="$ac_save_LIBS"
1886
1887 fi
1888 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1889   echo "$ac_t""yes" 1>&6
1890     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1891     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1892   cat >> confdefs.h <<EOF
1893 #define $ac_tr_lib 1
1894 EOF
1895
1896   LIBS="-lnsl_s $LIBS"
1897
1898 else
1899   echo "$ac_t""no" 1>&6
1900 fi
1901
1902         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
1903 echo "configure:1904: checking for main in -lnsl" >&5
1904 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
1905 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1906   echo $ac_n "(cached) $ac_c" 1>&6
1907 else
1908   ac_save_LIBS="$LIBS"
1909 LIBS="-lnsl  $LIBS"
1910 cat > conftest.$ac_ext <<EOF
1911 #line 1912 "configure"
1912 #include "confdefs.h"
1913
1914 int main() {
1915 main()
1916 ; return 0; }
1917 EOF
1918 if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1919   rm -rf conftest*
1920   eval "ac_cv_lib_$ac_lib_var=yes"
1921 else
1922   echo "configure: failed program was:" >&5
1923   cat conftest.$ac_ext >&5
1924   rm -rf conftest*
1925   eval "ac_cv_lib_$ac_lib_var=no"
1926 fi
1927 rm -f conftest*
1928 LIBS="$ac_save_LIBS"
1929
1930 fi
1931 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1932   echo "$ac_t""yes" 1>&6
1933     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1934     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1935   cat >> confdefs.h <<EOF
1936 #define $ac_tr_lib 1
1937 EOF
1938
1939   LIBS="-lnsl $LIBS"
1940
1941 else
1942   echo "$ac_t""no" 1>&6
1943 fi
1944
1945         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
1946 echo "configure:1947: checking for socket in -linet" >&5
1947 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
1948 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1949   echo $ac_n "(cached) $ac_c" 1>&6
1950 else
1951   ac_save_LIBS="$LIBS"
1952 LIBS="-linet  $LIBS"
1953 cat > conftest.$ac_ext <<EOF
1954 #line 1955 "configure"
1955 #include "confdefs.h"
1956 /* Override any gcc2 internal prototype to avoid an error.  */
1957 /* We use char because int might match the return type of a gcc2
1958     builtin and then its argument prototype would still apply.  */
1959 char socket();
1960
1961 int main() {
1962 socket()
1963 ; return 0; }
1964 EOF
1965 if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1966   rm -rf conftest*
1967   eval "ac_cv_lib_$ac_lib_var=yes"
1968 else
1969   echo "configure: failed program was:" >&5
1970   cat conftest.$ac_ext >&5
1971   rm -rf conftest*
1972   eval "ac_cv_lib_$ac_lib_var=no"
1973 fi
1974 rm -f conftest*
1975 LIBS="$ac_save_LIBS"
1976
1977 fi
1978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1979   echo "$ac_t""yes" 1>&6
1980     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1981     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1982   cat >> confdefs.h <<EOF
1983 #define $ac_tr_lib 1
1984 EOF
1985
1986   LIBS="-linet $LIBS"
1987
1988 else
1989   echo "$ac_t""no" 1>&6
1990 fi
1991
1992         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
1993 echo "configure:1994: checking for main in -lgen" >&5
1994 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
1995 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1996   echo $ac_n "(cached) $ac_c" 1>&6
1997 else
1998   ac_save_LIBS="$LIBS"
1999 LIBS="-lgen  $LIBS"
2000 cat > conftest.$ac_ext <<EOF
2001 #line 2002 "configure"
2002 #include "confdefs.h"
2003
2004 int main() {
2005 main()
2006 ; return 0; }
2007 EOF
2008 if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2009   rm -rf conftest*
2010   eval "ac_cv_lib_$ac_lib_var=yes"
2011 else
2012   echo "configure: failed program was:" >&5
2013   cat conftest.$ac_ext >&5
2014   rm -rf conftest*
2015   eval "ac_cv_lib_$ac_lib_var=no"
2016 fi
2017 rm -f conftest*
2018 LIBS="$ac_save_LIBS"
2019
2020 fi
2021 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2022   echo "$ac_t""yes" 1>&6
2023     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2024     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2025   cat >> confdefs.h <<EOF
2026 #define $ac_tr_lib 1
2027 EOF
2028
2029   LIBS="-lgen $LIBS"
2030
2031 else
2032   echo "$ac_t""no" 1>&6
2033 fi
2034
2035
2036 fi
2037
2038
2039 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
2040 echo "configure:2041: checking for sigset in -lV3" >&5
2041 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
2042 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2043   echo $ac_n "(cached) $ac_c" 1>&6
2044 else
2045   ac_save_LIBS="$LIBS"
2046 LIBS="-lV3  $LIBS"
2047 cat > conftest.$ac_ext <<EOF
2048 #line 2049 "configure"
2049 #include "confdefs.h"
2050 /* Override any gcc2 internal prototype to avoid an error.  */
2051 /* We use char because int might match the return type of a gcc2
2052     builtin and then its argument prototype would still apply.  */
2053 char sigset();
2054
2055 int main() {
2056 sigset()
2057 ; return 0; }
2058 EOF
2059 if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2060   rm -rf conftest*
2061   eval "ac_cv_lib_$ac_lib_var=yes"
2062 else
2063   echo "configure: failed program was:" >&5
2064   cat conftest.$ac_ext >&5
2065   rm -rf conftest*
2066   eval "ac_cv_lib_$ac_lib_var=no"
2067 fi
2068 rm -f conftest*
2069 LIBS="$ac_save_LIBS"
2070
2071 fi
2072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2073   echo "$ac_t""yes" 1>&6
2074     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2075     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2076   cat >> confdefs.h <<EOF
2077 #define $ac_tr_lib 1
2078 EOF
2079
2080   LIBS="-lV3 $LIBS"
2081
2082 else
2083   echo "$ac_t""no" 1>&6
2084 fi
2085
2086
2087 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
2088         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
2089 do
2090 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2091 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2092 echo "configure:2093: checking for $ac_hdr" >&5
2093 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2094   echo $ac_n "(cached) $ac_c" 1>&6
2095 else
2096   cat > conftest.$ac_ext <<EOF
2097 #line 2098 "configure"
2098 #include "confdefs.h"
2099 #include <$ac_hdr>
2100 EOF
2101 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2102 { (eval echo configure:2103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2103 ac_err=`grep -v '^ *+' conftest.out`
2104 if test -z "$ac_err"; then
2105   rm -rf conftest*
2106   eval "ac_cv_header_$ac_safe=yes"
2107 else
2108   echo "$ac_err" >&5
2109   echo "configure: failed program was:" >&5
2110   cat conftest.$ac_ext >&5
2111   rm -rf conftest*
2112   eval "ac_cv_header_$ac_safe=no"
2113 fi
2114 rm -f conftest*
2115 fi
2116 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2117   echo "$ac_t""yes" 1>&6
2118     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2119   cat >> confdefs.h <<EOF
2120 #define $ac_tr_hdr 1
2121 EOF
2122  
2123 else
2124   echo "$ac_t""no" 1>&6
2125 fi
2126 done
2127
2128
2129         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
2130                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
2131 echo "configure:2132: checking for main in -lkrb4" >&5
2132 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
2133 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2134   echo $ac_n "(cached) $ac_c" 1>&6
2135 else
2136   ac_save_LIBS="$LIBS"
2137 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
2138 cat > conftest.$ac_ext <<EOF
2139 #line 2140 "configure"
2140 #include "confdefs.h"
2141
2142 int main() {
2143 main()
2144 ; return 0; }
2145 EOF
2146 if { (eval echo configure:2147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2147   rm -rf conftest*
2148   eval "ac_cv_lib_$ac_lib_var=yes"
2149 else
2150   echo "configure: failed program was:" >&5
2151   cat conftest.$ac_ext >&5
2152   rm -rf conftest*
2153   eval "ac_cv_lib_$ac_lib_var=no"
2154 fi
2155 rm -f conftest*
2156 LIBS="$ac_save_LIBS"
2157
2158 fi
2159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2160   echo "$ac_t""yes" 1>&6
2161   have_k5=yes
2162 else
2163   echo "$ac_t""no" 1>&6
2164 have_k5=no
2165 fi
2166
2167
2168                 if test $have_k5 = yes ; then
2169                         ol_with_kerberos=found
2170                         ol_link_kerberos=yes
2171
2172                         cat >> confdefs.h <<\EOF
2173 #define HAVE_KERBEROS 1
2174 EOF
2175
2176
2177                         KRB_DEFS="-DKERBEROS"
2178                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
2179                 fi
2180         fi
2181 fi
2182 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
2183         for ac_hdr in krb.h des.h
2184 do
2185 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2186 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2187 echo "configure:2188: checking for $ac_hdr" >&5
2188 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2189   echo $ac_n "(cached) $ac_c" 1>&6
2190 else
2191   cat > conftest.$ac_ext <<EOF
2192 #line 2193 "configure"
2193 #include "confdefs.h"
2194 #include <$ac_hdr>
2195 EOF
2196 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2197 { (eval echo configure:2198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2198 ac_err=`grep -v '^ *+' conftest.out`
2199 if test -z "$ac_err"; then
2200   rm -rf conftest*
2201   eval "ac_cv_header_$ac_safe=yes"
2202 else
2203   echo "$ac_err" >&5
2204   echo "configure: failed program was:" >&5
2205   cat conftest.$ac_ext >&5
2206   rm -rf conftest*
2207   eval "ac_cv_header_$ac_safe=no"
2208 fi
2209 rm -f conftest*
2210 fi
2211 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2212   echo "$ac_t""yes" 1>&6
2213     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2214   cat >> confdefs.h <<EOF
2215 #define $ac_tr_hdr 1
2216 EOF
2217  
2218 else
2219   echo "$ac_t""no" 1>&6
2220 fi
2221 done
2222
2223
2224         if test $ac_cv_header_krb_h = yes ; then
2225                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
2226 echo "configure:2227: checking for main in -lkrb" >&5
2227 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
2228 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2229   echo $ac_n "(cached) $ac_c" 1>&6
2230 else
2231   ac_save_LIBS="$LIBS"
2232 LIBS="-lkrb -ldes $LIBS"
2233 cat > conftest.$ac_ext <<EOF
2234 #line 2235 "configure"
2235 #include "confdefs.h"
2236
2237 int main() {
2238 main()
2239 ; return 0; }
2240 EOF
2241 if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2242   rm -rf conftest*
2243   eval "ac_cv_lib_$ac_lib_var=yes"
2244 else
2245   echo "configure: failed program was:" >&5
2246   cat conftest.$ac_ext >&5
2247   rm -rf conftest*
2248   eval "ac_cv_lib_$ac_lib_var=no"
2249 fi
2250 rm -f conftest*
2251 LIBS="$ac_save_LIBS"
2252
2253 fi
2254 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2255   echo "$ac_t""yes" 1>&6
2256   have_k4=yes
2257 else
2258   echo "$ac_t""no" 1>&6
2259 have_k4=no
2260 fi
2261
2262
2263                 if test $have_k4 = yes ; then
2264                         ol_with_kerberos=found
2265                         ol_link_kerberos=yes
2266
2267                         cat >> confdefs.h <<\EOF
2268 #define HAVE_KERBEROS 1
2269 EOF
2270
2271
2272                         KRB_DEFS="-DKERBEROS"
2273                         KRB_LIBS="-lkrb -ldes"
2274                 fi
2275         fi
2276 fi
2277
2278
2279 ol_link_threads=no
2280 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
2281         for ac_hdr in pthread.h sched.h
2282 do
2283 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2284 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2285 echo "configure:2286: checking for $ac_hdr" >&5
2286 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2287   echo $ac_n "(cached) $ac_c" 1>&6
2288 else
2289   cat > conftest.$ac_ext <<EOF
2290 #line 2291 "configure"
2291 #include "confdefs.h"
2292 #include <$ac_hdr>
2293 EOF
2294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2295 { (eval echo configure:2296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2296 ac_err=`grep -v '^ *+' conftest.out`
2297 if test -z "$ac_err"; then
2298   rm -rf conftest*
2299   eval "ac_cv_header_$ac_safe=yes"
2300 else
2301   echo "$ac_err" >&5
2302   echo "configure: failed program was:" >&5
2303   cat conftest.$ac_ext >&5
2304   rm -rf conftest*
2305   eval "ac_cv_header_$ac_safe=no"
2306 fi
2307 rm -f conftest*
2308 fi
2309 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2310   echo "$ac_t""yes" 1>&6
2311     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2312   cat >> confdefs.h <<EOF
2313 #define $ac_tr_hdr 1
2314 EOF
2315  
2316 else
2317   echo "$ac_t""no" 1>&6
2318 fi
2319 done
2320
2321
2322         if test $ac_cv_header_pthread_h = yes ; then
2323                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
2324 echo "configure:2325: checking POSIX thread version" >&5
2325 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
2326   echo $ac_n "(cached) $ac_c" 1>&6
2327 else
2328   
2329         cat > conftest.$ac_ext <<EOF
2330 #line 2331 "configure"
2331 #include "confdefs.h"
2332
2333 #               include <pthread.h>
2334                 /* this check could be improved */
2335 #               ifdef PTHREAD_ONCE_INIT
2336                         final
2337 #               endif
2338         
2339 EOF
2340 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2341   egrep "final" >/dev/null 2>&1; then
2342   rm -rf conftest*
2343   ol_pthread_final=yes
2344 else
2345   rm -rf conftest*
2346   ol_pthread_final=no
2347 fi
2348 rm -f conftest*
2349
2350
2351         cat > conftest.$ac_ext <<EOF
2352 #line 2353 "configure"
2353 #include "confdefs.h"
2354
2355 #               include <pthread.h>
2356                 /* this check could be improved */
2357 #               ifdef pthread_once_init
2358                         draft4
2359 #               endif
2360         
2361 EOF
2362 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2363   egrep "draft4" >/dev/null 2>&1; then
2364   rm -rf conftest*
2365   ol_pthread_draft4=yes
2366 else
2367   rm -rf conftest*
2368   ol_pthread_draft4=no
2369 fi
2370 rm -f conftest*
2371
2372
2373         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
2374                 ol_cv_pthread_version=final
2375         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
2376                 ol_cv_pthread_version=draft4
2377         else
2378                 ol_cv_pthread_version=unknown
2379         fi
2380
2381 fi
2382
2383 echo "$ac_t""$ol_cv_pthread_version" 1>&6
2384
2385
2386                 if test $ol_cv_pthread_version = final ; then
2387                         LTHREAD_DEFS="$LTHREAD_DEFS -DPOSIX_THREADS"
2388                 elif test $ol_cv_pthread_version = draft4 ; then
2389                         cat >> confdefs.h <<\EOF
2390 #define HAVE_PTHREADS_D4 1
2391 EOF
2392
2393                         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_MIT_PTHREADS"
2394                 else
2395                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
2396                 fi
2397
2398                 # consider threads found
2399                 ol_with_threads=found
2400
2401                 
2402 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
2403 echo "configure:2404: checking for LinuxThreads" >&5
2404 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
2405   echo $ac_n "(cached) $ac_c" 1>&6
2406 else
2407   
2408         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
2409         if test "$res" -gt 0 ; then
2410                 ol_cv_linux_threads=yes
2411         else
2412                 ol_cv_linux_threads=no
2413         fi
2414
2415 fi
2416
2417 echo "$ac_t""$ol_cv_linux_threads" 1>&6
2418
2419
2420                 if test $ol_cv_linux_threads = yes ; then
2421                         cat >> confdefs.h <<\EOF
2422 #define HAVE_LINUX_THREADS 1
2423 EOF
2424
2425                         LTHREAD_DEFS="$LTHREAD_DEFS -DLINUX_THREADS"
2426                 fi
2427
2428                 
2429                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
2430 echo "configure:2431: checking for pthread_create" >&5
2431 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
2432   echo $ac_n "(cached) $ac_c" 1>&6
2433 else
2434   cat > conftest.$ac_ext <<EOF
2435 #line 2436 "configure"
2436 #include "confdefs.h"
2437 /* System header to define __stub macros and hopefully few prototypes,
2438     which can conflict with char pthread_create(); below.  */
2439 #include <assert.h>
2440 /* Override any gcc2 internal prototype to avoid an error.  */
2441 /* We use char because int might match the return type of a gcc2
2442     builtin and then its argument prototype would still apply.  */
2443 char pthread_create();
2444
2445 int main() {
2446
2447 /* The GNU C library defines this for functions which it implements
2448     to always fail with ENOSYS.  Some functions are actually named
2449     something starting with __ and the normal name is an alias.  */
2450 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
2451 choke me
2452 #else
2453 pthread_create();
2454 #endif
2455
2456 ; return 0; }
2457 EOF
2458 if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2459   rm -rf conftest*
2460   eval "ac_cv_func_pthread_create=yes"
2461 else
2462   echo "configure: failed program was:" >&5
2463   cat conftest.$ac_ext >&5
2464   rm -rf conftest*
2465   eval "ac_cv_func_pthread_create=no"
2466 fi
2467 rm -f conftest*
2468 fi
2469
2470 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
2471   echo "$ac_t""yes" 1>&6
2472   ol_link_threads=yes
2473 else
2474   echo "$ac_t""no" 1>&6
2475 fi
2476
2477
2478                 if test $ol_link_threads = no ; then
2479                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
2480 echo "configure:2481: checking for pthread_create with -pthread" >&5
2481 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
2482   echo $ac_n "(cached) $ac_c" 1>&6
2483 else
2484   
2485                                                                 save_LIBS="$LIBS"
2486                                 LIBS="-pthread $LIBS"
2487                                 cat > conftest.$ac_ext <<EOF
2488 #line 2489 "configure"
2489 #include "confdefs.h"
2490 #include <pthread.h>
2491 int main() {
2492
2493                                         pthread_create((pthread_t*) 0,
2494                                                 (pthread_attr_t*) 0, 0, 0);
2495                                         
2496 ; return 0; }
2497 EOF
2498 if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2499   rm -rf conftest*
2500   ol_cv_pthread_flag=yes
2501 else
2502   echo "configure: failed program was:" >&5
2503   cat conftest.$ac_ext >&5
2504   rm -rf conftest*
2505   ol_cv_pthread_flag=no
2506 fi
2507 rm -f conftest*
2508                                                                 LIBS="$save_LIBS"
2509                         
2510 fi
2511
2512 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
2513
2514                         if test $ol_cv_pthread_flag = yes ; then
2515                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
2516                                 ol_link_threads=posix
2517                         fi
2518                 fi
2519
2520                 if test $ol_link_threads = no ; then
2521                                                 save_LIBS="$LIBS"
2522                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
2523 echo "configure:2524: checking for pthread_create in -lpthread" >&5
2524 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
2525 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2526   echo $ac_n "(cached) $ac_c" 1>&6
2527 else
2528   ac_save_LIBS="$LIBS"
2529 LIBS="-lpthread  $LIBS"
2530 cat > conftest.$ac_ext <<EOF
2531 #line 2532 "configure"
2532 #include "confdefs.h"
2533 /* Override any gcc2 internal prototype to avoid an error.  */
2534 /* We use char because int might match the return type of a gcc2
2535     builtin and then its argument prototype would still apply.  */
2536 char pthread_create();
2537
2538 int main() {
2539 pthread_create()
2540 ; return 0; }
2541 EOF
2542 if { (eval echo configure:2543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2543   rm -rf conftest*
2544   eval "ac_cv_lib_$ac_lib_var=yes"
2545 else
2546   echo "configure: failed program was:" >&5
2547   cat conftest.$ac_ext >&5
2548   rm -rf conftest*
2549   eval "ac_cv_lib_$ac_lib_var=no"
2550 fi
2551 rm -f conftest*
2552 LIBS="$ac_save_LIBS"
2553
2554 fi
2555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2556   echo "$ac_t""yes" 1>&6
2557   
2558                                 ol_link_threads=posix
2559                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
2560 else
2561   echo "$ac_t""no" 1>&6
2562 fi
2563
2564                         LIBS="$save_LIBS"
2565                 fi
2566
2567                 if test $ol_link_threads = no ; then
2568                                                 save_LIBS="$LIBS"
2569                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
2570 echo "configure:2571: checking for pthread_create in -lc_r" >&5
2571 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
2572 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2573   echo $ac_n "(cached) $ac_c" 1>&6
2574 else
2575   ac_save_LIBS="$LIBS"
2576 LIBS="-lc_r  $LIBS"
2577 cat > conftest.$ac_ext <<EOF
2578 #line 2579 "configure"
2579 #include "confdefs.h"
2580 /* Override any gcc2 internal prototype to avoid an error.  */
2581 /* We use char because int might match the return type of a gcc2
2582     builtin and then its argument prototype would still apply.  */
2583 char pthread_create();
2584
2585 int main() {
2586 pthread_create()
2587 ; return 0; }
2588 EOF
2589 if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2590   rm -rf conftest*
2591   eval "ac_cv_lib_$ac_lib_var=yes"
2592 else
2593   echo "configure: failed program was:" >&5
2594   cat conftest.$ac_ext >&5
2595   rm -rf conftest*
2596   eval "ac_cv_lib_$ac_lib_var=no"
2597 fi
2598 rm -f conftest*
2599 LIBS="$ac_save_LIBS"
2600
2601 fi
2602 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2603   echo "$ac_t""yes" 1>&6
2604   
2605                                 ol_link_threads=posix
2606                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
2607 else
2608   echo "$ac_t""no" 1>&6
2609 fi
2610
2611                         LIBS="$save_LIBS"
2612                 fi
2613
2614                 if test $ol_link_threads = no ; then
2615                                                 save_LIBS="$LIBS"
2616                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
2617 echo "configure:2618: checking for pthread_create in -lpthread" >&5
2618 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
2619 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2620   echo $ac_n "(cached) $ac_c" 1>&6
2621 else
2622   ac_save_LIBS="$LIBS"
2623 LIBS="-lpthread if test $with_preemptive = auto ; then
2624                                         ol_with_preemptive=yes
2625                                 fi
2626                                 -lmach -lexc -lc $LIBS"
2627 cat > conftest.$ac_ext <<EOF
2628 #line 2629 "configure"
2629 #include "confdefs.h"
2630 /* Override any gcc2 internal prototype to avoid an error.  */
2631 /* We use char because int might match the return type of a gcc2
2632     builtin and then its argument prototype would still apply.  */
2633 char pthread_create();
2634
2635 int main() {
2636 pthread_create()
2637 ; return 0; }
2638 EOF
2639 if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2640   rm -rf conftest*
2641   eval "ac_cv_lib_$ac_lib_var=yes"
2642 else
2643   echo "configure: failed program was:" >&5
2644   cat conftest.$ac_ext >&5
2645   rm -rf conftest*
2646   eval "ac_cv_lib_$ac_lib_var=no"
2647 fi
2648 rm -f conftest*
2649 LIBS="$ac_save_LIBS"
2650
2651 fi
2652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2653   echo "$ac_t""yes" 1>&6
2654   
2655                                 cat >> confdefs.h <<\EOF
2656 #define HAVE_DCE 1
2657 EOF
2658
2659                                 ol_link_threads=posix
2660                                 LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_DCE_THREADS"
2661                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
2662 else
2663   echo "$ac_t""no" 1>&6
2664 fi
2665
2666                         LIBS="$save_LIBS"
2667                 fi
2668
2669                 if test $ol_link_threads != no ; then
2670                         cat >> confdefs.h <<\EOF
2671 #define HAVE_PTHREADS 1
2672 EOF
2673
2674
2675                                                 save_CPPFLAGS="$CPPFLAGS"
2676                         save_LIBS="$LIBS"
2677                         CPPFLAGS="$LTHREAD_DEFS $CPPFLAGS"
2678                         LIBS="$LTHREAD_LIBS $LIBS"
2679
2680                                                                                                 for ac_func in sched_yield pthread_yield
2681 do
2682 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2683 echo "configure:2684: checking for $ac_func" >&5
2684 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2685   echo $ac_n "(cached) $ac_c" 1>&6
2686 else
2687   cat > conftest.$ac_ext <<EOF
2688 #line 2689 "configure"
2689 #include "confdefs.h"
2690 /* System header to define __stub macros and hopefully few prototypes,
2691     which can conflict with char $ac_func(); below.  */
2692 #include <assert.h>
2693 /* Override any gcc2 internal prototype to avoid an error.  */
2694 /* We use char because int might match the return type of a gcc2
2695     builtin and then its argument prototype would still apply.  */
2696 char $ac_func();
2697
2698 int main() {
2699
2700 /* The GNU C library defines this for functions which it implements
2701     to always fail with ENOSYS.  Some functions are actually named
2702     something starting with __ and the normal name is an alias.  */
2703 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2704 choke me
2705 #else
2706 $ac_func();
2707 #endif
2708
2709 ; return 0; }
2710 EOF
2711 if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2712   rm -rf conftest*
2713   eval "ac_cv_func_$ac_func=yes"
2714 else
2715   echo "configure: failed program was:" >&5
2716   cat conftest.$ac_ext >&5
2717   rm -rf conftest*
2718   eval "ac_cv_func_$ac_func=no"
2719 fi
2720 rm -f conftest*
2721 fi
2722
2723 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2724   echo "$ac_t""yes" 1>&6
2725     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2726   cat >> confdefs.h <<EOF
2727 #define $ac_tr_func 1
2728 EOF
2729  
2730 else
2731   echo "$ac_t""no" 1>&6
2732 fi
2733 done
2734
2735
2736                         if test $ac_cv_func_sched_yield = no -a \
2737                                 $ac_cv_func_pthread_yield = no ; then
2738
2739                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
2740                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
2741                         fi
2742
2743                                                 for ac_func in pthread_kill
2744 do
2745 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2746 echo "configure:2747: checking for $ac_func" >&5
2747 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2748   echo $ac_n "(cached) $ac_c" 1>&6
2749 else
2750   cat > conftest.$ac_ext <<EOF
2751 #line 2752 "configure"
2752 #include "confdefs.h"
2753 /* System header to define __stub macros and hopefully few prototypes,
2754     which can conflict with char $ac_func(); below.  */
2755 #include <assert.h>
2756 /* Override any gcc2 internal prototype to avoid an error.  */
2757 /* We use char because int might match the return type of a gcc2
2758     builtin and then its argument prototype would still apply.  */
2759 char $ac_func();
2760
2761 int main() {
2762
2763 /* The GNU C library defines this for functions which it implements
2764     to always fail with ENOSYS.  Some functions are actually named
2765     something starting with __ and the normal name is an alias.  */
2766 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2767 choke me
2768 #else
2769 $ac_func();
2770 #endif
2771
2772 ; return 0; }
2773 EOF
2774 if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2775   rm -rf conftest*
2776   eval "ac_cv_func_$ac_func=yes"
2777 else
2778   echo "configure: failed program was:" >&5
2779   cat conftest.$ac_ext >&5
2780   rm -rf conftest*
2781   eval "ac_cv_func_$ac_func=no"
2782 fi
2783 rm -f conftest*
2784 fi
2785
2786 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2787   echo "$ac_t""yes" 1>&6
2788     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2789   cat >> confdefs.h <<EOF
2790 #define $ac_tr_func 1
2791 EOF
2792  
2793 else
2794   echo "$ac_t""no" 1>&6
2795 fi
2796 done
2797
2798
2799                                                 if test $ol_with_preemptive = auto ; then
2800                                 echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6
2801 echo "configure:2802: checking for preemptive Pthread implementation" >&5
2802                                 if test "$cross_compiling" = yes; then
2803   
2804                                 { echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; }
2805 else
2806   cat > conftest.$ac_ext <<EOF
2807 #line 2808 "configure"
2808 #include "confdefs.h"
2809
2810 #include <sys/types.h>
2811 #include <sys/time.h>
2812 #include <unistd.h>
2813 #include <pthread.h>
2814 #ifndef NULL
2815 #define NULL 0
2816 #endif
2817
2818 int task(arg)
2819         int *arg;
2820 {
2821         struct timeval tv;
2822
2823         tv.tv_sec=4;
2824         tv.tv_usec=0;
2825         select(0, NULL, NULL, NULL, &tv);
2826
2827         tv.tv_sec=6;
2828         tv.tv_usec=0;
2829         select(0, NULL, NULL, NULL, &tv);
2830
2831         exit(1); /* if we exit here, the select blocked the whole process */
2832 }
2833
2834 main(argc, argv)
2835 int argc; char **argv;
2836 {
2837         pthread_t t;
2838         pthread_create(&t, NULL, (void *) task, NULL);
2839
2840 #if HAVE_SCHED_YIELD
2841         sched_yield();  /* make sure task runs first */
2842 #else
2843 #if defined(HAVE_PTHREAD_YIELD)
2844         pthread_yield();        /* make sure task runs first */
2845 #endif
2846 #endif
2847         exit(0);
2848 }
2849                                 
2850 EOF
2851 if { (eval echo configure:2852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2852 then
2853   ol_pthread_preemptive=yes
2854 else
2855   echo "configure: failed program was:" >&5
2856   cat conftest.$ac_ext >&5
2857   rm -fr conftest*
2858   ol_pthread_preemptive=no
2859 fi
2860 rm -fr conftest*
2861 fi
2862
2863                                 echo "$ac_t""$ol_pthread_preemptive" 1>&6
2864
2865                                 if test $ol_pthread_preemptive = yes ; then
2866                                         cat >> confdefs.h <<\EOF
2867 #define HAVE_PREEMPTIVE_PTHREADS 1
2868 EOF
2869
2870                                         ol_with_preemptive=yes
2871                                 fi
2872                         fi
2873
2874                                                 CPPFLAGS="$save_CPPFLAGS"
2875                         LIBS="$save_LIBS"
2876                 else
2877                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
2878                 fi
2879         fi
2880
2881         if test $ol_with_threads = posix ; then
2882                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
2883         fi
2884 fi
2885
2886 if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then
2887                 for ac_hdr in mach/cthreads.h
2888 do
2889 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2890 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2891 echo "configure:2892: checking for $ac_hdr" >&5
2892 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2893   echo $ac_n "(cached) $ac_c" 1>&6
2894 else
2895   cat > conftest.$ac_ext <<EOF
2896 #line 2897 "configure"
2897 #include "confdefs.h"
2898 #include <$ac_hdr>
2899 EOF
2900 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2901 { (eval echo configure:2902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2902 ac_err=`grep -v '^ *+' conftest.out`
2903 if test -z "$ac_err"; then
2904   rm -rf conftest*
2905   eval "ac_cv_header_$ac_safe=yes"
2906 else
2907   echo "$ac_err" >&5
2908   echo "configure: failed program was:" >&5
2909   cat conftest.$ac_ext >&5
2910   rm -rf conftest*
2911   eval "ac_cv_header_$ac_safe=no"
2912 fi
2913 rm -f conftest*
2914 fi
2915 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2916   echo "$ac_t""yes" 1>&6
2917     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2918   cat >> confdefs.h <<EOF
2919 #define $ac_tr_hdr 1
2920 EOF
2921  
2922 else
2923   echo "$ac_t""no" 1>&6
2924 fi
2925 done
2926
2927         if test $ac_cv_header_lwp_lwp_h = yes ; then
2928                 echo $ac_n "checking for cthread_fork in -llwp""... $ac_c" 1>&6
2929 echo "configure:2930: checking for cthread_fork in -llwp" >&5
2930 ac_lib_var=`echo lwp'_'cthread_fork | sed 'y%./+-%__p_%'`
2931 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2932   echo $ac_n "(cached) $ac_c" 1>&6
2933 else
2934   ac_save_LIBS="$LIBS"
2935 LIBS="-llwp  $LIBS"
2936 cat > conftest.$ac_ext <<EOF
2937 #line 2938 "configure"
2938 #include "confdefs.h"
2939 /* Override any gcc2 internal prototype to avoid an error.  */
2940 /* We use char because int might match the return type of a gcc2
2941     builtin and then its argument prototype would still apply.  */
2942 char cthread_fork();
2943
2944 int main() {
2945 cthread_fork()
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_lib_$ac_lib_var=yes"
2951 else
2952   echo "configure: failed program was:" >&5
2953   cat conftest.$ac_ext >&5
2954   rm -rf conftest*
2955   eval "ac_cv_lib_$ac_lib_var=no"
2956 fi
2957 rm -f conftest*
2958 LIBS="$ac_save_LIBS"
2959
2960 fi
2961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2962   echo "$ac_t""yes" 1>&6
2963   have_cthreads=yes
2964 else
2965   echo "$ac_t""no" 1>&6
2966 have_cthreads=no
2967 fi
2968
2969
2970                 if test $have_cthreads = yes ; then
2971                         cat >> confdefs.h <<\EOF
2972 #define HAVE_CTHREADS 1
2973 EOF
2974
2975                         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_NEXT_CTHREADS"
2976                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
2977                 fi
2978         fi
2979 fi
2980
2981 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
2982                 for ac_hdr in thread.h synch.h
2983 do
2984 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2985 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2986 echo "configure:2987: checking for $ac_hdr" >&5
2987 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2988   echo $ac_n "(cached) $ac_c" 1>&6
2989 else
2990   cat > conftest.$ac_ext <<EOF
2991 #line 2992 "configure"
2992 #include "confdefs.h"
2993 #include <$ac_hdr>
2994 EOF
2995 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2996 { (eval echo configure:2997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2997 ac_err=`grep -v '^ *+' conftest.out`
2998 if test -z "$ac_err"; then
2999   rm -rf conftest*
3000   eval "ac_cv_header_$ac_safe=yes"
3001 else
3002   echo "$ac_err" >&5
3003   echo "configure: failed program was:" >&5
3004   cat conftest.$ac_ext >&5
3005   rm -rf conftest*
3006   eval "ac_cv_header_$ac_safe=no"
3007 fi
3008 rm -f conftest*
3009 fi
3010 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3011   echo "$ac_t""yes" 1>&6
3012     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3013   cat >> confdefs.h <<EOF
3014 #define $ac_tr_hdr 1
3015 EOF
3016  
3017 else
3018   echo "$ac_t""no" 1>&6
3019 fi
3020 done
3021
3022         if test $ac_cv_header_lwp_lwp_h = yes ; then
3023                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
3024 echo "configure:3025: checking for thr_create in -lthread" >&5
3025 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
3026 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3027   echo $ac_n "(cached) $ac_c" 1>&6
3028 else
3029   ac_save_LIBS="$LIBS"
3030 LIBS="-lthread  $LIBS"
3031 cat > conftest.$ac_ext <<EOF
3032 #line 3033 "configure"
3033 #include "confdefs.h"
3034 /* Override any gcc2 internal prototype to avoid an error.  */
3035 /* We use char because int might match the return type of a gcc2
3036     builtin and then its argument prototype would still apply.  */
3037 char thr_create();
3038
3039 int main() {
3040 thr_create()
3041 ; return 0; }
3042 EOF
3043 if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3044   rm -rf conftest*
3045   eval "ac_cv_lib_$ac_lib_var=yes"
3046 else
3047   echo "configure: failed program was:" >&5
3048   cat conftest.$ac_ext >&5
3049   rm -rf conftest*
3050   eval "ac_cv_lib_$ac_lib_var=no"
3051 fi
3052 rm -f conftest*
3053 LIBS="$ac_save_LIBS"
3054
3055 fi
3056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3057   echo "$ac_t""yes" 1>&6
3058   have_lwp=yes
3059 else
3060   echo "$ac_t""no" 1>&6
3061 have_lwp=no
3062 fi
3063
3064
3065                 if test $have_lwp = yes ; then
3066                         cat >> confdefs.h <<\EOF
3067 #define HAVE_LWP 1
3068 EOF
3069
3070                         cat >> confdefs.h <<\EOF
3071 #define HAVE_LWP_THR 1
3072 EOF
3073
3074                         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS5_LWP"
3075                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
3076                 fi
3077         fi
3078
3079                 for ac_hdr in lwp/lwp.h
3080 do
3081 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3082 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3083 echo "configure:3084: checking for $ac_hdr" >&5
3084 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3085   echo $ac_n "(cached) $ac_c" 1>&6
3086 else
3087   cat > conftest.$ac_ext <<EOF
3088 #line 3089 "configure"
3089 #include "confdefs.h"
3090 #include <$ac_hdr>
3091 EOF
3092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3093 { (eval echo configure:3094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3094 ac_err=`grep -v '^ *+' conftest.out`
3095 if test -z "$ac_err"; then
3096   rm -rf conftest*
3097   eval "ac_cv_header_$ac_safe=yes"
3098 else
3099   echo "$ac_err" >&5
3100   echo "configure: failed program was:" >&5
3101   cat conftest.$ac_ext >&5
3102   rm -rf conftest*
3103   eval "ac_cv_header_$ac_safe=no"
3104 fi
3105 rm -f conftest*
3106 fi
3107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3108   echo "$ac_t""yes" 1>&6
3109     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3110   cat >> confdefs.h <<EOF
3111 #define $ac_tr_hdr 1
3112 EOF
3113  
3114 else
3115   echo "$ac_t""no" 1>&6
3116 fi
3117 done
3118
3119         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
3120                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
3121 echo "configure:3122: checking for lwp_create in -llwp" >&5
3122 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
3123 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3124   echo $ac_n "(cached) $ac_c" 1>&6
3125 else
3126   ac_save_LIBS="$LIBS"
3127 LIBS="-llwp  $LIBS"
3128 cat > conftest.$ac_ext <<EOF
3129 #line 3130 "configure"
3130 #include "confdefs.h"
3131 /* Override any gcc2 internal prototype to avoid an error.  */
3132 /* We use char because int might match the return type of a gcc2
3133     builtin and then its argument prototype would still apply.  */
3134 char lwp_create();
3135
3136 int main() {
3137 lwp_create()
3138 ; return 0; }
3139 EOF
3140 if { (eval echo configure:3141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3141   rm -rf conftest*
3142   eval "ac_cv_lib_$ac_lib_var=yes"
3143 else
3144   echo "configure: failed program was:" >&5
3145   cat conftest.$ac_ext >&5
3146   rm -rf conftest*
3147   eval "ac_cv_lib_$ac_lib_var=no"
3148 fi
3149 rm -f conftest*
3150 LIBS="$ac_save_LIBS"
3151
3152 fi
3153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3154   echo "$ac_t""yes" 1>&6
3155   have_lwp=yes
3156 else
3157   echo "$ac_t""no" 1>&6
3158 have_lwp=no
3159 fi
3160
3161
3162                 if test $have_lwp = yes ; then
3163                         cat >> confdefs.h <<\EOF
3164 #define HAVE_LWP 1
3165 EOF
3166
3167                         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS4_LWP"
3168                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
3169
3170                         if test $with_preemptive = auto ; then
3171                                 with_preemptive=yes
3172                         fi
3173                 fi
3174         fi
3175 fi
3176
3177 if test $ol_with_preemptive = yes ; then
3178         LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_PREEMPTIVE"
3179 fi
3180
3181 if test $ol_with_threads = manual ; then
3182                 $ol_link_threads=yes
3183
3184         echo "configure: warning: thread defines and link options must be set manually" 1>&2
3185
3186         for ac_hdr in pthread.h sched.h
3187 do
3188 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3189 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3190 echo "configure:3191: checking for $ac_hdr" >&5
3191 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3192   echo $ac_n "(cached) $ac_c" 1>&6
3193 else
3194   cat > conftest.$ac_ext <<EOF
3195 #line 3196 "configure"
3196 #include "confdefs.h"
3197 #include <$ac_hdr>
3198 EOF
3199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3200 { (eval echo configure:3201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3201 ac_err=`grep -v '^ *+' conftest.out`
3202 if test -z "$ac_err"; then
3203   rm -rf conftest*
3204   eval "ac_cv_header_$ac_safe=yes"
3205 else
3206   echo "$ac_err" >&5
3207   echo "configure: failed program was:" >&5
3208   cat conftest.$ac_ext >&5
3209   rm -rf conftest*
3210   eval "ac_cv_header_$ac_safe=no"
3211 fi
3212 rm -f conftest*
3213 fi
3214 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3215   echo "$ac_t""yes" 1>&6
3216     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3217   cat >> confdefs.h <<EOF
3218 #define $ac_tr_hdr 1
3219 EOF
3220  
3221 else
3222   echo "$ac_t""no" 1>&6
3223 fi
3224 done
3225
3226         for ac_func in sched_yield pthread_yield
3227 do
3228 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3229 echo "configure:3230: checking for $ac_func" >&5
3230 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3231   echo $ac_n "(cached) $ac_c" 1>&6
3232 else
3233   cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236 /* System header to define __stub macros and hopefully few prototypes,
3237     which can conflict with char $ac_func(); below.  */
3238 #include <assert.h>
3239 /* Override any gcc2 internal prototype to avoid an error.  */
3240 /* We use char because int might match the return type of a gcc2
3241     builtin and then its argument prototype would still apply.  */
3242 char $ac_func();
3243
3244 int main() {
3245
3246 /* The GNU C library defines this for functions which it implements
3247     to always fail with ENOSYS.  Some functions are actually named
3248     something starting with __ and the normal name is an alias.  */
3249 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3250 choke me
3251 #else
3252 $ac_func();
3253 #endif
3254
3255 ; return 0; }
3256 EOF
3257 if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3258   rm -rf conftest*
3259   eval "ac_cv_func_$ac_func=yes"
3260 else
3261   echo "configure: failed program was:" >&5
3262   cat conftest.$ac_ext >&5
3263   rm -rf conftest*
3264   eval "ac_cv_func_$ac_func=no"
3265 fi
3266 rm -f conftest*
3267 fi
3268
3269 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3270   echo "$ac_t""yes" 1>&6
3271     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3272   cat >> confdefs.h <<EOF
3273 #define $ac_tr_func 1
3274 EOF
3275  
3276 else
3277   echo "$ac_t""no" 1>&6
3278 fi
3279 done
3280
3281         
3282 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
3283 echo "configure:3284: checking for LinuxThreads" >&5
3284 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
3285   echo $ac_n "(cached) $ac_c" 1>&6
3286 else
3287   
3288         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
3289         if test "$res" -gt 0 ; then
3290                 ol_cv_linux_threads=yes
3291         else
3292                 ol_cv_linux_threads=no
3293         fi
3294
3295 fi
3296
3297 echo "$ac_t""$ol_cv_linux_threads" 1>&6
3298
3299
3300         for ac_hdr in mach/cthreads.h
3301 do
3302 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3303 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3304 echo "configure:3305: checking for $ac_hdr" >&5
3305 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3306   echo $ac_n "(cached) $ac_c" 1>&6
3307 else
3308   cat > conftest.$ac_ext <<EOF
3309 #line 3310 "configure"
3310 #include "confdefs.h"
3311 #include <$ac_hdr>
3312 EOF
3313 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3314 { (eval echo configure:3315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3315 ac_err=`grep -v '^ *+' conftest.out`
3316 if test -z "$ac_err"; then
3317   rm -rf conftest*
3318   eval "ac_cv_header_$ac_safe=yes"
3319 else
3320   echo "$ac_err" >&5
3321   echo "configure: failed program was:" >&5
3322   cat conftest.$ac_ext >&5
3323   rm -rf conftest*
3324   eval "ac_cv_header_$ac_safe=no"
3325 fi
3326 rm -f conftest*
3327 fi
3328 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3329   echo "$ac_t""yes" 1>&6
3330     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3331   cat >> confdefs.h <<EOF
3332 #define $ac_tr_hdr 1
3333 EOF
3334  
3335 else
3336   echo "$ac_t""no" 1>&6
3337 fi
3338 done
3339
3340         for ac_hdr in lwp/lwp.h
3341 do
3342 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3343 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3344 echo "configure:3345: checking for $ac_hdr" >&5
3345 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3346   echo $ac_n "(cached) $ac_c" 1>&6
3347 else
3348   cat > conftest.$ac_ext <<EOF
3349 #line 3350 "configure"
3350 #include "confdefs.h"
3351 #include <$ac_hdr>
3352 EOF
3353 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3354 { (eval echo configure:3355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3355 ac_err=`grep -v '^ *+' conftest.out`
3356 if test -z "$ac_err"; then
3357   rm -rf conftest*
3358   eval "ac_cv_header_$ac_safe=yes"
3359 else
3360   echo "$ac_err" >&5
3361   echo "configure: failed program was:" >&5
3362   cat conftest.$ac_ext >&5
3363   rm -rf conftest*
3364   eval "ac_cv_header_$ac_safe=no"
3365 fi
3366 rm -f conftest*
3367 fi
3368 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3369   echo "$ac_t""yes" 1>&6
3370     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3371   cat >> confdefs.h <<EOF
3372 #define $ac_tr_hdr 1
3373 EOF
3374  
3375 else
3376   echo "$ac_t""no" 1>&6
3377 fi
3378 done
3379
3380         for ac_hdr in thread.h synch.h
3381 do
3382 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3383 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3384 echo "configure:3385: checking for $ac_hdr" >&5
3385 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3386   echo $ac_n "(cached) $ac_c" 1>&6
3387 else
3388   cat > conftest.$ac_ext <<EOF
3389 #line 3390 "configure"
3390 #include "confdefs.h"
3391 #include <$ac_hdr>
3392 EOF
3393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3394 { (eval echo configure:3395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3395 ac_err=`grep -v '^ *+' conftest.out`
3396 if test -z "$ac_err"; then
3397   rm -rf conftest*
3398   eval "ac_cv_header_$ac_safe=yes"
3399 else
3400   echo "$ac_err" >&5
3401   echo "configure: failed program was:" >&5
3402   cat conftest.$ac_ext >&5
3403   rm -rf conftest*
3404   eval "ac_cv_header_$ac_safe=no"
3405 fi
3406 rm -f conftest*
3407 fi
3408 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3409   echo "$ac_t""yes" 1>&6
3410     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3411   cat >> confdefs.h <<EOF
3412 #define $ac_tr_hdr 1
3413 EOF
3414  
3415 else
3416   echo "$ac_t""no" 1>&6
3417 fi
3418 done
3419
3420 fi
3421
3422 if test $ol_link_threads = no ; then
3423         if test $ol_with_threads = yes ; then
3424                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
3425         fi
3426
3427         if test $ol_with_threads = auto ; then
3428                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
3429                 $ol_with_threads = no
3430         fi
3431
3432         LTHREAD_DEFS="-DNO_THREADS"
3433         LTHREAD_LIBS=""
3434 fi
3435
3436 ol_link_ldbm=no 
3437 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
3438         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
3439 echo "configure:3440: checking for DB2 library" >&5
3440 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
3441   echo $ac_n "(cached) $ac_c" 1>&6
3442 else
3443         ol_LIBS="$LIBS"
3444         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
3445 echo "configure:3446: checking for db_open in -ldb" >&5
3446 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
3447 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3448   echo $ac_n "(cached) $ac_c" 1>&6
3449 else
3450   ac_save_LIBS="$LIBS"
3451 LIBS="-ldb  $LIBS"
3452 cat > conftest.$ac_ext <<EOF
3453 #line 3454 "configure"
3454 #include "confdefs.h"
3455 /* Override any gcc2 internal prototype to avoid an error.  */
3456 /* We use char because int might match the return type of a gcc2
3457     builtin and then its argument prototype would still apply.  */
3458 char db_open();
3459
3460 int main() {
3461 db_open()
3462 ; return 0; }
3463 EOF
3464 if { (eval echo configure:3465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3465   rm -rf conftest*
3466   eval "ac_cv_lib_$ac_lib_var=yes"
3467 else
3468   echo "configure: failed program was:" >&5
3469   cat conftest.$ac_ext >&5
3470   rm -rf conftest*
3471   eval "ac_cv_lib_$ac_lib_var=no"
3472 fi
3473 rm -f conftest*
3474 LIBS="$ac_save_LIBS"
3475
3476 fi
3477 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3478   echo "$ac_t""yes" 1>&6
3479   ol_cv_lib_db2=-ldb
3480 else
3481   echo "$ac_t""no" 1>&6
3482 ol_cv_lib_db2=no
3483 fi
3484
3485         LIBS="$ol_LIBS"
3486
3487 fi
3488
3489 echo "$ac_t""$ol_cv_lib_db2" 1>&6
3490
3491 for ac_hdr in db.h
3492 do
3493 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3494 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3495 echo "configure:3496: checking for $ac_hdr" >&5
3496 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3497   echo $ac_n "(cached) $ac_c" 1>&6
3498 else
3499   cat > conftest.$ac_ext <<EOF
3500 #line 3501 "configure"
3501 #include "confdefs.h"
3502 #include <$ac_hdr>
3503 EOF
3504 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3505 { (eval echo configure:3506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3506 ac_err=`grep -v '^ *+' conftest.out`
3507 if test -z "$ac_err"; then
3508   rm -rf conftest*
3509   eval "ac_cv_header_$ac_safe=yes"
3510 else
3511   echo "$ac_err" >&5
3512   echo "configure: failed program was:" >&5
3513   cat conftest.$ac_ext >&5
3514   rm -rf conftest*
3515   eval "ac_cv_header_$ac_safe=no"
3516 fi
3517 rm -f conftest*
3518 fi
3519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3520   echo "$ac_t""yes" 1>&6
3521     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3522   cat >> confdefs.h <<EOF
3523 #define $ac_tr_hdr 1
3524 EOF
3525  
3526 else
3527   echo "$ac_t""no" 1>&6
3528 fi
3529 done
3530
3531 if test $ac_cv_header_db_h = yes ; then
3532         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
3533 echo "configure:3534: checking if db.h is DB2" >&5
3534 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
3535   echo $ac_n "(cached) $ac_c" 1>&6
3536 else
3537   
3538                 cat > conftest.$ac_ext <<EOF
3539 #line 3540 "configure"
3540 #include "confdefs.h"
3541
3542 #                       include <db.h>
3543                         /* this check could be improved */
3544 #                       ifdef DB_VERSION_MAJOR
3545 #                               if DB_VERSION_MAJOR == 2
3546                                         __db_version_2
3547 #                               endif
3548 #                       endif
3549                 
3550 EOF
3551 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3552   egrep "__db_version_2" >/dev/null 2>&1; then
3553   rm -rf conftest*
3554   ol_cv_header_db2=yes
3555 else
3556   rm -rf conftest*
3557   ol_cv_header_db2=no
3558 fi
3559 rm -f conftest*
3560
3561 fi
3562
3563 echo "$ac_t""$ol_cv_header_db2" 1>&6
3564 else
3565         ol_cv_header_db2=no
3566 fi
3567
3568
3569  
3570  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
3571 echo "configure:3572: checking for Berkeley DB2" >&5
3572 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
3573   echo $ac_n "(cached) $ac_c" 1>&6
3574 else
3575   
3576         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
3577                 ol_cv_berkeley_db2=no
3578         else
3579                 ol_cv_berkeley_db2=yes
3580         fi
3581
3582 fi
3583
3584 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
3585  if test $ol_cv_berkeley_db2 = yes ; then
3586         cat >> confdefs.h <<\EOF
3587 #define HAVE_BERKELEY_DB2 1
3588 EOF
3589
3590  fi
3591
3592
3593         if test $ol_cv_berkeley_db2 = yes ; then
3594                 ol_link_ldbm=db2
3595                 ol_with_ldbm_api=db2
3596
3597                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2"
3598
3599                 if test $ol_with_ldbm_type = hash ; then
3600                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
3601                 else
3602                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
3603                 fi
3604
3605                                                 if test $ol_cv_lib_db2 != yes ; then
3606                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
3607                 fi
3608         fi
3609 fi
3610
3611 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
3612         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
3613 echo "configure:3614: checking for Berkeley DB library" >&5
3614 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
3615   echo $ac_n "(cached) $ac_c" 1>&6
3616 else
3617         ol_LIBS="$LIBS"
3618         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
3619 echo "configure:3620: checking for dbopen" >&5
3620 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
3621   echo $ac_n "(cached) $ac_c" 1>&6
3622 else
3623   cat > conftest.$ac_ext <<EOF
3624 #line 3625 "configure"
3625 #include "confdefs.h"
3626 /* System header to define __stub macros and hopefully few prototypes,
3627     which can conflict with char dbopen(); below.  */
3628 #include <assert.h>
3629 /* Override any gcc2 internal prototype to avoid an error.  */
3630 /* We use char because int might match the return type of a gcc2
3631     builtin and then its argument prototype would still apply.  */
3632 char dbopen();
3633
3634 int main() {
3635
3636 /* The GNU C library defines this for functions which it implements
3637     to always fail with ENOSYS.  Some functions are actually named
3638     something starting with __ and the normal name is an alias.  */
3639 #if defined (__stub_dbopen) || defined (__stub___dbopen)
3640 choke me
3641 #else
3642 dbopen();
3643 #endif
3644
3645 ; return 0; }
3646 EOF
3647 if { (eval echo configure:3648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3648   rm -rf conftest*
3649   eval "ac_cv_func_dbopen=yes"
3650 else
3651   echo "configure: failed program was:" >&5
3652   cat conftest.$ac_ext >&5
3653   rm -rf conftest*
3654   eval "ac_cv_func_dbopen=no"
3655 fi
3656 rm -f conftest*
3657 fi
3658
3659 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
3660   echo "$ac_t""yes" 1>&6
3661   ol_cv_lib_db=yes
3662 else
3663   echo "$ac_t""no" 1>&6
3664
3665                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
3666 echo "configure:3667: checking for dbopen in -ldb" >&5
3667 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
3668 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3669   echo $ac_n "(cached) $ac_c" 1>&6
3670 else
3671   ac_save_LIBS="$LIBS"
3672 LIBS="-ldb  $LIBS"
3673 cat > conftest.$ac_ext <<EOF
3674 #line 3675 "configure"
3675 #include "confdefs.h"
3676 /* Override any gcc2 internal prototype to avoid an error.  */
3677 /* We use char because int might match the return type of a gcc2
3678     builtin and then its argument prototype would still apply.  */
3679 char dbopen();
3680
3681 int main() {
3682 dbopen()
3683 ; return 0; }
3684 EOF
3685 if { (eval echo configure:3686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3686   rm -rf conftest*
3687   eval "ac_cv_lib_$ac_lib_var=yes"
3688 else
3689   echo "configure: failed program was:" >&5
3690   cat conftest.$ac_ext >&5
3691   rm -rf conftest*
3692   eval "ac_cv_lib_$ac_lib_var=no"
3693 fi
3694 rm -f conftest*
3695 LIBS="$ac_save_LIBS"
3696
3697 fi
3698 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3699   echo "$ac_t""yes" 1>&6
3700   ol_cv_lib_db=-ldb
3701 else
3702   echo "$ac_t""no" 1>&6
3703 ol_cv_lib_db=no
3704 fi
3705
3706         
3707 fi
3708
3709         LIBS="$ol_LIBS"
3710
3711 fi
3712
3713 echo "$ac_t""$ol_cv_lib_db" 1>&6
3714
3715
3716 for ac_hdr in db_185.h
3717 do
3718 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3719 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3720 echo "configure:3721: checking for $ac_hdr" >&5
3721 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3722   echo $ac_n "(cached) $ac_c" 1>&6
3723 else
3724   cat > conftest.$ac_ext <<EOF
3725 #line 3726 "configure"
3726 #include "confdefs.h"
3727 #include <$ac_hdr>
3728 EOF
3729 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3730 { (eval echo configure:3731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3731 ac_err=`grep -v '^ *+' conftest.out`
3732 if test -z "$ac_err"; then
3733   rm -rf conftest*
3734   eval "ac_cv_header_$ac_safe=yes"
3735 else
3736   echo "$ac_err" >&5
3737   echo "configure: failed program was:" >&5
3738   cat conftest.$ac_ext >&5
3739   rm -rf conftest*
3740   eval "ac_cv_header_$ac_safe=no"
3741 fi
3742 rm -f conftest*
3743 fi
3744 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3745   echo "$ac_t""yes" 1>&6
3746     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3747   cat >> confdefs.h <<EOF
3748 #define $ac_tr_hdr 1
3749 EOF
3750  
3751 else
3752   echo "$ac_t""no" 1>&6
3753 fi
3754 done
3755
3756 if test $ol_cv_header_db2 = yes ; then
3757         
3758         ol_cv_header_db=$ac_cv_header_db_185_h
3759 else
3760         ol_cv_header_db=$ac_cv_header_db_h
3761 fi
3762
3763
3764  
3765  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
3766 echo "configure:3767: checking for Berkeley DB" >&5
3767 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
3768   echo $ac_n "(cached) $ac_c" 1>&6
3769 else
3770   
3771         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
3772                 ol_cv_berkeley_db=no
3773         else
3774                 ol_cv_berkeley_db=yes
3775         fi
3776
3777 fi
3778
3779 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
3780  if test $ol_cv_berkeley_db = yes ; then
3781         cat >> confdefs.h <<\EOF
3782 #define HAVE_BERKELEY_DB 1
3783 EOF
3784
3785  fi
3786
3787
3788         if test $ol_cv_berkeley_db = yes ; then
3789                 ol_link_ldbm=db
3790                 ol_with_ldbm_api=db
3791
3792                 if test $ac_cv_header_db_185_h = yes ; then
3793                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2_COMPAT185"
3794                 fi
3795
3796                 if test $ol_with_ldbm_type = hash ; then
3797                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
3798                 else
3799                         LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
3800                 fi
3801
3802                                                 if test $ol_cv_lib_db != yes ; then
3803                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
3804                 fi
3805         fi
3806 fi
3807
3808 if test $ol_with_ldbm_api = manual ; then
3809                 $ol_link_ldbm=yes
3810
3811         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
3812
3813         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
3814 do
3815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3817 echo "configure:3818: checking for $ac_hdr" >&5
3818 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3819   echo $ac_n "(cached) $ac_c" 1>&6
3820 else
3821   cat > conftest.$ac_ext <<EOF
3822 #line 3823 "configure"
3823 #include "confdefs.h"
3824 #include <$ac_hdr>
3825 EOF
3826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3827 { (eval echo configure:3828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3828 ac_err=`grep -v '^ *+' conftest.out`
3829 if test -z "$ac_err"; then
3830   rm -rf conftest*
3831   eval "ac_cv_header_$ac_safe=yes"
3832 else
3833   echo "$ac_err" >&5
3834   echo "configure: failed program was:" >&5
3835   cat conftest.$ac_ext >&5
3836   rm -rf conftest*
3837   eval "ac_cv_header_$ac_safe=no"
3838 fi
3839 rm -f conftest*
3840 fi
3841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3842   echo "$ac_t""yes" 1>&6
3843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3844   cat >> confdefs.h <<EOF
3845 #define $ac_tr_hdr 1
3846 EOF
3847  
3848 else
3849   echo "$ac_t""no" 1>&6
3850 fi
3851 done
3852
3853 fi
3854
3855 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
3856         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2;
3857         $ol_with_ldbm_api=none
3858 fi
3859
3860 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
3861         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
3862 echo "configure:3863: checking for GDBM library" >&5
3863 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
3864   echo $ac_n "(cached) $ac_c" 1>&6
3865 else
3866         ol_LIBS="$LIBS"
3867         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
3868 echo "configure:3869: checking for gdbm_open" >&5
3869 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
3870   echo $ac_n "(cached) $ac_c" 1>&6
3871 else
3872   cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 /* System header to define __stub macros and hopefully few prototypes,
3876     which can conflict with char gdbm_open(); below.  */
3877 #include <assert.h>
3878 /* Override any gcc2 internal prototype to avoid an error.  */
3879 /* We use char because int might match the return type of a gcc2
3880     builtin and then its argument prototype would still apply.  */
3881 char gdbm_open();
3882
3883 int main() {
3884
3885 /* The GNU C library defines this for functions which it implements
3886     to always fail with ENOSYS.  Some functions are actually named
3887     something starting with __ and the normal name is an alias.  */
3888 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
3889 choke me
3890 #else
3891 gdbm_open();
3892 #endif
3893
3894 ; return 0; }
3895 EOF
3896 if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3897   rm -rf conftest*
3898   eval "ac_cv_func_gdbm_open=yes"
3899 else
3900   echo "configure: failed program was:" >&5
3901   cat conftest.$ac_ext >&5
3902   rm -rf conftest*
3903   eval "ac_cv_func_gdbm_open=no"
3904 fi
3905 rm -f conftest*
3906 fi
3907
3908 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
3909   echo "$ac_t""yes" 1>&6
3910   ol_cv_lib_gdbm=yes
3911 else
3912   echo "$ac_t""no" 1>&6
3913
3914                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
3915 echo "configure:3916: checking for gdbm_open in -lgdbm" >&5
3916 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
3917 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3918   echo $ac_n "(cached) $ac_c" 1>&6
3919 else
3920   ac_save_LIBS="$LIBS"
3921 LIBS="-lgdbm  $LIBS"
3922 cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925 /* Override any gcc2 internal prototype to avoid an error.  */
3926 /* We use char because int might match the return type of a gcc2
3927     builtin and then its argument prototype would still apply.  */
3928 char gdbm_open();
3929
3930 int main() {
3931 gdbm_open()
3932 ; return 0; }
3933 EOF
3934 if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3935   rm -rf conftest*
3936   eval "ac_cv_lib_$ac_lib_var=yes"
3937 else
3938   echo "configure: failed program was:" >&5
3939   cat conftest.$ac_ext >&5
3940   rm -rf conftest*
3941   eval "ac_cv_lib_$ac_lib_var=no"
3942 fi
3943 rm -f conftest*
3944 LIBS="$ac_save_LIBS"
3945
3946 fi
3947 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3948   echo "$ac_t""yes" 1>&6
3949   ol_cv_lib_gdbm=-lgdbm
3950 else
3951   echo "$ac_t""no" 1>&6
3952 ol_cv_lib_gdbm=no
3953 fi
3954
3955         
3956 fi
3957
3958         LIBS="$ol_LIBS"
3959
3960 fi
3961
3962 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
3963
3964
3965  for ac_hdr in gdbm.h
3966 do
3967 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3968 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3969 echo "configure:3970: checking for $ac_hdr" >&5
3970 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3971   echo $ac_n "(cached) $ac_c" 1>&6
3972 else
3973   cat > conftest.$ac_ext <<EOF
3974 #line 3975 "configure"
3975 #include "confdefs.h"
3976 #include <$ac_hdr>
3977 EOF
3978 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3979 { (eval echo configure:3980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3980 ac_err=`grep -v '^ *+' conftest.out`
3981 if test -z "$ac_err"; then
3982   rm -rf conftest*
3983   eval "ac_cv_header_$ac_safe=yes"
3984 else
3985   echo "$ac_err" >&5
3986   echo "configure: failed program was:" >&5
3987   cat conftest.$ac_ext >&5
3988   rm -rf conftest*
3989   eval "ac_cv_header_$ac_safe=no"
3990 fi
3991 rm -f conftest*
3992 fi
3993 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3994   echo "$ac_t""yes" 1>&6
3995     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3996   cat >> confdefs.h <<EOF
3997 #define $ac_tr_hdr 1
3998 EOF
3999  
4000 else
4001   echo "$ac_t""no" 1>&6
4002 fi
4003 done
4004
4005  echo $ac_n "checking for db""... $ac_c" 1>&6
4006 echo "configure:4007: checking for db" >&5
4007 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
4008   echo $ac_n "(cached) $ac_c" 1>&6
4009 else
4010   
4011         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
4012                 ol_cv_gdbm=no
4013         else
4014                 ol_cv_gdbm=yes
4015         fi
4016
4017 fi
4018
4019 echo "$ac_t""$ol_cv_gdbm" 1>&6
4020  if test $ol_cv_gdbm = yes ; then
4021         cat >> confdefs.h <<\EOF
4022 #define HAVE_GDBM 1
4023 EOF
4024
4025  fi
4026
4027
4028         if test $ol_cv_gdbm = yes ; then
4029                 ol_link_ldbm=gdbm
4030                 ol_with_ldbm_api=gdbm
4031
4032                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
4033
4034                 if test $ol_cv_lib_gdbm != yes ; then
4035                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
4036                 fi
4037         fi
4038 fi
4039
4040 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
4041         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
4042 echo "configure:4043: checking for NDBM library" >&5
4043 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
4044   echo $ac_n "(cached) $ac_c" 1>&6
4045 else
4046         ol_LIBS="$LIBS"
4047         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
4048 echo "configure:4049: checking for dbm_open" >&5
4049 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
4050   echo $ac_n "(cached) $ac_c" 1>&6
4051 else
4052   cat > conftest.$ac_ext <<EOF
4053 #line 4054 "configure"
4054 #include "confdefs.h"
4055 /* System header to define __stub macros and hopefully few prototypes,
4056     which can conflict with char dbm_open(); below.  */
4057 #include <assert.h>
4058 /* Override any gcc2 internal prototype to avoid an error.  */
4059 /* We use char because int might match the return type of a gcc2
4060     builtin and then its argument prototype would still apply.  */
4061 char dbm_open();
4062
4063 int main() {
4064
4065 /* The GNU C library defines this for functions which it implements
4066     to always fail with ENOSYS.  Some functions are actually named
4067     something starting with __ and the normal name is an alias.  */
4068 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
4069 choke me
4070 #else
4071 dbm_open();
4072 #endif
4073
4074 ; return 0; }
4075 EOF
4076 if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4077   rm -rf conftest*
4078   eval "ac_cv_func_dbm_open=yes"
4079 else
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   eval "ac_cv_func_dbm_open=no"
4084 fi
4085 rm -f conftest*
4086 fi
4087
4088 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
4089   echo "$ac_t""yes" 1>&6
4090   ol_cv_lib_ndbm=yes
4091 else
4092   echo "$ac_t""no" 1>&6
4093
4094                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
4095 echo "configure:4096: checking for dbm_open in -lndbm" >&5
4096 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
4097 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4098   echo $ac_n "(cached) $ac_c" 1>&6
4099 else
4100   ac_save_LIBS="$LIBS"
4101 LIBS="-lndbm  $LIBS"
4102 cat > conftest.$ac_ext <<EOF
4103 #line 4104 "configure"
4104 #include "confdefs.h"
4105 /* Override any gcc2 internal prototype to avoid an error.  */
4106 /* We use char because int might match the return type of a gcc2
4107     builtin and then its argument prototype would still apply.  */
4108 char dbm_open();
4109
4110 int main() {
4111 dbm_open()
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4115   rm -rf conftest*
4116   eval "ac_cv_lib_$ac_lib_var=yes"
4117 else
4118   echo "configure: failed program was:" >&5
4119   cat conftest.$ac_ext >&5
4120   rm -rf conftest*
4121   eval "ac_cv_lib_$ac_lib_var=no"
4122 fi
4123 rm -f conftest*
4124 LIBS="$ac_save_LIBS"
4125
4126 fi
4127 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4128   echo "$ac_t""yes" 1>&6
4129   ol_cv_lib_ndbm=-lndbm
4130 else
4131   echo "$ac_t""no" 1>&6
4132
4133                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
4134 echo "configure:4135: checking for dbm_open in -ldbm" >&5
4135 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
4136 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4137   echo $ac_n "(cached) $ac_c" 1>&6
4138 else
4139   ac_save_LIBS="$LIBS"
4140 LIBS="-ldbm  $LIBS"
4141 cat > conftest.$ac_ext <<EOF
4142 #line 4143 "configure"
4143 #include "confdefs.h"
4144 /* Override any gcc2 internal prototype to avoid an error.  */
4145 /* We use char because int might match the return type of a gcc2
4146     builtin and then its argument prototype would still apply.  */
4147 char dbm_open();
4148
4149 int main() {
4150 dbm_open()
4151 ; return 0; }
4152 EOF
4153 if { (eval echo configure:4154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4154   rm -rf conftest*
4155   eval "ac_cv_lib_$ac_lib_var=yes"
4156 else
4157   echo "configure: failed program was:" >&5
4158   cat conftest.$ac_ext >&5
4159   rm -rf conftest*
4160   eval "ac_cv_lib_$ac_lib_var=no"
4161 fi
4162 rm -f conftest*
4163 LIBS="$ac_save_LIBS"
4164
4165 fi
4166 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4167   echo "$ac_t""yes" 1>&6
4168   ol_cv_lib_ndbm=-ldbm
4169 else
4170   echo "$ac_t""no" 1>&6
4171 ol_cv_lib_ndbm=no
4172 fi
4173                 
4174 fi
4175
4176         
4177 fi
4178
4179         LIBS="$ol_LIBS"
4180
4181 fi
4182
4183 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
4184
4185
4186  for ac_hdr in ndbm.h
4187 do
4188 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4189 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4190 echo "configure:4191: checking for $ac_hdr" >&5
4191 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4192   echo $ac_n "(cached) $ac_c" 1>&6
4193 else
4194   cat > conftest.$ac_ext <<EOF
4195 #line 4196 "configure"
4196 #include "confdefs.h"
4197 #include <$ac_hdr>
4198 EOF
4199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4200 { (eval echo configure:4201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4201 ac_err=`grep -v '^ *+' conftest.out`
4202 if test -z "$ac_err"; then
4203   rm -rf conftest*
4204   eval "ac_cv_header_$ac_safe=yes"
4205 else
4206   echo "$ac_err" >&5
4207   echo "configure: failed program was:" >&5
4208   cat conftest.$ac_ext >&5
4209   rm -rf conftest*
4210   eval "ac_cv_header_$ac_safe=no"
4211 fi
4212 rm -f conftest*
4213 fi
4214 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4215   echo "$ac_t""yes" 1>&6
4216     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4217   cat >> confdefs.h <<EOF
4218 #define $ac_tr_hdr 1
4219 EOF
4220  
4221 else
4222   echo "$ac_t""no" 1>&6
4223 fi
4224 done
4225
4226  echo $ac_n "checking for db""... $ac_c" 1>&6
4227 echo "configure:4228: checking for db" >&5
4228 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
4229   echo $ac_n "(cached) $ac_c" 1>&6
4230 else
4231   
4232         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
4233                 ol_cv_ndbm=no
4234         else
4235                 ol_cv_ndbm=yes
4236         fi
4237
4238 fi
4239
4240 echo "$ac_t""$ol_cv_ndbm" 1>&6
4241  if test $ol_cv_ndbm = yes ; then
4242         cat >> confdefs.h <<\EOF
4243 #define HAVE_NDBM 1
4244 EOF
4245
4246  fi
4247
4248
4249         if test $ol_cv_ndbm = yes ; then
4250                 ol_link_ldbm=ndbm
4251                 ol_with_ldbm_api=ndbm
4252
4253                 if test $ol_with_ldbm_api = ndbm ; then
4254                         echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
4255                 fi
4256
4257                 LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_NDBM"
4258
4259                 if test $ol_cv_lib_ndbm != yes ; then
4260                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
4261                 fi
4262         fi
4263 fi
4264
4265 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
4266         echo "configure: warning: could not find suitable LDBM backend" 1>&2
4267         if test $ol_enable_ldbm = yes ; then
4268                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
4269         fi
4270
4271         echo "configure: warning: disabling LDBM" 1>&2
4272         $ol_enable_ldbm=no
4273 fi
4274
4275 if test $ol_enable_wrappers = yes ; then
4276         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
4277 echo "configure:4278: checking for hosts_access in -lwrap" >&5
4278 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
4279 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4280   echo $ac_n "(cached) $ac_c" 1>&6
4281 else
4282   ac_save_LIBS="$LIBS"
4283 LIBS="-lwrap  $LIBS"
4284 cat > conftest.$ac_ext <<EOF
4285 #line 4286 "configure"
4286 #include "confdefs.h"
4287 /* Override any gcc2 internal prototype to avoid an error.  */
4288 /* We use char because int might match the return type of a gcc2
4289     builtin and then its argument prototype would still apply.  */
4290 char hosts_access();
4291
4292 int main() {
4293 hosts_access()
4294 ; return 0; }
4295 EOF
4296 if { (eval echo configure:4297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4297   rm -rf conftest*
4298   eval "ac_cv_lib_$ac_lib_var=yes"
4299 else
4300   echo "configure: failed program was:" >&5
4301   cat conftest.$ac_ext >&5
4302   rm -rf conftest*
4303   eval "ac_cv_lib_$ac_lib_var=no"
4304 fi
4305 rm -f conftest*
4306 LIBS="$ac_save_LIBS"
4307
4308 fi
4309 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4310   echo "$ac_t""yes" 1>&6
4311   have_wrappers=yes
4312 else
4313   echo "$ac_t""no" 1>&6
4314 have_wrappers=no
4315 fi
4316
4317
4318         if test $have_wrappers = yes ; then
4319                 SLAPD_DEFS="$SLAPD_DEFS -DTCP_WRAPPERS"
4320                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
4321         else
4322                 echo "configure: warning: could not find -lwrap" 1>&2
4323                 if test $ol_enable_wrappers = yes ; then
4324                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
4325                 fi
4326
4327                 echo "configure: warning: disabling wrappers support" 1>&2
4328                 ol_enable_wrappers=no
4329         fi
4330
4331 fi
4332
4333 # ud needs termcap (should insert check here)
4334 ol_link_termcap=no
4335
4336 for ac_hdr in termcap.h ncurses.h
4337 do
4338 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4339 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4340 echo "configure:4341: checking for $ac_hdr" >&5
4341 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4342   echo $ac_n "(cached) $ac_c" 1>&6
4343 else
4344   cat > conftest.$ac_ext <<EOF
4345 #line 4346 "configure"
4346 #include "confdefs.h"
4347 #include <$ac_hdr>
4348 EOF
4349 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4350 { (eval echo configure:4351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4351 ac_err=`grep -v '^ *+' conftest.out`
4352 if test -z "$ac_err"; then
4353   rm -rf conftest*
4354   eval "ac_cv_header_$ac_safe=yes"
4355 else
4356   echo "$ac_err" >&5
4357   echo "configure: failed program was:" >&5
4358   cat conftest.$ac_ext >&5
4359   rm -rf conftest*
4360   eval "ac_cv_header_$ac_safe=no"
4361 fi
4362 rm -f conftest*
4363 fi
4364 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4365   echo "$ac_t""yes" 1>&6
4366     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4367   cat >> confdefs.h <<EOF
4368 #define $ac_tr_hdr 1
4369 EOF
4370  
4371 else
4372   echo "$ac_t""no" 1>&6
4373 fi
4374 done
4375
4376
4377 if test $ol_link_termcap = no ; then
4378         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
4379 echo "configure:4380: checking for tputs in -ltermcap" >&5
4380 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
4381 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4382   echo $ac_n "(cached) $ac_c" 1>&6
4383 else
4384   ac_save_LIBS="$LIBS"
4385 LIBS="-ltermcap  $LIBS"
4386 cat > conftest.$ac_ext <<EOF
4387 #line 4388 "configure"
4388 #include "confdefs.h"
4389 /* Override any gcc2 internal prototype to avoid an error.  */
4390 /* We use char because int might match the return type of a gcc2
4391     builtin and then its argument prototype would still apply.  */
4392 char tputs();
4393
4394 int main() {
4395 tputs()
4396 ; return 0; }
4397 EOF
4398 if { (eval echo configure:4399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4399   rm -rf conftest*
4400   eval "ac_cv_lib_$ac_lib_var=yes"
4401 else
4402   echo "configure: failed program was:" >&5
4403   cat conftest.$ac_ext >&5
4404   rm -rf conftest*
4405   eval "ac_cv_lib_$ac_lib_var=no"
4406 fi
4407 rm -f conftest*
4408 LIBS="$ac_save_LIBS"
4409
4410 fi
4411 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4412   echo "$ac_t""yes" 1>&6
4413   have_termcap=yes
4414 else
4415   echo "$ac_t""no" 1>&6
4416 have_termcap=no
4417 fi
4418
4419         if test $have_termcap = yes ; then
4420                 ol_link_termcap=yes
4421                 TERMCAP_LIBS=-ltermcap
4422         fi
4423 fi
4424
4425 if test $ol_link_termcap = no ; then
4426         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
4427 echo "configure:4428: checking for initscr in -lncurses" >&5
4428 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
4429 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4430   echo $ac_n "(cached) $ac_c" 1>&6
4431 else
4432   ac_save_LIBS="$LIBS"
4433 LIBS="-lncurses  $LIBS"
4434 cat > conftest.$ac_ext <<EOF
4435 #line 4436 "configure"
4436 #include "confdefs.h"
4437 /* Override any gcc2 internal prototype to avoid an error.  */
4438 /* We use char because int might match the return type of a gcc2
4439     builtin and then its argument prototype would still apply.  */
4440 char initscr();
4441
4442 int main() {
4443 initscr()
4444 ; return 0; }
4445 EOF
4446 if { (eval echo configure:4447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4447   rm -rf conftest*
4448   eval "ac_cv_lib_$ac_lib_var=yes"
4449 else
4450   echo "configure: failed program was:" >&5
4451   cat conftest.$ac_ext >&5
4452   rm -rf conftest*
4453   eval "ac_cv_lib_$ac_lib_var=no"
4454 fi
4455 rm -f conftest*
4456 LIBS="$ac_save_LIBS"
4457
4458 fi
4459 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4460   echo "$ac_t""yes" 1>&6
4461   have_ncurses=yes
4462 else
4463   echo "$ac_t""no" 1>&6
4464 have_ncurses=no
4465 fi
4466
4467         if test $have_ncurses = yes ; then
4468                 ol_link_termcap=yes
4469                 TERMCAP_LIBS=-lncurses
4470         fi
4471 fi
4472
4473 if test $ol_link_termcap = no ; then
4474         TERMCAP_DEFS="-DNOTERMCAP"
4475         TERMCAP_LIBS=
4476 fi
4477
4478 # FreeBSD (and others) have crypt(3) in -lcrypt
4479 if test $ol_enable_crypt != no ; then
4480         echo $ac_n "checking for crypt""... $ac_c" 1>&6
4481 echo "configure:4482: checking for crypt" >&5
4482 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
4483   echo $ac_n "(cached) $ac_c" 1>&6
4484 else
4485   cat > conftest.$ac_ext <<EOF
4486 #line 4487 "configure"
4487 #include "confdefs.h"
4488 /* System header to define __stub macros and hopefully few prototypes,
4489     which can conflict with char crypt(); below.  */
4490 #include <assert.h>
4491 /* Override any gcc2 internal prototype to avoid an error.  */
4492 /* We use char because int might match the return type of a gcc2
4493     builtin and then its argument prototype would still apply.  */
4494 char crypt();
4495
4496 int main() {
4497
4498 /* The GNU C library defines this for functions which it implements
4499     to always fail with ENOSYS.  Some functions are actually named
4500     something starting with __ and the normal name is an alias.  */
4501 #if defined (__stub_crypt) || defined (__stub___crypt)
4502 choke me
4503 #else
4504 crypt();
4505 #endif
4506
4507 ; return 0; }
4508 EOF
4509 if { (eval echo configure:4510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4510   rm -rf conftest*
4511   eval "ac_cv_func_crypt=yes"
4512 else
4513   echo "configure: failed program was:" >&5
4514   cat conftest.$ac_ext >&5
4515   rm -rf conftest*
4516   eval "ac_cv_func_crypt=no"
4517 fi
4518 rm -f conftest*
4519 fi
4520
4521 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
4522   echo "$ac_t""yes" 1>&6
4523   have_crypt=yes
4524 else
4525   echo "$ac_t""no" 1>&6
4526
4527                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
4528 echo "configure:4529: checking for crypt in -lcrypt" >&5
4529 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
4530 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4531   echo $ac_n "(cached) $ac_c" 1>&6
4532 else
4533   ac_save_LIBS="$LIBS"
4534 LIBS="-lcrypt  $LIBS"
4535 cat > conftest.$ac_ext <<EOF
4536 #line 4537 "configure"
4537 #include "confdefs.h"
4538 /* Override any gcc2 internal prototype to avoid an error.  */
4539 /* We use char because int might match the return type of a gcc2
4540     builtin and then its argument prototype would still apply.  */
4541 char crypt();
4542
4543 int main() {
4544 crypt()
4545 ; return 0; }
4546 EOF
4547 if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4548   rm -rf conftest*
4549   eval "ac_cv_lib_$ac_lib_var=yes"
4550 else
4551   echo "configure: failed program was:" >&5
4552   cat conftest.$ac_ext >&5
4553   rm -rf conftest*
4554   eval "ac_cv_lib_$ac_lib_var=no"
4555 fi
4556 rm -f conftest*
4557 LIBS="$ac_save_LIBS"
4558
4559 fi
4560 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4561   echo "$ac_t""yes" 1>&6
4562   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
4563                         have_crypt=yes
4564 else
4565   echo "$ac_t""no" 1>&6
4566 have_crypt=no
4567 fi
4568
4569 fi
4570
4571
4572         if test $have_crypt = yes ; then
4573                 LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
4574         else
4575                 echo "configure: warning: could not find crypt" 1>&2
4576                 if test $ol_enable_crypt = yes ; then
4577                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
4578                 fi
4579
4580                 echo "configure: warning: disabling crypt support" 1>&2
4581                 ol_enable_crypt=no
4582         fi
4583 fi
4584
4585 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4586 echo "configure:4587: checking for ANSI C header files" >&5
4587 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
4588   echo $ac_n "(cached) $ac_c" 1>&6
4589 else
4590   cat > conftest.$ac_ext <<EOF
4591 #line 4592 "configure"
4592 #include "confdefs.h"
4593 #include <stdlib.h>
4594 #include <stdarg.h>
4595 #include <string.h>
4596 #include <float.h>
4597 EOF
4598 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4599 { (eval echo configure:4600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4600 ac_err=`grep -v '^ *+' conftest.out`
4601 if test -z "$ac_err"; then
4602   rm -rf conftest*
4603   ac_cv_header_stdc=yes
4604 else
4605   echo "$ac_err" >&5
4606   echo "configure: failed program was:" >&5
4607   cat conftest.$ac_ext >&5
4608   rm -rf conftest*
4609   ac_cv_header_stdc=no
4610 fi
4611 rm -f conftest*
4612
4613 if test $ac_cv_header_stdc = yes; then
4614   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4615 cat > conftest.$ac_ext <<EOF
4616 #line 4617 "configure"
4617 #include "confdefs.h"
4618 #include <string.h>
4619 EOF
4620 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4621   egrep "memchr" >/dev/null 2>&1; then
4622   :
4623 else
4624   rm -rf conftest*
4625   ac_cv_header_stdc=no
4626 fi
4627 rm -f conftest*
4628
4629 fi
4630
4631 if test $ac_cv_header_stdc = yes; then
4632   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4633 cat > conftest.$ac_ext <<EOF
4634 #line 4635 "configure"
4635 #include "confdefs.h"
4636 #include <stdlib.h>
4637 EOF
4638 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4639   egrep "free" >/dev/null 2>&1; then
4640   :
4641 else
4642   rm -rf conftest*
4643   ac_cv_header_stdc=no
4644 fi
4645 rm -f conftest*
4646
4647 fi
4648
4649 if test $ac_cv_header_stdc = yes; then
4650   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4651 if test "$cross_compiling" = yes; then
4652   :
4653 else
4654   cat > conftest.$ac_ext <<EOF
4655 #line 4656 "configure"
4656 #include "confdefs.h"
4657 #include <ctype.h>
4658 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4659 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4660 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4661 int main () { int i; for (i = 0; i < 256; i++)
4662 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4663 exit (0); }
4664
4665 EOF
4666 if { (eval echo configure:4667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4667 then
4668   :
4669 else
4670   echo "configure: failed program was:" >&5
4671   cat conftest.$ac_ext >&5
4672   rm -fr conftest*
4673   ac_cv_header_stdc=no
4674 fi
4675 rm -fr conftest*
4676 fi
4677
4678 fi
4679 fi
4680
4681 echo "$ac_t""$ac_cv_header_stdc" 1>&6
4682 if test $ac_cv_header_stdc = yes; then
4683   cat >> confdefs.h <<\EOF
4684 #define STDC_HEADERS 1
4685 EOF
4686
4687 fi
4688
4689 ac_header_dirent=no
4690 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4691 do
4692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4693 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4694 echo "configure:4695: checking for $ac_hdr that defines DIR" >&5
4695 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
4696   echo $ac_n "(cached) $ac_c" 1>&6
4697 else
4698   cat > conftest.$ac_ext <<EOF
4699 #line 4700 "configure"
4700 #include "confdefs.h"
4701 #include <sys/types.h>
4702 #include <$ac_hdr>
4703 int main() {
4704 DIR *dirp = 0;
4705 ; return 0; }
4706 EOF
4707 if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4708   rm -rf conftest*
4709   eval "ac_cv_header_dirent_$ac_safe=yes"
4710 else
4711   echo "configure: failed program was:" >&5
4712   cat conftest.$ac_ext >&5
4713   rm -rf conftest*
4714   eval "ac_cv_header_dirent_$ac_safe=no"
4715 fi
4716 rm -f conftest*
4717 fi
4718 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4719   echo "$ac_t""yes" 1>&6
4720     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4721   cat >> confdefs.h <<EOF
4722 #define $ac_tr_hdr 1
4723 EOF
4724  ac_header_dirent=$ac_hdr; break
4725 else
4726   echo "$ac_t""no" 1>&6
4727 fi
4728 done
4729 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4730 if test $ac_header_dirent = dirent.h; then
4731 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4732 echo "configure:4733: checking for opendir in -ldir" >&5
4733 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
4734 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4735   echo $ac_n "(cached) $ac_c" 1>&6
4736 else
4737   ac_save_LIBS="$LIBS"
4738 LIBS="-ldir  $LIBS"
4739 cat > conftest.$ac_ext <<EOF
4740 #line 4741 "configure"
4741 #include "confdefs.h"
4742 /* Override any gcc2 internal prototype to avoid an error.  */
4743 /* We use char because int might match the return type of a gcc2
4744     builtin and then its argument prototype would still apply.  */
4745 char opendir();
4746
4747 int main() {
4748 opendir()
4749 ; return 0; }
4750 EOF
4751 if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4752   rm -rf conftest*
4753   eval "ac_cv_lib_$ac_lib_var=yes"
4754 else
4755   echo "configure: failed program was:" >&5
4756   cat conftest.$ac_ext >&5
4757   rm -rf conftest*
4758   eval "ac_cv_lib_$ac_lib_var=no"
4759 fi
4760 rm -f conftest*
4761 LIBS="$ac_save_LIBS"
4762
4763 fi
4764 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4765   echo "$ac_t""yes" 1>&6
4766   LIBS="$LIBS -ldir"
4767 else
4768   echo "$ac_t""no" 1>&6
4769 fi
4770
4771 else
4772 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4773 echo "configure:4774: checking for opendir in -lx" >&5
4774 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
4775 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4776   echo $ac_n "(cached) $ac_c" 1>&6
4777 else
4778   ac_save_LIBS="$LIBS"
4779 LIBS="-lx  $LIBS"
4780 cat > conftest.$ac_ext <<EOF
4781 #line 4782 "configure"
4782 #include "confdefs.h"
4783 /* Override any gcc2 internal prototype to avoid an error.  */
4784 /* We use char because int might match the return type of a gcc2
4785     builtin and then its argument prototype would still apply.  */
4786 char opendir();
4787
4788 int main() {
4789 opendir()
4790 ; return 0; }
4791 EOF
4792 if { (eval echo configure:4793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4793   rm -rf conftest*
4794   eval "ac_cv_lib_$ac_lib_var=yes"
4795 else
4796   echo "configure: failed program was:" >&5
4797   cat conftest.$ac_ext >&5
4798   rm -rf conftest*
4799   eval "ac_cv_lib_$ac_lib_var=no"
4800 fi
4801 rm -f conftest*
4802 LIBS="$ac_save_LIBS"
4803
4804 fi
4805 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4806   echo "$ac_t""yes" 1>&6
4807   LIBS="$LIBS -lx"
4808 else
4809   echo "$ac_t""no" 1>&6
4810 fi
4811
4812 fi
4813
4814 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4815 echo "configure:4816: checking for sys/wait.h that is POSIX.1 compatible" >&5
4816 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
4817   echo $ac_n "(cached) $ac_c" 1>&6
4818 else
4819   cat > conftest.$ac_ext <<EOF
4820 #line 4821 "configure"
4821 #include "confdefs.h"
4822 #include <sys/types.h>
4823 #include <sys/wait.h>
4824 #ifndef WEXITSTATUS
4825 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4826 #endif
4827 #ifndef WIFEXITED
4828 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4829 #endif
4830 int main() {
4831 int s;
4832 wait (&s);
4833 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4834 ; return 0; }
4835 EOF
4836 if { (eval echo configure:4837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4837   rm -rf conftest*
4838   ac_cv_header_sys_wait_h=yes
4839 else
4840   echo "configure: failed program was:" >&5
4841   cat conftest.$ac_ext >&5
4842   rm -rf conftest*
4843   ac_cv_header_sys_wait_h=no
4844 fi
4845 rm -f conftest*
4846 fi
4847
4848 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4849 if test $ac_cv_header_sys_wait_h = yes; then
4850   cat >> confdefs.h <<\EOF
4851 #define HAVE_SYS_WAIT_H 1
4852 EOF
4853
4854 fi
4855
4856 for ac_hdr in \
4857         stddef.h        \
4858         fcntl.h         \
4859         filio.h         \
4860         limits.h        \
4861         malloc.h        \
4862         sgtty.h         \
4863         sys/file.h      \
4864         sys/ioctl.h     \
4865         sys/time.h      \
4866         syslog.h        \
4867         termio.h        \
4868         unistd.h        \
4869
4870 do
4871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4873 echo "configure:4874: checking for $ac_hdr" >&5
4874 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4875   echo $ac_n "(cached) $ac_c" 1>&6
4876 else
4877   cat > conftest.$ac_ext <<EOF
4878 #line 4879 "configure"
4879 #include "confdefs.h"
4880 #include <$ac_hdr>
4881 EOF
4882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4883 { (eval echo configure:4884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4884 ac_err=`grep -v '^ *+' conftest.out`
4885 if test -z "$ac_err"; then
4886   rm -rf conftest*
4887   eval "ac_cv_header_$ac_safe=yes"
4888 else
4889   echo "$ac_err" >&5
4890   echo "configure: failed program was:" >&5
4891   cat conftest.$ac_ext >&5
4892   rm -rf conftest*
4893   eval "ac_cv_header_$ac_safe=no"
4894 fi
4895 rm -f conftest*
4896 fi
4897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4898   echo "$ac_t""yes" 1>&6
4899     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4900   cat >> confdefs.h <<EOF
4901 #define $ac_tr_hdr 1
4902 EOF
4903  
4904 else
4905   echo "$ac_t""no" 1>&6
4906 fi
4907 done
4908
4909
4910 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
4911 echo "configure:4912: checking for uid_t in sys/types.h" >&5
4912 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
4913   echo $ac_n "(cached) $ac_c" 1>&6
4914 else
4915   cat > conftest.$ac_ext <<EOF
4916 #line 4917 "configure"
4917 #include "confdefs.h"
4918 #include <sys/types.h>
4919 EOF
4920 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4921   egrep "uid_t" >/dev/null 2>&1; then
4922   rm -rf conftest*
4923   ac_cv_type_uid_t=yes
4924 else
4925   rm -rf conftest*
4926   ac_cv_type_uid_t=no
4927 fi
4928 rm -f conftest*
4929
4930 fi
4931
4932 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
4933 if test $ac_cv_type_uid_t = no; then
4934   cat >> confdefs.h <<\EOF
4935 #define uid_t int
4936 EOF
4937
4938   cat >> confdefs.h <<\EOF
4939 #define gid_t int
4940 EOF
4941
4942 fi
4943
4944 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
4945 echo "configure:4946: checking type of array argument to getgroups" >&5
4946 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
4947   echo $ac_n "(cached) $ac_c" 1>&6
4948 else
4949   if test "$cross_compiling" = yes; then
4950   ac_cv_type_getgroups=cross
4951 else
4952   cat > conftest.$ac_ext <<EOF
4953 #line 4954 "configure"
4954 #include "confdefs.h"
4955
4956 /* Thanks to Mike Rendell for this test.  */
4957 #include <sys/types.h>
4958 #define NGID 256
4959 #undef MAX
4960 #define MAX(x, y) ((x) > (y) ? (x) : (y))
4961 main()
4962 {
4963   gid_t gidset[NGID];
4964   int i, n;
4965   union { gid_t gval; long lval; }  val;
4966
4967   val.lval = -1;
4968   for (i = 0; i < NGID; i++)
4969     gidset[i] = val.gval;
4970   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
4971                  gidset);
4972   /* Exit non-zero if getgroups seems to require an array of ints.  This
4973      happens when gid_t is short but getgroups modifies an array of ints.  */
4974   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
4975 }
4976
4977 EOF
4978 if { (eval echo configure:4979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4979 then
4980     ac_cv_type_getgroups=gid_t
4981 else
4982   echo "configure: failed program was:" >&5
4983   cat conftest.$ac_ext >&5
4984   rm -fr conftest*
4985   ac_cv_type_getgroups=int
4986 fi
4987 rm -fr conftest*
4988 fi
4989
4990 if test $ac_cv_type_getgroups = cross; then
4991         cat > conftest.$ac_ext <<EOF
4992 #line 4993 "configure"
4993 #include "confdefs.h"
4994 #include <unistd.h>
4995 EOF
4996 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4997   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
4998   rm -rf conftest*
4999   ac_cv_type_getgroups=gid_t
5000 else
5001   rm -rf conftest*
5002   ac_cv_type_getgroups=int
5003 fi
5004 rm -f conftest*
5005
5006 fi
5007 fi
5008
5009 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
5010 cat >> confdefs.h <<EOF
5011 #define GETGROUPS_T $ac_cv_type_getgroups
5012 EOF
5013
5014
5015 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
5016 echo "configure:5017: checking for mode_t" >&5
5017 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
5018   echo $ac_n "(cached) $ac_c" 1>&6
5019 else
5020   cat > conftest.$ac_ext <<EOF
5021 #line 5022 "configure"
5022 #include "confdefs.h"
5023 #include <sys/types.h>
5024 #if STDC_HEADERS
5025 #include <stdlib.h>
5026 #include <stddef.h>
5027 #endif
5028 EOF
5029 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5030   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5031   rm -rf conftest*
5032   ac_cv_type_mode_t=yes
5033 else
5034   rm -rf conftest*
5035   ac_cv_type_mode_t=no
5036 fi
5037 rm -f conftest*
5038
5039 fi
5040 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
5041 if test $ac_cv_type_mode_t = no; then
5042   cat >> confdefs.h <<\EOF
5043 #define mode_t int
5044 EOF
5045
5046 fi
5047
5048 echo $ac_n "checking for off_t""... $ac_c" 1>&6
5049 echo "configure:5050: checking for off_t" >&5
5050 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
5051   echo $ac_n "(cached) $ac_c" 1>&6
5052 else
5053   cat > conftest.$ac_ext <<EOF
5054 #line 5055 "configure"
5055 #include "confdefs.h"
5056 #include <sys/types.h>
5057 #if STDC_HEADERS
5058 #include <stdlib.h>
5059 #include <stddef.h>
5060 #endif
5061 EOF
5062 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5063   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5064   rm -rf conftest*
5065   ac_cv_type_off_t=yes
5066 else
5067   rm -rf conftest*
5068   ac_cv_type_off_t=no
5069 fi
5070 rm -f conftest*
5071
5072 fi
5073 echo "$ac_t""$ac_cv_type_off_t" 1>&6
5074 if test $ac_cv_type_off_t = no; then
5075   cat >> confdefs.h <<\EOF
5076 #define off_t long
5077 EOF
5078
5079 fi
5080
5081 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
5082 echo "configure:5083: checking for pid_t" >&5
5083 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   cat > conftest.$ac_ext <<EOF
5087 #line 5088 "configure"
5088 #include "confdefs.h"
5089 #include <sys/types.h>
5090 #if STDC_HEADERS
5091 #include <stdlib.h>
5092 #include <stddef.h>
5093 #endif
5094 EOF
5095 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5096   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5097   rm -rf conftest*
5098   ac_cv_type_pid_t=yes
5099 else
5100   rm -rf conftest*
5101   ac_cv_type_pid_t=no
5102 fi
5103 rm -f conftest*
5104
5105 fi
5106 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
5107 if test $ac_cv_type_pid_t = no; then
5108   cat >> confdefs.h <<\EOF
5109 #define pid_t int
5110 EOF
5111
5112 fi
5113
5114 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
5115 echo "configure:5116: checking return type of signal handlers" >&5
5116 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
5117   echo $ac_n "(cached) $ac_c" 1>&6
5118 else
5119   cat > conftest.$ac_ext <<EOF
5120 #line 5121 "configure"
5121 #include "confdefs.h"
5122 #include <sys/types.h>
5123 #include <signal.h>
5124 #ifdef signal
5125 #undef signal
5126 #endif
5127 #ifdef __cplusplus
5128 extern "C" void (*signal (int, void (*)(int)))(int);
5129 #else
5130 void (*signal ()) ();
5131 #endif
5132
5133 int main() {
5134 int i;
5135 ; return 0; }
5136 EOF
5137 if { (eval echo configure:5138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5138   rm -rf conftest*
5139   ac_cv_type_signal=void
5140 else
5141   echo "configure: failed program was:" >&5
5142   cat conftest.$ac_ext >&5
5143   rm -rf conftest*
5144   ac_cv_type_signal=int
5145 fi
5146 rm -f conftest*
5147 fi
5148
5149 echo "$ac_t""$ac_cv_type_signal" 1>&6
5150 cat >> confdefs.h <<EOF
5151 #define RETSIGTYPE $ac_cv_type_signal
5152 EOF
5153
5154
5155 echo $ac_n "checking for size_t""... $ac_c" 1>&6
5156 echo "configure:5157: checking for size_t" >&5
5157 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
5158   echo $ac_n "(cached) $ac_c" 1>&6
5159 else
5160   cat > conftest.$ac_ext <<EOF
5161 #line 5162 "configure"
5162 #include "confdefs.h"
5163 #include <sys/types.h>
5164 #if STDC_HEADERS
5165 #include <stdlib.h>
5166 #include <stddef.h>
5167 #endif
5168 EOF
5169 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5170   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5171   rm -rf conftest*
5172   ac_cv_type_size_t=yes
5173 else
5174   rm -rf conftest*
5175   ac_cv_type_size_t=no
5176 fi
5177 rm -f conftest*
5178
5179 fi
5180 echo "$ac_t""$ac_cv_type_size_t" 1>&6
5181 if test $ac_cv_type_size_t = no; then
5182   cat >> confdefs.h <<\EOF
5183 #define size_t unsigned
5184 EOF
5185
5186 fi
5187
5188 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
5189 echo "configure:5190: checking for uid_t in sys/types.h" >&5
5190 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
5191   echo $ac_n "(cached) $ac_c" 1>&6
5192 else
5193   cat > conftest.$ac_ext <<EOF
5194 #line 5195 "configure"
5195 #include "confdefs.h"
5196 #include <sys/types.h>
5197 EOF
5198 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5199   egrep "uid_t" >/dev/null 2>&1; then
5200   rm -rf conftest*
5201   ac_cv_type_uid_t=yes
5202 else
5203   rm -rf conftest*
5204   ac_cv_type_uid_t=no
5205 fi
5206 rm -f conftest*
5207
5208 fi
5209
5210 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
5211 if test $ac_cv_type_uid_t = no; then
5212   cat >> confdefs.h <<\EOF
5213 #define uid_t int
5214 EOF
5215
5216   cat >> confdefs.h <<\EOF
5217 #define gid_t int
5218 EOF
5219
5220 fi
5221
5222 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
5223 echo "configure:5224: checking for st_blksize in struct stat" >&5
5224 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
5225   echo $ac_n "(cached) $ac_c" 1>&6
5226 else
5227   cat > conftest.$ac_ext <<EOF
5228 #line 5229 "configure"
5229 #include "confdefs.h"
5230 #include <sys/types.h>
5231 #include <sys/stat.h>
5232 int main() {
5233 struct stat s; s.st_blksize;
5234 ; return 0; }
5235 EOF
5236 if { (eval echo configure:5237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5237   rm -rf conftest*
5238   ac_cv_struct_st_blksize=yes
5239 else
5240   echo "configure: failed program was:" >&5
5241   cat conftest.$ac_ext >&5
5242   rm -rf conftest*
5243   ac_cv_struct_st_blksize=no
5244 fi
5245 rm -f conftest*
5246 fi
5247
5248 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
5249 if test $ac_cv_struct_st_blksize = yes; then
5250   cat >> confdefs.h <<\EOF
5251 #define HAVE_ST_BLKSIZE 1
5252 EOF
5253
5254 fi
5255
5256 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
5257 echo "configure:5258: checking whether time.h and sys/time.h may both be included" >&5
5258 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
5259   echo $ac_n "(cached) $ac_c" 1>&6
5260 else
5261   cat > conftest.$ac_ext <<EOF
5262 #line 5263 "configure"
5263 #include "confdefs.h"
5264 #include <sys/types.h>
5265 #include <sys/time.h>
5266 #include <time.h>
5267 int main() {
5268 struct tm *tp;
5269 ; return 0; }
5270 EOF
5271 if { (eval echo configure:5272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5272   rm -rf conftest*
5273   ac_cv_header_time=yes
5274 else
5275   echo "configure: failed program was:" >&5
5276   cat conftest.$ac_ext >&5
5277   rm -rf conftest*
5278   ac_cv_header_time=no
5279 fi
5280 rm -f conftest*
5281 fi
5282
5283 echo "$ac_t""$ac_cv_header_time" 1>&6
5284 if test $ac_cv_header_time = yes; then
5285   cat >> confdefs.h <<\EOF
5286 #define TIME_WITH_SYS_TIME 1
5287 EOF
5288
5289 fi
5290
5291 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
5292 echo "configure:5293: checking whether struct tm is in sys/time.h or time.h" >&5
5293 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
5294   echo $ac_n "(cached) $ac_c" 1>&6
5295 else
5296   cat > conftest.$ac_ext <<EOF
5297 #line 5298 "configure"
5298 #include "confdefs.h"
5299 #include <sys/types.h>
5300 #include <time.h>
5301 int main() {
5302 struct tm *tp; tp->tm_sec;
5303 ; return 0; }
5304 EOF
5305 if { (eval echo configure:5306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5306   rm -rf conftest*
5307   ac_cv_struct_tm=time.h
5308 else
5309   echo "configure: failed program was:" >&5
5310   cat conftest.$ac_ext >&5
5311   rm -rf conftest*
5312   ac_cv_struct_tm=sys/time.h
5313 fi
5314 rm -f conftest*
5315 fi
5316
5317 echo "$ac_t""$ac_cv_struct_tm" 1>&6
5318 if test $ac_cv_struct_tm = sys/time.h; then
5319   cat >> confdefs.h <<\EOF
5320 #define TM_IN_SYS_TIME 1
5321 EOF
5322
5323 fi
5324
5325
5326 echo $ac_n "checking for working const""... $ac_c" 1>&6
5327 echo "configure:5328: checking for working const" >&5
5328 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
5329   echo $ac_n "(cached) $ac_c" 1>&6
5330 else
5331   cat > conftest.$ac_ext <<EOF
5332 #line 5333 "configure"
5333 #include "confdefs.h"
5334
5335 int main() {
5336
5337 /* Ultrix mips cc rejects this.  */
5338 typedef int charset[2]; const charset x;
5339 /* SunOS 4.1.1 cc rejects this.  */
5340 char const *const *ccp;
5341 char **p;
5342 /* NEC SVR4.0.2 mips cc rejects this.  */
5343 struct point {int x, y;};
5344 static struct point const zero = {0,0};
5345 /* AIX XL C 1.02.0.0 rejects this.
5346    It does not let you subtract one const X* pointer from another in an arm
5347    of an if-expression whose if-part is not a constant expression */
5348 const char *g = "string";
5349 ccp = &g + (g ? g-g : 0);
5350 /* HPUX 7.0 cc rejects these. */
5351 ++ccp;
5352 p = (char**) ccp;
5353 ccp = (char const *const *) p;
5354 { /* SCO 3.2v4 cc rejects this.  */
5355   char *t;
5356   char const *s = 0 ? (char *) 0 : (char const *) 0;
5357
5358   *t++ = 0;
5359 }
5360 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
5361   int x[] = {25, 17};
5362   const int *foo = &x[0];
5363   ++foo;
5364 }
5365 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5366   typedef const int *iptr;
5367   iptr p = 0;
5368   ++p;
5369 }
5370 { /* AIX XL C 1.02.0.0 rejects this saying
5371      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5372   struct s { int j; const int *ap[3]; };
5373   struct s *b; b->j = 5;
5374 }
5375 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5376   const int foo = 10;
5377 }
5378
5379 ; return 0; }
5380 EOF
5381 if { (eval echo configure:5382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5382   rm -rf conftest*
5383   ac_cv_c_const=yes
5384 else
5385   echo "configure: failed program was:" >&5
5386   cat conftest.$ac_ext >&5
5387   rm -rf conftest*
5388   ac_cv_c_const=no
5389 fi
5390 rm -f conftest*
5391 fi
5392
5393 echo "$ac_t""$ac_cv_c_const" 1>&6
5394 if test $ac_cv_c_const = no; then
5395   cat >> confdefs.h <<\EOF
5396 #define const 
5397 EOF
5398
5399 fi
5400
5401
5402 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
5403 echo "configure:5404: checking for 8-bit clean memcmp" >&5
5404 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
5405   echo $ac_n "(cached) $ac_c" 1>&6
5406 else
5407   if test "$cross_compiling" = yes; then
5408   ac_cv_func_memcmp_clean=no
5409 else
5410   cat > conftest.$ac_ext <<EOF
5411 #line 5412 "configure"
5412 #include "confdefs.h"
5413
5414 main()
5415 {
5416   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
5417   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
5418 }
5419
5420 EOF
5421 if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5422 then
5423   ac_cv_func_memcmp_clean=yes
5424 else
5425   echo "configure: failed program was:" >&5
5426   cat conftest.$ac_ext >&5
5427   rm -fr conftest*
5428   ac_cv_func_memcmp_clean=no
5429 fi
5430 rm -fr conftest*
5431 fi
5432
5433 fi
5434
5435 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
5436 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
5437
5438 echo $ac_n "checking for strftime""... $ac_c" 1>&6
5439 echo "configure:5440: checking for strftime" >&5
5440 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
5441   echo $ac_n "(cached) $ac_c" 1>&6
5442 else
5443   cat > conftest.$ac_ext <<EOF
5444 #line 5445 "configure"
5445 #include "confdefs.h"
5446 /* System header to define __stub macros and hopefully few prototypes,
5447     which can conflict with char strftime(); below.  */
5448 #include <assert.h>
5449 /* Override any gcc2 internal prototype to avoid an error.  */
5450 /* We use char because int might match the return type of a gcc2
5451     builtin and then its argument prototype would still apply.  */
5452 char strftime();
5453
5454 int main() {
5455
5456 /* The GNU C library defines this for functions which it implements
5457     to always fail with ENOSYS.  Some functions are actually named
5458     something starting with __ and the normal name is an alias.  */
5459 #if defined (__stub_strftime) || defined (__stub___strftime)
5460 choke me
5461 #else
5462 strftime();
5463 #endif
5464
5465 ; return 0; }
5466 EOF
5467 if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5468   rm -rf conftest*
5469   eval "ac_cv_func_strftime=yes"
5470 else
5471   echo "configure: failed program was:" >&5
5472   cat conftest.$ac_ext >&5
5473   rm -rf conftest*
5474   eval "ac_cv_func_strftime=no"
5475 fi
5476 rm -f conftest*
5477 fi
5478
5479 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
5480   echo "$ac_t""yes" 1>&6
5481   cat >> confdefs.h <<\EOF
5482 #define HAVE_STRFTIME 1
5483 EOF
5484
5485 else
5486   echo "$ac_t""no" 1>&6
5487 # strftime is in -lintl on SCO UNIX.
5488 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
5489 echo "configure:5490: checking for strftime in -lintl" >&5
5490 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
5491 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5492   echo $ac_n "(cached) $ac_c" 1>&6
5493 else
5494   ac_save_LIBS="$LIBS"
5495 LIBS="-lintl  $LIBS"
5496 cat > conftest.$ac_ext <<EOF
5497 #line 5498 "configure"
5498 #include "confdefs.h"
5499 /* Override any gcc2 internal prototype to avoid an error.  */
5500 /* We use char because int might match the return type of a gcc2
5501     builtin and then its argument prototype would still apply.  */
5502 char strftime();
5503
5504 int main() {
5505 strftime()
5506 ; return 0; }
5507 EOF
5508 if { (eval echo configure:5509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5509   rm -rf conftest*
5510   eval "ac_cv_lib_$ac_lib_var=yes"
5511 else
5512   echo "configure: failed program was:" >&5
5513   cat conftest.$ac_ext >&5
5514   rm -rf conftest*
5515   eval "ac_cv_lib_$ac_lib_var=no"
5516 fi
5517 rm -f conftest*
5518 LIBS="$ac_save_LIBS"
5519
5520 fi
5521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5522   echo "$ac_t""yes" 1>&6
5523   cat >> confdefs.h <<\EOF
5524 #define HAVE_STRFTIME 1
5525 EOF
5526
5527 LIBS="-lintl $LIBS"
5528 else
5529   echo "$ac_t""no" 1>&6
5530 fi
5531
5532 fi
5533
5534 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
5535 echo "configure:5536: checking for vprintf" >&5
5536 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
5537   echo $ac_n "(cached) $ac_c" 1>&6
5538 else
5539   cat > conftest.$ac_ext <<EOF
5540 #line 5541 "configure"
5541 #include "confdefs.h"
5542 /* System header to define __stub macros and hopefully few prototypes,
5543     which can conflict with char vprintf(); below.  */
5544 #include <assert.h>
5545 /* Override any gcc2 internal prototype to avoid an error.  */
5546 /* We use char because int might match the return type of a gcc2
5547     builtin and then its argument prototype would still apply.  */
5548 char vprintf();
5549
5550 int main() {
5551
5552 /* The GNU C library defines this for functions which it implements
5553     to always fail with ENOSYS.  Some functions are actually named
5554     something starting with __ and the normal name is an alias.  */
5555 #if defined (__stub_vprintf) || defined (__stub___vprintf)
5556 choke me
5557 #else
5558 vprintf();
5559 #endif
5560
5561 ; return 0; }
5562 EOF
5563 if { (eval echo configure:5564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5564   rm -rf conftest*
5565   eval "ac_cv_func_vprintf=yes"
5566 else
5567   echo "configure: failed program was:" >&5
5568   cat conftest.$ac_ext >&5
5569   rm -rf conftest*
5570   eval "ac_cv_func_vprintf=no"
5571 fi
5572 rm -f conftest*
5573 fi
5574
5575 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
5576   echo "$ac_t""yes" 1>&6
5577   cat >> confdefs.h <<\EOF
5578 #define HAVE_VPRINTF 1
5579 EOF
5580
5581 else
5582   echo "$ac_t""no" 1>&6
5583 fi
5584
5585 if test "$ac_cv_func_vprintf" != yes; then
5586 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
5587 echo "configure:5588: checking for _doprnt" >&5
5588 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
5589   echo $ac_n "(cached) $ac_c" 1>&6
5590 else
5591   cat > conftest.$ac_ext <<EOF
5592 #line 5593 "configure"
5593 #include "confdefs.h"
5594 /* System header to define __stub macros and hopefully few prototypes,
5595     which can conflict with char _doprnt(); below.  */
5596 #include <assert.h>
5597 /* Override any gcc2 internal prototype to avoid an error.  */
5598 /* We use char because int might match the return type of a gcc2
5599     builtin and then its argument prototype would still apply.  */
5600 char _doprnt();
5601
5602 int main() {
5603
5604 /* The GNU C library defines this for functions which it implements
5605     to always fail with ENOSYS.  Some functions are actually named
5606     something starting with __ and the normal name is an alias.  */
5607 #if defined (__stub__doprnt) || defined (__stub____doprnt)
5608 choke me
5609 #else
5610 _doprnt();
5611 #endif
5612
5613 ; return 0; }
5614 EOF
5615 if { (eval echo configure:5616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5616   rm -rf conftest*
5617   eval "ac_cv_func__doprnt=yes"
5618 else
5619   echo "configure: failed program was:" >&5
5620   cat conftest.$ac_ext >&5
5621   rm -rf conftest*
5622   eval "ac_cv_func__doprnt=no"
5623 fi
5624 rm -f conftest*
5625 fi
5626
5627 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
5628   echo "$ac_t""yes" 1>&6
5629   cat >> confdefs.h <<\EOF
5630 #define HAVE_DOPRNT 1
5631 EOF
5632
5633 else
5634   echo "$ac_t""no" 1>&6
5635 fi
5636
5637 fi
5638
5639 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
5640 echo "configure:5641: checking for wait3 that fills in rusage" >&5
5641 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
5642   echo $ac_n "(cached) $ac_c" 1>&6
5643 else
5644   if test "$cross_compiling" = yes; then
5645   ac_cv_func_wait3_rusage=no
5646 else
5647   cat > conftest.$ac_ext <<EOF
5648 #line 5649 "configure"
5649 #include "confdefs.h"
5650 #include <sys/types.h>
5651 #include <sys/time.h>
5652 #include <sys/resource.h>
5653 #include <stdio.h>
5654 /* HP-UX has wait3 but does not fill in rusage at all.  */
5655 main() {
5656   struct rusage r;
5657   int i;
5658   /* Use a field that we can force nonzero --
5659      voluntary context switches.
5660      For systems like NeXT and OSF/1 that don't set it,
5661      also use the system CPU time.  And page faults (I/O) for Linux.  */
5662   r.ru_nvcsw = 0;
5663   r.ru_stime.tv_sec = 0;
5664   r.ru_stime.tv_usec = 0;
5665   r.ru_majflt = r.ru_minflt = 0;
5666   switch (fork()) {
5667   case 0: /* Child.  */
5668     sleep(1); /* Give up the CPU.  */
5669     _exit(0);
5670   case -1: _exit(0); /* What can we do?  */
5671   default: /* Parent.  */
5672     wait3(&i, 0, &r);
5673     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
5674     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
5675          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
5676   }
5677 }
5678 EOF
5679 if { (eval echo configure:5680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5680 then
5681   ac_cv_func_wait3_rusage=yes
5682 else
5683   echo "configure: failed program was:" >&5
5684   cat conftest.$ac_ext >&5
5685   rm -fr conftest*
5686   ac_cv_func_wait3_rusage=no
5687 fi
5688 rm -fr conftest*
5689 fi
5690
5691 fi
5692
5693 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
5694 if test $ac_cv_func_wait3_rusage = yes; then
5695   cat >> confdefs.h <<\EOF
5696 #define HAVE_WAIT3 1
5697 EOF
5698
5699 fi
5700
5701
5702 for ac_func in \
5703         flock                   \
5704         gethostname             \
5705         gettimeofday    \
5706         getdtablesize   \
5707         lockf                   \
5708         memcpy                  \
5709         mktime                  \
5710         select                  \
5711         setpwfile               \
5712         setsid                  \
5713         signal                  \
5714         sigset                  \
5715         socket                  \
5716         strerror                \
5717         strstr                  \
5718         strrchr                 \
5719         strsep                  \
5720         strtod                  \
5721         strtol                  \
5722         strtoul                 \
5723         sysconf                 \
5724
5725 do
5726 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5727 echo "configure:5728: checking for $ac_func" >&5
5728 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5729   echo $ac_n "(cached) $ac_c" 1>&6
5730 else
5731   cat > conftest.$ac_ext <<EOF
5732 #line 5733 "configure"
5733 #include "confdefs.h"
5734 /* System header to define __stub macros and hopefully few prototypes,
5735     which can conflict with char $ac_func(); below.  */
5736 #include <assert.h>
5737 /* Override any gcc2 internal prototype to avoid an error.  */
5738 /* We use char because int might match the return type of a gcc2
5739     builtin and then its argument prototype would still apply.  */
5740 char $ac_func();
5741
5742 int main() {
5743
5744 /* The GNU C library defines this for functions which it implements
5745     to always fail with ENOSYS.  Some functions are actually named
5746     something starting with __ and the normal name is an alias.  */
5747 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5748 choke me
5749 #else
5750 $ac_func();
5751 #endif
5752
5753 ; return 0; }
5754 EOF
5755 if { (eval echo configure:5756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5756   rm -rf conftest*
5757   eval "ac_cv_func_$ac_func=yes"
5758 else
5759   echo "configure: failed program was:" >&5
5760   cat conftest.$ac_ext >&5
5761   rm -rf conftest*
5762   eval "ac_cv_func_$ac_func=no"
5763 fi
5764 rm -f conftest*
5765 fi
5766
5767 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5768   echo "$ac_t""yes" 1>&6
5769     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5770   cat >> confdefs.h <<EOF
5771 #define $ac_tr_func 1
5772 EOF
5773  
5774 else
5775   echo "$ac_t""no" 1>&6
5776 fi
5777 done
5778
5779
5780 for ac_func in strdup
5781 do
5782 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5783 echo "configure:5784: checking for $ac_func" >&5
5784 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5785   echo $ac_n "(cached) $ac_c" 1>&6
5786 else
5787   cat > conftest.$ac_ext <<EOF
5788 #line 5789 "configure"
5789 #include "confdefs.h"
5790 /* System header to define __stub macros and hopefully few prototypes,
5791     which can conflict with char $ac_func(); below.  */
5792 #include <assert.h>
5793 /* Override any gcc2 internal prototype to avoid an error.  */
5794 /* We use char because int might match the return type of a gcc2
5795     builtin and then its argument prototype would still apply.  */
5796 char $ac_func();
5797
5798 int main() {
5799
5800 /* The GNU C library defines this for functions which it implements
5801     to always fail with ENOSYS.  Some functions are actually named
5802     something starting with __ and the normal name is an alias.  */
5803 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5804 choke me
5805 #else
5806 $ac_func();
5807 #endif
5808
5809 ; return 0; }
5810 EOF
5811 if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5812   rm -rf conftest*
5813   eval "ac_cv_func_$ac_func=yes"
5814 else
5815   echo "configure: failed program was:" >&5
5816   cat conftest.$ac_ext >&5
5817   rm -rf conftest*
5818   eval "ac_cv_func_$ac_func=no"
5819 fi
5820 rm -f conftest*
5821 fi
5822
5823 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5824   echo "$ac_t""yes" 1>&6
5825     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5826   cat >> confdefs.h <<EOF
5827 #define $ac_tr_func 1
5828 EOF
5829  
5830 else
5831   echo "$ac_t""no" 1>&6
5832 LIBOBJS="$LIBOBJS ${ac_func}.o"
5833 fi
5834 done
5835
5836
5837
5838 # Check Configuration
5839
5840 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
5841 echo "configure:5842: checking declaration of sys_errlist" >&5
5842 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
5843   echo $ac_n "(cached) $ac_c" 1>&6
5844 else
5845   
5846         cat > conftest.$ac_ext <<EOF
5847 #line 5848 "configure"
5848 #include "confdefs.h"
5849
5850 #include <stdio.h>
5851 #include <sys/types.h>
5852 #include <errno.h> 
5853 int main() {
5854 char *c = (char *) *sys_errlist
5855 ; return 0; }
5856 EOF
5857 if { (eval echo configure:5858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5858   rm -rf conftest*
5859   ol_cv_dcl_sys_errlist=yes
5860 else
5861   echo "configure: failed program was:" >&5
5862   cat conftest.$ac_ext >&5
5863   rm -rf conftest*
5864   ol_cv_dcl_sys_errlist=no
5865 fi
5866 rm -f conftest*
5867 fi
5868
5869 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
5870
5871 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
5872 if test $ol_cv_dcl_sys_errlist = no ; then
5873         cat >> confdefs.h <<\EOF
5874 #define DECL_SYS_ERRLIST 1
5875 EOF
5876
5877         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
5878 echo "configure:5879: checking existence of sys_errlist" >&5
5879         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
5880   echo $ac_n "(cached) $ac_c" 1>&6
5881 else
5882   
5883                 cat > conftest.$ac_ext <<EOF
5884 #line 5885 "configure"
5885 #include "confdefs.h"
5886 #include <errno.h>
5887 int main() {
5888 char *c = (char *) *sys_errlist
5889 ; return 0; }
5890 EOF
5891 if { (eval echo configure:5892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5892   rm -rf conftest*
5893   ol_cv_have_sys_errlist=yes
5894 else
5895   echo "configure: failed program was:" >&5
5896   cat conftest.$ac_ext >&5
5897   rm -rf conftest*
5898   ol_cv_have_sys_errlist=no
5899 fi
5900 rm -f conftest*
5901 fi
5902
5903         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
5904 fi
5905
5906
5907
5908 if test $ol_enable_debug != no ; then
5909         LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
5910 fi
5911 if test $ol_enable_libui = yes ; then
5912         LDAP_DEFS="$LDAP_DEFS -DLDAP_LIBUI"
5913 fi
5914 if test $ol_enable_cache = no ; then
5915         LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
5916 fi
5917 if test $ol_enable_dns != no ; then
5918         LDAP_DEFS="$LDAP_DEFS -DLDAP_DNS"
5919 fi
5920 if test $ol_enable_referrals != no ; then
5921         LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
5922 fi
5923 if test $ol_enable_cldap != no ; then
5924         LDAP_DEFS="$LDAP_DEFS -DCLDAP"
5925 fi
5926
5927 if test $ol_enable_aclgroup != no ; then
5928         cat >> confdefs.h <<\EOF
5929 #define SLAPD_ACLGROUP 1
5930 EOF
5931
5932         SLAPD_DEFS="$SLAPD_DEFS -DACLGROUP"
5933 fi
5934
5935 if test $ol_enable_md5 != no ; then
5936         LUTIL_DEFS="$LUTIL_DEFS -DLDAP_MD5"
5937 fi
5938
5939 if test $ol_enable_sha1 != no ; then
5940         LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
5941 fi
5942
5943 if test $ol_enable_phonetic != no ; then
5944         cat >> confdefs.h <<\EOF
5945 #define SLAPD_PHONETIC 1
5946 EOF
5947
5948         SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
5949 fi
5950
5951 if test $ol_enable_rlookups != no ; then
5952         cat >> confdefs.h <<\EOF
5953 #define SLAPD_RLOOKUPS 1
5954 EOF
5955
5956         SLAPD_DEFS="$SLAPD_DEFS -DREVERSE_LOOKUPS"
5957 fi
5958
5959 if test $ol_link_ldbm != no ; then
5960         BUILD_SLAPD=yes
5961         BUILD_LDBM=yes
5962         LDBM_DEFS="-DLDAP_LDBM $LDBM_DEFS"
5963 fi
5964
5965 if test $ol_enable_passwd != no ; then
5966         BUILD_SLAPD=yes
5967         BUILD_PASSWD=yes
5968         SLAPD_DEFS="-DLDAP_PASSWD $SLAPD_DEFS"
5969 fi
5970
5971 if test $ol_enable_shell != no ; then
5972         BUILD_SLAPD=yes
5973         BUILD_SHELL=yes
5974         SLAPD_DEFS="-DLDAP_SHELL $SLAPD_DEFS"
5975 fi
5976
5977 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
5978         $BUILD_SLAPD = yes ; then
5979         BUILD_SLURPD=yes
5980 fi
5981
5982
5983
5984
5985   
5986   
5987   
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013 trap '' 1 2 15
6014 cat > confcache <<\EOF
6015 # This file is a shell script that caches the results of configure
6016 # tests run on this system so they can be shared between configure
6017 # scripts and configure runs.  It is not useful on other systems.
6018 # If it contains results you don't want to keep, you may remove or edit it.
6019 #
6020 # By default, configure uses ./config.cache as the cache file,
6021 # creating it if it does not exist already.  You can give configure
6022 # the --cache-file=FILE option to use a different cache file; that is
6023 # what configure does when it calls configure scripts in
6024 # subdirectories, so they share the cache.
6025 # Giving --cache-file=/dev/null disables caching, for debugging configure.
6026 # config.status only pays attention to the cache file if you give it the
6027 # --recheck option to rerun configure.
6028 #
6029 EOF
6030 # The following way of writing the cache mishandles newlines in values,
6031 # but we know of no workaround that is simple, portable, and efficient.
6032 # So, don't put newlines in cache variables' values.
6033 # Ultrix sh set writes to stderr and can't be redirected directly,
6034 # and sets the high bit in the cache file unless we assign to the vars.
6035 (set) 2>&1 |
6036   case `(ac_space=' '; set) 2>&1` in
6037   *ac_space=\ *)
6038     # `set' does not quote correctly, so add quotes (double-quote substitution
6039     # turns \\\\ into \\, and sed turns \\ into \).
6040     sed -n \
6041       -e "s/'/'\\\\''/g" \
6042       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
6043     ;;
6044   *)
6045     # `set' quotes correctly as required by POSIX, so do not add quotes.
6046     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
6047     ;;
6048   esac >> confcache
6049 if cmp -s $cache_file confcache; then
6050   :
6051 else
6052   if test -w $cache_file; then
6053     echo "updating cache $cache_file"
6054     cat confcache > $cache_file
6055   else
6056     echo "not updating unwritable cache $cache_file"
6057   fi
6058 fi
6059 rm -f confcache
6060
6061 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6062
6063 test "x$prefix" = xNONE && prefix=$ac_default_prefix
6064 # Let make expand exec_prefix.
6065 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6066
6067 # Any assignment to VPATH causes Sun make to only execute
6068 # the first set of double-colon rules, so remove it if not needed.
6069 # If there is a colon in the path, we need to keep it.
6070 if test "x$srcdir" = x.; then
6071   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
6072 fi
6073
6074 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6075
6076 DEFS=-DHAVE_CONFIG_H
6077
6078 # Without the "./", some shells look in PATH for config.status.
6079 : ${CONFIG_STATUS=./config.status}
6080
6081 echo creating $CONFIG_STATUS
6082 rm -f $CONFIG_STATUS
6083 cat > $CONFIG_STATUS <<EOF
6084 #! /bin/sh
6085 # Generated automatically by configure.
6086 # Run this file to recreate the current configuration.
6087 # This directory was configured as follows,
6088 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6089 #
6090 # $0 $ac_configure_args
6091 #
6092 # Compiler output produced by configure, useful for debugging
6093 # configure, is in ./config.log if it exists.
6094
6095 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
6096 for ac_option
6097 do
6098   case "\$ac_option" in
6099   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
6100     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
6101     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
6102   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
6103     echo "$CONFIG_STATUS generated by autoconf version 2.12"
6104     exit 0 ;;
6105   -help | --help | --hel | --he | --h)
6106     echo "\$ac_cs_usage"; exit 0 ;;
6107   *) echo "\$ac_cs_usage"; exit 1 ;;
6108   esac
6109 done
6110
6111 ac_given_srcdir=$srcdir
6112 ac_given_INSTALL="$INSTALL"
6113
6114 trap 'rm -fr `echo "\
6115 Makefile:build/top.mk:Makefile.in:build/dir.mk \
6116 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
6117 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
6118 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
6119 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
6120 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
6121 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
6122 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
6123 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
6124 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
6125 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
6126 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
6127 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
6128 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
6129 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
6130 include/Makefile:build/top.mk:include/Makefile.in \
6131 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
6132 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
6133 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
6134 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
6135 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
6136 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
6137 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
6138 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
6139 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
6140 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
6141 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
6142 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
6143 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
6144 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
6145 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
6146 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
6147 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
6148 tests/Makefile:build/top.mk:tests/Makefile.in \
6149  include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
6150 EOF
6151 cat >> $CONFIG_STATUS <<EOF
6152
6153 # Protect against being on the right side of a sed subst in config.status.
6154 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
6155  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
6156 $ac_vpsub
6157 $extrasub
6158 s%@CFLAGS@%$CFLAGS%g
6159 s%@CPPFLAGS@%$CPPFLAGS%g
6160 s%@CXXFLAGS@%$CXXFLAGS%g
6161 s%@DEFS@%$DEFS%g
6162 s%@LDFLAGS@%$LDFLAGS%g
6163 s%@LIBS@%$LIBS%g
6164 s%@exec_prefix@%$exec_prefix%g
6165 s%@prefix@%$prefix%g
6166 s%@program_transform_name@%$program_transform_name%g
6167 s%@bindir@%$bindir%g
6168 s%@sbindir@%$sbindir%g
6169 s%@libexecdir@%$libexecdir%g
6170 s%@datadir@%$datadir%g
6171 s%@sysconfdir@%$sysconfdir%g
6172 s%@sharedstatedir@%$sharedstatedir%g
6173 s%@localstatedir@%$localstatedir%g
6174 s%@libdir@%$libdir%g
6175 s%@includedir@%$includedir%g
6176 s%@oldincludedir@%$oldincludedir%g
6177 s%@infodir@%$infodir%g
6178 s%@mandir@%$mandir%g
6179 s%@CC@%$CC%g
6180 s%@CPP@%$CPP%g
6181 s%@LN_S@%$LN_S%g
6182 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
6183 s%@INSTALL_DATA@%$INSTALL_DATA%g
6184 s%@RANLIB@%$RANLIB%g
6185 s%@SET_MAKE@%$SET_MAKE%g
6186 s%@SENDMAIL@%$SENDMAIL%g
6187 s%@EDITOR@%$EDITOR%g
6188 s%@FINGER@%$FINGER%g
6189 s%@LIBOBJS@%$LIBOBJS%g
6190 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
6191 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
6192 s%@BUILD_LDBM@%$BUILD_LDBM%g
6193 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
6194 s%@BUILD_SHELL@%$BUILD_SHELL%g
6195 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
6196 s%@LDAP_DEFS@%$LDAP_DEFS%g
6197 s%@LDAP_LIBS@%$LDAP_LIBS%g
6198 s%@LDAPD_DEFS@%$LDAPD_DEFS%g
6199 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
6200 s%@SLAPD_DEFS@%$SLAPD_DEFS%g
6201 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
6202 s%@SLURPD_DEFS@%$SLURPD_DEFS%g
6203 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
6204 s%@LDBM_DEFS@%$LDBM_DEFS%g
6205 s%@LDBM_LIBS@%$LDBM_LIBS%g
6206 s%@LTHREAD_DEFS@%$LTHREAD_DEFS%g
6207 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
6208 s%@LUTIL_DEFS@%$LUTIL_DEFS%g
6209 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
6210 s%@KRB_DEFS@%$KRB_DEFS%g
6211 s%@KRB_LIBS@%$KRB_LIBS%g
6212 s%@TERMCAP_DEFS@%$TERMCAP_DEFS%g
6213 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
6214
6215 CEOF
6216 EOF
6217
6218 cat >> $CONFIG_STATUS <<\EOF
6219
6220 # Split the substitutions into bite-sized pieces for seds with
6221 # small command number limits, like on Digital OSF/1 and HP-UX.
6222 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
6223 ac_file=1 # Number of current file.
6224 ac_beg=1 # First line for current file.
6225 ac_end=$ac_max_sed_cmds # Line after last line for current file.
6226 ac_more_lines=:
6227 ac_sed_cmds=""
6228 while $ac_more_lines; do
6229   if test $ac_beg -gt 1; then
6230     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
6231   else
6232     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
6233   fi
6234   if test ! -s conftest.s$ac_file; then
6235     ac_more_lines=false
6236     rm -f conftest.s$ac_file
6237   else
6238     if test -z "$ac_sed_cmds"; then
6239       ac_sed_cmds="sed -f conftest.s$ac_file"
6240     else
6241       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
6242     fi
6243     ac_file=`expr $ac_file + 1`
6244     ac_beg=$ac_end
6245     ac_end=`expr $ac_end + $ac_max_sed_cmds`
6246   fi
6247 done
6248 if test -z "$ac_sed_cmds"; then
6249   ac_sed_cmds=cat
6250 fi
6251 EOF
6252
6253 cat >> $CONFIG_STATUS <<EOF
6254
6255 CONFIG_FILES=\${CONFIG_FILES-"\
6256 Makefile:build/top.mk:Makefile.in:build/dir.mk \
6257 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
6258 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
6259 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
6260 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
6261 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
6262 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
6263 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
6264 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
6265 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
6266 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
6267 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
6268 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
6269 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
6270 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
6271 include/Makefile:build/top.mk:include/Makefile.in \
6272 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
6273 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
6274 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
6275 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
6276 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
6277 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
6278 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
6279 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
6280 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
6281 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
6282 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
6283 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
6284 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
6285 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
6286 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
6287 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
6288 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
6289 tests/Makefile:build/top.mk:tests/Makefile.in \
6290 "}
6291 EOF
6292 cat >> $CONFIG_STATUS <<\EOF
6293 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
6294   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6295   case "$ac_file" in
6296   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6297        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6298   *) ac_file_in="${ac_file}.in" ;;
6299   esac
6300
6301   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
6302
6303   # Remove last slash and all that follows it.  Not all systems have dirname.
6304   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6305   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6306     # The file is in a subdirectory.
6307     test ! -d "$ac_dir" && mkdir "$ac_dir"
6308     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
6309     # A "../" for each directory in $ac_dir_suffix.
6310     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
6311   else
6312     ac_dir_suffix= ac_dots=
6313   fi
6314
6315   case "$ac_given_srcdir" in
6316   .)  srcdir=.
6317       if test -z "$ac_dots"; then top_srcdir=.
6318       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
6319   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
6320   *) # Relative path.
6321     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
6322     top_srcdir="$ac_dots$ac_given_srcdir" ;;
6323   esac
6324
6325   case "$ac_given_INSTALL" in
6326   [/$]*) INSTALL="$ac_given_INSTALL" ;;
6327   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
6328   esac
6329
6330   echo creating "$ac_file"
6331   rm -f "$ac_file"
6332   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
6333   case "$ac_file" in
6334   *Makefile*) ac_comsub="1i\\
6335 # $configure_input" ;;
6336   *) ac_comsub= ;;
6337   esac
6338
6339   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6340   sed -e "$ac_comsub
6341 s%@configure_input@%$configure_input%g
6342 s%@srcdir@%$srcdir%g
6343 s%@top_srcdir@%$top_srcdir%g
6344 s%@INSTALL@%$INSTALL%g
6345 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
6346 fi; done
6347 rm -f conftest.s*
6348
6349 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
6350 # NAME is the cpp macro being defined and VALUE is the value it is being given.
6351 #
6352 # ac_d sets the value in "#define NAME VALUE" lines.
6353 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
6354 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
6355 ac_dC='\3'
6356 ac_dD='%g'
6357 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
6358 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6359 ac_uB='\([      ]\)%\1#\2define\3'
6360 ac_uC=' '
6361 ac_uD='\4%g'
6362 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
6363 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6364 ac_eB='$%\1#\2define\3'
6365 ac_eC=' '
6366 ac_eD='%g'
6367
6368 if test "${CONFIG_HEADERS+set}" != set; then
6369 EOF
6370 cat >> $CONFIG_STATUS <<EOF
6371   CONFIG_HEADERS="include/portable.h"
6372 EOF
6373 cat >> $CONFIG_STATUS <<\EOF
6374 fi
6375 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
6376   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6377   case "$ac_file" in
6378   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6379        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6380   *) ac_file_in="${ac_file}.in" ;;
6381   esac
6382
6383   echo creating $ac_file
6384
6385   rm -f conftest.frag conftest.in conftest.out
6386   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6387   cat $ac_file_inputs > conftest.in
6388
6389 EOF
6390
6391 # Transform confdefs.h into a sed script conftest.vals that substitutes
6392 # the proper values into config.h.in to produce config.h.  And first:
6393 # Protect against being on the right side of a sed subst in config.status.
6394 # Protect against being in an unquoted here document in config.status.
6395 rm -f conftest.vals
6396 cat > conftest.hdr <<\EOF
6397 s/[\\&%]/\\&/g
6398 s%[\\$`]%\\&%g
6399 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
6400 s%ac_d%ac_u%gp
6401 s%ac_u%ac_e%gp
6402 EOF
6403 sed -n -f conftest.hdr confdefs.h > conftest.vals
6404 rm -f conftest.hdr
6405
6406 # This sed command replaces #undef with comments.  This is necessary, for
6407 # example, in the case of _POSIX_SOURCE, which is predefined and required
6408 # on some systems where configure will not decide to define it.
6409 cat >> conftest.vals <<\EOF
6410 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
6411 EOF
6412
6413 # Break up conftest.vals because some shells have a limit on
6414 # the size of here documents, and old seds have small limits too.
6415
6416 rm -f conftest.tail
6417 while :
6418 do
6419   ac_lines=`grep -c . conftest.vals`
6420   # grep -c gives empty output for an empty file on some AIX systems.
6421   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
6422   # Write a limited-size here document to conftest.frag.
6423   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
6424   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
6425   echo 'CEOF
6426   sed -f conftest.frag conftest.in > conftest.out
6427   rm -f conftest.in
6428   mv conftest.out conftest.in
6429 ' >> $CONFIG_STATUS
6430   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
6431   rm -f conftest.vals
6432   mv conftest.tail conftest.vals
6433 done
6434 rm -f conftest.vals
6435
6436 cat >> $CONFIG_STATUS <<\EOF
6437   rm -f conftest.frag conftest.h
6438   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
6439   cat conftest.in >> conftest.h
6440   rm -f conftest.in
6441   if cmp -s $ac_file conftest.h 2>/dev/null; then
6442     echo "$ac_file is unchanged"
6443     rm -f conftest.h
6444   else
6445     # Remove last slash and all that follows it.  Not all systems have dirname.
6446       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6447       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6448       # The file is in a subdirectory.
6449       test ! -d "$ac_dir" && mkdir "$ac_dir"
6450     fi
6451     rm -f $ac_file
6452     mv conftest.h $ac_file
6453   fi
6454 fi; done
6455
6456 EOF
6457 cat >> $CONFIG_STATUS <<EOF
6458
6459 EOF
6460 cat >> $CONFIG_STATUS <<\EOF
6461 date > stamp-h
6462 exit 0
6463 EOF
6464 chmod +x $CONFIG_STATUS
6465 rm -fr confdefs* $ac_clean_files
6466 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
6467