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