]> git.sur5r.net Git - openldap/blob - configure
Mongo patch: changes from -devel from 981105 snap to present
[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 # validate options
1131 if test $ol_enable_referrals = no ; then
1132         if test $ol_enable_dns = yes ; then
1133                 echo "configure: warning: dns disabled, ignoring --enable-dns argument" 1>&2
1134         fi
1135         ol_enable_dns=no
1136 fi
1137
1138 if test $ol_enable_slapd = no ; then
1139                 if test $ol_enable_ldbm = yes ; then
1140                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1141         fi
1142         if test $ol_enable_passwd = yes ; then
1143                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1144         fi
1145         if test $ol_enable_shell = yes ; then
1146                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1147         fi
1148         if test $ol_enable_aclgroups = yes ; then
1149                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1150         fi
1151         if test $ol_enable_crypt = yes ; then
1152                 echo "configure: warning: slapd disabled, ignoring --enable_crypt argument" 1>&2
1153         fi
1154         if test $ol_enable_md5 = yes ; then
1155                 echo "configure: warning: slapd disabled, ignoring --enable_md5 argument" 1>&2
1156         fi
1157         if test $ol_enable_sha1 = yes ; then
1158                 echo "configure: warning: slapd disabled, ignoring --enable_sha1 argument" 1>&2
1159         fi
1160         if test $ol_enable_wrappers = yes ; then
1161                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1162         fi
1163         if test $ol_enable_phonetic = yes ; then
1164                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1165         fi
1166         if test $ol_enable_rlookups = yes ; then
1167                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1168         fi
1169         if test $ol_with_ldbm_api != auto ; then
1170                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1171         fi
1172         if test $ol_with_ldbm_type != auto ; then
1173                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1174         fi
1175         if test $ol_enable_slurpd = yes ; then
1176                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1177         fi
1178
1179         # force settings to no
1180         ol_enable_ldbm=no
1181         ol_enable_shell=no
1182         ol_enable_passwd=no
1183         ol_enable_aclgroups=no
1184         ol_enable_crypt=no
1185         ol_enable_md5=no
1186         ol_enable_sha1=no
1187         ol_enable_wrappers=no
1188         ol_enable_phonetic=no
1189         ol_enable_rlookups=no
1190         ol_with_ldbm_api=no
1191         ol_with_ldbm_type=no
1192         ol_enable_slurpd=no
1193
1194 elif test $ol_enable_ldbm = no ; then
1195         
1196         if test $ol_with_ldbm_api != auto ; then
1197                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1198         fi
1199
1200         if test $ol_with_ldbm_type != auto ; then
1201                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1202         fi
1203
1204         if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
1205                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1206         fi
1207
1208         ol_with_ldbm_api=no
1209         ol_with_ldbm_type=no
1210
1211 else
1212         
1213         if test $ol_with_ldbm_api = gdbm -a \
1214                 $ol_with_ldbm_type = btree ; then
1215                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1216         fi
1217         if test $ol_with_ldbm_api = ndbm -a \
1218                 $ol_with_ldbm_type = btree ; then
1219                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1220         fi
1221 fi
1222
1223 if test $ol_enable_slurpd = yes ; then
1224                 if test $ol_with_threads = no ; then
1225                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1226         fi
1227 fi
1228
1229 echo "$ac_t""done" 1>&6
1230
1231 ## Initialize vars
1232 LDAP_LIBS=
1233 LDBM_LIBS=
1234 LTHREAD_LIBS=
1235 LUTIL_LIBS=
1236
1237 LDAPD_LIBS=
1238 SLAPD_LIBS=
1239 SLURPD_LIBS=
1240
1241 BUILD_LDAPD=no
1242 BUILD_SLAPD=no
1243 BUILD_SLURPD=no
1244
1245 BUILD_LDBM=no
1246 BUILD_PASSWD=no
1247 BUILD_SHELL=no
1248 BUILD_THREAD=no
1249
1250 KRB_LIBS=
1251 TERMCAP_LIBS=
1252
1253
1254 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1255 echo "configure:1256: checking whether ln -s works" >&5
1256 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1257   echo $ac_n "(cached) $ac_c" 1>&6
1258 else
1259   rm -f conftestdata
1260 if ln -s X conftestdata 2>/dev/null
1261 then
1262   rm -f conftestdata
1263   ac_cv_prog_LN_S="ln -s"
1264 else
1265   ac_cv_prog_LN_S=ln
1266 fi
1267 fi
1268 LN_S="$ac_cv_prog_LN_S"
1269 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1270   echo "$ac_t""yes" 1>&6
1271 else
1272   echo "$ac_t""no" 1>&6
1273 fi
1274
1275 # Find a good install program.  We prefer a C program (faster),
1276 # so one script is as good as another.  But avoid the broken or
1277 # incompatible versions:
1278 # SysV /etc/install, /usr/sbin/install
1279 # SunOS /usr/etc/install
1280 # IRIX /sbin/install
1281 # AIX /bin/install
1282 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1283 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1284 # ./install, which can be erroneously created by make from ./install.sh.
1285 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1286 echo "configure:1287: checking for a BSD compatible install" >&5
1287 if test -z "$INSTALL"; then
1288 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1289   echo $ac_n "(cached) $ac_c" 1>&6
1290 else
1291     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1292   for ac_dir in $PATH; do
1293     # Account for people who put trailing slashes in PATH elements.
1294     case "$ac_dir/" in
1295     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1296     *)
1297       # OSF1 and SCO ODT 3.0 have their own names for install.
1298       for ac_prog in ginstall installbsd scoinst install; do
1299         if test -f $ac_dir/$ac_prog; then
1300           if test $ac_prog = install &&
1301             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1302             # AIX install.  It has an incompatible calling convention.
1303             # OSF/1 installbsd also uses dspmsg, but is usable.
1304             :
1305           else
1306             ac_cv_path_install="$ac_dir/$ac_prog -c"
1307             break 2
1308           fi
1309         fi
1310       done
1311       ;;
1312     esac
1313   done
1314   IFS="$ac_save_IFS"
1315
1316 fi
1317   if test "${ac_cv_path_install+set}" = set; then
1318     INSTALL="$ac_cv_path_install"
1319   else
1320     # As a last resort, use the slow shell script.  We don't cache a
1321     # path for INSTALL within a source directory, because that will
1322     # break other packages using the cache if that directory is
1323     # removed, or if the path is relative.
1324     INSTALL="$ac_install_sh"
1325   fi
1326 fi
1327 echo "$ac_t""$INSTALL" 1>&6
1328
1329 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1330 # It thinks the first close brace ends the variable substitution.
1331 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1332
1333 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1334
1335 # Extract the first word of "ranlib", so it can be a program name with args.
1336 set dummy ranlib; ac_word=$2
1337 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1338 echo "configure:1339: checking for $ac_word" >&5
1339 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1340   echo $ac_n "(cached) $ac_c" 1>&6
1341 else
1342   if test -n "$RANLIB"; then
1343   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1344 else
1345   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1346   for ac_dir in $PATH; do
1347     test -z "$ac_dir" && ac_dir=.
1348     if test -f $ac_dir/$ac_word; then
1349       ac_cv_prog_RANLIB="ranlib"
1350       break
1351     fi
1352   done
1353   IFS="$ac_save_ifs"
1354   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1355 fi
1356 fi
1357 RANLIB="$ac_cv_prog_RANLIB"
1358 if test -n "$RANLIB"; then
1359   echo "$ac_t""$RANLIB" 1>&6
1360 else
1361   echo "$ac_t""no" 1>&6
1362 fi
1363
1364 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1365 echo "configure:1366: checking whether ${MAKE-make} sets \${MAKE}" >&5
1366 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1367 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1368   echo $ac_n "(cached) $ac_c" 1>&6
1369 else
1370   cat > conftestmake <<\EOF
1371 all:
1372         @echo 'ac_maketemp="${MAKE}"'
1373 EOF
1374 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1375 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1376 if test -n "$ac_maketemp"; then
1377   eval ac_cv_prog_make_${ac_make}_set=yes
1378 else
1379   eval ac_cv_prog_make_${ac_make}_set=no
1380 fi
1381 rm -f conftestmake
1382 fi
1383 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1384   echo "$ac_t""yes" 1>&6
1385   SET_MAKE=
1386 else
1387   echo "$ac_t""no" 1>&6
1388   SET_MAKE="MAKE=${MAKE-make}"
1389 fi
1390
1391
1392 # Extract the first word of "sendmail", so it can be a program name with args.
1393 set dummy sendmail; ac_word=$2
1394 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1395 echo "configure:1396: checking for $ac_word" >&5
1396 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
1397   echo $ac_n "(cached) $ac_c" 1>&6
1398 else
1399   case "$SENDMAIL" in
1400   /*)
1401   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
1402   ;;
1403   *)
1404   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1405   for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
1406     test -z "$ac_dir" && ac_dir=.
1407     if test -f $ac_dir/$ac_word; then
1408       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
1409       break
1410     fi
1411   done
1412   IFS="$ac_save_ifs"
1413   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
1414   ;;
1415 esac
1416 fi
1417 SENDMAIL="$ac_cv_path_SENDMAIL"
1418 if test -n "$SENDMAIL"; then
1419   echo "$ac_t""$SENDMAIL" 1>&6
1420 else
1421   echo "$ac_t""no" 1>&6
1422 fi
1423
1424 # Extract the first word of "vi", so it can be a program name with args.
1425 set dummy vi; ac_word=$2
1426 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1427 echo "configure:1428: checking for $ac_word" >&5
1428 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
1429   echo $ac_n "(cached) $ac_c" 1>&6
1430 else
1431   case "$EDITOR" in
1432   /*)
1433   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
1434   ;;
1435   *)
1436   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1437   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1438     test -z "$ac_dir" && ac_dir=.
1439     if test -f $ac_dir/$ac_word; then
1440       ac_cv_path_EDITOR="$ac_dir/$ac_word"
1441       break
1442     fi
1443   done
1444   IFS="$ac_save_ifs"
1445   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
1446   ;;
1447 esac
1448 fi
1449 EDITOR="$ac_cv_path_EDITOR"
1450 if test -n "$EDITOR"; then
1451   echo "$ac_t""$EDITOR" 1>&6
1452 else
1453   echo "$ac_t""no" 1>&6
1454 fi
1455
1456 # Extract the first word of "finger", so it can be a program name with args.
1457 set dummy finger; ac_word=$2
1458 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1459 echo "configure:1460: checking for $ac_word" >&5
1460 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
1461   echo $ac_n "(cached) $ac_c" 1>&6
1462 else
1463   case "$FINGER" in
1464   /*)
1465   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
1466   ;;
1467   *)
1468   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1469   for ac_dir in $PATH:/usr/ucb$ac_dummy; do
1470     test -z "$ac_dir" && ac_dir=.
1471     if test -f $ac_dir/$ac_word; then
1472       ac_cv_path_FINGER="$ac_dir/$ac_word"
1473       break
1474     fi
1475   done
1476   IFS="$ac_save_ifs"
1477   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
1478   ;;
1479 esac
1480 fi
1481 FINGER="$ac_cv_path_FINGER"
1482 if test -n "$FINGER"; then
1483   echo "$ac_t""$FINGER" 1>&6
1484 else
1485   echo "$ac_t""no" 1>&6
1486 fi
1487
1488
1489 # Extract the first word of "gcc", so it can be a program name with args.
1490 set dummy gcc; ac_word=$2
1491 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1492 echo "configure:1493: checking for $ac_word" >&5
1493 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1494   echo $ac_n "(cached) $ac_c" 1>&6
1495 else
1496   if test -n "$CC"; then
1497   ac_cv_prog_CC="$CC" # Let the user override the test.
1498 else
1499   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1500   for ac_dir in $PATH; do
1501     test -z "$ac_dir" && ac_dir=.
1502     if test -f $ac_dir/$ac_word; then
1503       ac_cv_prog_CC="gcc"
1504       break
1505     fi
1506   done
1507   IFS="$ac_save_ifs"
1508 fi
1509 fi
1510 CC="$ac_cv_prog_CC"
1511 if test -n "$CC"; then
1512   echo "$ac_t""$CC" 1>&6
1513 else
1514   echo "$ac_t""no" 1>&6
1515 fi
1516
1517 if test -z "$CC"; then
1518   # Extract the first word of "cc", so it can be a program name with args.
1519 set dummy cc; ac_word=$2
1520 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1521 echo "configure:1522: checking for $ac_word" >&5
1522 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1523   echo $ac_n "(cached) $ac_c" 1>&6
1524 else
1525   if test -n "$CC"; then
1526   ac_cv_prog_CC="$CC" # Let the user override the test.
1527 else
1528   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1529   ac_prog_rejected=no
1530   for ac_dir in $PATH; do
1531     test -z "$ac_dir" && ac_dir=.
1532     if test -f $ac_dir/$ac_word; then
1533       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1534         ac_prog_rejected=yes
1535         continue
1536       fi
1537       ac_cv_prog_CC="cc"
1538       break
1539     fi
1540   done
1541   IFS="$ac_save_ifs"
1542 if test $ac_prog_rejected = yes; then
1543   # We found a bogon in the path, so make sure we never use it.
1544   set dummy $ac_cv_prog_CC
1545   shift
1546   if test $# -gt 0; then
1547     # We chose a different compiler from the bogus one.
1548     # However, it has the same basename, so the bogon will be chosen
1549     # first if we set CC to just the basename; use the full file name.
1550     shift
1551     set dummy "$ac_dir/$ac_word" "$@"
1552     shift
1553     ac_cv_prog_CC="$@"
1554   fi
1555 fi
1556 fi
1557 fi
1558 CC="$ac_cv_prog_CC"
1559 if test -n "$CC"; then
1560   echo "$ac_t""$CC" 1>&6
1561 else
1562   echo "$ac_t""no" 1>&6
1563 fi
1564
1565   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1566 fi
1567
1568 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1569 echo "configure:1570: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1570
1571 ac_ext=c
1572 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1573 ac_cpp='$CPP $CPPFLAGS'
1574 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1575 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1576 cross_compiling=$ac_cv_prog_cc_cross
1577
1578 cat > conftest.$ac_ext <<EOF
1579 #line 1580 "configure"
1580 #include "confdefs.h"
1581 main(){return(0);}
1582 EOF
1583 if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1584   ac_cv_prog_cc_works=yes
1585   # If we can't run a trivial program, we are probably using a cross compiler.
1586   if (./conftest; exit) 2>/dev/null; then
1587     ac_cv_prog_cc_cross=no
1588   else
1589     ac_cv_prog_cc_cross=yes
1590   fi
1591 else
1592   echo "configure: failed program was:" >&5
1593   cat conftest.$ac_ext >&5
1594   ac_cv_prog_cc_works=no
1595 fi
1596 rm -fr conftest*
1597
1598 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1599 if test $ac_cv_prog_cc_works = no; then
1600   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1601 fi
1602 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1603 echo "configure:1604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1604 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1605 cross_compiling=$ac_cv_prog_cc_cross
1606
1607 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1608 echo "configure:1609: checking whether we are using GNU C" >&5
1609 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1610   echo $ac_n "(cached) $ac_c" 1>&6
1611 else
1612   cat > conftest.c <<EOF
1613 #ifdef __GNUC__
1614   yes;
1615 #endif
1616 EOF
1617 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1618   ac_cv_prog_gcc=yes
1619 else
1620   ac_cv_prog_gcc=no
1621 fi
1622 fi
1623
1624 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1625
1626 if test $ac_cv_prog_gcc = yes; then
1627   GCC=yes
1628   ac_test_CFLAGS="${CFLAGS+set}"
1629   ac_save_CFLAGS="$CFLAGS"
1630   CFLAGS=
1631   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1632 echo "configure:1633: checking whether ${CC-cc} accepts -g" >&5
1633 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1634   echo $ac_n "(cached) $ac_c" 1>&6
1635 else
1636   echo 'void f(){}' > conftest.c
1637 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1638   ac_cv_prog_cc_g=yes
1639 else
1640   ac_cv_prog_cc_g=no
1641 fi
1642 rm -f conftest*
1643
1644 fi
1645
1646 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1647   if test "$ac_test_CFLAGS" = set; then
1648     CFLAGS="$ac_save_CFLAGS"
1649   elif test $ac_cv_prog_cc_g = yes; then
1650     CFLAGS="-g -O2"
1651   else
1652     CFLAGS="-O2"
1653   fi
1654 else
1655   GCC=
1656   test "${CFLAGS+set}" = set || CFLAGS="-g"
1657 fi
1658
1659
1660 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
1661         echo "configure: warning: cross compiling....  go for it" 1>&2
1662
1663 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
1664         echo "configure: warning: programs compiled here do run here..." 1>&2
1665         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
1666
1667 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
1668         echo "configure: warning: programs compiled here do not run here..." 1>&2
1669         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
1670 fi
1671
1672 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1673 echo "configure:1674: checking how to run the C preprocessor" >&5
1674 # On Suns, sometimes $CPP names a directory.
1675 if test -n "$CPP" && test -d "$CPP"; then
1676   CPP=
1677 fi
1678 if test -z "$CPP"; then
1679 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1680   echo $ac_n "(cached) $ac_c" 1>&6
1681 else
1682     # This must be in double quotes, not single quotes, because CPP may get
1683   # substituted into the Makefile and "${CC-cc}" will confuse make.
1684   CPP="${CC-cc} -E"
1685   # On the NeXT, cc -E runs the code through the compiler's parser,
1686   # not just through cpp.
1687   cat > conftest.$ac_ext <<EOF
1688 #line 1689 "configure"
1689 #include "confdefs.h"
1690 #include <assert.h>
1691 Syntax Error
1692 EOF
1693 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1694 { (eval echo configure:1695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1695 ac_err=`grep -v '^ *+' conftest.out`
1696 if test -z "$ac_err"; then
1697   :
1698 else
1699   echo "$ac_err" >&5
1700   echo "configure: failed program was:" >&5
1701   cat conftest.$ac_ext >&5
1702   rm -rf conftest*
1703   CPP="${CC-cc} -E -traditional-cpp"
1704   cat > conftest.$ac_ext <<EOF
1705 #line 1706 "configure"
1706 #include "confdefs.h"
1707 #include <assert.h>
1708 Syntax Error
1709 EOF
1710 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1711 { (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1712 ac_err=`grep -v '^ *+' conftest.out`
1713 if test -z "$ac_err"; then
1714   :
1715 else
1716   echo "$ac_err" >&5
1717   echo "configure: failed program was:" >&5
1718   cat conftest.$ac_ext >&5
1719   rm -rf conftest*
1720   CPP=/lib/cpp
1721 fi
1722 rm -f conftest*
1723 fi
1724 rm -f conftest*
1725   ac_cv_prog_CPP="$CPP"
1726 fi
1727   CPP="$ac_cv_prog_CPP"
1728 else
1729   ac_cv_prog_CPP="$CPP"
1730 fi
1731 echo "$ac_t""$CPP" 1>&6
1732
1733
1734
1735 echo $ac_n "checking for AIX""... $ac_c" 1>&6
1736 echo "configure:1737: checking for AIX" >&5
1737 cat > conftest.$ac_ext <<EOF
1738 #line 1739 "configure"
1739 #include "confdefs.h"
1740 #ifdef _AIX
1741   yes
1742 #endif
1743
1744 EOF
1745 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1746   egrep "yes" >/dev/null 2>&1; then
1747   rm -rf conftest*
1748   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
1749 #define _ALL_SOURCE 1
1750 EOF
1751
1752 else
1753   rm -rf conftest*
1754   echo "$ac_t""no" 1>&6
1755 fi
1756 rm -f conftest*
1757
1758
1759 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1760 echo "configure:1761: checking for POSIXized ISC" >&5
1761 if test -d /etc/conf/kconfig.d &&
1762   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1763 then
1764   echo "$ac_t""yes" 1>&6
1765   ISC=yes # If later tests want to check for ISC.
1766   cat >> confdefs.h <<\EOF
1767 #define _POSIX_SOURCE 1
1768 EOF
1769
1770   if test "$GCC" = yes; then
1771     CC="$CC -posix"
1772   else
1773     CC="$CC -Xp"
1774   fi
1775 else
1776   echo "$ac_t""no" 1>&6
1777   ISC=
1778 fi
1779
1780 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
1781 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
1782 echo "configure:1783: checking for minix/config.h" >&5
1783 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1784   echo $ac_n "(cached) $ac_c" 1>&6
1785 else
1786   cat > conftest.$ac_ext <<EOF
1787 #line 1788 "configure"
1788 #include "confdefs.h"
1789 #include <minix/config.h>
1790 EOF
1791 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1792 { (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1793 ac_err=`grep -v '^ *+' conftest.out`
1794 if test -z "$ac_err"; then
1795   rm -rf conftest*
1796   eval "ac_cv_header_$ac_safe=yes"
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   eval "ac_cv_header_$ac_safe=no"
1803 fi
1804 rm -f conftest*
1805 fi
1806 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1807   echo "$ac_t""yes" 1>&6
1808   MINIX=yes
1809 else
1810   echo "$ac_t""no" 1>&6
1811 MINIX=
1812 fi
1813
1814 if test "$MINIX" = yes; then
1815   cat >> confdefs.h <<\EOF
1816 #define _POSIX_SOURCE 1
1817 EOF
1818
1819   cat >> confdefs.h <<\EOF
1820 #define _POSIX_1_SOURCE 2
1821 EOF
1822
1823   cat >> confdefs.h <<\EOF
1824 #define _MINIX 1
1825 EOF
1826
1827 fi
1828
1829
1830
1831
1832 echo $ac_n "checking for socket""... $ac_c" 1>&6
1833 echo "configure:1834: checking for socket" >&5
1834 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
1835   echo $ac_n "(cached) $ac_c" 1>&6
1836 else
1837   cat > conftest.$ac_ext <<EOF
1838 #line 1839 "configure"
1839 #include "confdefs.h"
1840 /* System header to define __stub macros and hopefully few prototypes,
1841     which can conflict with char socket(); below.  */
1842 #include <assert.h>
1843 /* Override any gcc2 internal prototype to avoid an error.  */
1844 /* We use char because int might match the return type of a gcc2
1845     builtin and then its argument prototype would still apply.  */
1846 char socket();
1847
1848 int main() {
1849
1850 /* The GNU C library defines this for functions which it implements
1851     to always fail with ENOSYS.  Some functions are actually named
1852     something starting with __ and the normal name is an alias.  */
1853 #if defined (__stub_socket) || defined (__stub___socket)
1854 choke me
1855 #else
1856 socket();
1857 #endif
1858
1859 ; return 0; }
1860 EOF
1861 if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1862   rm -rf conftest*
1863   eval "ac_cv_func_socket=yes"
1864 else
1865   echo "configure: failed program was:" >&5
1866   cat conftest.$ac_ext >&5
1867   rm -rf conftest*
1868   eval "ac_cv_func_socket=no"
1869 fi
1870 rm -f conftest*
1871 fi
1872
1873 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
1874   echo "$ac_t""yes" 1>&6
1875   :
1876 else
1877   echo "$ac_t""no" 1>&6
1878         
1879         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
1880 echo "configure:1881: checking for main in -lsocket" >&5
1881 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
1882 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1883   echo $ac_n "(cached) $ac_c" 1>&6
1884 else
1885   ac_save_LIBS="$LIBS"
1886 LIBS="-lsocket  $LIBS"
1887 cat > conftest.$ac_ext <<EOF
1888 #line 1889 "configure"
1889 #include "confdefs.h"
1890
1891 int main() {
1892 main()
1893 ; return 0; }
1894 EOF
1895 if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1896   rm -rf conftest*
1897   eval "ac_cv_lib_$ac_lib_var=yes"
1898 else
1899   echo "configure: failed program was:" >&5
1900   cat conftest.$ac_ext >&5
1901   rm -rf conftest*
1902   eval "ac_cv_lib_$ac_lib_var=no"
1903 fi
1904 rm -f conftest*
1905 LIBS="$ac_save_LIBS"
1906
1907 fi
1908 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1909   echo "$ac_t""yes" 1>&6
1910     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1911     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1912   cat >> confdefs.h <<EOF
1913 #define $ac_tr_lib 1
1914 EOF
1915
1916   LIBS="-lsocket $LIBS"
1917
1918 else
1919   echo "$ac_t""no" 1>&6
1920 fi
1921
1922         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
1923 echo "configure:1924: checking for main in -lnet" >&5
1924 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
1925 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1926   echo $ac_n "(cached) $ac_c" 1>&6
1927 else
1928   ac_save_LIBS="$LIBS"
1929 LIBS="-lnet  $LIBS"
1930 cat > conftest.$ac_ext <<EOF
1931 #line 1932 "configure"
1932 #include "confdefs.h"
1933
1934 int main() {
1935 main()
1936 ; return 0; }
1937 EOF
1938 if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1939   rm -rf conftest*
1940   eval "ac_cv_lib_$ac_lib_var=yes"
1941 else
1942   echo "configure: failed program was:" >&5
1943   cat conftest.$ac_ext >&5
1944   rm -rf conftest*
1945   eval "ac_cv_lib_$ac_lib_var=no"
1946 fi
1947 rm -f conftest*
1948 LIBS="$ac_save_LIBS"
1949
1950 fi
1951 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1952   echo "$ac_t""yes" 1>&6
1953     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1954     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1955   cat >> confdefs.h <<EOF
1956 #define $ac_tr_lib 1
1957 EOF
1958
1959   LIBS="-lnet $LIBS"
1960
1961 else
1962   echo "$ac_t""no" 1>&6
1963 fi
1964
1965         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
1966 echo "configure:1967: checking for main in -lnsl_s" >&5
1967 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
1968 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1969   echo $ac_n "(cached) $ac_c" 1>&6
1970 else
1971   ac_save_LIBS="$LIBS"
1972 LIBS="-lnsl_s  $LIBS"
1973 cat > conftest.$ac_ext <<EOF
1974 #line 1975 "configure"
1975 #include "confdefs.h"
1976
1977 int main() {
1978 main()
1979 ; return 0; }
1980 EOF
1981 if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1982   rm -rf conftest*
1983   eval "ac_cv_lib_$ac_lib_var=yes"
1984 else
1985   echo "configure: failed program was:" >&5
1986   cat conftest.$ac_ext >&5
1987   rm -rf conftest*
1988   eval "ac_cv_lib_$ac_lib_var=no"
1989 fi
1990 rm -f conftest*
1991 LIBS="$ac_save_LIBS"
1992
1993 fi
1994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1995   echo "$ac_t""yes" 1>&6
1996     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1997     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1998   cat >> confdefs.h <<EOF
1999 #define $ac_tr_lib 1
2000 EOF
2001
2002   LIBS="-lnsl_s $LIBS"
2003
2004 else
2005   echo "$ac_t""no" 1>&6
2006 fi
2007
2008         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
2009 echo "configure:2010: checking for main in -lnsl" >&5
2010 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
2011 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2012   echo $ac_n "(cached) $ac_c" 1>&6
2013 else
2014   ac_save_LIBS="$LIBS"
2015 LIBS="-lnsl  $LIBS"
2016 cat > conftest.$ac_ext <<EOF
2017 #line 2018 "configure"
2018 #include "confdefs.h"
2019
2020 int main() {
2021 main()
2022 ; return 0; }
2023 EOF
2024 if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2025   rm -rf conftest*
2026   eval "ac_cv_lib_$ac_lib_var=yes"
2027 else
2028   echo "configure: failed program was:" >&5
2029   cat conftest.$ac_ext >&5
2030   rm -rf conftest*
2031   eval "ac_cv_lib_$ac_lib_var=no"
2032 fi
2033 rm -f conftest*
2034 LIBS="$ac_save_LIBS"
2035
2036 fi
2037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2038   echo "$ac_t""yes" 1>&6
2039     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2040     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2041   cat >> confdefs.h <<EOF
2042 #define $ac_tr_lib 1
2043 EOF
2044
2045   LIBS="-lnsl $LIBS"
2046
2047 else
2048   echo "$ac_t""no" 1>&6
2049 fi
2050
2051         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
2052 echo "configure:2053: checking for socket in -linet" >&5
2053 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
2054 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2055   echo $ac_n "(cached) $ac_c" 1>&6
2056 else
2057   ac_save_LIBS="$LIBS"
2058 LIBS="-linet  $LIBS"
2059 cat > conftest.$ac_ext <<EOF
2060 #line 2061 "configure"
2061 #include "confdefs.h"
2062 /* Override any gcc2 internal prototype to avoid an error.  */
2063 /* We use char because int might match the return type of a gcc2
2064     builtin and then its argument prototype would still apply.  */
2065 char socket();
2066
2067 int main() {
2068 socket()
2069 ; return 0; }
2070 EOF
2071 if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2072   rm -rf conftest*
2073   eval "ac_cv_lib_$ac_lib_var=yes"
2074 else
2075   echo "configure: failed program was:" >&5
2076   cat conftest.$ac_ext >&5
2077   rm -rf conftest*
2078   eval "ac_cv_lib_$ac_lib_var=no"
2079 fi
2080 rm -f conftest*
2081 LIBS="$ac_save_LIBS"
2082
2083 fi
2084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2085   echo "$ac_t""yes" 1>&6
2086     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2087     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2088   cat >> confdefs.h <<EOF
2089 #define $ac_tr_lib 1
2090 EOF
2091
2092   LIBS="-linet $LIBS"
2093
2094 else
2095   echo "$ac_t""no" 1>&6
2096 fi
2097
2098         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
2099 echo "configure:2100: checking for main in -lgen" >&5
2100 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
2101 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2102   echo $ac_n "(cached) $ac_c" 1>&6
2103 else
2104   ac_save_LIBS="$LIBS"
2105 LIBS="-lgen  $LIBS"
2106 cat > conftest.$ac_ext <<EOF
2107 #line 2108 "configure"
2108 #include "confdefs.h"
2109
2110 int main() {
2111 main()
2112 ; return 0; }
2113 EOF
2114 if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2115   rm -rf conftest*
2116   eval "ac_cv_lib_$ac_lib_var=yes"
2117 else
2118   echo "configure: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   rm -rf conftest*
2121   eval "ac_cv_lib_$ac_lib_var=no"
2122 fi
2123 rm -f conftest*
2124 LIBS="$ac_save_LIBS"
2125
2126 fi
2127 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2128   echo "$ac_t""yes" 1>&6
2129     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2130     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2131   cat >> confdefs.h <<EOF
2132 #define $ac_tr_lib 1
2133 EOF
2134
2135   LIBS="-lgen $LIBS"
2136
2137 else
2138   echo "$ac_t""no" 1>&6
2139 fi
2140
2141
2142 fi
2143
2144
2145 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
2146 echo "configure:2147: checking for res_search in -lresolv" >&5
2147 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
2148 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2149   echo $ac_n "(cached) $ac_c" 1>&6
2150 else
2151   ac_save_LIBS="$LIBS"
2152 LIBS="-lresolv  $LIBS"
2153 cat > conftest.$ac_ext <<EOF
2154 #line 2155 "configure"
2155 #include "confdefs.h"
2156 /* Override any gcc2 internal prototype to avoid an error.  */
2157 /* We use char because int might match the return type of a gcc2
2158     builtin and then its argument prototype would still apply.  */
2159 char res_search();
2160
2161 int main() {
2162 res_search()
2163 ; return 0; }
2164 EOF
2165 if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2166   rm -rf conftest*
2167   eval "ac_cv_lib_$ac_lib_var=yes"
2168 else
2169   echo "configure: failed program was:" >&5
2170   cat conftest.$ac_ext >&5
2171   rm -rf conftest*
2172   eval "ac_cv_lib_$ac_lib_var=no"
2173 fi
2174 rm -f conftest*
2175 LIBS="$ac_save_LIBS"
2176
2177 fi
2178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2179   echo "$ac_t""yes" 1>&6
2180     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2181     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2182   cat >> confdefs.h <<EOF
2183 #define $ac_tr_lib 1
2184 EOF
2185
2186   LIBS="-lresolv $LIBS"
2187
2188 else
2189   echo "$ac_t""no" 1>&6
2190 fi
2191
2192
2193 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
2194 echo "configure:2195: checking for sigset in -lV3" >&5
2195 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
2196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2197   echo $ac_n "(cached) $ac_c" 1>&6
2198 else
2199   ac_save_LIBS="$LIBS"
2200 LIBS="-lV3  $LIBS"
2201 cat > conftest.$ac_ext <<EOF
2202 #line 2203 "configure"
2203 #include "confdefs.h"
2204 /* Override any gcc2 internal prototype to avoid an error.  */
2205 /* We use char because int might match the return type of a gcc2
2206     builtin and then its argument prototype would still apply.  */
2207 char sigset();
2208
2209 int main() {
2210 sigset()
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 V3 | 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="-lV3 $LIBS"
2235
2236 else
2237   echo "$ac_t""no" 1>&6
2238 fi
2239
2240
2241 # ISODE tests
2242 ol_link_isode=no
2243 if test $ol_enable_ldapd != no ; then
2244                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
2245 echo "configure:2246: checking for main in -lxtpp" >&5
2246 ac_lib_var=`echo xtpp'_'main | 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="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
2252 cat > conftest.$ac_ext <<EOF
2253 #line 2254 "configure"
2254 #include "confdefs.h"
2255
2256 int main() {
2257 main()
2258 ; return 0; }
2259 EOF
2260 if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2261   rm -rf conftest*
2262   eval "ac_cv_lib_$ac_lib_var=yes"
2263 else
2264   echo "configure: failed program was:" >&5
2265   cat conftest.$ac_ext >&5
2266   rm -rf conftest*
2267   eval "ac_cv_lib_$ac_lib_var=no"
2268 fi
2269 rm -f conftest*
2270 LIBS="$ac_save_LIBS"
2271
2272 fi
2273 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2274   echo "$ac_t""yes" 1>&6
2275   
2276                 ol_link_isode=yes
2277                 cat >> confdefs.h <<\EOF
2278 #define HAVE_XTPP 1
2279 EOF
2280
2281                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
2282                 
2283 else
2284   echo "$ac_t""no" 1>&6
2285 :
2286 fi
2287
2288         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
2289 echo "configure:2290: checking for main in -ldsap" >&5
2290 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
2291 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2292   echo $ac_n "(cached) $ac_c" 1>&6
2293 else
2294   ac_save_LIBS="$LIBS"
2295 LIBS="-ldsap -lisode $LIBS"
2296 cat > conftest.$ac_ext <<EOF
2297 #line 2298 "configure"
2298 #include "confdefs.h"
2299
2300 int main() {
2301 main()
2302 ; return 0; }
2303 EOF
2304 if { (eval echo configure:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2305   rm -rf conftest*
2306   eval "ac_cv_lib_$ac_lib_var=yes"
2307 else
2308   echo "configure: failed program was:" >&5
2309   cat conftest.$ac_ext >&5
2310   rm -rf conftest*
2311   eval "ac_cv_lib_$ac_lib_var=no"
2312 fi
2313 rm -f conftest*
2314 LIBS="$ac_save_LIBS"
2315
2316 fi
2317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2318   echo "$ac_t""yes" 1>&6
2319   
2320                 ol_link_isode=yes
2321                 cat >> confdefs.h <<\EOF
2322 #define HAVE_DSAP 1
2323 EOF
2324
2325                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
2326                 
2327 else
2328   echo "$ac_t""no" 1>&6
2329 :
2330 fi
2331
2332         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
2333 echo "configure:2334: checking for main in -lisode" >&5
2334 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
2335 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2336   echo $ac_n "(cached) $ac_c" 1>&6
2337 else
2338   ac_save_LIBS="$LIBS"
2339 LIBS="-lisode  $LIBS"
2340 cat > conftest.$ac_ext <<EOF
2341 #line 2342 "configure"
2342 #include "confdefs.h"
2343
2344 int main() {
2345 main()
2346 ; return 0; }
2347 EOF
2348 if { (eval echo configure:2349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2349   rm -rf conftest*
2350   eval "ac_cv_lib_$ac_lib_var=yes"
2351 else
2352   echo "configure: failed program was:" >&5
2353   cat conftest.$ac_ext >&5
2354   rm -rf conftest*
2355   eval "ac_cv_lib_$ac_lib_var=no"
2356 fi
2357 rm -f conftest*
2358 LIBS="$ac_save_LIBS"
2359
2360 fi
2361 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2362   echo "$ac_t""yes" 1>&6
2363   
2364                 ol_link_isode=yes
2365                 cat >> confdefs.h <<\EOF
2366 #define HAVE_ISODE 1
2367 EOF
2368
2369                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
2370                 
2371 else
2372   echo "$ac_t""no" 1>&6
2373 :
2374 fi
2375
2376 fi
2377
2378 if test $ol_link_isode != no; then
2379         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
2380 echo "configure:2381: checking for main in -lpp" >&5
2381 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
2382 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   ac_save_LIBS="$LIBS"
2386 LIBS="-lpp  $LIBS"
2387 cat > conftest.$ac_ext <<EOF
2388 #line 2389 "configure"
2389 #include "confdefs.h"
2390
2391 int main() {
2392 main()
2393 ; return 0; }
2394 EOF
2395 if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2396   rm -rf conftest*
2397   eval "ac_cv_lib_$ac_lib_var=yes"
2398 else
2399   echo "configure: failed program was:" >&5
2400   cat conftest.$ac_ext >&5
2401   rm -rf conftest*
2402   eval "ac_cv_lib_$ac_lib_var=no"
2403 fi
2404 rm -f conftest*
2405 LIBS="$ac_save_LIBS"
2406
2407 fi
2408 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2409   echo "$ac_t""yes" 1>&6
2410   
2411                 cat >> confdefs.h <<\EOF
2412 #define HAVE_PP 1
2413 EOF
2414
2415                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
2416                 
2417 else
2418   echo "$ac_t""no" 1>&6
2419 :
2420 fi
2421
2422
2423         # Extract the first word of "pepsy", so it can be a program name with args.
2424 set dummy pepsy; ac_word=$2
2425 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2426 echo "configure:2427: checking for $ac_word" >&5
2427 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
2428   echo $ac_n "(cached) $ac_c" 1>&6
2429 else
2430   case "$PEPSY" in
2431   /*)
2432   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
2433   ;;
2434   *)
2435   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2436   for ac_dir in $PATH; do
2437     test -z "$ac_dir" && ac_dir=.
2438     if test -f $ac_dir/$ac_word; then
2439       ac_cv_path_PEPSY="$ac_dir/$ac_word"
2440       break
2441     fi
2442   done
2443   IFS="$ac_save_ifs"
2444   ;;
2445 esac
2446 fi
2447 PEPSY="$ac_cv_path_PEPSY"
2448 if test -n "$PEPSY"; then
2449   echo "$ac_t""$PEPSY" 1>&6
2450 else
2451   echo "$ac_t""no" 1>&6
2452 fi
2453
2454 fi
2455
2456 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
2457         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
2458 do
2459 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2460 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2461 echo "configure:2462: checking for $ac_hdr" >&5
2462 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2463   echo $ac_n "(cached) $ac_c" 1>&6
2464 else
2465   cat > conftest.$ac_ext <<EOF
2466 #line 2467 "configure"
2467 #include "confdefs.h"
2468 #include <$ac_hdr>
2469 EOF
2470 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2471 { (eval echo configure:2472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2472 ac_err=`grep -v '^ *+' conftest.out`
2473 if test -z "$ac_err"; then
2474   rm -rf conftest*
2475   eval "ac_cv_header_$ac_safe=yes"
2476 else
2477   echo "$ac_err" >&5
2478   echo "configure: failed program was:" >&5
2479   cat conftest.$ac_ext >&5
2480   rm -rf conftest*
2481   eval "ac_cv_header_$ac_safe=no"
2482 fi
2483 rm -f conftest*
2484 fi
2485 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2486   echo "$ac_t""yes" 1>&6
2487     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2488   cat >> confdefs.h <<EOF
2489 #define $ac_tr_hdr 1
2490 EOF
2491  
2492 else
2493   echo "$ac_t""no" 1>&6
2494 fi
2495 done
2496
2497
2498         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
2499                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
2500 echo "configure:2501: checking for main in -lkrb4" >&5
2501 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
2502 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2503   echo $ac_n "(cached) $ac_c" 1>&6
2504 else
2505   ac_save_LIBS="$LIBS"
2506 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
2507 cat > conftest.$ac_ext <<EOF
2508 #line 2509 "configure"
2509 #include "confdefs.h"
2510
2511 int main() {
2512 main()
2513 ; return 0; }
2514 EOF
2515 if { (eval echo configure:2516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2516   rm -rf conftest*
2517   eval "ac_cv_lib_$ac_lib_var=yes"
2518 else
2519   echo "configure: failed program was:" >&5
2520   cat conftest.$ac_ext >&5
2521   rm -rf conftest*
2522   eval "ac_cv_lib_$ac_lib_var=no"
2523 fi
2524 rm -f conftest*
2525 LIBS="$ac_save_LIBS"
2526
2527 fi
2528 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2529   echo "$ac_t""yes" 1>&6
2530   have_k5=yes
2531 else
2532   echo "$ac_t""no" 1>&6
2533 have_k5=no
2534 fi
2535
2536
2537                 if test $have_k5 = yes ; then
2538                         ol_with_kerberos=found
2539                         ol_link_kerberos=yes
2540
2541                         cat >> confdefs.h <<\EOF
2542 #define HAVE_KERBEROS 1
2543 EOF
2544
2545
2546                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
2547                 fi
2548         fi
2549 fi
2550 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
2551         for ac_hdr in krb.h des.h
2552 do
2553 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2554 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2555 echo "configure:2556: checking for $ac_hdr" >&5
2556 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2557   echo $ac_n "(cached) $ac_c" 1>&6
2558 else
2559   cat > conftest.$ac_ext <<EOF
2560 #line 2561 "configure"
2561 #include "confdefs.h"
2562 #include <$ac_hdr>
2563 EOF
2564 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2565 { (eval echo configure:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2566 ac_err=`grep -v '^ *+' conftest.out`
2567 if test -z "$ac_err"; then
2568   rm -rf conftest*
2569   eval "ac_cv_header_$ac_safe=yes"
2570 else
2571   echo "$ac_err" >&5
2572   echo "configure: failed program was:" >&5
2573   cat conftest.$ac_ext >&5
2574   rm -rf conftest*
2575   eval "ac_cv_header_$ac_safe=no"
2576 fi
2577 rm -f conftest*
2578 fi
2579 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2580   echo "$ac_t""yes" 1>&6
2581     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2582   cat >> confdefs.h <<EOF
2583 #define $ac_tr_hdr 1
2584 EOF
2585  
2586 else
2587   echo "$ac_t""no" 1>&6
2588 fi
2589 done
2590
2591
2592         if test $ac_cv_header_krb_h = yes ; then
2593                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
2594 echo "configure:2595: checking for main in -lkrb" >&5
2595 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
2596 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2597   echo $ac_n "(cached) $ac_c" 1>&6
2598 else
2599   ac_save_LIBS="$LIBS"
2600 LIBS="-lkrb -ldes $LIBS"
2601 cat > conftest.$ac_ext <<EOF
2602 #line 2603 "configure"
2603 #include "confdefs.h"
2604
2605 int main() {
2606 main()
2607 ; return 0; }
2608 EOF
2609 if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2610   rm -rf conftest*
2611   eval "ac_cv_lib_$ac_lib_var=yes"
2612 else
2613   echo "configure: failed program was:" >&5
2614   cat conftest.$ac_ext >&5
2615   rm -rf conftest*
2616   eval "ac_cv_lib_$ac_lib_var=no"
2617 fi
2618 rm -f conftest*
2619 LIBS="$ac_save_LIBS"
2620
2621 fi
2622 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2623   echo "$ac_t""yes" 1>&6
2624   have_k4=yes
2625 else
2626   echo "$ac_t""no" 1>&6
2627 have_k4=no
2628 fi
2629
2630
2631                 if test $have_k4 = yes ; then
2632                         ol_with_kerberos=found
2633                         ol_link_kerberos=yes
2634
2635                         cat >> confdefs.h <<\EOF
2636 #define HAVE_KERBEROS 1
2637 EOF
2638
2639
2640                         KRB_LIBS="-lkrb -ldes"
2641                 fi
2642         fi
2643 fi
2644
2645
2646 ol_link_threads=no
2647 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
2648         for ac_hdr in pthread.h sched.h
2649 do
2650 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2651 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2652 echo "configure:2653: checking for $ac_hdr" >&5
2653 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2654   echo $ac_n "(cached) $ac_c" 1>&6
2655 else
2656   cat > conftest.$ac_ext <<EOF
2657 #line 2658 "configure"
2658 #include "confdefs.h"
2659 #include <$ac_hdr>
2660 EOF
2661 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2662 { (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2663 ac_err=`grep -v '^ *+' conftest.out`
2664 if test -z "$ac_err"; then
2665   rm -rf conftest*
2666   eval "ac_cv_header_$ac_safe=yes"
2667 else
2668   echo "$ac_err" >&5
2669   echo "configure: failed program was:" >&5
2670   cat conftest.$ac_ext >&5
2671   rm -rf conftest*
2672   eval "ac_cv_header_$ac_safe=no"
2673 fi
2674 rm -f conftest*
2675 fi
2676 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2677   echo "$ac_t""yes" 1>&6
2678     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2679   cat >> confdefs.h <<EOF
2680 #define $ac_tr_hdr 1
2681 EOF
2682  
2683 else
2684   echo "$ac_t""no" 1>&6
2685 fi
2686 done
2687
2688
2689         if test $ac_cv_header_pthread_h = yes ; then
2690                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
2691 echo "configure:2692: checking POSIX thread version" >&5
2692 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
2693   echo $ac_n "(cached) $ac_c" 1>&6
2694 else
2695   
2696         cat > conftest.$ac_ext <<EOF
2697 #line 2698 "configure"
2698 #include "confdefs.h"
2699
2700 #               include <pthread.h>
2701                 /* this check could be improved */
2702 #               ifdef PTHREAD_ONCE_INIT
2703                         final
2704 #               endif
2705         
2706 EOF
2707 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2708   egrep "final" >/dev/null 2>&1; then
2709   rm -rf conftest*
2710   ol_pthread_final=yes
2711 else
2712   rm -rf conftest*
2713   ol_pthread_final=no
2714 fi
2715 rm -f conftest*
2716
2717
2718         cat > conftest.$ac_ext <<EOF
2719 #line 2720 "configure"
2720 #include "confdefs.h"
2721
2722 #               include <pthread.h>
2723                 /* this check could be improved */
2724 #               ifdef pthread_once_init
2725                         draft4
2726 #               endif
2727         
2728 EOF
2729 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2730   egrep "draft4" >/dev/null 2>&1; then
2731   rm -rf conftest*
2732   ol_pthread_draft4=yes
2733 else
2734   rm -rf conftest*
2735   ol_pthread_draft4=no
2736 fi
2737 rm -f conftest*
2738
2739
2740         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
2741                 ol_cv_pthread_version=final
2742         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
2743                 ol_cv_pthread_version=draft4
2744         else
2745                 ol_cv_pthread_version=unknown
2746         fi
2747
2748 fi
2749
2750 echo "$ac_t""$ol_cv_pthread_version" 1>&6
2751
2752
2753                 if test $ol_cv_pthread_version = final ; then
2754                         cat >> confdefs.h <<\EOF
2755 #define HAVE_PTHREADS_FINAL 1
2756 EOF
2757
2758                 elif test $ol_cv_pthread_version = draft4 ; then
2759                         cat >> confdefs.h <<\EOF
2760 #define HAVE_PTHREADS_D4 1
2761 EOF
2762
2763                 else
2764                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
2765                 fi
2766
2767                 # consider threads found
2768                 ol_with_threads=found
2769
2770                 
2771 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
2772 echo "configure:2773: checking for LinuxThreads" >&5
2773 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
2774   echo $ac_n "(cached) $ac_c" 1>&6
2775 else
2776   
2777         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
2778         if test "$res" -gt 0 ; then
2779                 ol_cv_linux_threads=yes
2780         else
2781                 ol_cv_linux_threads=no
2782         fi
2783
2784 fi
2785
2786 echo "$ac_t""$ol_cv_linux_threads" 1>&6
2787
2788
2789                 if test $ol_cv_linux_threads = yes ; then
2790                         cat >> confdefs.h <<\EOF
2791 #define HAVE_LINUX_THREADS 1
2792 EOF
2793
2794                 fi
2795
2796                 
2797                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
2798 echo "configure:2799: checking for pthread_create" >&5
2799 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
2800   echo $ac_n "(cached) $ac_c" 1>&6
2801 else
2802   cat > conftest.$ac_ext <<EOF
2803 #line 2804 "configure"
2804 #include "confdefs.h"
2805 /* System header to define __stub macros and hopefully few prototypes,
2806     which can conflict with char pthread_create(); below.  */
2807 #include <assert.h>
2808 /* Override any gcc2 internal prototype to avoid an error.  */
2809 /* We use char because int might match the return type of a gcc2
2810     builtin and then its argument prototype would still apply.  */
2811 char pthread_create();
2812
2813 int main() {
2814
2815 /* The GNU C library defines this for functions which it implements
2816     to always fail with ENOSYS.  Some functions are actually named
2817     something starting with __ and the normal name is an alias.  */
2818 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
2819 choke me
2820 #else
2821 pthread_create();
2822 #endif
2823
2824 ; return 0; }
2825 EOF
2826 if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2827   rm -rf conftest*
2828   eval "ac_cv_func_pthread_create=yes"
2829 else
2830   echo "configure: failed program was:" >&5
2831   cat conftest.$ac_ext >&5
2832   rm -rf conftest*
2833   eval "ac_cv_func_pthread_create=no"
2834 fi
2835 rm -f conftest*
2836 fi
2837
2838 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
2839   echo "$ac_t""yes" 1>&6
2840   ol_link_threads=yes
2841 else
2842   echo "$ac_t""no" 1>&6
2843 fi
2844
2845
2846                 if test $ol_link_threads = no ; then
2847                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
2848 echo "configure:2849: checking for pthread_create with -pthread" >&5
2849 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
2850   echo $ac_n "(cached) $ac_c" 1>&6
2851 else
2852   
2853                                                                 save_LIBS="$LIBS"
2854                                 LIBS="-pthread $LIBS"
2855                                 cat > conftest.$ac_ext <<EOF
2856 #line 2857 "configure"
2857 #include "confdefs.h"
2858 char pthread();
2859 int main() {
2860
2861                                         pthread_create();
2862                                         
2863 ; return 0; }
2864 EOF
2865 if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2866   rm -rf conftest*
2867   ol_cv_pthread_flag=yes
2868 else
2869   echo "configure: failed program was:" >&5
2870   cat conftest.$ac_ext >&5
2871   rm -rf conftest*
2872   ol_cv_pthread_flag=no
2873 fi
2874 rm -f conftest*
2875                                                                 LIBS="$save_LIBS"
2876                         
2877 fi
2878
2879 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
2880
2881                         if test $ol_cv_pthread_flag = yes ; then
2882                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
2883                                 ol_link_threads=posix
2884                         fi
2885                 fi
2886
2887                 if test $ol_link_threads = no ; then
2888                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
2889 echo "configure:2890: checking for pthread_create with -thread" >&5
2890 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   
2894                                                                 save_LIBS="$LIBS"
2895                                 LIBS="-thread $LIBS"
2896                                 cat > conftest.$ac_ext <<EOF
2897 #line 2898 "configure"
2898 #include "confdefs.h"
2899 char pthread();
2900 int main() {
2901
2902                                         pthread_create();
2903                                         
2904 ; return 0; }
2905 EOF
2906 if { (eval echo configure:2907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2907   rm -rf conftest*
2908   ol_cv_thread_flag=yes
2909 else
2910   echo "configure: failed program was:" >&5
2911   cat conftest.$ac_ext >&5
2912   rm -rf conftest*
2913   ol_cv_thread_flag=no
2914 fi
2915 rm -f conftest*
2916                                                                 LIBS="$save_LIBS"
2917                         
2918 fi
2919
2920 echo "$ac_t""$ol_cv_thread_flag" 1>&6
2921
2922                         if test $ol_cv_thread_flag = yes ; then
2923                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
2924                                 ol_link_threads=posix
2925                         fi
2926                 fi
2927
2928                 if test $ol_link_threads = no ; then
2929                                                 save_LIBS="$LIBS"
2930                         echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
2931 echo "configure:2932: checking for pthread_join in -lpthread" >&5
2932 ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
2933 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2934   echo $ac_n "(cached) $ac_c" 1>&6
2935 else
2936   ac_save_LIBS="$LIBS"
2937 LIBS="-lpthread -lexc $LIBS"
2938 cat > conftest.$ac_ext <<EOF
2939 #line 2940 "configure"
2940 #include "confdefs.h"
2941 /* Override any gcc2 internal prototype to avoid an error.  */
2942 /* We use char because int might match the return type of a gcc2
2943     builtin and then its argument prototype would still apply.  */
2944 char pthread_join();
2945
2946 int main() {
2947 pthread_join()
2948 ; return 0; }
2949 EOF
2950 if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2951   rm -rf conftest*
2952   eval "ac_cv_lib_$ac_lib_var=yes"
2953 else
2954   echo "configure: failed program was:" >&5
2955   cat conftest.$ac_ext >&5
2956   rm -rf conftest*
2957   eval "ac_cv_lib_$ac_lib_var=no"
2958 fi
2959 rm -f conftest*
2960 LIBS="$ac_save_LIBS"
2961
2962 fi
2963 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2964   echo "$ac_t""yes" 1>&6
2965   
2966                                 ol_link_threads=posix
2967                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
2968                                 if test $ol_with_preemptive = auto ; then
2969                                         ol_with_preemptive=yes
2970                                 fi
2971                                 
2972 else
2973   echo "$ac_t""no" 1>&6
2974 fi
2975
2976                         LIBS="$save_LIBS"
2977                 fi
2978
2979                 if test $ol_link_threads = no ; then
2980                                                 save_LIBS="$LIBS"
2981                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
2982 echo "configure:2983: checking for pthread_join in -lpthreads" >&5
2983 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
2984 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2985   echo $ac_n "(cached) $ac_c" 1>&6
2986 else
2987   ac_save_LIBS="$LIBS"
2988 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
2989 cat > conftest.$ac_ext <<EOF
2990 #line 2991 "configure"
2991 #include "confdefs.h"
2992 /* Override any gcc2 internal prototype to avoid an error.  */
2993 /* We use char because int might match the return type of a gcc2
2994     builtin and then its argument prototype would still apply.  */
2995 char pthread_join();
2996
2997 int main() {
2998 pthread_join()
2999 ; return 0; }
3000 EOF
3001 if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3002   rm -rf conftest*
3003   eval "ac_cv_lib_$ac_lib_var=yes"
3004 else
3005   echo "configure: failed program was:" >&5
3006   cat conftest.$ac_ext >&5
3007   rm -rf conftest*
3008   eval "ac_cv_lib_$ac_lib_var=no"
3009 fi
3010 rm -f conftest*
3011 LIBS="$ac_save_LIBS"
3012
3013 fi
3014 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3015   echo "$ac_t""yes" 1>&6
3016   
3017                                 ol_link_threads=posix
3018                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
3019                                 if test $ol_with_preemptive = auto ; then
3020                                         ol_with_preemptive=yes
3021                                 fi
3022                                 
3023 else
3024   echo "$ac_t""no" 1>&6
3025 fi
3026
3027                         LIBS="$save_LIBS"
3028                 fi
3029
3030                 if test $ol_link_threads = no ; then
3031                                                 save_LIBS="$LIBS"
3032                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3033 echo "configure:3034: checking for pthread_create in -lpthread" >&5
3034 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3035 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3036   echo $ac_n "(cached) $ac_c" 1>&6
3037 else
3038   ac_save_LIBS="$LIBS"
3039 LIBS="-lpthread  $LIBS"
3040 cat > conftest.$ac_ext <<EOF
3041 #line 3042 "configure"
3042 #include "confdefs.h"
3043 /* Override any gcc2 internal prototype to avoid an error.  */
3044 /* We use char because int might match the return type of a gcc2
3045     builtin and then its argument prototype would still apply.  */
3046 char pthread_create();
3047
3048 int main() {
3049 pthread_create()
3050 ; return 0; }
3051 EOF
3052 if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3053   rm -rf conftest*
3054   eval "ac_cv_lib_$ac_lib_var=yes"
3055 else
3056   echo "configure: failed program was:" >&5
3057   cat conftest.$ac_ext >&5
3058   rm -rf conftest*
3059   eval "ac_cv_lib_$ac_lib_var=no"
3060 fi
3061 rm -f conftest*
3062 LIBS="$ac_save_LIBS"
3063
3064 fi
3065 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3066   echo "$ac_t""yes" 1>&6
3067   
3068                                 ol_link_threads=posix
3069                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3070 else
3071   echo "$ac_t""no" 1>&6
3072 fi
3073
3074                         LIBS="$save_LIBS"
3075                 fi
3076
3077                 if test $ol_link_threads = no ; then
3078                                                 save_LIBS="$LIBS"
3079                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3080 echo "configure:3081: checking for pthread_create in -lc_r" >&5
3081 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3082 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3083   echo $ac_n "(cached) $ac_c" 1>&6
3084 else
3085   ac_save_LIBS="$LIBS"
3086 LIBS="-lc_r  $LIBS"
3087 cat > conftest.$ac_ext <<EOF
3088 #line 3089 "configure"
3089 #include "confdefs.h"
3090 /* Override any gcc2 internal prototype to avoid an error.  */
3091 /* We use char because int might match the return type of a gcc2
3092     builtin and then its argument prototype would still apply.  */
3093 char pthread_create();
3094
3095 int main() {
3096 pthread_create()
3097 ; return 0; }
3098 EOF
3099 if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3100   rm -rf conftest*
3101   eval "ac_cv_lib_$ac_lib_var=yes"
3102 else
3103   echo "configure: failed program was:" >&5
3104   cat conftest.$ac_ext >&5
3105   rm -rf conftest*
3106   eval "ac_cv_lib_$ac_lib_var=no"
3107 fi
3108 rm -f conftest*
3109 LIBS="$ac_save_LIBS"
3110
3111 fi
3112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3113   echo "$ac_t""yes" 1>&6
3114   
3115                                 ol_link_threads=posix
3116                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
3117 else
3118   echo "$ac_t""no" 1>&6
3119 fi
3120
3121                         LIBS="$save_LIBS"
3122                 fi
3123
3124                 if test $ol_link_threads != no ; then
3125                         cat >> confdefs.h <<\EOF
3126 #define HAVE_PTHREADS 1
3127 EOF
3128
3129
3130                                                 save_CPPFLAGS="$CPPFLAGS"
3131                         save_LIBS="$LIBS"
3132                         LIBS="$LTHREAD_LIBS $LIBS"
3133
3134                                                                                                 for ac_func in sched_yield pthread_yield
3135 do
3136 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3137 echo "configure:3138: checking for $ac_func" >&5
3138 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3139   echo $ac_n "(cached) $ac_c" 1>&6
3140 else
3141   cat > conftest.$ac_ext <<EOF
3142 #line 3143 "configure"
3143 #include "confdefs.h"
3144 /* System header to define __stub macros and hopefully few prototypes,
3145     which can conflict with char $ac_func(); below.  */
3146 #include <assert.h>
3147 /* Override any gcc2 internal prototype to avoid an error.  */
3148 /* We use char because int might match the return type of a gcc2
3149     builtin and then its argument prototype would still apply.  */
3150 char $ac_func();
3151
3152 int main() {
3153
3154 /* The GNU C library defines this for functions which it implements
3155     to always fail with ENOSYS.  Some functions are actually named
3156     something starting with __ and the normal name is an alias.  */
3157 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3158 choke me
3159 #else
3160 $ac_func();
3161 #endif
3162
3163 ; return 0; }
3164 EOF
3165 if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3166   rm -rf conftest*
3167   eval "ac_cv_func_$ac_func=yes"
3168 else
3169   echo "configure: failed program was:" >&5
3170   cat conftest.$ac_ext >&5
3171   rm -rf conftest*
3172   eval "ac_cv_func_$ac_func=no"
3173 fi
3174 rm -f conftest*
3175 fi
3176
3177 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3178   echo "$ac_t""yes" 1>&6
3179     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3180   cat >> confdefs.h <<EOF
3181 #define $ac_tr_func 1
3182 EOF
3183  
3184 else
3185   echo "$ac_t""no" 1>&6
3186 fi
3187 done
3188
3189
3190                         if test $ac_cv_func_sched_yield = no -a \
3191                                 $ac_cv_func_pthread_yield = no ; then
3192                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
3193 echo "configure:3194: checking for sched_yield in -lrt" >&5
3194 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
3195 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3196   echo $ac_n "(cached) $ac_c" 1>&6
3197 else
3198   ac_save_LIBS="$LIBS"
3199 LIBS="-lrt  $LIBS"
3200 cat > conftest.$ac_ext <<EOF
3201 #line 3202 "configure"
3202 #include "confdefs.h"
3203 /* Override any gcc2 internal prototype to avoid an error.  */
3204 /* We use char because int might match the return type of a gcc2
3205     builtin and then its argument prototype would still apply.  */
3206 char sched_yield();
3207
3208 int main() {
3209 sched_yield()
3210 ; return 0; }
3211 EOF
3212 if { (eval echo configure:3213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3213   rm -rf conftest*
3214   eval "ac_cv_lib_$ac_lib_var=yes"
3215 else
3216   echo "configure: failed program was:" >&5
3217   cat conftest.$ac_ext >&5
3218   rm -rf conftest*
3219   eval "ac_cv_lib_$ac_lib_var=no"
3220 fi
3221 rm -f conftest*
3222 LIBS="$ac_save_LIBS"
3223
3224 fi
3225 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3226   echo "$ac_t""yes" 1>&6
3227   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
3228                                         cat >> confdefs.h <<\EOF
3229 #define HAVE_SCHED_YIELD 1
3230 EOF
3231
3232                                         ac_cv_func_sched_yield=yes
3233 else
3234   echo "$ac_t""no" 1>&6
3235 ac_cv_func_sched_yield=no
3236 fi
3237
3238                         fi
3239                         if test $ac_cv_func_sched_yield = no -a \
3240                                 $ac_cv_func_pthread_yield = no ; then
3241                                                                 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
3242 echo "configure:3243: checking for sched_yield in -lposix4" >&5
3243 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
3244 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3245   echo $ac_n "(cached) $ac_c" 1>&6
3246 else
3247   ac_save_LIBS="$LIBS"
3248 LIBS="-lposix4  $LIBS"
3249 cat > conftest.$ac_ext <<EOF
3250 #line 3251 "configure"
3251 #include "confdefs.h"
3252 /* Override any gcc2 internal prototype to avoid an error.  */
3253 /* We use char because int might match the return type of a gcc2
3254     builtin and then its argument prototype would still apply.  */
3255 char sched_yield();
3256
3257 int main() {
3258 sched_yield()
3259 ; return 0; }
3260 EOF
3261 if { (eval echo configure:3262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3262   rm -rf conftest*
3263   eval "ac_cv_lib_$ac_lib_var=yes"
3264 else
3265   echo "configure: failed program was:" >&5
3266   cat conftest.$ac_ext >&5
3267   rm -rf conftest*
3268   eval "ac_cv_lib_$ac_lib_var=no"
3269 fi
3270 rm -f conftest*
3271 LIBS="$ac_save_LIBS"
3272
3273 fi
3274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3275   echo "$ac_t""yes" 1>&6
3276   LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
3277                                         cat >> confdefs.h <<\EOF
3278 #define HAVE_SCHED_YIELD 1
3279 EOF
3280
3281                                         ac_cv_func_sched_yield=yes
3282 else
3283   echo "$ac_t""no" 1>&6
3284 ac_cv_func_sched_yield=no
3285 fi
3286
3287                         fi
3288                         if test $ac_cv_func_sched_yield = no -a \
3289                                 $ac_cv_func_pthread_yield = no ; then
3290                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
3291                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
3292                         fi
3293
3294                                                 for ac_func in pthread_kill
3295 do
3296 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3297 echo "configure:3298: checking for $ac_func" >&5
3298 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3299   echo $ac_n "(cached) $ac_c" 1>&6
3300 else
3301   cat > conftest.$ac_ext <<EOF
3302 #line 3303 "configure"
3303 #include "confdefs.h"
3304 /* System header to define __stub macros and hopefully few prototypes,
3305     which can conflict with char $ac_func(); below.  */
3306 #include <assert.h>
3307 /* Override any gcc2 internal prototype to avoid an error.  */
3308 /* We use char because int might match the return type of a gcc2
3309     builtin and then its argument prototype would still apply.  */
3310 char $ac_func();
3311
3312 int main() {
3313
3314 /* The GNU C library defines this for functions which it implements
3315     to always fail with ENOSYS.  Some functions are actually named
3316     something starting with __ and the normal name is an alias.  */
3317 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3318 choke me
3319 #else
3320 $ac_func();
3321 #endif
3322
3323 ; return 0; }
3324 EOF
3325 if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3326   rm -rf conftest*
3327   eval "ac_cv_func_$ac_func=yes"
3328 else
3329   echo "configure: failed program was:" >&5
3330   cat conftest.$ac_ext >&5
3331   rm -rf conftest*
3332   eval "ac_cv_func_$ac_func=no"
3333 fi
3334 rm -f conftest*
3335 fi
3336
3337 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3338   echo "$ac_t""yes" 1>&6
3339     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3340   cat >> confdefs.h <<EOF
3341 #define $ac_tr_func 1
3342 EOF
3343  
3344 else
3345   echo "$ac_t""no" 1>&6
3346 fi
3347 done
3348
3349                         for ac_func in \
3350                                 pthread_attr_create pthread_attr_init \
3351                                 pthread_attr_destroy pthread_attr_delete \
3352                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
3353                         
3354 do
3355 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3356 echo "configure:3357: checking for $ac_func" >&5
3357 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3358   echo $ac_n "(cached) $ac_c" 1>&6
3359 else
3360   cat > conftest.$ac_ext <<EOF
3361 #line 3362 "configure"
3362 #include "confdefs.h"
3363 /* System header to define __stub macros and hopefully few prototypes,
3364     which can conflict with char $ac_func(); below.  */
3365 #include <assert.h>
3366 /* Override any gcc2 internal prototype to avoid an error.  */
3367 /* We use char because int might match the return type of a gcc2
3368     builtin and then its argument prototype would still apply.  */
3369 char $ac_func();
3370
3371 int main() {
3372
3373 /* The GNU C library defines this for functions which it implements
3374     to always fail with ENOSYS.  Some functions are actually named
3375     something starting with __ and the normal name is an alias.  */
3376 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3377 choke me
3378 #else
3379 $ac_func();
3380 #endif
3381
3382 ; return 0; }
3383 EOF
3384 if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3385   rm -rf conftest*
3386   eval "ac_cv_func_$ac_func=yes"
3387 else
3388   echo "configure: failed program was:" >&5
3389   cat conftest.$ac_ext >&5
3390   rm -rf conftest*
3391   eval "ac_cv_func_$ac_func=no"
3392 fi
3393 rm -f conftest*
3394 fi
3395
3396 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3397   echo "$ac_t""yes" 1>&6
3398     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3399   cat >> confdefs.h <<EOF
3400 #define $ac_tr_func 1
3401 EOF
3402  
3403 else
3404   echo "$ac_t""no" 1>&6
3405 fi
3406 done
3407
3408
3409                                                 for ac_func in \
3410                                 pthread_setconcurrency \
3411                                 thr_setconcurrency \
3412                         
3413 do
3414 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3415 echo "configure:3416: checking for $ac_func" >&5
3416 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3417   echo $ac_n "(cached) $ac_c" 1>&6
3418 else
3419   cat > conftest.$ac_ext <<EOF
3420 #line 3421 "configure"
3421 #include "confdefs.h"
3422 /* System header to define __stub macros and hopefully few prototypes,
3423     which can conflict with char $ac_func(); below.  */
3424 #include <assert.h>
3425 /* Override any gcc2 internal prototype to avoid an error.  */
3426 /* We use char because int might match the return type of a gcc2
3427     builtin and then its argument prototype would still apply.  */
3428 char $ac_func();
3429
3430 int main() {
3431
3432 /* The GNU C library defines this for functions which it implements
3433     to always fail with ENOSYS.  Some functions are actually named
3434     something starting with __ and the normal name is an alias.  */
3435 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3436 choke me
3437 #else
3438 $ac_func();
3439 #endif
3440
3441 ; return 0; }
3442 EOF
3443 if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3444   rm -rf conftest*
3445   eval "ac_cv_func_$ac_func=yes"
3446 else
3447   echo "configure: failed program was:" >&5
3448   cat conftest.$ac_ext >&5
3449   rm -rf conftest*
3450   eval "ac_cv_func_$ac_func=no"
3451 fi
3452 rm -f conftest*
3453 fi
3454
3455 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3456   echo "$ac_t""yes" 1>&6
3457     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3458   cat >> confdefs.h <<EOF
3459 #define $ac_tr_func 1
3460 EOF
3461  
3462 else
3463   echo "$ac_t""no" 1>&6
3464 fi
3465 done
3466
3467
3468                                                 if test $ol_with_preemptive = auto ; then
3469                                 echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6
3470 echo "configure:3471: checking for preemptive Pthread implementation" >&5
3471                                 if test "$cross_compiling" = yes; then
3472   
3473                                 { echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; }
3474 else
3475   cat > conftest.$ac_ext <<EOF
3476 #line 3477 "configure"
3477 #include "confdefs.h"
3478
3479 #include <sys/types.h>
3480 #include <sys/time.h>
3481 #include <unistd.h>
3482 #include <pthread.h>
3483 #ifndef NULL
3484 #define NULL 0
3485 #endif
3486
3487 int task(arg)
3488         int *arg;
3489 {
3490         struct timeval tv;
3491
3492         tv.tv_sec=4;
3493         tv.tv_usec=0;
3494         select(0, NULL, NULL, NULL, &tv);
3495
3496         tv.tv_sec=6;
3497         tv.tv_usec=0;
3498         select(0, NULL, NULL, NULL, &tv);
3499
3500         exit(1); /* if we exit here, the select blocked the whole process */
3501 }
3502
3503 main(argc, argv)
3504 int argc; char **argv;
3505 {
3506         pthread_t t;
3507
3508 #ifdef HAVE_PTHREAD_SETCONCURRENCY
3509         (void) pthread_setconcurrency(2);
3510 #else
3511 #ifdef HAVE_THR_SETCONCURRENCY
3512         /* Set Solaris LWP concurrency to 2 */
3513         thr_setconcurrency(2);
3514 #endif
3515 #endif
3516
3517         pthread_create(&t, NULL, (void *) task, NULL);
3518
3519 #if HAVE_SCHED_YIELD
3520         sched_yield();  /* make sure task runs first */
3521 #else
3522 #ifdef HAVE_PTHREAD_YIELD
3523         pthread_yield();        /* make sure task runs first */
3524 #endif
3525 #endif
3526         exit(0);
3527 }
3528                                 
3529 EOF
3530 if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3531 then
3532   ol_pthread_preemptive=yes
3533 else
3534   echo "configure: failed program was:" >&5
3535   cat conftest.$ac_ext >&5
3536   rm -fr conftest*
3537   ol_pthread_preemptive=no
3538 fi
3539 rm -fr conftest*
3540 fi
3541
3542                                 echo "$ac_t""$ol_pthread_preemptive" 1>&6
3543
3544                                 if test $ol_pthread_preemptive = yes ; then
3545                                         cat >> confdefs.h <<\EOF
3546 #define HAVE_PREEMPTIVE_PTHREADS 1
3547 EOF
3548
3549                                         ol_with_preemptive=yes
3550                                 fi
3551                         fi
3552
3553
3554                                                 CPPFLAGS="$save_CPPFLAGS"
3555                         LIBS="$save_LIBS"
3556                 else
3557                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
3558                 fi
3559         fi
3560
3561         if test $ol_with_threads = posix ; then
3562                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
3563         fi
3564 fi
3565
3566 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
3567                 for ac_hdr in mach/cthreads.h
3568 do
3569 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3570 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3571 echo "configure:3572: checking for $ac_hdr" >&5
3572 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3573   echo $ac_n "(cached) $ac_c" 1>&6
3574 else
3575   cat > conftest.$ac_ext <<EOF
3576 #line 3577 "configure"
3577 #include "confdefs.h"
3578 #include <$ac_hdr>
3579 EOF
3580 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3581 { (eval echo configure:3582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3582 ac_err=`grep -v '^ *+' conftest.out`
3583 if test -z "$ac_err"; then
3584   rm -rf conftest*
3585   eval "ac_cv_header_$ac_safe=yes"
3586 else
3587   echo "$ac_err" >&5
3588   echo "configure: failed program was:" >&5
3589   cat conftest.$ac_ext >&5
3590   rm -rf conftest*
3591   eval "ac_cv_header_$ac_safe=no"
3592 fi
3593 rm -f conftest*
3594 fi
3595 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3596   echo "$ac_t""yes" 1>&6
3597     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3598   cat >> confdefs.h <<EOF
3599 #define $ac_tr_hdr 1
3600 EOF
3601  
3602 else
3603   echo "$ac_t""no" 1>&6
3604 fi
3605 done
3606
3607         if test $ac_cv_header_mach_cthreads_h = yes ; then
3608                 ol_with_threads=found
3609
3610                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
3611 echo "configure:3612: checking for cthread_fork" >&5
3612 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
3613   echo $ac_n "(cached) $ac_c" 1>&6
3614 else
3615   cat > conftest.$ac_ext <<EOF
3616 #line 3617 "configure"
3617 #include "confdefs.h"
3618 /* System header to define __stub macros and hopefully few prototypes,
3619     which can conflict with char cthread_fork(); below.  */
3620 #include <assert.h>
3621 /* Override any gcc2 internal prototype to avoid an error.  */
3622 /* We use char because int might match the return type of a gcc2
3623     builtin and then its argument prototype would still apply.  */
3624 char cthread_fork();
3625
3626 int main() {
3627
3628 /* The GNU C library defines this for functions which it implements
3629     to always fail with ENOSYS.  Some functions are actually named
3630     something starting with __ and the normal name is an alias.  */
3631 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
3632 choke me
3633 #else
3634 cthread_fork();
3635 #endif
3636
3637 ; return 0; }
3638 EOF
3639 if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3640   rm -rf conftest*
3641   eval "ac_cv_func_cthread_fork=yes"
3642 else
3643   echo "configure: failed program was:" >&5
3644   cat conftest.$ac_ext >&5
3645   rm -rf conftest*
3646   eval "ac_cv_func_cthread_fork=no"
3647 fi
3648 rm -f conftest*
3649 fi
3650
3651 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
3652   echo "$ac_t""yes" 1>&6
3653   ol_link_threads=yes
3654 else
3655   echo "$ac_t""no" 1>&6
3656 fi
3657
3658
3659                 if test $ol_link_threads = no ; then
3660                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
3661 echo "configure:3662: checking for cthread_fork with -all_load" >&5
3662 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
3663   echo $ac_n "(cached) $ac_c" 1>&6
3664 else
3665   
3666                                                                 save_LIBS="$LIBS"
3667                                 LIBS="-all_load $LIBS"
3668                                 cat > conftest.$ac_ext <<EOF
3669 #line 3670 "configure"
3670 #include "confdefs.h"
3671 #include <mach/cthreads.h>
3672 int main() {
3673
3674                                         cthread_fork((void *)0, (void *)0);
3675                                         
3676 ; return 0; }
3677 EOF
3678 if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3679   rm -rf conftest*
3680   ol_cv_cthread_all_load=yes
3681 else
3682   echo "configure: failed program was:" >&5
3683   cat conftest.$ac_ext >&5
3684   rm -rf conftest*
3685   ol_cv_cthread_all_load=no
3686 fi
3687 rm -f conftest*
3688                                                                 LIBS="$save_LIBS"
3689                         
3690 fi
3691
3692 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
3693
3694                         if test $ol_cv_cthread_all_load = yes ; then
3695                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
3696                                 ol_link_threads=mach
3697                         fi
3698                 fi
3699
3700                 if test $ol_link_threads != no ; then
3701                         : check for cthread specific functionality here
3702                         cat >> confdefs.h <<\EOF
3703 #define HAVE_MACH_CTHREADS 1
3704 EOF
3705
3706                 else
3707                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
3708                 fi
3709         fi
3710
3711         if test $ol_with_threads = mach ; then
3712                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
3713         fi
3714 fi
3715
3716 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
3717                 for ac_hdr in thread.h synch.h
3718 do
3719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3721 echo "configure:3722: checking for $ac_hdr" >&5
3722 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3723   echo $ac_n "(cached) $ac_c" 1>&6
3724 else
3725   cat > conftest.$ac_ext <<EOF
3726 #line 3727 "configure"
3727 #include "confdefs.h"
3728 #include <$ac_hdr>
3729 EOF
3730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3731 { (eval echo configure:3732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3732 ac_err=`grep -v '^ *+' conftest.out`
3733 if test -z "$ac_err"; then
3734   rm -rf conftest*
3735   eval "ac_cv_header_$ac_safe=yes"
3736 else
3737   echo "$ac_err" >&5
3738   echo "configure: failed program was:" >&5
3739   cat conftest.$ac_ext >&5
3740   rm -rf conftest*
3741   eval "ac_cv_header_$ac_safe=no"
3742 fi
3743 rm -f conftest*
3744 fi
3745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3746   echo "$ac_t""yes" 1>&6
3747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3748   cat >> confdefs.h <<EOF
3749 #define $ac_tr_hdr 1
3750 EOF
3751  
3752 else
3753   echo "$ac_t""no" 1>&6
3754 fi
3755 done
3756
3757         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
3758                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
3759 echo "configure:3760: checking for thr_create in -lthread" >&5
3760 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
3761 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3762   echo $ac_n "(cached) $ac_c" 1>&6
3763 else
3764   ac_save_LIBS="$LIBS"
3765 LIBS="-lthread  $LIBS"
3766 cat > conftest.$ac_ext <<EOF
3767 #line 3768 "configure"
3768 #include "confdefs.h"
3769 /* Override any gcc2 internal prototype to avoid an error.  */
3770 /* We use char because int might match the return type of a gcc2
3771     builtin and then its argument prototype would still apply.  */
3772 char thr_create();
3773
3774 int main() {
3775 thr_create()
3776 ; return 0; }
3777 EOF
3778 if { (eval echo configure:3779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3779   rm -rf conftest*
3780   eval "ac_cv_lib_$ac_lib_var=yes"
3781 else
3782   echo "configure: failed program was:" >&5
3783   cat conftest.$ac_ext >&5
3784   rm -rf conftest*
3785   eval "ac_cv_lib_$ac_lib_var=no"
3786 fi
3787 rm -f conftest*
3788 LIBS="$ac_save_LIBS"
3789
3790 fi
3791 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3792   echo "$ac_t""yes" 1>&6
3793   have_lwp=yes
3794 else
3795   echo "$ac_t""no" 1>&6
3796 have_lwp=no
3797 fi
3798
3799
3800                 if test $have_lwp = yes ; then
3801                         cat >> confdefs.h <<\EOF
3802 #define HAVE_THR 1
3803 EOF
3804
3805                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
3806
3807                         if test $ol_with_preemptive = auto ; then
3808                                 ol_with_preemptive=yes
3809                         fi
3810                 fi
3811         fi
3812
3813                 for ac_hdr in lwp/lwp.h
3814 do
3815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3817 echo "configure:3818: checking for $ac_hdr" >&5
3818 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3819   echo $ac_n "(cached) $ac_c" 1>&6
3820 else
3821   cat > conftest.$ac_ext <<EOF
3822 #line 3823 "configure"
3823 #include "confdefs.h"
3824 #include <$ac_hdr>
3825 EOF
3826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3827 { (eval echo configure:3828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3828 ac_err=`grep -v '^ *+' conftest.out`
3829 if test -z "$ac_err"; then
3830   rm -rf conftest*
3831   eval "ac_cv_header_$ac_safe=yes"
3832 else
3833   echo "$ac_err" >&5
3834   echo "configure: failed program was:" >&5
3835   cat conftest.$ac_ext >&5
3836   rm -rf conftest*
3837   eval "ac_cv_header_$ac_safe=no"
3838 fi
3839 rm -f conftest*
3840 fi
3841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3842   echo "$ac_t""yes" 1>&6
3843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3844   cat >> confdefs.h <<EOF
3845 #define $ac_tr_hdr 1
3846 EOF
3847  
3848 else
3849   echo "$ac_t""no" 1>&6
3850 fi
3851 done
3852
3853         if test $ac_cv_header_lwp_lwp_h = yes ; then
3854                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
3855 echo "configure:3856: checking for lwp_create in -llwp" >&5
3856 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
3857 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3858   echo $ac_n "(cached) $ac_c" 1>&6
3859 else
3860   ac_save_LIBS="$LIBS"
3861 LIBS="-llwp  $LIBS"
3862 cat > conftest.$ac_ext <<EOF
3863 #line 3864 "configure"
3864 #include "confdefs.h"
3865 /* Override any gcc2 internal prototype to avoid an error.  */
3866 /* We use char because int might match the return type of a gcc2
3867     builtin and then its argument prototype would still apply.  */
3868 char lwp_create();
3869
3870 int main() {
3871 lwp_create()
3872 ; return 0; }
3873 EOF
3874 if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3875   rm -rf conftest*
3876   eval "ac_cv_lib_$ac_lib_var=yes"
3877 else
3878   echo "configure: failed program was:" >&5
3879   cat conftest.$ac_ext >&5
3880   rm -rf conftest*
3881   eval "ac_cv_lib_$ac_lib_var=no"
3882 fi
3883 rm -f conftest*
3884 LIBS="$ac_save_LIBS"
3885
3886 fi
3887 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3888   echo "$ac_t""yes" 1>&6
3889   have_lwp=yes
3890 else
3891   echo "$ac_t""no" 1>&6
3892 have_lwp=no
3893 fi
3894
3895
3896                 if test $have_lwp = yes ; then
3897                         cat >> confdefs.h <<\EOF
3898 #define HAVE_LWP 1
3899 EOF
3900
3901                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
3902
3903                         if test $ol_with_preemptive = auto ; then
3904                                 ol_with_preemptive=no
3905                         fi
3906                 fi
3907         fi
3908 fi
3909
3910 if test $ol_with_preemptive = yes ; then
3911         cat >> confdefs.h <<\EOF
3912 #define PREEMPTIVE_THREADS 1
3913 EOF
3914
3915 fi
3916
3917 if test $ol_with_threads = manual ; then
3918                 ol_link_threads=yes
3919
3920         echo "configure: warning: thread defines and link options must be set manually" 1>&2
3921
3922         for ac_hdr in pthread.h sched.h
3923 do
3924 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3925 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3926 echo "configure:3927: checking for $ac_hdr" >&5
3927 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3928   echo $ac_n "(cached) $ac_c" 1>&6
3929 else
3930   cat > conftest.$ac_ext <<EOF
3931 #line 3932 "configure"
3932 #include "confdefs.h"
3933 #include <$ac_hdr>
3934 EOF
3935 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3936 { (eval echo configure:3937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3937 ac_err=`grep -v '^ *+' conftest.out`
3938 if test -z "$ac_err"; then
3939   rm -rf conftest*
3940   eval "ac_cv_header_$ac_safe=yes"
3941 else
3942   echo "$ac_err" >&5
3943   echo "configure: failed program was:" >&5
3944   cat conftest.$ac_ext >&5
3945   rm -rf conftest*
3946   eval "ac_cv_header_$ac_safe=no"
3947 fi
3948 rm -f conftest*
3949 fi
3950 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3951   echo "$ac_t""yes" 1>&6
3952     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3953   cat >> confdefs.h <<EOF
3954 #define $ac_tr_hdr 1
3955 EOF
3956  
3957 else
3958   echo "$ac_t""no" 1>&6
3959 fi
3960 done
3961
3962         for ac_func in sched_yield pthread_yield
3963 do
3964 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3965 echo "configure:3966: checking for $ac_func" >&5
3966 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3967   echo $ac_n "(cached) $ac_c" 1>&6
3968 else
3969   cat > conftest.$ac_ext <<EOF
3970 #line 3971 "configure"
3971 #include "confdefs.h"
3972 /* System header to define __stub macros and hopefully few prototypes,
3973     which can conflict with char $ac_func(); below.  */
3974 #include <assert.h>
3975 /* Override any gcc2 internal prototype to avoid an error.  */
3976 /* We use char because int might match the return type of a gcc2
3977     builtin and then its argument prototype would still apply.  */
3978 char $ac_func();
3979
3980 int main() {
3981
3982 /* The GNU C library defines this for functions which it implements
3983     to always fail with ENOSYS.  Some functions are actually named
3984     something starting with __ and the normal name is an alias.  */
3985 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3986 choke me
3987 #else
3988 $ac_func();
3989 #endif
3990
3991 ; return 0; }
3992 EOF
3993 if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3994   rm -rf conftest*
3995   eval "ac_cv_func_$ac_func=yes"
3996 else
3997   echo "configure: failed program was:" >&5
3998   cat conftest.$ac_ext >&5
3999   rm -rf conftest*
4000   eval "ac_cv_func_$ac_func=no"
4001 fi
4002 rm -f conftest*
4003 fi
4004
4005 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4006   echo "$ac_t""yes" 1>&6
4007     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4008   cat >> confdefs.h <<EOF
4009 #define $ac_tr_func 1
4010 EOF
4011  
4012 else
4013   echo "$ac_t""no" 1>&6
4014 fi
4015 done
4016
4017         
4018 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4019 echo "configure:4020: checking for LinuxThreads" >&5
4020 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4021   echo $ac_n "(cached) $ac_c" 1>&6
4022 else
4023   
4024         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4025         if test "$res" -gt 0 ; then
4026                 ol_cv_linux_threads=yes
4027         else
4028                 ol_cv_linux_threads=no
4029         fi
4030
4031 fi
4032
4033 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4034
4035
4036         for ac_hdr in mach/cthreads.h
4037 do
4038 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4039 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4040 echo "configure:4041: checking for $ac_hdr" >&5
4041 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4042   echo $ac_n "(cached) $ac_c" 1>&6
4043 else
4044   cat > conftest.$ac_ext <<EOF
4045 #line 4046 "configure"
4046 #include "confdefs.h"
4047 #include <$ac_hdr>
4048 EOF
4049 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4050 { (eval echo configure:4051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4051 ac_err=`grep -v '^ *+' conftest.out`
4052 if test -z "$ac_err"; then
4053   rm -rf conftest*
4054   eval "ac_cv_header_$ac_safe=yes"
4055 else
4056   echo "$ac_err" >&5
4057   echo "configure: failed program was:" >&5
4058   cat conftest.$ac_ext >&5
4059   rm -rf conftest*
4060   eval "ac_cv_header_$ac_safe=no"
4061 fi
4062 rm -f conftest*
4063 fi
4064 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4065   echo "$ac_t""yes" 1>&6
4066     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4067   cat >> confdefs.h <<EOF
4068 #define $ac_tr_hdr 1
4069 EOF
4070  
4071 else
4072   echo "$ac_t""no" 1>&6
4073 fi
4074 done
4075
4076         for ac_hdr in lwp/lwp.h
4077 do
4078 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4079 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4080 echo "configure:4081: checking for $ac_hdr" >&5
4081 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4082   echo $ac_n "(cached) $ac_c" 1>&6
4083 else
4084   cat > conftest.$ac_ext <<EOF
4085 #line 4086 "configure"
4086 #include "confdefs.h"
4087 #include <$ac_hdr>
4088 EOF
4089 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4090 { (eval echo configure:4091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4091 ac_err=`grep -v '^ *+' conftest.out`
4092 if test -z "$ac_err"; then
4093   rm -rf conftest*
4094   eval "ac_cv_header_$ac_safe=yes"
4095 else
4096   echo "$ac_err" >&5
4097   echo "configure: failed program was:" >&5
4098   cat conftest.$ac_ext >&5
4099   rm -rf conftest*
4100   eval "ac_cv_header_$ac_safe=no"
4101 fi
4102 rm -f conftest*
4103 fi
4104 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4105   echo "$ac_t""yes" 1>&6
4106     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4107   cat >> confdefs.h <<EOF
4108 #define $ac_tr_hdr 1
4109 EOF
4110  
4111 else
4112   echo "$ac_t""no" 1>&6
4113 fi
4114 done
4115
4116         for ac_hdr in thread.h synch.h
4117 do
4118 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4119 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4120 echo "configure:4121: checking for $ac_hdr" >&5
4121 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4122   echo $ac_n "(cached) $ac_c" 1>&6
4123 else
4124   cat > conftest.$ac_ext <<EOF
4125 #line 4126 "configure"
4126 #include "confdefs.h"
4127 #include <$ac_hdr>
4128 EOF
4129 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4130 { (eval echo configure:4131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4131 ac_err=`grep -v '^ *+' conftest.out`
4132 if test -z "$ac_err"; then
4133   rm -rf conftest*
4134   eval "ac_cv_header_$ac_safe=yes"
4135 else
4136   echo "$ac_err" >&5
4137   echo "configure: failed program was:" >&5
4138   cat conftest.$ac_ext >&5
4139   rm -rf conftest*
4140   eval "ac_cv_header_$ac_safe=no"
4141 fi
4142 rm -f conftest*
4143 fi
4144 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4145   echo "$ac_t""yes" 1>&6
4146     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4147   cat >> confdefs.h <<EOF
4148 #define $ac_tr_hdr 1
4149 EOF
4150  
4151 else
4152   echo "$ac_t""no" 1>&6
4153 fi
4154 done
4155
4156 fi
4157
4158 if test $ol_with_threads != no ; then
4159                                                 cat >> confdefs.h <<\EOF
4160 #define _REENTRANT 1
4161 EOF
4162
4163         cat >> confdefs.h <<\EOF
4164 #define _THREAD_SAFE 1
4165 EOF
4166
4167         cat >> confdefs.h <<\EOF
4168 #define _THREADSAFE 1
4169 EOF
4170
4171 fi
4172
4173
4174 if test $ol_link_threads = no ; then
4175         if test $ol_with_threads = yes ; then
4176                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
4177         fi
4178
4179         if test $ol_with_threads = auto ; then
4180                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
4181                 ol_with_threads=no
4182         fi
4183
4184         cat >> confdefs.h <<\EOF
4185 #define NO_THREADS 1
4186 EOF
4187
4188         cat >> confdefs.h <<\EOF
4189 #define PREEMPTIVE_THREADS 1
4190 EOF
4191
4192         LTHREAD_LIBS=""
4193 fi
4194
4195 ol_link_ldbm=no 
4196 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
4197         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
4198 echo "configure:4199: checking for DB2 library" >&5
4199 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
4200   echo $ac_n "(cached) $ac_c" 1>&6
4201 else
4202         ol_LIBS="$LIBS"
4203         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
4204 echo "configure:4205: checking for db_open in -ldb" >&5
4205 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
4206 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4207   echo $ac_n "(cached) $ac_c" 1>&6
4208 else
4209   ac_save_LIBS="$LIBS"
4210 LIBS="-ldb  $LIBS"
4211 cat > conftest.$ac_ext <<EOF
4212 #line 4213 "configure"
4213 #include "confdefs.h"
4214 /* Override any gcc2 internal prototype to avoid an error.  */
4215 /* We use char because int might match the return type of a gcc2
4216     builtin and then its argument prototype would still apply.  */
4217 char db_open();
4218
4219 int main() {
4220 db_open()
4221 ; return 0; }
4222 EOF
4223 if { (eval echo configure:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4224   rm -rf conftest*
4225   eval "ac_cv_lib_$ac_lib_var=yes"
4226 else
4227   echo "configure: failed program was:" >&5
4228   cat conftest.$ac_ext >&5
4229   rm -rf conftest*
4230   eval "ac_cv_lib_$ac_lib_var=no"
4231 fi
4232 rm -f conftest*
4233 LIBS="$ac_save_LIBS"
4234
4235 fi
4236 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4237   echo "$ac_t""yes" 1>&6
4238   ol_cv_lib_db2=-ldb
4239 else
4240   echo "$ac_t""no" 1>&6
4241 ol_cv_lib_db2=no
4242 fi
4243
4244         LIBS="$ol_LIBS"
4245
4246 fi
4247
4248 echo "$ac_t""$ol_cv_lib_db2" 1>&6
4249
4250 for ac_hdr in db.h
4251 do
4252 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4253 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4254 echo "configure:4255: checking for $ac_hdr" >&5
4255 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4256   echo $ac_n "(cached) $ac_c" 1>&6
4257 else
4258   cat > conftest.$ac_ext <<EOF
4259 #line 4260 "configure"
4260 #include "confdefs.h"
4261 #include <$ac_hdr>
4262 EOF
4263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4264 { (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4265 ac_err=`grep -v '^ *+' conftest.out`
4266 if test -z "$ac_err"; then
4267   rm -rf conftest*
4268   eval "ac_cv_header_$ac_safe=yes"
4269 else
4270   echo "$ac_err" >&5
4271   echo "configure: failed program was:" >&5
4272   cat conftest.$ac_ext >&5
4273   rm -rf conftest*
4274   eval "ac_cv_header_$ac_safe=no"
4275 fi
4276 rm -f conftest*
4277 fi
4278 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4279   echo "$ac_t""yes" 1>&6
4280     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4281   cat >> confdefs.h <<EOF
4282 #define $ac_tr_hdr 1
4283 EOF
4284  
4285 else
4286   echo "$ac_t""no" 1>&6
4287 fi
4288 done
4289
4290 if test $ac_cv_header_db_h = yes ; then
4291         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
4292 echo "configure:4293: checking if db.h is DB2" >&5
4293 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
4294   echo $ac_n "(cached) $ac_c" 1>&6
4295 else
4296   
4297                 cat > conftest.$ac_ext <<EOF
4298 #line 4299 "configure"
4299 #include "confdefs.h"
4300
4301 #                       include <db.h>
4302                         /* this check could be improved */
4303 #                       ifdef DB_VERSION_MAJOR
4304 #                               if DB_VERSION_MAJOR == 2
4305                                         __db_version_2
4306 #                               endif
4307 #                       endif
4308                 
4309 EOF
4310 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4311   egrep "__db_version_2" >/dev/null 2>&1; then
4312   rm -rf conftest*
4313   ol_cv_header_db2=yes
4314 else
4315   rm -rf conftest*
4316   ol_cv_header_db2=no
4317 fi
4318 rm -f conftest*
4319
4320 fi
4321
4322 echo "$ac_t""$ol_cv_header_db2" 1>&6
4323 else
4324         ol_cv_header_db2=no
4325 fi
4326
4327
4328  
4329  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
4330 echo "configure:4331: checking for Berkeley DB2" >&5
4331 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
4332   echo $ac_n "(cached) $ac_c" 1>&6
4333 else
4334   
4335         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
4336                 ol_cv_berkeley_db2=no
4337         else
4338                 ol_cv_berkeley_db2=yes
4339         fi
4340
4341 fi
4342
4343 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
4344  if test $ol_cv_berkeley_db2 = yes ; then
4345         cat >> confdefs.h <<\EOF
4346 #define HAVE_BERKELEY_DB2 1
4347 EOF
4348
4349  fi
4350
4351
4352         if test $ol_cv_berkeley_db2 = yes ; then
4353                 ol_link_ldbm=db2
4354                 ol_with_ldbm_api=db2
4355
4356                 if test $ol_with_ldbm_type = hash ; then
4357                         cat >> confdefs.h <<\EOF
4358 #define LDBM_USE_DBHASH 1
4359 EOF
4360
4361                 else
4362                         cat >> confdefs.h <<\EOF
4363 #define LDBM_USE_DBBTREE 1
4364 EOF
4365
4366                 fi
4367
4368                                                 if test $ol_cv_lib_db2 != yes ; then
4369                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
4370                 fi
4371         fi
4372 fi
4373
4374 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
4375         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
4376 echo "configure:4377: checking for Berkeley DB library" >&5
4377 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
4378   echo $ac_n "(cached) $ac_c" 1>&6
4379 else
4380         ol_LIBS="$LIBS"
4381         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
4382 echo "configure:4383: checking for dbopen" >&5
4383 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
4384   echo $ac_n "(cached) $ac_c" 1>&6
4385 else
4386   cat > conftest.$ac_ext <<EOF
4387 #line 4388 "configure"
4388 #include "confdefs.h"
4389 /* System header to define __stub macros and hopefully few prototypes,
4390     which can conflict with char dbopen(); below.  */
4391 #include <assert.h>
4392 /* Override any gcc2 internal prototype to avoid an error.  */
4393 /* We use char because int might match the return type of a gcc2
4394     builtin and then its argument prototype would still apply.  */
4395 char dbopen();
4396
4397 int main() {
4398
4399 /* The GNU C library defines this for functions which it implements
4400     to always fail with ENOSYS.  Some functions are actually named
4401     something starting with __ and the normal name is an alias.  */
4402 #if defined (__stub_dbopen) || defined (__stub___dbopen)
4403 choke me
4404 #else
4405 dbopen();
4406 #endif
4407
4408 ; return 0; }
4409 EOF
4410 if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4411   rm -rf conftest*
4412   eval "ac_cv_func_dbopen=yes"
4413 else
4414   echo "configure: failed program was:" >&5
4415   cat conftest.$ac_ext >&5
4416   rm -rf conftest*
4417   eval "ac_cv_func_dbopen=no"
4418 fi
4419 rm -f conftest*
4420 fi
4421
4422 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
4423   echo "$ac_t""yes" 1>&6
4424   ol_cv_lib_db=yes
4425 else
4426   echo "$ac_t""no" 1>&6
4427
4428                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
4429 echo "configure:4430: checking for dbopen in -ldb" >&5
4430 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
4431 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4432   echo $ac_n "(cached) $ac_c" 1>&6
4433 else
4434   ac_save_LIBS="$LIBS"
4435 LIBS="-ldb  $LIBS"
4436 cat > conftest.$ac_ext <<EOF
4437 #line 4438 "configure"
4438 #include "confdefs.h"
4439 /* Override any gcc2 internal prototype to avoid an error.  */
4440 /* We use char because int might match the return type of a gcc2
4441     builtin and then its argument prototype would still apply.  */
4442 char dbopen();
4443
4444 int main() {
4445 dbopen()
4446 ; return 0; }
4447 EOF
4448 if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4449   rm -rf conftest*
4450   eval "ac_cv_lib_$ac_lib_var=yes"
4451 else
4452   echo "configure: failed program was:" >&5
4453   cat conftest.$ac_ext >&5
4454   rm -rf conftest*
4455   eval "ac_cv_lib_$ac_lib_var=no"
4456 fi
4457 rm -f conftest*
4458 LIBS="$ac_save_LIBS"
4459
4460 fi
4461 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4462   echo "$ac_t""yes" 1>&6
4463   ol_cv_lib_db=-ldb
4464 else
4465   echo "$ac_t""no" 1>&6
4466 ol_cv_lib_db=no
4467 fi
4468
4469         
4470 fi
4471
4472         LIBS="$ol_LIBS"
4473
4474 fi
4475
4476 echo "$ac_t""$ol_cv_lib_db" 1>&6
4477
4478
4479 for ac_hdr in db_185.h
4480 do
4481 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4482 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4483 echo "configure:4484: checking for $ac_hdr" >&5
4484 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4485   echo $ac_n "(cached) $ac_c" 1>&6
4486 else
4487   cat > conftest.$ac_ext <<EOF
4488 #line 4489 "configure"
4489 #include "confdefs.h"
4490 #include <$ac_hdr>
4491 EOF
4492 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4493 { (eval echo configure:4494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4494 ac_err=`grep -v '^ *+' conftest.out`
4495 if test -z "$ac_err"; then
4496   rm -rf conftest*
4497   eval "ac_cv_header_$ac_safe=yes"
4498 else
4499   echo "$ac_err" >&5
4500   echo "configure: failed program was:" >&5
4501   cat conftest.$ac_ext >&5
4502   rm -rf conftest*
4503   eval "ac_cv_header_$ac_safe=no"
4504 fi
4505 rm -f conftest*
4506 fi
4507 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4508   echo "$ac_t""yes" 1>&6
4509     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4510   cat >> confdefs.h <<EOF
4511 #define $ac_tr_hdr 1
4512 EOF
4513  
4514 else
4515   echo "$ac_t""no" 1>&6
4516 fi
4517 done
4518
4519 if test $ol_cv_header_db2 = yes ; then
4520         
4521         ol_cv_header_db=$ac_cv_header_db_185_h
4522 else
4523         ol_cv_header_db=$ac_cv_header_db_h
4524 fi
4525
4526
4527  
4528  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
4529 echo "configure:4530: checking for Berkeley DB" >&5
4530 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
4531   echo $ac_n "(cached) $ac_c" 1>&6
4532 else
4533   
4534         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
4535                 ol_cv_berkeley_db=no
4536         else
4537                 ol_cv_berkeley_db=yes
4538         fi
4539
4540 fi
4541
4542 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
4543  if test $ol_cv_berkeley_db = yes ; then
4544         cat >> confdefs.h <<\EOF
4545 #define HAVE_BERKELEY_DB 1
4546 EOF
4547
4548  fi
4549
4550
4551         if test $ol_cv_berkeley_db = yes ; then
4552                 ol_link_ldbm=db
4553                 ol_with_ldbm_api=db
4554
4555                 if test $ol_with_ldbm_type = hash ; then
4556                         cat >> confdefs.h <<\EOF
4557 #define LDBM_USE_DBHASH 1
4558 EOF
4559
4560                 else
4561                         cat >> confdefs.h <<\EOF
4562 #define LDBM_USE_DBBTREE 1
4563 EOF
4564
4565                 fi
4566
4567                                                 if test $ol_cv_lib_db != yes ; then
4568                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
4569                 fi
4570         fi
4571 fi
4572
4573 if test $ol_with_ldbm_api = manual ; then
4574                 ol_link_ldbm=yes
4575
4576         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
4577
4578         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
4579 do
4580 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4581 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4582 echo "configure:4583: checking for $ac_hdr" >&5
4583 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4584   echo $ac_n "(cached) $ac_c" 1>&6
4585 else
4586   cat > conftest.$ac_ext <<EOF
4587 #line 4588 "configure"
4588 #include "confdefs.h"
4589 #include <$ac_hdr>
4590 EOF
4591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4592 { (eval echo configure:4593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4593 ac_err=`grep -v '^ *+' conftest.out`
4594 if test -z "$ac_err"; then
4595   rm -rf conftest*
4596   eval "ac_cv_header_$ac_safe=yes"
4597 else
4598   echo "$ac_err" >&5
4599   echo "configure: failed program was:" >&5
4600   cat conftest.$ac_ext >&5
4601   rm -rf conftest*
4602   eval "ac_cv_header_$ac_safe=no"
4603 fi
4604 rm -f conftest*
4605 fi
4606 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4607   echo "$ac_t""yes" 1>&6
4608     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4609   cat >> confdefs.h <<EOF
4610 #define $ac_tr_hdr 1
4611 EOF
4612  
4613 else
4614   echo "$ac_t""no" 1>&6
4615 fi
4616 done
4617
4618 fi
4619
4620 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
4621         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
4622         ol_with_ldbm_api=none
4623 fi
4624
4625 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
4626         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
4627 echo "configure:4628: checking for GDBM library" >&5
4628 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
4629   echo $ac_n "(cached) $ac_c" 1>&6
4630 else
4631         ol_LIBS="$LIBS"
4632         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
4633 echo "configure:4634: checking for gdbm_open" >&5
4634 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+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 /* System header to define __stub macros and hopefully few prototypes,
4641     which can conflict with char gdbm_open(); below.  */
4642 #include <assert.h>
4643 /* Override any gcc2 internal prototype to avoid an error.  */
4644 /* We use char because int might match the return type of a gcc2
4645     builtin and then its argument prototype would still apply.  */
4646 char gdbm_open();
4647
4648 int main() {
4649
4650 /* The GNU C library defines this for functions which it implements
4651     to always fail with ENOSYS.  Some functions are actually named
4652     something starting with __ and the normal name is an alias.  */
4653 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
4654 choke me
4655 #else
4656 gdbm_open();
4657 #endif
4658
4659 ; return 0; }
4660 EOF
4661 if { (eval echo configure:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4662   rm -rf conftest*
4663   eval "ac_cv_func_gdbm_open=yes"
4664 else
4665   echo "configure: failed program was:" >&5
4666   cat conftest.$ac_ext >&5
4667   rm -rf conftest*
4668   eval "ac_cv_func_gdbm_open=no"
4669 fi
4670 rm -f conftest*
4671 fi
4672
4673 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
4674   echo "$ac_t""yes" 1>&6
4675   ol_cv_lib_gdbm=yes
4676 else
4677   echo "$ac_t""no" 1>&6
4678
4679                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
4680 echo "configure:4681: checking for gdbm_open in -lgdbm" >&5
4681 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
4682 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4683   echo $ac_n "(cached) $ac_c" 1>&6
4684 else
4685   ac_save_LIBS="$LIBS"
4686 LIBS="-lgdbm  $LIBS"
4687 cat > conftest.$ac_ext <<EOF
4688 #line 4689 "configure"
4689 #include "confdefs.h"
4690 /* Override any gcc2 internal prototype to avoid an error.  */
4691 /* We use char because int might match the return type of a gcc2
4692     builtin and then its argument prototype would still apply.  */
4693 char gdbm_open();
4694
4695 int main() {
4696 gdbm_open()
4697 ; return 0; }
4698 EOF
4699 if { (eval echo configure:4700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4700   rm -rf conftest*
4701   eval "ac_cv_lib_$ac_lib_var=yes"
4702 else
4703   echo "configure: failed program was:" >&5
4704   cat conftest.$ac_ext >&5
4705   rm -rf conftest*
4706   eval "ac_cv_lib_$ac_lib_var=no"
4707 fi
4708 rm -f conftest*
4709 LIBS="$ac_save_LIBS"
4710
4711 fi
4712 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4713   echo "$ac_t""yes" 1>&6
4714   ol_cv_lib_gdbm=-lgdbm
4715 else
4716   echo "$ac_t""no" 1>&6
4717 ol_cv_lib_gdbm=no
4718 fi
4719
4720         
4721 fi
4722
4723         LIBS="$ol_LIBS"
4724
4725 fi
4726
4727 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
4728
4729
4730  for ac_hdr in gdbm.h
4731 do
4732 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4733 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4734 echo "configure:4735: checking for $ac_hdr" >&5
4735 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4736   echo $ac_n "(cached) $ac_c" 1>&6
4737 else
4738   cat > conftest.$ac_ext <<EOF
4739 #line 4740 "configure"
4740 #include "confdefs.h"
4741 #include <$ac_hdr>
4742 EOF
4743 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4744 { (eval echo configure:4745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4745 ac_err=`grep -v '^ *+' conftest.out`
4746 if test -z "$ac_err"; then
4747   rm -rf conftest*
4748   eval "ac_cv_header_$ac_safe=yes"
4749 else
4750   echo "$ac_err" >&5
4751   echo "configure: failed program was:" >&5
4752   cat conftest.$ac_ext >&5
4753   rm -rf conftest*
4754   eval "ac_cv_header_$ac_safe=no"
4755 fi
4756 rm -f conftest*
4757 fi
4758 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4759   echo "$ac_t""yes" 1>&6
4760     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4761   cat >> confdefs.h <<EOF
4762 #define $ac_tr_hdr 1
4763 EOF
4764  
4765 else
4766   echo "$ac_t""no" 1>&6
4767 fi
4768 done
4769
4770  echo $ac_n "checking for db""... $ac_c" 1>&6
4771 echo "configure:4772: checking for db" >&5
4772 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
4773   echo $ac_n "(cached) $ac_c" 1>&6
4774 else
4775   
4776         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
4777                 ol_cv_gdbm=no
4778         else
4779                 ol_cv_gdbm=yes
4780         fi
4781
4782 fi
4783
4784 echo "$ac_t""$ol_cv_gdbm" 1>&6
4785  if test $ol_cv_gdbm = yes ; then
4786         cat >> confdefs.h <<\EOF
4787 #define HAVE_GDBM 1
4788 EOF
4789
4790  fi
4791
4792
4793         if test $ol_cv_gdbm = yes ; then
4794                 ol_link_ldbm=gdbm
4795                 ol_with_ldbm_api=gdbm
4796
4797                 if test $ol_cv_lib_gdbm != yes ; then
4798                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
4799                 fi
4800         fi
4801 fi
4802
4803 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
4804         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
4805 echo "configure:4806: checking for NDBM library" >&5
4806 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
4807   echo $ac_n "(cached) $ac_c" 1>&6
4808 else
4809         ol_LIBS="$LIBS"
4810         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
4811 echo "configure:4812: checking for dbm_open" >&5
4812 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
4813   echo $ac_n "(cached) $ac_c" 1>&6
4814 else
4815   cat > conftest.$ac_ext <<EOF
4816 #line 4817 "configure"
4817 #include "confdefs.h"
4818 /* System header to define __stub macros and hopefully few prototypes,
4819     which can conflict with char dbm_open(); below.  */
4820 #include <assert.h>
4821 /* Override any gcc2 internal prototype to avoid an error.  */
4822 /* We use char because int might match the return type of a gcc2
4823     builtin and then its argument prototype would still apply.  */
4824 char dbm_open();
4825
4826 int main() {
4827
4828 /* The GNU C library defines this for functions which it implements
4829     to always fail with ENOSYS.  Some functions are actually named
4830     something starting with __ and the normal name is an alias.  */
4831 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
4832 choke me
4833 #else
4834 dbm_open();
4835 #endif
4836
4837 ; return 0; }
4838 EOF
4839 if { (eval echo configure:4840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4840   rm -rf conftest*
4841   eval "ac_cv_func_dbm_open=yes"
4842 else
4843   echo "configure: failed program was:" >&5
4844   cat conftest.$ac_ext >&5
4845   rm -rf conftest*
4846   eval "ac_cv_func_dbm_open=no"
4847 fi
4848 rm -f conftest*
4849 fi
4850
4851 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
4852   echo "$ac_t""yes" 1>&6
4853   ol_cv_lib_ndbm=yes
4854 else
4855   echo "$ac_t""no" 1>&6
4856
4857                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
4858 echo "configure:4859: checking for dbm_open in -lndbm" >&5
4859 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
4860 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4861   echo $ac_n "(cached) $ac_c" 1>&6
4862 else
4863   ac_save_LIBS="$LIBS"
4864 LIBS="-lndbm  $LIBS"
4865 cat > conftest.$ac_ext <<EOF
4866 #line 4867 "configure"
4867 #include "confdefs.h"
4868 /* Override any gcc2 internal prototype to avoid an error.  */
4869 /* We use char because int might match the return type of a gcc2
4870     builtin and then its argument prototype would still apply.  */
4871 char dbm_open();
4872
4873 int main() {
4874 dbm_open()
4875 ; return 0; }
4876 EOF
4877 if { (eval echo configure:4878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4878   rm -rf conftest*
4879   eval "ac_cv_lib_$ac_lib_var=yes"
4880 else
4881   echo "configure: failed program was:" >&5
4882   cat conftest.$ac_ext >&5
4883   rm -rf conftest*
4884   eval "ac_cv_lib_$ac_lib_var=no"
4885 fi
4886 rm -f conftest*
4887 LIBS="$ac_save_LIBS"
4888
4889 fi
4890 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4891   echo "$ac_t""yes" 1>&6
4892   ol_cv_lib_ndbm=-lndbm
4893 else
4894   echo "$ac_t""no" 1>&6
4895
4896                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
4897 echo "configure:4898: checking for dbm_open in -ldbm" >&5
4898 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
4899 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4900   echo $ac_n "(cached) $ac_c" 1>&6
4901 else
4902   ac_save_LIBS="$LIBS"
4903 LIBS="-ldbm  $LIBS"
4904 cat > conftest.$ac_ext <<EOF
4905 #line 4906 "configure"
4906 #include "confdefs.h"
4907 /* Override any gcc2 internal prototype to avoid an error.  */
4908 /* We use char because int might match the return type of a gcc2
4909     builtin and then its argument prototype would still apply.  */
4910 char dbm_open();
4911
4912 int main() {
4913 dbm_open()
4914 ; return 0; }
4915 EOF
4916 if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4917   rm -rf conftest*
4918   eval "ac_cv_lib_$ac_lib_var=yes"
4919 else
4920   echo "configure: failed program was:" >&5
4921   cat conftest.$ac_ext >&5
4922   rm -rf conftest*
4923   eval "ac_cv_lib_$ac_lib_var=no"
4924 fi
4925 rm -f conftest*
4926 LIBS="$ac_save_LIBS"
4927
4928 fi
4929 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4930   echo "$ac_t""yes" 1>&6
4931   ol_cv_lib_ndbm=-ldbm
4932 else
4933   echo "$ac_t""no" 1>&6
4934 ol_cv_lib_ndbm=no
4935 fi
4936                 
4937 fi
4938
4939         
4940 fi
4941
4942         LIBS="$ol_LIBS"
4943
4944 fi
4945
4946 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
4947
4948
4949  for ac_hdr in ndbm.h
4950 do
4951 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4952 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4953 echo "configure:4954: checking for $ac_hdr" >&5
4954 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4955   echo $ac_n "(cached) $ac_c" 1>&6
4956 else
4957   cat > conftest.$ac_ext <<EOF
4958 #line 4959 "configure"
4959 #include "confdefs.h"
4960 #include <$ac_hdr>
4961 EOF
4962 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4963 { (eval echo configure:4964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4964 ac_err=`grep -v '^ *+' conftest.out`
4965 if test -z "$ac_err"; then
4966   rm -rf conftest*
4967   eval "ac_cv_header_$ac_safe=yes"
4968 else
4969   echo "$ac_err" >&5
4970   echo "configure: failed program was:" >&5
4971   cat conftest.$ac_ext >&5
4972   rm -rf conftest*
4973   eval "ac_cv_header_$ac_safe=no"
4974 fi
4975 rm -f conftest*
4976 fi
4977 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4978   echo "$ac_t""yes" 1>&6
4979     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4980   cat >> confdefs.h <<EOF
4981 #define $ac_tr_hdr 1
4982 EOF
4983  
4984 else
4985   echo "$ac_t""no" 1>&6
4986 fi
4987 done
4988
4989  echo $ac_n "checking for db""... $ac_c" 1>&6
4990 echo "configure:4991: checking for db" >&5
4991 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
4992   echo $ac_n "(cached) $ac_c" 1>&6
4993 else
4994   
4995         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
4996                 ol_cv_ndbm=no
4997         else
4998                 ol_cv_ndbm=yes
4999         fi
5000
5001 fi
5002
5003 echo "$ac_t""$ol_cv_ndbm" 1>&6
5004  if test $ol_cv_ndbm = yes ; then
5005         cat >> confdefs.h <<\EOF
5006 #define HAVE_NDBM 1
5007 EOF
5008
5009  fi
5010
5011
5012         if test $ol_cv_ndbm = yes ; then
5013                 ol_link_ldbm=ndbm
5014                 ol_with_ldbm_api=ndbm
5015
5016                 if test $ol_with_ldbm_api = ndbm ; then
5017                         echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
5018                 fi
5019
5020                 if test $ol_cv_lib_ndbm != yes ; then
5021                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
5022                 fi
5023         fi
5024 fi
5025
5026 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
5027         echo "configure: warning: could not find suitable LDBM backend" 1>&2
5028         if test $ol_enable_ldbm = yes ; then
5029                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
5030         fi
5031
5032         echo "configure: warning: disabling LDBM" 1>&2
5033         ol_enable_ldbm=no
5034 fi
5035
5036 if test $ol_enable_wrappers = yes ; then
5037         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
5038 echo "configure:5039: checking for hosts_access in -lwrap" >&5
5039 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
5040 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5041   echo $ac_n "(cached) $ac_c" 1>&6
5042 else
5043   ac_save_LIBS="$LIBS"
5044 LIBS="-lwrap  $LIBS"
5045 cat > conftest.$ac_ext <<EOF
5046 #line 5047 "configure"
5047 #include "confdefs.h"
5048 /* Override any gcc2 internal prototype to avoid an error.  */
5049 /* We use char because int might match the return type of a gcc2
5050     builtin and then its argument prototype would still apply.  */
5051 char hosts_access();
5052
5053 int main() {
5054 hosts_access()
5055 ; return 0; }
5056 EOF
5057 if { (eval echo configure:5058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5058   rm -rf conftest*
5059   eval "ac_cv_lib_$ac_lib_var=yes"
5060 else
5061   echo "configure: failed program was:" >&5
5062   cat conftest.$ac_ext >&5
5063   rm -rf conftest*
5064   eval "ac_cv_lib_$ac_lib_var=no"
5065 fi
5066 rm -f conftest*
5067 LIBS="$ac_save_LIBS"
5068
5069 fi
5070 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5071   echo "$ac_t""yes" 1>&6
5072   have_wrappers=yes
5073 else
5074   echo "$ac_t""no" 1>&6
5075 have_wrappers=no
5076 fi
5077
5078
5079         if test $have_wrappers = yes ; then
5080                 cat >> confdefs.h <<\EOF
5081 #define HAVE_TCPD 1
5082 EOF
5083
5084                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
5085         else
5086                 echo "configure: warning: could not find -lwrap" 1>&2
5087                 if test $ol_enable_wrappers = yes ; then
5088                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
5089                 fi
5090
5091                 echo "configure: warning: disabling wrappers support" 1>&2
5092                 ol_enable_wrappers=no
5093         fi
5094
5095 fi
5096
5097 # ud needs termcap (should insert check here)
5098 ol_link_termcap=no
5099 for ac_hdr in termcap.h ncurses.h
5100 do
5101 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5102 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5103 echo "configure:5104: checking for $ac_hdr" >&5
5104 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5105   echo $ac_n "(cached) $ac_c" 1>&6
5106 else
5107   cat > conftest.$ac_ext <<EOF
5108 #line 5109 "configure"
5109 #include "confdefs.h"
5110 #include <$ac_hdr>
5111 EOF
5112 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5113 { (eval echo configure:5114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5114 ac_err=`grep -v '^ *+' conftest.out`
5115 if test -z "$ac_err"; then
5116   rm -rf conftest*
5117   eval "ac_cv_header_$ac_safe=yes"
5118 else
5119   echo "$ac_err" >&5
5120   echo "configure: failed program was:" >&5
5121   cat conftest.$ac_ext >&5
5122   rm -rf conftest*
5123   eval "ac_cv_header_$ac_safe=no"
5124 fi
5125 rm -f conftest*
5126 fi
5127 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5128   echo "$ac_t""yes" 1>&6
5129     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5130   cat >> confdefs.h <<EOF
5131 #define $ac_tr_hdr 1
5132 EOF
5133  
5134 else
5135   echo "$ac_t""no" 1>&6
5136 fi
5137 done
5138
5139
5140 if test $ol_link_termcap = no ; then
5141         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
5142 echo "configure:5143: checking for tputs in -ltermcap" >&5
5143 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
5144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5145   echo $ac_n "(cached) $ac_c" 1>&6
5146 else
5147   ac_save_LIBS="$LIBS"
5148 LIBS="-ltermcap  $LIBS"
5149 cat > conftest.$ac_ext <<EOF
5150 #line 5151 "configure"
5151 #include "confdefs.h"
5152 /* Override any gcc2 internal prototype to avoid an error.  */
5153 /* We use char because int might match the return type of a gcc2
5154     builtin and then its argument prototype would still apply.  */
5155 char tputs();
5156
5157 int main() {
5158 tputs()
5159 ; return 0; }
5160 EOF
5161 if { (eval echo configure:5162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5162   rm -rf conftest*
5163   eval "ac_cv_lib_$ac_lib_var=yes"
5164 else
5165   echo "configure: failed program was:" >&5
5166   cat conftest.$ac_ext >&5
5167   rm -rf conftest*
5168   eval "ac_cv_lib_$ac_lib_var=no"
5169 fi
5170 rm -f conftest*
5171 LIBS="$ac_save_LIBS"
5172
5173 fi
5174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5175   echo "$ac_t""yes" 1>&6
5176   have_termcap=yes
5177 else
5178   echo "$ac_t""no" 1>&6
5179 have_termcap=no
5180 fi
5181
5182         if test $have_termcap = yes ; then
5183                 cat >> confdefs.h <<\EOF
5184 #define HAVE_TERMCAP 1
5185 EOF
5186
5187                 ol_link_termcap=yes
5188                 TERMCAP_LIBS=-ltermcap
5189         fi
5190 fi
5191
5192 if test $ol_link_termcap = no ; then
5193         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
5194 echo "configure:5195: checking for initscr in -lncurses" >&5
5195 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
5196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5197   echo $ac_n "(cached) $ac_c" 1>&6
5198 else
5199   ac_save_LIBS="$LIBS"
5200 LIBS="-lncurses  $LIBS"
5201 cat > conftest.$ac_ext <<EOF
5202 #line 5203 "configure"
5203 #include "confdefs.h"
5204 /* Override any gcc2 internal prototype to avoid an error.  */
5205 /* We use char because int might match the return type of a gcc2
5206     builtin and then its argument prototype would still apply.  */
5207 char initscr();
5208
5209 int main() {
5210 initscr()
5211 ; return 0; }
5212 EOF
5213 if { (eval echo configure:5214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5214   rm -rf conftest*
5215   eval "ac_cv_lib_$ac_lib_var=yes"
5216 else
5217   echo "configure: failed program was:" >&5
5218   cat conftest.$ac_ext >&5
5219   rm -rf conftest*
5220   eval "ac_cv_lib_$ac_lib_var=no"
5221 fi
5222 rm -f conftest*
5223 LIBS="$ac_save_LIBS"
5224
5225 fi
5226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5227   echo "$ac_t""yes" 1>&6
5228   have_ncurses=yes
5229 else
5230   echo "$ac_t""no" 1>&6
5231 have_ncurses=no
5232 fi
5233
5234         if test $have_ncurses = yes ; then
5235                 cat >> confdefs.h <<\EOF
5236 #define HAVE_NCURSES 1
5237 EOF
5238
5239                 ol_link_termcap=yes
5240                 TERMCAP_LIBS=-lncurses
5241         fi
5242 fi
5243
5244 if test $ol_link_termcap = no ; then
5245         cat >> confdefs.h <<\EOF
5246 #define NO_TERMCAP 1
5247 EOF
5248
5249         TERMCAP_LIBS=
5250 fi
5251
5252 # FreeBSD (and others) have crypt(3) in -lcrypt
5253 if test $ol_enable_crypt != no ; then
5254         echo $ac_n "checking for crypt""... $ac_c" 1>&6
5255 echo "configure:5256: checking for crypt" >&5
5256 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
5257   echo $ac_n "(cached) $ac_c" 1>&6
5258 else
5259   cat > conftest.$ac_ext <<EOF
5260 #line 5261 "configure"
5261 #include "confdefs.h"
5262 /* System header to define __stub macros and hopefully few prototypes,
5263     which can conflict with char crypt(); below.  */
5264 #include <assert.h>
5265 /* Override any gcc2 internal prototype to avoid an error.  */
5266 /* We use char because int might match the return type of a gcc2
5267     builtin and then its argument prototype would still apply.  */
5268 char crypt();
5269
5270 int main() {
5271
5272 /* The GNU C library defines this for functions which it implements
5273     to always fail with ENOSYS.  Some functions are actually named
5274     something starting with __ and the normal name is an alias.  */
5275 #if defined (__stub_crypt) || defined (__stub___crypt)
5276 choke me
5277 #else
5278 crypt();
5279 #endif
5280
5281 ; return 0; }
5282 EOF
5283 if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5284   rm -rf conftest*
5285   eval "ac_cv_func_crypt=yes"
5286 else
5287   echo "configure: failed program was:" >&5
5288   cat conftest.$ac_ext >&5
5289   rm -rf conftest*
5290   eval "ac_cv_func_crypt=no"
5291 fi
5292 rm -f conftest*
5293 fi
5294
5295 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
5296   echo "$ac_t""yes" 1>&6
5297   have_crypt=yes
5298 else
5299   echo "$ac_t""no" 1>&6
5300
5301                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
5302 echo "configure:5303: checking for crypt in -lcrypt" >&5
5303 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
5304 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5305   echo $ac_n "(cached) $ac_c" 1>&6
5306 else
5307   ac_save_LIBS="$LIBS"
5308 LIBS="-lcrypt  $LIBS"
5309 cat > conftest.$ac_ext <<EOF
5310 #line 5311 "configure"
5311 #include "confdefs.h"
5312 /* Override any gcc2 internal prototype to avoid an error.  */
5313 /* We use char because int might match the return type of a gcc2
5314     builtin and then its argument prototype would still apply.  */
5315 char crypt();
5316
5317 int main() {
5318 crypt()
5319 ; return 0; }
5320 EOF
5321 if { (eval echo configure:5322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5322   rm -rf conftest*
5323   eval "ac_cv_lib_$ac_lib_var=yes"
5324 else
5325   echo "configure: failed program was:" >&5
5326   cat conftest.$ac_ext >&5
5327   rm -rf conftest*
5328   eval "ac_cv_lib_$ac_lib_var=no"
5329 fi
5330 rm -f conftest*
5331 LIBS="$ac_save_LIBS"
5332
5333 fi
5334 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5335   echo "$ac_t""yes" 1>&6
5336   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
5337                         have_crypt=yes
5338 else
5339   echo "$ac_t""no" 1>&6
5340 have_crypt=no
5341 fi
5342
5343 fi
5344
5345
5346         if test $have_crypt = yes ; then
5347                 cat >> confdefs.h <<\EOF
5348 #define HAVE_CRYPT 1
5349 EOF
5350
5351         else
5352                 echo "configure: warning: could not find crypt" 1>&2
5353                 if test $ol_enable_crypt = yes ; then
5354                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
5355                 fi
5356
5357                 echo "configure: warning: disabling crypt support" 1>&2
5358                 ol_enable_crypt=no
5359         fi
5360 fi
5361
5362 # FreeBSD (and others) have setproctitle(3) in -lutil
5363 if test $ol_enable_proctitle != no ; then
5364         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
5365 echo "configure:5366: checking for setproctitle" >&5
5366 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
5367   echo $ac_n "(cached) $ac_c" 1>&6
5368 else
5369   cat > conftest.$ac_ext <<EOF
5370 #line 5371 "configure"
5371 #include "confdefs.h"
5372 /* System header to define __stub macros and hopefully few prototypes,
5373     which can conflict with char setproctitle(); below.  */
5374 #include <assert.h>
5375 /* Override any gcc2 internal prototype to avoid an error.  */
5376 /* We use char because int might match the return type of a gcc2
5377     builtin and then its argument prototype would still apply.  */
5378 char setproctitle();
5379
5380 int main() {
5381
5382 /* The GNU C library defines this for functions which it implements
5383     to always fail with ENOSYS.  Some functions are actually named
5384     something starting with __ and the normal name is an alias.  */
5385 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
5386 choke me
5387 #else
5388 setproctitle();
5389 #endif
5390
5391 ; return 0; }
5392 EOF
5393 if { (eval echo configure:5394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5394   rm -rf conftest*
5395   eval "ac_cv_func_setproctitle=yes"
5396 else
5397   echo "configure: failed program was:" >&5
5398   cat conftest.$ac_ext >&5
5399   rm -rf conftest*
5400   eval "ac_cv_func_setproctitle=no"
5401 fi
5402 rm -f conftest*
5403 fi
5404
5405 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
5406   echo "$ac_t""yes" 1>&6
5407   have_setproctitle=yes
5408 else
5409   echo "$ac_t""no" 1>&6
5410
5411                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
5412 echo "configure:5413: checking for setproctitle in -lutil" >&5
5413 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
5414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5415   echo $ac_n "(cached) $ac_c" 1>&6
5416 else
5417   ac_save_LIBS="$LIBS"
5418 LIBS="-lutil  $LIBS"
5419 cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 /* Override any gcc2 internal prototype to avoid an error.  */
5423 /* We use char because int might match the return type of a gcc2
5424     builtin and then its argument prototype would still apply.  */
5425 char setproctitle();
5426
5427 int main() {
5428 setproctitle()
5429 ; return 0; }
5430 EOF
5431 if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=yes"
5434 else
5435   echo "configure: failed program was:" >&5
5436   cat conftest.$ac_ext >&5
5437   rm -rf conftest*
5438   eval "ac_cv_lib_$ac_lib_var=no"
5439 fi
5440 rm -f conftest*
5441 LIBS="$ac_save_LIBS"
5442
5443 fi
5444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5445   echo "$ac_t""yes" 1>&6
5446   have_setproctitle=yes
5447                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
5448 else
5449   echo "$ac_t""no" 1>&6
5450 have_setproctitle=no
5451                         LIBOBJS="$LIBOBJS setproctitle.o"
5452 fi
5453
5454 fi
5455
5456
5457         if test $have_setproctitle = yes ; then
5458                 cat >> confdefs.h <<\EOF
5459 #define HAVE_SETPROCTITLE 1
5460 EOF
5461
5462         fi
5463 fi
5464
5465 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
5466 echo "configure:5467: checking for ANSI C header files" >&5
5467 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
5468   echo $ac_n "(cached) $ac_c" 1>&6
5469 else
5470   cat > conftest.$ac_ext <<EOF
5471 #line 5472 "configure"
5472 #include "confdefs.h"
5473 #include <stdlib.h>
5474 #include <stdarg.h>
5475 #include <string.h>
5476 #include <float.h>
5477 EOF
5478 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5479 { (eval echo configure:5480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5480 ac_err=`grep -v '^ *+' conftest.out`
5481 if test -z "$ac_err"; then
5482   rm -rf conftest*
5483   ac_cv_header_stdc=yes
5484 else
5485   echo "$ac_err" >&5
5486   echo "configure: failed program was:" >&5
5487   cat conftest.$ac_ext >&5
5488   rm -rf conftest*
5489   ac_cv_header_stdc=no
5490 fi
5491 rm -f conftest*
5492
5493 if test $ac_cv_header_stdc = yes; then
5494   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5495 cat > conftest.$ac_ext <<EOF
5496 #line 5497 "configure"
5497 #include "confdefs.h"
5498 #include <string.h>
5499 EOF
5500 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5501   egrep "memchr" >/dev/null 2>&1; then
5502   :
5503 else
5504   rm -rf conftest*
5505   ac_cv_header_stdc=no
5506 fi
5507 rm -f conftest*
5508
5509 fi
5510
5511 if test $ac_cv_header_stdc = yes; then
5512   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5513 cat > conftest.$ac_ext <<EOF
5514 #line 5515 "configure"
5515 #include "confdefs.h"
5516 #include <stdlib.h>
5517 EOF
5518 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5519   egrep "free" >/dev/null 2>&1; then
5520   :
5521 else
5522   rm -rf conftest*
5523   ac_cv_header_stdc=no
5524 fi
5525 rm -f conftest*
5526
5527 fi
5528
5529 if test $ac_cv_header_stdc = yes; then
5530   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5531 if test "$cross_compiling" = yes; then
5532   :
5533 else
5534   cat > conftest.$ac_ext <<EOF
5535 #line 5536 "configure"
5536 #include "confdefs.h"
5537 #include <ctype.h>
5538 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5539 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5540 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5541 int main () { int i; for (i = 0; i < 256; i++)
5542 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
5543 exit (0); }
5544
5545 EOF
5546 if { (eval echo configure:5547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5547 then
5548   :
5549 else
5550   echo "configure: failed program was:" >&5
5551   cat conftest.$ac_ext >&5
5552   rm -fr conftest*
5553   ac_cv_header_stdc=no
5554 fi
5555 rm -fr conftest*
5556 fi
5557
5558 fi
5559 fi
5560
5561 echo "$ac_t""$ac_cv_header_stdc" 1>&6
5562 if test $ac_cv_header_stdc = yes; then
5563   cat >> confdefs.h <<\EOF
5564 #define STDC_HEADERS 1
5565 EOF
5566
5567 fi
5568
5569
5570 if test $ac_cv_header_stdc != yes; then
5571         echo "configure: warning: could not locate Standard C headers" 1>&2
5572 fi
5573
5574 ac_header_dirent=no
5575 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
5576 do
5577 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5578 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
5579 echo "configure:5580: checking for $ac_hdr that defines DIR" >&5
5580 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
5581   echo $ac_n "(cached) $ac_c" 1>&6
5582 else
5583   cat > conftest.$ac_ext <<EOF
5584 #line 5585 "configure"
5585 #include "confdefs.h"
5586 #include <sys/types.h>
5587 #include <$ac_hdr>
5588 int main() {
5589 DIR *dirp = 0;
5590 ; return 0; }
5591 EOF
5592 if { (eval echo configure:5593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5593   rm -rf conftest*
5594   eval "ac_cv_header_dirent_$ac_safe=yes"
5595 else
5596   echo "configure: failed program was:" >&5
5597   cat conftest.$ac_ext >&5
5598   rm -rf conftest*
5599   eval "ac_cv_header_dirent_$ac_safe=no"
5600 fi
5601 rm -f conftest*
5602 fi
5603 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
5604   echo "$ac_t""yes" 1>&6
5605     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5606   cat >> confdefs.h <<EOF
5607 #define $ac_tr_hdr 1
5608 EOF
5609  ac_header_dirent=$ac_hdr; break
5610 else
5611   echo "$ac_t""no" 1>&6
5612 fi
5613 done
5614 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
5615 if test $ac_header_dirent = dirent.h; then
5616 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
5617 echo "configure:5618: checking for opendir in -ldir" >&5
5618 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
5619 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5620   echo $ac_n "(cached) $ac_c" 1>&6
5621 else
5622   ac_save_LIBS="$LIBS"
5623 LIBS="-ldir  $LIBS"
5624 cat > conftest.$ac_ext <<EOF
5625 #line 5626 "configure"
5626 #include "confdefs.h"
5627 /* Override any gcc2 internal prototype to avoid an error.  */
5628 /* We use char because int might match the return type of a gcc2
5629     builtin and then its argument prototype would still apply.  */
5630 char opendir();
5631
5632 int main() {
5633 opendir()
5634 ; return 0; }
5635 EOF
5636 if { (eval echo configure:5637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5637   rm -rf conftest*
5638   eval "ac_cv_lib_$ac_lib_var=yes"
5639 else
5640   echo "configure: failed program was:" >&5
5641   cat conftest.$ac_ext >&5
5642   rm -rf conftest*
5643   eval "ac_cv_lib_$ac_lib_var=no"
5644 fi
5645 rm -f conftest*
5646 LIBS="$ac_save_LIBS"
5647
5648 fi
5649 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5650   echo "$ac_t""yes" 1>&6
5651   LIBS="$LIBS -ldir"
5652 else
5653   echo "$ac_t""no" 1>&6
5654 fi
5655
5656 else
5657 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
5658 echo "configure:5659: checking for opendir in -lx" >&5
5659 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
5660 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5661   echo $ac_n "(cached) $ac_c" 1>&6
5662 else
5663   ac_save_LIBS="$LIBS"
5664 LIBS="-lx  $LIBS"
5665 cat > conftest.$ac_ext <<EOF
5666 #line 5667 "configure"
5667 #include "confdefs.h"
5668 /* Override any gcc2 internal prototype to avoid an error.  */
5669 /* We use char because int might match the return type of a gcc2
5670     builtin and then its argument prototype would still apply.  */
5671 char opendir();
5672
5673 int main() {
5674 opendir()
5675 ; return 0; }
5676 EOF
5677 if { (eval echo configure:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5678   rm -rf conftest*
5679   eval "ac_cv_lib_$ac_lib_var=yes"
5680 else
5681   echo "configure: failed program was:" >&5
5682   cat conftest.$ac_ext >&5
5683   rm -rf conftest*
5684   eval "ac_cv_lib_$ac_lib_var=no"
5685 fi
5686 rm -f conftest*
5687 LIBS="$ac_save_LIBS"
5688
5689 fi
5690 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5691   echo "$ac_t""yes" 1>&6
5692   LIBS="$LIBS -lx"
5693 else
5694   echo "$ac_t""no" 1>&6
5695 fi
5696
5697 fi
5698
5699 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
5700 echo "configure:5701: checking for sys/wait.h that is POSIX.1 compatible" >&5
5701 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
5702   echo $ac_n "(cached) $ac_c" 1>&6
5703 else
5704   cat > conftest.$ac_ext <<EOF
5705 #line 5706 "configure"
5706 #include "confdefs.h"
5707 #include <sys/types.h>
5708 #include <sys/wait.h>
5709 #ifndef WEXITSTATUS
5710 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
5711 #endif
5712 #ifndef WIFEXITED
5713 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
5714 #endif
5715 int main() {
5716 int s;
5717 wait (&s);
5718 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
5719 ; return 0; }
5720 EOF
5721 if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5722   rm -rf conftest*
5723   ac_cv_header_sys_wait_h=yes
5724 else
5725   echo "configure: failed program was:" >&5
5726   cat conftest.$ac_ext >&5
5727   rm -rf conftest*
5728   ac_cv_header_sys_wait_h=no
5729 fi
5730 rm -f conftest*
5731 fi
5732
5733 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
5734 if test $ac_cv_header_sys_wait_h = yes; then
5735   cat >> confdefs.h <<\EOF
5736 #define HAVE_SYS_WAIT_H 1
5737 EOF
5738
5739 fi
5740
5741 for ac_hdr in \
5742         stdarg.h                \
5743         stddef.h                \
5744         errno.h                 \
5745         fcntl.h                 \
5746         filio.h                 \
5747         getopt.h                \
5748         libutil.h               \
5749         limits.h                \
5750         malloc.h                \
5751         regex.h                 \
5752         pwd.h                   \
5753         sgtty.h                 \
5754         sys/file.h              \
5755         sys/filio.h             \
5756         sys/errno.h             \
5757         sys/ioctl.h             \
5758         sys/param.h             \
5759         sys/resource.h  \
5760         sys/socket.h    \
5761         sys/syslog.h    \
5762         sys/time.h              \
5763         sys/types.h             \
5764         syslog.h                \
5765         termios.h               \
5766         unistd.h                \
5767
5768 do
5769 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5770 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5771 echo "configure:5772: checking for $ac_hdr" >&5
5772 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5773   echo $ac_n "(cached) $ac_c" 1>&6
5774 else
5775   cat > conftest.$ac_ext <<EOF
5776 #line 5777 "configure"
5777 #include "confdefs.h"
5778 #include <$ac_hdr>
5779 EOF
5780 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5781 { (eval echo configure:5782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5782 ac_err=`grep -v '^ *+' conftest.out`
5783 if test -z "$ac_err"; then
5784   rm -rf conftest*
5785   eval "ac_cv_header_$ac_safe=yes"
5786 else
5787   echo "$ac_err" >&5
5788   echo "configure: failed program was:" >&5
5789   cat conftest.$ac_ext >&5
5790   rm -rf conftest*
5791   eval "ac_cv_header_$ac_safe=no"
5792 fi
5793 rm -f conftest*
5794 fi
5795 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5796   echo "$ac_t""yes" 1>&6
5797     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5798   cat >> confdefs.h <<EOF
5799 #define $ac_tr_hdr 1
5800 EOF
5801  
5802 else
5803   echo "$ac_t""no" 1>&6
5804 fi
5805 done
5806
5807
5808 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
5809 echo "configure:5810: checking for uid_t in sys/types.h" >&5
5810 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
5811   echo $ac_n "(cached) $ac_c" 1>&6
5812 else
5813   cat > conftest.$ac_ext <<EOF
5814 #line 5815 "configure"
5815 #include "confdefs.h"
5816 #include <sys/types.h>
5817 EOF
5818 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5819   egrep "uid_t" >/dev/null 2>&1; then
5820   rm -rf conftest*
5821   ac_cv_type_uid_t=yes
5822 else
5823   rm -rf conftest*
5824   ac_cv_type_uid_t=no
5825 fi
5826 rm -f conftest*
5827
5828 fi
5829
5830 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
5831 if test $ac_cv_type_uid_t = no; then
5832   cat >> confdefs.h <<\EOF
5833 #define uid_t int
5834 EOF
5835
5836   cat >> confdefs.h <<\EOF
5837 #define gid_t int
5838 EOF
5839
5840 fi
5841
5842 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
5843 echo "configure:5844: checking type of array argument to getgroups" >&5
5844 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
5845   echo $ac_n "(cached) $ac_c" 1>&6
5846 else
5847   if test "$cross_compiling" = yes; then
5848   ac_cv_type_getgroups=cross
5849 else
5850   cat > conftest.$ac_ext <<EOF
5851 #line 5852 "configure"
5852 #include "confdefs.h"
5853
5854 /* Thanks to Mike Rendell for this test.  */
5855 #include <sys/types.h>
5856 #define NGID 256
5857 #undef MAX
5858 #define MAX(x, y) ((x) > (y) ? (x) : (y))
5859 main()
5860 {
5861   gid_t gidset[NGID];
5862   int i, n;
5863   union { gid_t gval; long lval; }  val;
5864
5865   val.lval = -1;
5866   for (i = 0; i < NGID; i++)
5867     gidset[i] = val.gval;
5868   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
5869                  gidset);
5870   /* Exit non-zero if getgroups seems to require an array of ints.  This
5871      happens when gid_t is short but getgroups modifies an array of ints.  */
5872   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
5873 }
5874
5875 EOF
5876 if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5877 then
5878     ac_cv_type_getgroups=gid_t
5879 else
5880   echo "configure: failed program was:" >&5
5881   cat conftest.$ac_ext >&5
5882   rm -fr conftest*
5883   ac_cv_type_getgroups=int
5884 fi
5885 rm -fr conftest*
5886 fi
5887
5888 if test $ac_cv_type_getgroups = cross; then
5889         cat > conftest.$ac_ext <<EOF
5890 #line 5891 "configure"
5891 #include "confdefs.h"
5892 #include <unistd.h>
5893 EOF
5894 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5895   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
5896   rm -rf conftest*
5897   ac_cv_type_getgroups=gid_t
5898 else
5899   rm -rf conftest*
5900   ac_cv_type_getgroups=int
5901 fi
5902 rm -f conftest*
5903
5904 fi
5905 fi
5906
5907 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
5908 cat >> confdefs.h <<EOF
5909 #define GETGROUPS_T $ac_cv_type_getgroups
5910 EOF
5911
5912
5913 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
5914 echo "configure:5915: checking for mode_t" >&5
5915 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
5916   echo $ac_n "(cached) $ac_c" 1>&6
5917 else
5918   cat > conftest.$ac_ext <<EOF
5919 #line 5920 "configure"
5920 #include "confdefs.h"
5921 #include <sys/types.h>
5922 #if STDC_HEADERS
5923 #include <stdlib.h>
5924 #include <stddef.h>
5925 #endif
5926 EOF
5927 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5928   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5929   rm -rf conftest*
5930   ac_cv_type_mode_t=yes
5931 else
5932   rm -rf conftest*
5933   ac_cv_type_mode_t=no
5934 fi
5935 rm -f conftest*
5936
5937 fi
5938 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
5939 if test $ac_cv_type_mode_t = no; then
5940   cat >> confdefs.h <<\EOF
5941 #define mode_t int
5942 EOF
5943
5944 fi
5945
5946 echo $ac_n "checking for off_t""... $ac_c" 1>&6
5947 echo "configure:5948: checking for off_t" >&5
5948 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
5949   echo $ac_n "(cached) $ac_c" 1>&6
5950 else
5951   cat > conftest.$ac_ext <<EOF
5952 #line 5953 "configure"
5953 #include "confdefs.h"
5954 #include <sys/types.h>
5955 #if STDC_HEADERS
5956 #include <stdlib.h>
5957 #include <stddef.h>
5958 #endif
5959 EOF
5960 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5961   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5962   rm -rf conftest*
5963   ac_cv_type_off_t=yes
5964 else
5965   rm -rf conftest*
5966   ac_cv_type_off_t=no
5967 fi
5968 rm -f conftest*
5969
5970 fi
5971 echo "$ac_t""$ac_cv_type_off_t" 1>&6
5972 if test $ac_cv_type_off_t = no; then
5973   cat >> confdefs.h <<\EOF
5974 #define off_t long
5975 EOF
5976
5977 fi
5978
5979 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
5980 echo "configure:5981: checking for pid_t" >&5
5981 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
5982   echo $ac_n "(cached) $ac_c" 1>&6
5983 else
5984   cat > conftest.$ac_ext <<EOF
5985 #line 5986 "configure"
5986 #include "confdefs.h"
5987 #include <sys/types.h>
5988 #if STDC_HEADERS
5989 #include <stdlib.h>
5990 #include <stddef.h>
5991 #endif
5992 EOF
5993 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5994   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5995   rm -rf conftest*
5996   ac_cv_type_pid_t=yes
5997 else
5998   rm -rf conftest*
5999   ac_cv_type_pid_t=no
6000 fi
6001 rm -f conftest*
6002
6003 fi
6004 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
6005 if test $ac_cv_type_pid_t = no; then
6006   cat >> confdefs.h <<\EOF
6007 #define pid_t int
6008 EOF
6009
6010 fi
6011
6012 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
6013 echo "configure:6014: checking return type of signal handlers" >&5
6014 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
6015   echo $ac_n "(cached) $ac_c" 1>&6
6016 else
6017   cat > conftest.$ac_ext <<EOF
6018 #line 6019 "configure"
6019 #include "confdefs.h"
6020 #include <sys/types.h>
6021 #include <signal.h>
6022 #ifdef signal
6023 #undef signal
6024 #endif
6025 #ifdef __cplusplus
6026 extern "C" void (*signal (int, void (*)(int)))(int);
6027 #else
6028 void (*signal ()) ();
6029 #endif
6030
6031 int main() {
6032 int i;
6033 ; return 0; }
6034 EOF
6035 if { (eval echo configure:6036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6036   rm -rf conftest*
6037   ac_cv_type_signal=void
6038 else
6039   echo "configure: failed program was:" >&5
6040   cat conftest.$ac_ext >&5
6041   rm -rf conftest*
6042   ac_cv_type_signal=int
6043 fi
6044 rm -f conftest*
6045 fi
6046
6047 echo "$ac_t""$ac_cv_type_signal" 1>&6
6048 cat >> confdefs.h <<EOF
6049 #define RETSIGTYPE $ac_cv_type_signal
6050 EOF
6051
6052
6053 echo $ac_n "checking for size_t""... $ac_c" 1>&6
6054 echo "configure:6055: checking for size_t" >&5
6055 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
6056   echo $ac_n "(cached) $ac_c" 1>&6
6057 else
6058   cat > conftest.$ac_ext <<EOF
6059 #line 6060 "configure"
6060 #include "confdefs.h"
6061 #include <sys/types.h>
6062 #if STDC_HEADERS
6063 #include <stdlib.h>
6064 #include <stddef.h>
6065 #endif
6066 EOF
6067 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6068   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6069   rm -rf conftest*
6070   ac_cv_type_size_t=yes
6071 else
6072   rm -rf conftest*
6073   ac_cv_type_size_t=no
6074 fi
6075 rm -f conftest*
6076
6077 fi
6078 echo "$ac_t""$ac_cv_type_size_t" 1>&6
6079 if test $ac_cv_type_size_t = no; then
6080   cat >> confdefs.h <<\EOF
6081 #define size_t unsigned
6082 EOF
6083
6084 fi
6085
6086 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
6087 echo "configure:6088: checking for uid_t in sys/types.h" >&5
6088 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
6089   echo $ac_n "(cached) $ac_c" 1>&6
6090 else
6091   cat > conftest.$ac_ext <<EOF
6092 #line 6093 "configure"
6093 #include "confdefs.h"
6094 #include <sys/types.h>
6095 EOF
6096 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6097   egrep "uid_t" >/dev/null 2>&1; then
6098   rm -rf conftest*
6099   ac_cv_type_uid_t=yes
6100 else
6101   rm -rf conftest*
6102   ac_cv_type_uid_t=no
6103 fi
6104 rm -f conftest*
6105
6106 fi
6107
6108 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
6109 if test $ac_cv_type_uid_t = no; then
6110   cat >> confdefs.h <<\EOF
6111 #define uid_t int
6112 EOF
6113
6114   cat >> confdefs.h <<\EOF
6115 #define gid_t int
6116 EOF
6117
6118 fi
6119
6120 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
6121 echo "configure:6122: checking for st_blksize in struct stat" >&5
6122 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
6123   echo $ac_n "(cached) $ac_c" 1>&6
6124 else
6125   cat > conftest.$ac_ext <<EOF
6126 #line 6127 "configure"
6127 #include "confdefs.h"
6128 #include <sys/types.h>
6129 #include <sys/stat.h>
6130 int main() {
6131 struct stat s; s.st_blksize;
6132 ; return 0; }
6133 EOF
6134 if { (eval echo configure:6135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6135   rm -rf conftest*
6136   ac_cv_struct_st_blksize=yes
6137 else
6138   echo "configure: failed program was:" >&5
6139   cat conftest.$ac_ext >&5
6140   rm -rf conftest*
6141   ac_cv_struct_st_blksize=no
6142 fi
6143 rm -f conftest*
6144 fi
6145
6146 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
6147 if test $ac_cv_struct_st_blksize = yes; then
6148   cat >> confdefs.h <<\EOF
6149 #define HAVE_ST_BLKSIZE 1
6150 EOF
6151
6152 fi
6153
6154 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6155 echo "configure:6156: checking whether time.h and sys/time.h may both be included" >&5
6156 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
6157   echo $ac_n "(cached) $ac_c" 1>&6
6158 else
6159   cat > conftest.$ac_ext <<EOF
6160 #line 6161 "configure"
6161 #include "confdefs.h"
6162 #include <sys/types.h>
6163 #include <sys/time.h>
6164 #include <time.h>
6165 int main() {
6166 struct tm *tp;
6167 ; return 0; }
6168 EOF
6169 if { (eval echo configure:6170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6170   rm -rf conftest*
6171   ac_cv_header_time=yes
6172 else
6173   echo "configure: failed program was:" >&5
6174   cat conftest.$ac_ext >&5
6175   rm -rf conftest*
6176   ac_cv_header_time=no
6177 fi
6178 rm -f conftest*
6179 fi
6180
6181 echo "$ac_t""$ac_cv_header_time" 1>&6
6182 if test $ac_cv_header_time = yes; then
6183   cat >> confdefs.h <<\EOF
6184 #define TIME_WITH_SYS_TIME 1
6185 EOF
6186
6187 fi
6188
6189 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
6190 echo "configure:6191: checking whether struct tm is in sys/time.h or time.h" >&5
6191 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
6192   echo $ac_n "(cached) $ac_c" 1>&6
6193 else
6194   cat > conftest.$ac_ext <<EOF
6195 #line 6196 "configure"
6196 #include "confdefs.h"
6197 #include <sys/types.h>
6198 #include <time.h>
6199 int main() {
6200 struct tm *tp; tp->tm_sec;
6201 ; return 0; }
6202 EOF
6203 if { (eval echo configure:6204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6204   rm -rf conftest*
6205   ac_cv_struct_tm=time.h
6206 else
6207   echo "configure: failed program was:" >&5
6208   cat conftest.$ac_ext >&5
6209   rm -rf conftest*
6210   ac_cv_struct_tm=sys/time.h
6211 fi
6212 rm -f conftest*
6213 fi
6214
6215 echo "$ac_t""$ac_cv_struct_tm" 1>&6
6216 if test $ac_cv_struct_tm = sys/time.h; then
6217   cat >> confdefs.h <<\EOF
6218 #define TM_IN_SYS_TIME 1
6219 EOF
6220
6221 fi
6222
6223
6224
6225 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
6226 echo "configure:6227: checking if toupper() requires islower()" >&5
6227 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
6228   echo $ac_n "(cached) $ac_c" 1>&6
6229 else
6230   
6231         if test "$cross_compiling" = yes; then
6232   ol_cv_c_upper_lower=safe
6233 else
6234   cat > conftest.$ac_ext <<EOF
6235 #line 6236 "configure"
6236 #include "confdefs.h"
6237
6238 #include <ctype.h>
6239 main()
6240 {
6241         if ('C' == toupper('C'))
6242                 exit(0);
6243         else
6244                 exit(1);
6245 }
6246 EOF
6247 if { (eval echo configure:6248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6248 then
6249   ol_cv_c_upper_lower=no
6250 else
6251   echo "configure: failed program was:" >&5
6252   cat conftest.$ac_ext >&5
6253   rm -fr conftest*
6254   ol_cv_c_upper_lower=yes
6255 fi
6256 rm -fr conftest*
6257 fi
6258
6259 fi
6260
6261 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
6262 if test $ol_cv_c_upper_lower != no ; then
6263         cat >> confdefs.h <<\EOF
6264 #define C_UPPER_LOWER 1
6265 EOF
6266
6267 fi
6268
6269 echo $ac_n "checking for working const""... $ac_c" 1>&6
6270 echo "configure:6271: checking for working const" >&5
6271 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
6272   echo $ac_n "(cached) $ac_c" 1>&6
6273 else
6274   cat > conftest.$ac_ext <<EOF
6275 #line 6276 "configure"
6276 #include "confdefs.h"
6277
6278 int main() {
6279
6280 /* Ultrix mips cc rejects this.  */
6281 typedef int charset[2]; const charset x;
6282 /* SunOS 4.1.1 cc rejects this.  */
6283 char const *const *ccp;
6284 char **p;
6285 /* NEC SVR4.0.2 mips cc rejects this.  */
6286 struct point {int x, y;};
6287 static struct point const zero = {0,0};
6288 /* AIX XL C 1.02.0.0 rejects this.
6289    It does not let you subtract one const X* pointer from another in an arm
6290    of an if-expression whose if-part is not a constant expression */
6291 const char *g = "string";
6292 ccp = &g + (g ? g-g : 0);
6293 /* HPUX 7.0 cc rejects these. */
6294 ++ccp;
6295 p = (char**) ccp;
6296 ccp = (char const *const *) p;
6297 { /* SCO 3.2v4 cc rejects this.  */
6298   char *t;
6299   char const *s = 0 ? (char *) 0 : (char const *) 0;
6300
6301   *t++ = 0;
6302 }
6303 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
6304   int x[] = {25, 17};
6305   const int *foo = &x[0];
6306   ++foo;
6307 }
6308 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
6309   typedef const int *iptr;
6310   iptr p = 0;
6311   ++p;
6312 }
6313 { /* AIX XL C 1.02.0.0 rejects this saying
6314      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
6315   struct s { int j; const int *ap[3]; };
6316   struct s *b; b->j = 5;
6317 }
6318 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6319   const int foo = 10;
6320 }
6321
6322 ; return 0; }
6323 EOF
6324 if { (eval echo configure:6325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6325   rm -rf conftest*
6326   ac_cv_c_const=yes
6327 else
6328   echo "configure: failed program was:" >&5
6329   cat conftest.$ac_ext >&5
6330   rm -rf conftest*
6331   ac_cv_c_const=no
6332 fi
6333 rm -f conftest*
6334 fi
6335
6336 echo "$ac_t""$ac_cv_c_const" 1>&6
6337 if test $ac_cv_c_const = no; then
6338   cat >> confdefs.h <<\EOF
6339 #define const 
6340 EOF
6341
6342 fi
6343
6344
6345
6346 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
6347 echo "configure:6348: checking for 8-bit clean memcmp" >&5
6348 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
6349   echo $ac_n "(cached) $ac_c" 1>&6
6350 else
6351   if test "$cross_compiling" = yes; then
6352   ac_cv_func_memcmp_clean=no
6353 else
6354   cat > conftest.$ac_ext <<EOF
6355 #line 6356 "configure"
6356 #include "confdefs.h"
6357
6358 main()
6359 {
6360   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
6361   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
6362 }
6363
6364 EOF
6365 if { (eval echo configure:6366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6366 then
6367   ac_cv_func_memcmp_clean=yes
6368 else
6369   echo "configure: failed program was:" >&5
6370   cat conftest.$ac_ext >&5
6371   rm -fr conftest*
6372   ac_cv_func_memcmp_clean=no
6373 fi
6374 rm -fr conftest*
6375 fi
6376
6377 fi
6378
6379 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
6380 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
6381
6382 echo $ac_n "checking for strftime""... $ac_c" 1>&6
6383 echo "configure:6384: checking for strftime" >&5
6384 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
6385   echo $ac_n "(cached) $ac_c" 1>&6
6386 else
6387   cat > conftest.$ac_ext <<EOF
6388 #line 6389 "configure"
6389 #include "confdefs.h"
6390 /* System header to define __stub macros and hopefully few prototypes,
6391     which can conflict with char strftime(); below.  */
6392 #include <assert.h>
6393 /* Override any gcc2 internal prototype to avoid an error.  */
6394 /* We use char because int might match the return type of a gcc2
6395     builtin and then its argument prototype would still apply.  */
6396 char strftime();
6397
6398 int main() {
6399
6400 /* The GNU C library defines this for functions which it implements
6401     to always fail with ENOSYS.  Some functions are actually named
6402     something starting with __ and the normal name is an alias.  */
6403 #if defined (__stub_strftime) || defined (__stub___strftime)
6404 choke me
6405 #else
6406 strftime();
6407 #endif
6408
6409 ; return 0; }
6410 EOF
6411 if { (eval echo configure:6412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6412   rm -rf conftest*
6413   eval "ac_cv_func_strftime=yes"
6414 else
6415   echo "configure: failed program was:" >&5
6416   cat conftest.$ac_ext >&5
6417   rm -rf conftest*
6418   eval "ac_cv_func_strftime=no"
6419 fi
6420 rm -f conftest*
6421 fi
6422
6423 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
6424   echo "$ac_t""yes" 1>&6
6425   cat >> confdefs.h <<\EOF
6426 #define HAVE_STRFTIME 1
6427 EOF
6428
6429 else
6430   echo "$ac_t""no" 1>&6
6431 # strftime is in -lintl on SCO UNIX.
6432 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
6433 echo "configure:6434: checking for strftime in -lintl" >&5
6434 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
6435 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6436   echo $ac_n "(cached) $ac_c" 1>&6
6437 else
6438   ac_save_LIBS="$LIBS"
6439 LIBS="-lintl  $LIBS"
6440 cat > conftest.$ac_ext <<EOF
6441 #line 6442 "configure"
6442 #include "confdefs.h"
6443 /* Override any gcc2 internal prototype to avoid an error.  */
6444 /* We use char because int might match the return type of a gcc2
6445     builtin and then its argument prototype would still apply.  */
6446 char strftime();
6447
6448 int main() {
6449 strftime()
6450 ; return 0; }
6451 EOF
6452 if { (eval echo configure:6453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6453   rm -rf conftest*
6454   eval "ac_cv_lib_$ac_lib_var=yes"
6455 else
6456   echo "configure: failed program was:" >&5
6457   cat conftest.$ac_ext >&5
6458   rm -rf conftest*
6459   eval "ac_cv_lib_$ac_lib_var=no"
6460 fi
6461 rm -f conftest*
6462 LIBS="$ac_save_LIBS"
6463
6464 fi
6465 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6466   echo "$ac_t""yes" 1>&6
6467   cat >> confdefs.h <<\EOF
6468 #define HAVE_STRFTIME 1
6469 EOF
6470
6471 LIBS="-lintl $LIBS"
6472 else
6473   echo "$ac_t""no" 1>&6
6474 fi
6475
6476 fi
6477
6478 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
6479 echo "configure:6480: checking for vprintf" >&5
6480 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483   cat > conftest.$ac_ext <<EOF
6484 #line 6485 "configure"
6485 #include "confdefs.h"
6486 /* System header to define __stub macros and hopefully few prototypes,
6487     which can conflict with char vprintf(); below.  */
6488 #include <assert.h>
6489 /* Override any gcc2 internal prototype to avoid an error.  */
6490 /* We use char because int might match the return type of a gcc2
6491     builtin and then its argument prototype would still apply.  */
6492 char vprintf();
6493
6494 int main() {
6495
6496 /* The GNU C library defines this for functions which it implements
6497     to always fail with ENOSYS.  Some functions are actually named
6498     something starting with __ and the normal name is an alias.  */
6499 #if defined (__stub_vprintf) || defined (__stub___vprintf)
6500 choke me
6501 #else
6502 vprintf();
6503 #endif
6504
6505 ; return 0; }
6506 EOF
6507 if { (eval echo configure:6508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6508   rm -rf conftest*
6509   eval "ac_cv_func_vprintf=yes"
6510 else
6511   echo "configure: failed program was:" >&5
6512   cat conftest.$ac_ext >&5
6513   rm -rf conftest*
6514   eval "ac_cv_func_vprintf=no"
6515 fi
6516 rm -f conftest*
6517 fi
6518
6519 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
6520   echo "$ac_t""yes" 1>&6
6521   cat >> confdefs.h <<\EOF
6522 #define HAVE_VPRINTF 1
6523 EOF
6524
6525 else
6526   echo "$ac_t""no" 1>&6
6527 fi
6528
6529 if test "$ac_cv_func_vprintf" != yes; then
6530 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
6531 echo "configure:6532: checking for _doprnt" >&5
6532 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
6533   echo $ac_n "(cached) $ac_c" 1>&6
6534 else
6535   cat > conftest.$ac_ext <<EOF
6536 #line 6537 "configure"
6537 #include "confdefs.h"
6538 /* System header to define __stub macros and hopefully few prototypes,
6539     which can conflict with char _doprnt(); below.  */
6540 #include <assert.h>
6541 /* Override any gcc2 internal prototype to avoid an error.  */
6542 /* We use char because int might match the return type of a gcc2
6543     builtin and then its argument prototype would still apply.  */
6544 char _doprnt();
6545
6546 int main() {
6547
6548 /* The GNU C library defines this for functions which it implements
6549     to always fail with ENOSYS.  Some functions are actually named
6550     something starting with __ and the normal name is an alias.  */
6551 #if defined (__stub__doprnt) || defined (__stub____doprnt)
6552 choke me
6553 #else
6554 _doprnt();
6555 #endif
6556
6557 ; return 0; }
6558 EOF
6559 if { (eval echo configure:6560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6560   rm -rf conftest*
6561   eval "ac_cv_func__doprnt=yes"
6562 else
6563   echo "configure: failed program was:" >&5
6564   cat conftest.$ac_ext >&5
6565   rm -rf conftest*
6566   eval "ac_cv_func__doprnt=no"
6567 fi
6568 rm -f conftest*
6569 fi
6570
6571 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
6572   echo "$ac_t""yes" 1>&6
6573   cat >> confdefs.h <<\EOF
6574 #define HAVE_DOPRNT 1
6575 EOF
6576
6577 else
6578   echo "$ac_t""no" 1>&6
6579 fi
6580
6581 fi
6582
6583
6584 if test $ac_cv_func_vprintf = yes ; then
6585                 for ac_func in vsnprintf
6586 do
6587 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6588 echo "configure:6589: checking for $ac_func" >&5
6589 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6590   echo $ac_n "(cached) $ac_c" 1>&6
6591 else
6592   cat > conftest.$ac_ext <<EOF
6593 #line 6594 "configure"
6594 #include "confdefs.h"
6595 /* System header to define __stub macros and hopefully few prototypes,
6596     which can conflict with char $ac_func(); below.  */
6597 #include <assert.h>
6598 /* Override any gcc2 internal prototype to avoid an error.  */
6599 /* We use char because int might match the return type of a gcc2
6600     builtin and then its argument prototype would still apply.  */
6601 char $ac_func();
6602
6603 int main() {
6604
6605 /* The GNU C library defines this for functions which it implements
6606     to always fail with ENOSYS.  Some functions are actually named
6607     something starting with __ and the normal name is an alias.  */
6608 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6609 choke me
6610 #else
6611 $ac_func();
6612 #endif
6613
6614 ; return 0; }
6615 EOF
6616 if { (eval echo configure:6617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6617   rm -rf conftest*
6618   eval "ac_cv_func_$ac_func=yes"
6619 else
6620   echo "configure: failed program was:" >&5
6621   cat conftest.$ac_ext >&5
6622   rm -rf conftest*
6623   eval "ac_cv_func_$ac_func=no"
6624 fi
6625 rm -f conftest*
6626 fi
6627
6628 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6629   echo "$ac_t""yes" 1>&6
6630     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6631   cat >> confdefs.h <<EOF
6632 #define $ac_tr_func 1
6633 EOF
6634  
6635 else
6636   echo "$ac_t""no" 1>&6
6637 fi
6638 done
6639
6640 fi
6641
6642 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
6643 echo "configure:6644: checking for wait3 that fills in rusage" >&5
6644 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
6645   echo $ac_n "(cached) $ac_c" 1>&6
6646 else
6647   if test "$cross_compiling" = yes; then
6648   ac_cv_func_wait3_rusage=no
6649 else
6650   cat > conftest.$ac_ext <<EOF
6651 #line 6652 "configure"
6652 #include "confdefs.h"
6653 #include <sys/types.h>
6654 #include <sys/time.h>
6655 #include <sys/resource.h>
6656 #include <stdio.h>
6657 /* HP-UX has wait3 but does not fill in rusage at all.  */
6658 main() {
6659   struct rusage r;
6660   int i;
6661   /* Use a field that we can force nonzero --
6662      voluntary context switches.
6663      For systems like NeXT and OSF/1 that don't set it,
6664      also use the system CPU time.  And page faults (I/O) for Linux.  */
6665   r.ru_nvcsw = 0;
6666   r.ru_stime.tv_sec = 0;
6667   r.ru_stime.tv_usec = 0;
6668   r.ru_majflt = r.ru_minflt = 0;
6669   switch (fork()) {
6670   case 0: /* Child.  */
6671     sleep(1); /* Give up the CPU.  */
6672     _exit(0);
6673   case -1: _exit(0); /* What can we do?  */
6674   default: /* Parent.  */
6675     wait3(&i, 0, &r);
6676     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
6677     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
6678          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
6679   }
6680 }
6681 EOF
6682 if { (eval echo configure:6683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6683 then
6684   ac_cv_func_wait3_rusage=yes
6685 else
6686   echo "configure: failed program was:" >&5
6687   cat conftest.$ac_ext >&5
6688   rm -fr conftest*
6689   ac_cv_func_wait3_rusage=no
6690 fi
6691 rm -fr conftest*
6692 fi
6693
6694 fi
6695
6696 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
6697 if test $ac_cv_func_wait3_rusage = yes; then
6698   cat >> confdefs.h <<\EOF
6699 #define HAVE_WAIT3 1
6700 EOF
6701
6702 fi
6703
6704
6705 for ac_func in \
6706         bcopy                   \
6707         getopt                  \
6708         flock                   \
6709         gethostname             \
6710         gettimeofday    \
6711         getdtablesize   \
6712         getpwuid                \
6713         lockf                   \
6714         memcpy                  \
6715         memmove                 \
6716         mkstemp                 \
6717         mktime                  \
6718         res_search              \
6719         select                  \
6720         setpwfile               \
6721         setsid                  \
6722         signal                  \
6723         sigset                  \
6724         snprintf                \
6725         socket                  \
6726         strerror                \
6727         strstr                  \
6728         strrchr                 \
6729         strsep                  \
6730         strtod                  \
6731         strtol                  \
6732         strtoul                 \
6733         sysconf                 \
6734         tempnam                 \
6735         waitpid                 \
6736
6737 do
6738 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6739 echo "configure:6740: checking for $ac_func" >&5
6740 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6741   echo $ac_n "(cached) $ac_c" 1>&6
6742 else
6743   cat > conftest.$ac_ext <<EOF
6744 #line 6745 "configure"
6745 #include "confdefs.h"
6746 /* System header to define __stub macros and hopefully few prototypes,
6747     which can conflict with char $ac_func(); below.  */
6748 #include <assert.h>
6749 /* Override any gcc2 internal prototype to avoid an error.  */
6750 /* We use char because int might match the return type of a gcc2
6751     builtin and then its argument prototype would still apply.  */
6752 char $ac_func();
6753
6754 int main() {
6755
6756 /* The GNU C library defines this for functions which it implements
6757     to always fail with ENOSYS.  Some functions are actually named
6758     something starting with __ and the normal name is an alias.  */
6759 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6760 choke me
6761 #else
6762 $ac_func();
6763 #endif
6764
6765 ; return 0; }
6766 EOF
6767 if { (eval echo configure:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6768   rm -rf conftest*
6769   eval "ac_cv_func_$ac_func=yes"
6770 else
6771   echo "configure: failed program was:" >&5
6772   cat conftest.$ac_ext >&5
6773   rm -rf conftest*
6774   eval "ac_cv_func_$ac_func=no"
6775 fi
6776 rm -f conftest*
6777 fi
6778
6779 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6780   echo "$ac_t""yes" 1>&6
6781     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6782   cat >> confdefs.h <<EOF
6783 #define $ac_tr_func 1
6784 EOF
6785  
6786 else
6787   echo "$ac_t""no" 1>&6
6788 fi
6789 done
6790
6791
6792 for ac_func in getopt strdup tempnam
6793 do
6794 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6795 echo "configure:6796: checking for $ac_func" >&5
6796 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6797   echo $ac_n "(cached) $ac_c" 1>&6
6798 else
6799   cat > conftest.$ac_ext <<EOF
6800 #line 6801 "configure"
6801 #include "confdefs.h"
6802 /* System header to define __stub macros and hopefully few prototypes,
6803     which can conflict with char $ac_func(); below.  */
6804 #include <assert.h>
6805 /* Override any gcc2 internal prototype to avoid an error.  */
6806 /* We use char because int might match the return type of a gcc2
6807     builtin and then its argument prototype would still apply.  */
6808 char $ac_func();
6809
6810 int main() {
6811
6812 /* The GNU C library defines this for functions which it implements
6813     to always fail with ENOSYS.  Some functions are actually named
6814     something starting with __ and the normal name is an alias.  */
6815 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6816 choke me
6817 #else
6818 $ac_func();
6819 #endif
6820
6821 ; return 0; }
6822 EOF
6823 if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6824   rm -rf conftest*
6825   eval "ac_cv_func_$ac_func=yes"
6826 else
6827   echo "configure: failed program was:" >&5
6828   cat conftest.$ac_ext >&5
6829   rm -rf conftest*
6830   eval "ac_cv_func_$ac_func=no"
6831 fi
6832 rm -f conftest*
6833 fi
6834
6835 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6836   echo "$ac_t""yes" 1>&6
6837     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6838   cat >> confdefs.h <<EOF
6839 #define $ac_tr_func 1
6840 EOF
6841  
6842 else
6843   echo "$ac_t""no" 1>&6
6844 LIBOBJS="$LIBOBJS ${ac_func}.o"
6845 fi
6846 done
6847
6848
6849
6850 # Check Configuration
6851
6852 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
6853 echo "configure:6854: checking declaration of sys_errlist" >&5
6854 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
6855   echo $ac_n "(cached) $ac_c" 1>&6
6856 else
6857   
6858         cat > conftest.$ac_ext <<EOF
6859 #line 6860 "configure"
6860 #include "confdefs.h"
6861
6862 #include <stdio.h>
6863 #include <sys/types.h>
6864 #include <errno.h> 
6865 int main() {
6866 char *c = (char *) *sys_errlist
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6870   rm -rf conftest*
6871   ol_cv_dcl_sys_errlist=yes
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   ol_cv_dcl_sys_errlist=no
6877 fi
6878 rm -f conftest*
6879 fi
6880
6881 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
6882
6883 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
6884 if test $ol_cv_dcl_sys_errlist = no ; then
6885         cat >> confdefs.h <<\EOF
6886 #define DECL_SYS_ERRLIST 1
6887 EOF
6888
6889         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
6890 echo "configure:6891: checking existence of sys_errlist" >&5
6891         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
6892   echo $ac_n "(cached) $ac_c" 1>&6
6893 else
6894   
6895                 cat > conftest.$ac_ext <<EOF
6896 #line 6897 "configure"
6897 #include "confdefs.h"
6898 #include <errno.h>
6899 int main() {
6900 char *c = (char *) *sys_errlist
6901 ; return 0; }
6902 EOF
6903 if { (eval echo configure:6904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6904   rm -rf conftest*
6905   ol_cv_have_sys_errlist=yes
6906 else
6907   echo "configure: failed program was:" >&5
6908   cat conftest.$ac_ext >&5
6909   rm -rf conftest*
6910   ol_cv_have_sys_errlist=no
6911 fi
6912 rm -f conftest*
6913 fi
6914
6915         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
6916 fi
6917
6918
6919
6920 if test $ol_enable_debug != no ; then
6921         cat >> confdefs.h <<\EOF
6922 #define LDAP_DEBUG 1
6923 EOF
6924
6925 fi
6926 if test $ol_enable_libui = yes ; then
6927         cat >> confdefs.h <<\EOF
6928 #define LDAP_LIBUI 1
6929 EOF
6930
6931 fi
6932 if test $ol_enable_cache = no ; then
6933         cat >> confdefs.h <<\EOF
6934 #define LDAP_NOCACHE 1
6935 EOF
6936
6937 fi
6938 if test $ol_enable_dns != no ; then
6939         cat >> confdefs.h <<\EOF
6940 #define LDAP_DNS 1
6941 EOF
6942
6943 fi
6944 if test $ol_enable_proctitle != no ; then
6945         cat >> confdefs.h <<\EOF
6946 #define LDAP_PROCTITLE 1
6947 EOF
6948
6949 fi
6950 if test $ol_enable_referrals != no ; then
6951         cat >> confdefs.h <<\EOF
6952 #define LDAP_REFERRALS 1
6953 EOF
6954
6955 fi
6956 if test $ol_enable_cldap != no ; then
6957         cat >> confdefs.h <<\EOF
6958 #define LDAP_CONNECTIONLESS 1
6959 EOF
6960
6961 fi
6962
6963 if test $ol_enable_aclgroups != no ; then
6964         cat >> confdefs.h <<\EOF
6965 #define SLAPD_ACLGROUPS 1
6966 EOF
6967
6968 fi
6969 if test $ol_enable_crypt != no ; then
6970         cat >> confdefs.h <<\EOF
6971 #define SLAPD_CRYPT 1
6972 EOF
6973
6974 fi
6975 if test $ol_enable_md5 != no ; then
6976         cat >> confdefs.h <<\EOF
6977 #define SLAPD_MD5 1
6978 EOF
6979
6980 fi
6981 if test $ol_enable_sha1 != no ; then
6982         cat >> confdefs.h <<\EOF
6983 #define SLAPD_SHA1 1
6984 EOF
6985
6986 fi
6987 if test $ol_enable_phonetic != no ; then
6988         cat >> confdefs.h <<\EOF
6989 #define SLAPD_PHONETIC 1
6990 EOF
6991
6992 fi
6993 if test $ol_enable_rlookups != no ; then
6994         cat >> confdefs.h <<\EOF
6995 #define SLAPD_RLOOKUPS 1
6996 EOF
6997
6998 fi
6999
7000 if test $ol_link_ldbm != no ; then
7001         cat >> confdefs.h <<\EOF
7002 #define SLAPD_LDBM 1
7003 EOF
7004
7005         BUILD_SLAPD=yes
7006         BUILD_LDBM=yes
7007 fi
7008
7009 if test $ol_enable_passwd != no ; then
7010         cat >> confdefs.h <<\EOF
7011 #define SLAPD_PASSWD 1
7012 EOF
7013
7014         BUILD_SLAPD=yes
7015         BUILD_PASSWD=yes
7016 fi
7017
7018 if test $ol_enable_shell != no ; then
7019         cat >> confdefs.h <<\EOF
7020 #define SLAPD_SHELL 1
7021 EOF
7022
7023         BUILD_SLAPD=yes
7024         BUILD_SHELL=yes
7025 fi
7026
7027 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
7028         $BUILD_SLAPD = yes ; then
7029         BUILD_SLURPD=yes
7030 fi
7031
7032 if test $ol_link_isode != no ; then
7033         BUILD_LDAPD=yes
7034 fi
7035
7036
7037
7038
7039   
7040   
7041   
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057 trap '' 1 2 15
7058 cat > confcache <<\EOF
7059 # This file is a shell script that caches the results of configure
7060 # tests run on this system so they can be shared between configure
7061 # scripts and configure runs.  It is not useful on other systems.
7062 # If it contains results you don't want to keep, you may remove or edit it.
7063 #
7064 # By default, configure uses ./config.cache as the cache file,
7065 # creating it if it does not exist already.  You can give configure
7066 # the --cache-file=FILE option to use a different cache file; that is
7067 # what configure does when it calls configure scripts in
7068 # subdirectories, so they share the cache.
7069 # Giving --cache-file=/dev/null disables caching, for debugging configure.
7070 # config.status only pays attention to the cache file if you give it the
7071 # --recheck option to rerun configure.
7072 #
7073 EOF
7074 # The following way of writing the cache mishandles newlines in values,
7075 # but we know of no workaround that is simple, portable, and efficient.
7076 # So, don't put newlines in cache variables' values.
7077 # Ultrix sh set writes to stderr and can't be redirected directly,
7078 # and sets the high bit in the cache file unless we assign to the vars.
7079 (set) 2>&1 |
7080   case `(ac_space=' '; set) 2>&1` in
7081   *ac_space=\ *)
7082     # `set' does not quote correctly, so add quotes (double-quote substitution
7083     # turns \\\\ into \\, and sed turns \\ into \).
7084     sed -n \
7085       -e "s/'/'\\\\''/g" \
7086       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
7087     ;;
7088   *)
7089     # `set' quotes correctly as required by POSIX, so do not add quotes.
7090     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
7091     ;;
7092   esac >> confcache
7093 if cmp -s $cache_file confcache; then
7094   :
7095 else
7096   if test -w $cache_file; then
7097     echo "updating cache $cache_file"
7098     cat confcache > $cache_file
7099   else
7100     echo "not updating unwritable cache $cache_file"
7101   fi
7102 fi
7103 rm -f confcache
7104
7105 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
7106
7107 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7108 # Let make expand exec_prefix.
7109 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7110
7111 # Any assignment to VPATH causes Sun make to only execute
7112 # the first set of double-colon rules, so remove it if not needed.
7113 # If there is a colon in the path, we need to keep it.
7114 if test "x$srcdir" = x.; then
7115   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
7116 fi
7117
7118 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
7119
7120 DEFS=-DHAVE_CONFIG_H
7121
7122 # Without the "./", some shells look in PATH for config.status.
7123 : ${CONFIG_STATUS=./config.status}
7124
7125 echo creating $CONFIG_STATUS
7126 rm -f $CONFIG_STATUS
7127 cat > $CONFIG_STATUS <<EOF
7128 #! /bin/sh
7129 # Generated automatically by configure.
7130 # Run this file to recreate the current configuration.
7131 # This directory was configured as follows,
7132 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7133 #
7134 # $0 $ac_configure_args
7135 #
7136 # Compiler output produced by configure, useful for debugging
7137 # configure, is in ./config.log if it exists.
7138
7139 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
7140 for ac_option
7141 do
7142   case "\$ac_option" in
7143   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
7144     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
7145     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
7146   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
7147     echo "$CONFIG_STATUS generated by autoconf version 2.12"
7148     exit 0 ;;
7149   -help | --help | --hel | --he | --h)
7150     echo "\$ac_cs_usage"; exit 0 ;;
7151   *) echo "\$ac_cs_usage"; exit 1 ;;
7152   esac
7153 done
7154
7155 ac_given_srcdir=$srcdir
7156 ac_given_INSTALL="$INSTALL"
7157
7158 trap 'rm -fr `echo "\
7159 Makefile:build/top.mk:Makefile.in:build/dir.mk \
7160 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
7161 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
7162 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
7163 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
7164 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
7165 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
7166 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
7167 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
7168 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
7169 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
7170 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
7171 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
7172 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
7173 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
7174 include/Makefile:build/top.mk:include/Makefile.in \
7175 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
7176 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
7177 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
7178 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
7179 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
7180 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
7181 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
7182 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
7183 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
7184 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
7185 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
7186 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
7187 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
7188 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
7189 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
7190 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
7191 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
7192 tests/Makefile:build/top.mk:tests/Makefile.in \
7193  include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
7194 EOF
7195 cat >> $CONFIG_STATUS <<EOF
7196
7197 # Protect against being on the right side of a sed subst in config.status.
7198 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
7199  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
7200 $ac_vpsub
7201 $extrasub
7202 s%@CFLAGS@%$CFLAGS%g
7203 s%@CPPFLAGS@%$CPPFLAGS%g
7204 s%@CXXFLAGS@%$CXXFLAGS%g
7205 s%@DEFS@%$DEFS%g
7206 s%@LDFLAGS@%$LDFLAGS%g
7207 s%@LIBS@%$LIBS%g
7208 s%@exec_prefix@%$exec_prefix%g
7209 s%@prefix@%$prefix%g
7210 s%@program_transform_name@%$program_transform_name%g
7211 s%@bindir@%$bindir%g
7212 s%@sbindir@%$sbindir%g
7213 s%@libexecdir@%$libexecdir%g
7214 s%@datadir@%$datadir%g
7215 s%@sysconfdir@%$sysconfdir%g
7216 s%@sharedstatedir@%$sharedstatedir%g
7217 s%@localstatedir@%$localstatedir%g
7218 s%@libdir@%$libdir%g
7219 s%@includedir@%$includedir%g
7220 s%@oldincludedir@%$oldincludedir%g
7221 s%@infodir@%$infodir%g
7222 s%@mandir@%$mandir%g
7223 s%@LN_S@%$LN_S%g
7224 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
7225 s%@INSTALL_DATA@%$INSTALL_DATA%g
7226 s%@RANLIB@%$RANLIB%g
7227 s%@SET_MAKE@%$SET_MAKE%g
7228 s%@SENDMAIL@%$SENDMAIL%g
7229 s%@EDITOR@%$EDITOR%g
7230 s%@FINGER@%$FINGER%g
7231 s%@CC@%$CC%g
7232 s%@CPP@%$CPP%g
7233 s%@PEPSY@%$PEPSY%g
7234 s%@LIBOBJS@%$LIBOBJS%g
7235 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
7236 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
7237 s%@BUILD_LDBM@%$BUILD_LDBM%g
7238 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
7239 s%@BUILD_SHELL@%$BUILD_SHELL%g
7240 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
7241 s%@LDAP_LIBS@%$LDAP_LIBS%g
7242 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
7243 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
7244 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
7245 s%@LDBM_LIBS@%$LDBM_LIBS%g
7246 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
7247 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
7248 s%@KRB_LIBS@%$KRB_LIBS%g
7249 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
7250
7251 CEOF
7252 EOF
7253
7254 cat >> $CONFIG_STATUS <<\EOF
7255
7256 # Split the substitutions into bite-sized pieces for seds with
7257 # small command number limits, like on Digital OSF/1 and HP-UX.
7258 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7259 ac_file=1 # Number of current file.
7260 ac_beg=1 # First line for current file.
7261 ac_end=$ac_max_sed_cmds # Line after last line for current file.
7262 ac_more_lines=:
7263 ac_sed_cmds=""
7264 while $ac_more_lines; do
7265   if test $ac_beg -gt 1; then
7266     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7267   else
7268     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7269   fi
7270   if test ! -s conftest.s$ac_file; then
7271     ac_more_lines=false
7272     rm -f conftest.s$ac_file
7273   else
7274     if test -z "$ac_sed_cmds"; then
7275       ac_sed_cmds="sed -f conftest.s$ac_file"
7276     else
7277       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7278     fi
7279     ac_file=`expr $ac_file + 1`
7280     ac_beg=$ac_end
7281     ac_end=`expr $ac_end + $ac_max_sed_cmds`
7282   fi
7283 done
7284 if test -z "$ac_sed_cmds"; then
7285   ac_sed_cmds=cat
7286 fi
7287 EOF
7288
7289 cat >> $CONFIG_STATUS <<EOF
7290
7291 CONFIG_FILES=\${CONFIG_FILES-"\
7292 Makefile:build/top.mk:Makefile.in:build/dir.mk \
7293 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
7294 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
7295 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
7296 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
7297 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
7298 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
7299 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
7300 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
7301 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
7302 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
7303 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
7304 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
7305 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
7306 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
7307 include/Makefile:build/top.mk:include/Makefile.in \
7308 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
7309 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
7310 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
7311 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
7312 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
7313 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
7314 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
7315 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
7316 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
7317 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
7318 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
7319 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
7320 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
7321 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
7322 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
7323 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
7324 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
7325 tests/Makefile:build/top.mk:tests/Makefile.in \
7326 "}
7327 EOF
7328 cat >> $CONFIG_STATUS <<\EOF
7329 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7330   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7331   case "$ac_file" in
7332   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7333        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7334   *) ac_file_in="${ac_file}.in" ;;
7335   esac
7336
7337   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7338
7339   # Remove last slash and all that follows it.  Not all systems have dirname.
7340   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7341   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7342     # The file is in a subdirectory.
7343     test ! -d "$ac_dir" && mkdir "$ac_dir"
7344     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7345     # A "../" for each directory in $ac_dir_suffix.
7346     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7347   else
7348     ac_dir_suffix= ac_dots=
7349   fi
7350
7351   case "$ac_given_srcdir" in
7352   .)  srcdir=.
7353       if test -z "$ac_dots"; then top_srcdir=.
7354       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7355   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7356   *) # Relative path.
7357     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7358     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7359   esac
7360
7361   case "$ac_given_INSTALL" in
7362   [/$]*) INSTALL="$ac_given_INSTALL" ;;
7363   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
7364   esac
7365
7366   echo creating "$ac_file"
7367   rm -f "$ac_file"
7368   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7369   case "$ac_file" in
7370   *Makefile*) ac_comsub="1i\\
7371 # $configure_input" ;;
7372   *) ac_comsub= ;;
7373   esac
7374
7375   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7376   sed -e "$ac_comsub
7377 s%@configure_input@%$configure_input%g
7378 s%@srcdir@%$srcdir%g
7379 s%@top_srcdir@%$top_srcdir%g
7380 s%@INSTALL@%$INSTALL%g
7381 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7382 fi; done
7383 rm -f conftest.s*
7384
7385 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7386 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7387 #
7388 # ac_d sets the value in "#define NAME VALUE" lines.
7389 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7390 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7391 ac_dC='\3'
7392 ac_dD='%g'
7393 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7394 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7395 ac_uB='\([      ]\)%\1#\2define\3'
7396 ac_uC=' '
7397 ac_uD='\4%g'
7398 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7399 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7400 ac_eB='$%\1#\2define\3'
7401 ac_eC=' '
7402 ac_eD='%g'
7403
7404 if test "${CONFIG_HEADERS+set}" != set; then
7405 EOF
7406 cat >> $CONFIG_STATUS <<EOF
7407   CONFIG_HEADERS="include/portable.h"
7408 EOF
7409 cat >> $CONFIG_STATUS <<\EOF
7410 fi
7411 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7412   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7413   case "$ac_file" in
7414   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7415        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7416   *) ac_file_in="${ac_file}.in" ;;
7417   esac
7418
7419   echo creating $ac_file
7420
7421   rm -f conftest.frag conftest.in conftest.out
7422   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7423   cat $ac_file_inputs > conftest.in
7424
7425 EOF
7426
7427 # Transform confdefs.h into a sed script conftest.vals that substitutes
7428 # the proper values into config.h.in to produce config.h.  And first:
7429 # Protect against being on the right side of a sed subst in config.status.
7430 # Protect against being in an unquoted here document in config.status.
7431 rm -f conftest.vals
7432 cat > conftest.hdr <<\EOF
7433 s/[\\&%]/\\&/g
7434 s%[\\$`]%\\&%g
7435 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
7436 s%ac_d%ac_u%gp
7437 s%ac_u%ac_e%gp
7438 EOF
7439 sed -n -f conftest.hdr confdefs.h > conftest.vals
7440 rm -f conftest.hdr
7441
7442 # This sed command replaces #undef with comments.  This is necessary, for
7443 # example, in the case of _POSIX_SOURCE, which is predefined and required
7444 # on some systems where configure will not decide to define it.
7445 cat >> conftest.vals <<\EOF
7446 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
7447 EOF
7448
7449 # Break up conftest.vals because some shells have a limit on
7450 # the size of here documents, and old seds have small limits too.
7451
7452 rm -f conftest.tail
7453 while :
7454 do
7455   ac_lines=`grep -c . conftest.vals`
7456   # grep -c gives empty output for an empty file on some AIX systems.
7457   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7458   # Write a limited-size here document to conftest.frag.
7459   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
7460   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7461   echo 'CEOF
7462   sed -f conftest.frag conftest.in > conftest.out
7463   rm -f conftest.in
7464   mv conftest.out conftest.in
7465 ' >> $CONFIG_STATUS
7466   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7467   rm -f conftest.vals
7468   mv conftest.tail conftest.vals
7469 done
7470 rm -f conftest.vals
7471
7472 cat >> $CONFIG_STATUS <<\EOF
7473   rm -f conftest.frag conftest.h
7474   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7475   cat conftest.in >> conftest.h
7476   rm -f conftest.in
7477   if cmp -s $ac_file conftest.h 2>/dev/null; then
7478     echo "$ac_file is unchanged"
7479     rm -f conftest.h
7480   else
7481     # Remove last slash and all that follows it.  Not all systems have dirname.
7482       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7483       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7484       # The file is in a subdirectory.
7485       test ! -d "$ac_dir" && mkdir "$ac_dir"
7486     fi
7487     rm -f $ac_file
7488     mv conftest.h $ac_file
7489   fi
7490 fi; done
7491
7492 EOF
7493 cat >> $CONFIG_STATUS <<EOF
7494
7495 EOF
7496 cat >> $CONFIG_STATUS <<\EOF
7497
7498 date > stamp-h
7499 echo Please \"make depend\" to build dependencies
7500
7501 exit 0
7502 EOF
7503 chmod +x $CONFIG_STATUS
7504 rm -fr confdefs* $ac_clean_files
7505 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7506