]> git.sur5r.net Git - openldap/blob - configure
6dadc3e21bd4972d01d547b16f0378658aa11df2
[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 V2 DNS  extension (no)"
25 ac_help="$ac_help
26   --enable-referrals    enable V2 Referrals extension (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....  some functionality will be removed." 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 ol_link_threads=no
2646 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
2647         for ac_hdr in pthread.h sched.h
2648 do
2649 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2650 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2651 echo "configure:2652: checking for $ac_hdr" >&5
2652 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2653   echo $ac_n "(cached) $ac_c" 1>&6
2654 else
2655   cat > conftest.$ac_ext <<EOF
2656 #line 2657 "configure"
2657 #include "confdefs.h"
2658 #include <$ac_hdr>
2659 EOF
2660 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2661 { (eval echo configure:2662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2662 ac_err=`grep -v '^ *+' conftest.out`
2663 if test -z "$ac_err"; then
2664   rm -rf conftest*
2665   eval "ac_cv_header_$ac_safe=yes"
2666 else
2667   echo "$ac_err" >&5
2668   echo "configure: failed program was:" >&5
2669   cat conftest.$ac_ext >&5
2670   rm -rf conftest*
2671   eval "ac_cv_header_$ac_safe=no"
2672 fi
2673 rm -f conftest*
2674 fi
2675 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2676   echo "$ac_t""yes" 1>&6
2677     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2678   cat >> confdefs.h <<EOF
2679 #define $ac_tr_hdr 1
2680 EOF
2681  
2682 else
2683   echo "$ac_t""no" 1>&6
2684 fi
2685 done
2686
2687
2688         if test $ac_cv_header_pthread_h = yes ; then
2689                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
2690 echo "configure:2691: checking POSIX thread version" >&5
2691 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
2692   echo $ac_n "(cached) $ac_c" 1>&6
2693 else
2694   
2695         cat > conftest.$ac_ext <<EOF
2696 #line 2697 "configure"
2697 #include "confdefs.h"
2698
2699 #               include <pthread.h>
2700                 /* this check could be improved */
2701 #               ifdef PTHREAD_ONCE_INIT
2702                         final
2703 #               endif
2704         
2705 EOF
2706 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2707   egrep "final" >/dev/null 2>&1; then
2708   rm -rf conftest*
2709   ol_pthread_final=yes
2710 else
2711   rm -rf conftest*
2712   ol_pthread_final=no
2713 fi
2714 rm -f conftest*
2715
2716
2717         cat > conftest.$ac_ext <<EOF
2718 #line 2719 "configure"
2719 #include "confdefs.h"
2720
2721 #               include <pthread.h>
2722                 /* this check could be improved */
2723 #               ifdef pthread_once_init
2724                         draft4
2725 #               endif
2726         
2727 EOF
2728 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2729   egrep "draft4" >/dev/null 2>&1; then
2730   rm -rf conftest*
2731   ol_pthread_draft4=yes
2732 else
2733   rm -rf conftest*
2734   ol_pthread_draft4=no
2735 fi
2736 rm -f conftest*
2737
2738
2739         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
2740                 ol_cv_pthread_version=final
2741         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
2742                 ol_cv_pthread_version=draft4
2743         else
2744                 ol_cv_pthread_version=unknown
2745         fi
2746
2747 fi
2748
2749 echo "$ac_t""$ol_cv_pthread_version" 1>&6
2750
2751
2752                 if test $ol_cv_pthread_version = final ; then
2753                         cat >> confdefs.h <<\EOF
2754 #define HAVE_PTHREADS_FINAL 1
2755 EOF
2756
2757                 elif test $ol_cv_pthread_version = draft4 ; then
2758                         cat >> confdefs.h <<\EOF
2759 #define HAVE_PTHREADS_D4 1
2760 EOF
2761
2762                 else
2763                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
2764                 fi
2765
2766                 # consider threads found
2767                 ol_with_threads=found
2768
2769                 
2770 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
2771 echo "configure:2772: checking for LinuxThreads" >&5
2772 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
2773   echo $ac_n "(cached) $ac_c" 1>&6
2774 else
2775   
2776         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
2777         if test "$res" -gt 0 ; then
2778                 ol_cv_linux_threads=yes
2779         else
2780                 ol_cv_linux_threads=no
2781         fi
2782
2783 fi
2784
2785 echo "$ac_t""$ol_cv_linux_threads" 1>&6
2786
2787
2788                 if test $ol_cv_linux_threads = yes ; then
2789                         cat >> confdefs.h <<\EOF
2790 #define HAVE_LINUX_THREADS 1
2791 EOF
2792
2793                 fi
2794
2795                 
2796                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
2797 echo "configure:2798: checking for pthread_create" >&5
2798 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
2799   echo $ac_n "(cached) $ac_c" 1>&6
2800 else
2801   cat > conftest.$ac_ext <<EOF
2802 #line 2803 "configure"
2803 #include "confdefs.h"
2804 /* System header to define __stub macros and hopefully few prototypes,
2805     which can conflict with char pthread_create(); below.  */
2806 #include <assert.h>
2807 /* Override any gcc2 internal prototype to avoid an error.  */
2808 /* We use char because int might match the return type of a gcc2
2809     builtin and then its argument prototype would still apply.  */
2810 char pthread_create();
2811
2812 int main() {
2813
2814 /* The GNU C library defines this for functions which it implements
2815     to always fail with ENOSYS.  Some functions are actually named
2816     something starting with __ and the normal name is an alias.  */
2817 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
2818 choke me
2819 #else
2820 pthread_create();
2821 #endif
2822
2823 ; return 0; }
2824 EOF
2825 if { (eval echo configure:2826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2826   rm -rf conftest*
2827   eval "ac_cv_func_pthread_create=yes"
2828 else
2829   echo "configure: failed program was:" >&5
2830   cat conftest.$ac_ext >&5
2831   rm -rf conftest*
2832   eval "ac_cv_func_pthread_create=no"
2833 fi
2834 rm -f conftest*
2835 fi
2836
2837 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
2838   echo "$ac_t""yes" 1>&6
2839   ol_link_threads=yes
2840 else
2841   echo "$ac_t""no" 1>&6
2842 fi
2843
2844
2845                 if test $ol_link_threads = no ; then
2846                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
2847 echo "configure:2848: checking for pthread_create with -pthread" >&5
2848 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
2849   echo $ac_n "(cached) $ac_c" 1>&6
2850 else
2851   
2852                                                                 save_LIBS="$LIBS"
2853                                 LIBS="-pthread $LIBS"
2854                                 cat > conftest.$ac_ext <<EOF
2855 #line 2856 "configure"
2856 #include "confdefs.h"
2857 char pthread();
2858 int main() {
2859
2860                                         pthread_create();
2861                                         
2862 ; return 0; }
2863 EOF
2864 if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2865   rm -rf conftest*
2866   ol_cv_pthread_flag=yes
2867 else
2868   echo "configure: failed program was:" >&5
2869   cat conftest.$ac_ext >&5
2870   rm -rf conftest*
2871   ol_cv_pthread_flag=no
2872 fi
2873 rm -f conftest*
2874                                                                 LIBS="$save_LIBS"
2875                         
2876 fi
2877
2878 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
2879
2880                         if test $ol_cv_pthread_flag = yes ; then
2881                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
2882                                 ol_link_threads=posix
2883                         fi
2884                 fi
2885
2886                 if test $ol_link_threads = no ; then
2887                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
2888 echo "configure:2889: checking for pthread_create with -thread" >&5
2889 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
2890   echo $ac_n "(cached) $ac_c" 1>&6
2891 else
2892   
2893                                                                 save_LIBS="$LIBS"
2894                                 LIBS="-thread $LIBS"
2895                                 cat > conftest.$ac_ext <<EOF
2896 #line 2897 "configure"
2897 #include "confdefs.h"
2898 char pthread();
2899 int main() {
2900
2901                                         pthread_create();
2902                                         
2903 ; return 0; }
2904 EOF
2905 if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2906   rm -rf conftest*
2907   ol_cv_thread_flag=yes
2908 else
2909   echo "configure: failed program was:" >&5
2910   cat conftest.$ac_ext >&5
2911   rm -rf conftest*
2912   ol_cv_thread_flag=no
2913 fi
2914 rm -f conftest*
2915                                                                 LIBS="$save_LIBS"
2916                         
2917 fi
2918
2919 echo "$ac_t""$ol_cv_thread_flag" 1>&6
2920
2921                         if test $ol_cv_thread_flag = yes ; then
2922                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
2923                                 ol_link_threads=posix
2924                         fi
2925                 fi
2926
2927                 if test $ol_link_threads = no ; then
2928                                                 save_LIBS="$LIBS"
2929                         echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
2930 echo "configure:2931: checking for pthread_join in -lpthread" >&5
2931 ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
2932 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2933   echo $ac_n "(cached) $ac_c" 1>&6
2934 else
2935   ac_save_LIBS="$LIBS"
2936 LIBS="-lpthread -lexc $LIBS"
2937 cat > conftest.$ac_ext <<EOF
2938 #line 2939 "configure"
2939 #include "confdefs.h"
2940 /* Override any gcc2 internal prototype to avoid an error.  */
2941 /* We use char because int might match the return type of a gcc2
2942     builtin and then its argument prototype would still apply.  */
2943 char pthread_join();
2944
2945 int main() {
2946 pthread_join()
2947 ; return 0; }
2948 EOF
2949 if { (eval echo configure:2950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2950   rm -rf conftest*
2951   eval "ac_cv_lib_$ac_lib_var=yes"
2952 else
2953   echo "configure: failed program was:" >&5
2954   cat conftest.$ac_ext >&5
2955   rm -rf conftest*
2956   eval "ac_cv_lib_$ac_lib_var=no"
2957 fi
2958 rm -f conftest*
2959 LIBS="$ac_save_LIBS"
2960
2961 fi
2962 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2963   echo "$ac_t""yes" 1>&6
2964   
2965                                 ol_link_threads=posix
2966                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
2967                                 if test $ol_with_preemptive = auto ; then
2968                                         ol_with_preemptive=yes
2969                                 fi
2970                                 
2971 else
2972   echo "$ac_t""no" 1>&6
2973 fi
2974
2975                         LIBS="$save_LIBS"
2976                 fi
2977
2978                 if test $ol_link_threads = no ; then
2979                                                 save_LIBS="$LIBS"
2980                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
2981 echo "configure:2982: checking for pthread_join in -lpthreads" >&5
2982 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
2983 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2984   echo $ac_n "(cached) $ac_c" 1>&6
2985 else
2986   ac_save_LIBS="$LIBS"
2987 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
2988 cat > conftest.$ac_ext <<EOF
2989 #line 2990 "configure"
2990 #include "confdefs.h"
2991 /* Override any gcc2 internal prototype to avoid an error.  */
2992 /* We use char because int might match the return type of a gcc2
2993     builtin and then its argument prototype would still apply.  */
2994 char pthread_join();
2995
2996 int main() {
2997 pthread_join()
2998 ; return 0; }
2999 EOF
3000 if { (eval echo configure:3001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3001   rm -rf conftest*
3002   eval "ac_cv_lib_$ac_lib_var=yes"
3003 else
3004   echo "configure: failed program was:" >&5
3005   cat conftest.$ac_ext >&5
3006   rm -rf conftest*
3007   eval "ac_cv_lib_$ac_lib_var=no"
3008 fi
3009 rm -f conftest*
3010 LIBS="$ac_save_LIBS"
3011
3012 fi
3013 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3014   echo "$ac_t""yes" 1>&6
3015   
3016                                 ol_link_threads=posix
3017                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
3018                                 if test $ol_with_preemptive = auto ; then
3019                                         ol_with_preemptive=yes
3020                                 fi
3021                                 
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025
3026                         LIBS="$save_LIBS"
3027                 fi
3028
3029                 if test $ol_link_threads = no ; then
3030                                                 save_LIBS="$LIBS"
3031                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
3032 echo "configure:3033: checking for pthread_create in -lpthread" >&5
3033 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
3034 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3035   echo $ac_n "(cached) $ac_c" 1>&6
3036 else
3037   ac_save_LIBS="$LIBS"
3038 LIBS="-lpthread  $LIBS"
3039 cat > conftest.$ac_ext <<EOF
3040 #line 3041 "configure"
3041 #include "confdefs.h"
3042 /* Override any gcc2 internal prototype to avoid an error.  */
3043 /* We use char because int might match the return type of a gcc2
3044     builtin and then its argument prototype would still apply.  */
3045 char pthread_create();
3046
3047 int main() {
3048 pthread_create()
3049 ; return 0; }
3050 EOF
3051 if { (eval echo configure:3052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3052   rm -rf conftest*
3053   eval "ac_cv_lib_$ac_lib_var=yes"
3054 else
3055   echo "configure: failed program was:" >&5
3056   cat conftest.$ac_ext >&5
3057   rm -rf conftest*
3058   eval "ac_cv_lib_$ac_lib_var=no"
3059 fi
3060 rm -f conftest*
3061 LIBS="$ac_save_LIBS"
3062
3063 fi
3064 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3065   echo "$ac_t""yes" 1>&6
3066   
3067                                 ol_link_threads=posix
3068                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
3069 else
3070   echo "$ac_t""no" 1>&6
3071 fi
3072
3073                         LIBS="$save_LIBS"
3074                 fi
3075
3076                 if test $ol_link_threads = no ; then
3077                                                 save_LIBS="$LIBS"
3078                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
3079 echo "configure:3080: checking for pthread_create in -lc_r" >&5
3080 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
3081 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3082   echo $ac_n "(cached) $ac_c" 1>&6
3083 else
3084   ac_save_LIBS="$LIBS"
3085 LIBS="-lc_r  $LIBS"
3086 cat > conftest.$ac_ext <<EOF
3087 #line 3088 "configure"
3088 #include "confdefs.h"
3089 /* Override any gcc2 internal prototype to avoid an error.  */
3090 /* We use char because int might match the return type of a gcc2
3091     builtin and then its argument prototype would still apply.  */
3092 char pthread_create();
3093
3094 int main() {
3095 pthread_create()
3096 ; return 0; }
3097 EOF
3098 if { (eval echo configure:3099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3099   rm -rf conftest*
3100   eval "ac_cv_lib_$ac_lib_var=yes"
3101 else
3102   echo "configure: failed program was:" >&5
3103   cat conftest.$ac_ext >&5
3104   rm -rf conftest*
3105   eval "ac_cv_lib_$ac_lib_var=no"
3106 fi
3107 rm -f conftest*
3108 LIBS="$ac_save_LIBS"
3109
3110 fi
3111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3112   echo "$ac_t""yes" 1>&6
3113   
3114                                 ol_link_threads=posix
3115                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
3116 else
3117   echo "$ac_t""no" 1>&6
3118 fi
3119
3120                         LIBS="$save_LIBS"
3121                 fi
3122
3123                 if test $ol_link_threads != no ; then
3124                         cat >> confdefs.h <<\EOF
3125 #define HAVE_PTHREADS 1
3126 EOF
3127
3128
3129                                                 save_CPPFLAGS="$CPPFLAGS"
3130                         save_LIBS="$LIBS"
3131                         LIBS="$LTHREAD_LIBS $LIBS"
3132
3133                                                                                                 for ac_func in sched_yield pthread_yield
3134 do
3135 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3136 echo "configure:3137: checking for $ac_func" >&5
3137 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3138   echo $ac_n "(cached) $ac_c" 1>&6
3139 else
3140   cat > conftest.$ac_ext <<EOF
3141 #line 3142 "configure"
3142 #include "confdefs.h"
3143 /* System header to define __stub macros and hopefully few prototypes,
3144     which can conflict with char $ac_func(); below.  */
3145 #include <assert.h>
3146 /* Override any gcc2 internal prototype to avoid an error.  */
3147 /* We use char because int might match the return type of a gcc2
3148     builtin and then its argument prototype would still apply.  */
3149 char $ac_func();
3150
3151 int main() {
3152
3153 /* The GNU C library defines this for functions which it implements
3154     to always fail with ENOSYS.  Some functions are actually named
3155     something starting with __ and the normal name is an alias.  */
3156 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3157 choke me
3158 #else
3159 $ac_func();
3160 #endif
3161
3162 ; return 0; }
3163 EOF
3164 if { (eval echo configure:3165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3165   rm -rf conftest*
3166   eval "ac_cv_func_$ac_func=yes"
3167 else
3168   echo "configure: failed program was:" >&5
3169   cat conftest.$ac_ext >&5
3170   rm -rf conftest*
3171   eval "ac_cv_func_$ac_func=no"
3172 fi
3173 rm -f conftest*
3174 fi
3175
3176 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3177   echo "$ac_t""yes" 1>&6
3178     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3179   cat >> confdefs.h <<EOF
3180 #define $ac_tr_func 1
3181 EOF
3182  
3183 else
3184   echo "$ac_t""no" 1>&6
3185 fi
3186 done
3187
3188
3189                         if test $ac_cv_func_sched_yield = no -a \
3190                                 $ac_cv_func_pthread_yield = no ; then
3191                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
3192 echo "configure:3193: checking for sched_yield in -lrt" >&5
3193 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
3194 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3195   echo $ac_n "(cached) $ac_c" 1>&6
3196 else
3197   ac_save_LIBS="$LIBS"
3198 LIBS="-lrt  $LIBS"
3199 cat > conftest.$ac_ext <<EOF
3200 #line 3201 "configure"
3201 #include "confdefs.h"
3202 /* Override any gcc2 internal prototype to avoid an error.  */
3203 /* We use char because int might match the return type of a gcc2
3204     builtin and then its argument prototype would still apply.  */
3205 char sched_yield();
3206
3207 int main() {
3208 sched_yield()
3209 ; return 0; }
3210 EOF
3211 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3212   rm -rf conftest*
3213   eval "ac_cv_lib_$ac_lib_var=yes"
3214 else
3215   echo "configure: failed program was:" >&5
3216   cat conftest.$ac_ext >&5
3217   rm -rf conftest*
3218   eval "ac_cv_lib_$ac_lib_var=no"
3219 fi
3220 rm -f conftest*
3221 LIBS="$ac_save_LIBS"
3222
3223 fi
3224 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3225   echo "$ac_t""yes" 1>&6
3226   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
3227                                         cat >> confdefs.h <<\EOF
3228 #define HAVE_SCHED_YIELD 1
3229 EOF
3230
3231                                         ac_cv_func_sched_yield=yes
3232 else
3233   echo "$ac_t""no" 1>&6
3234 ac_cv_func_sched_yield=no
3235 fi
3236
3237                         fi
3238                         if test $ac_cv_func_sched_yield = no -a \
3239                                 $ac_cv_func_pthread_yield = no ; then
3240                                                                 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
3241 echo "configure:3242: checking for sched_yield in -lposix4" >&5
3242 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
3243 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3244   echo $ac_n "(cached) $ac_c" 1>&6
3245 else
3246   ac_save_LIBS="$LIBS"
3247 LIBS="-lposix4  $LIBS"
3248 cat > conftest.$ac_ext <<EOF
3249 #line 3250 "configure"
3250 #include "confdefs.h"
3251 /* Override any gcc2 internal prototype to avoid an error.  */
3252 /* We use char because int might match the return type of a gcc2
3253     builtin and then its argument prototype would still apply.  */
3254 char sched_yield();
3255
3256 int main() {
3257 sched_yield()
3258 ; return 0; }
3259 EOF
3260 if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3261   rm -rf conftest*
3262   eval "ac_cv_lib_$ac_lib_var=yes"
3263 else
3264   echo "configure: failed program was:" >&5
3265   cat conftest.$ac_ext >&5
3266   rm -rf conftest*
3267   eval "ac_cv_lib_$ac_lib_var=no"
3268 fi
3269 rm -f conftest*
3270 LIBS="$ac_save_LIBS"
3271
3272 fi
3273 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3274   echo "$ac_t""yes" 1>&6
3275   LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
3276                                         cat >> confdefs.h <<\EOF
3277 #define HAVE_SCHED_YIELD 1
3278 EOF
3279
3280                                         ac_cv_func_sched_yield=yes
3281 else
3282   echo "$ac_t""no" 1>&6
3283 ac_cv_func_sched_yield=no
3284 fi
3285
3286                         fi
3287                         if test $ac_cv_func_sched_yield = no -a \
3288                                 $ac_cv_func_pthread_yield = no ; then
3289                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
3290                                 { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
3291                         fi
3292
3293                                                 for ac_func in pthread_kill
3294 do
3295 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3296 echo "configure:3297: checking for $ac_func" >&5
3297 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3298   echo $ac_n "(cached) $ac_c" 1>&6
3299 else
3300   cat > conftest.$ac_ext <<EOF
3301 #line 3302 "configure"
3302 #include "confdefs.h"
3303 /* System header to define __stub macros and hopefully few prototypes,
3304     which can conflict with char $ac_func(); below.  */
3305 #include <assert.h>
3306 /* Override any gcc2 internal prototype to avoid an error.  */
3307 /* We use char because int might match the return type of a gcc2
3308     builtin and then its argument prototype would still apply.  */
3309 char $ac_func();
3310
3311 int main() {
3312
3313 /* The GNU C library defines this for functions which it implements
3314     to always fail with ENOSYS.  Some functions are actually named
3315     something starting with __ and the normal name is an alias.  */
3316 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3317 choke me
3318 #else
3319 $ac_func();
3320 #endif
3321
3322 ; return 0; }
3323 EOF
3324 if { (eval echo configure:3325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3325   rm -rf conftest*
3326   eval "ac_cv_func_$ac_func=yes"
3327 else
3328   echo "configure: failed program was:" >&5
3329   cat conftest.$ac_ext >&5
3330   rm -rf conftest*
3331   eval "ac_cv_func_$ac_func=no"
3332 fi
3333 rm -f conftest*
3334 fi
3335
3336 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3337   echo "$ac_t""yes" 1>&6
3338     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3339   cat >> confdefs.h <<EOF
3340 #define $ac_tr_func 1
3341 EOF
3342  
3343 else
3344   echo "$ac_t""no" 1>&6
3345 fi
3346 done
3347
3348                         for ac_func in \
3349                                 pthread_attr_create pthread_attr_init \
3350                                 pthread_attr_destroy pthread_attr_delete \
3351                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
3352                         
3353 do
3354 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3355 echo "configure:3356: checking for $ac_func" >&5
3356 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3357   echo $ac_n "(cached) $ac_c" 1>&6
3358 else
3359   cat > conftest.$ac_ext <<EOF
3360 #line 3361 "configure"
3361 #include "confdefs.h"
3362 /* System header to define __stub macros and hopefully few prototypes,
3363     which can conflict with char $ac_func(); below.  */
3364 #include <assert.h>
3365 /* Override any gcc2 internal prototype to avoid an error.  */
3366 /* We use char because int might match the return type of a gcc2
3367     builtin and then its argument prototype would still apply.  */
3368 char $ac_func();
3369
3370 int main() {
3371
3372 /* The GNU C library defines this for functions which it implements
3373     to always fail with ENOSYS.  Some functions are actually named
3374     something starting with __ and the normal name is an alias.  */
3375 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3376 choke me
3377 #else
3378 $ac_func();
3379 #endif
3380
3381 ; return 0; }
3382 EOF
3383 if { (eval echo configure:3384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3384   rm -rf conftest*
3385   eval "ac_cv_func_$ac_func=yes"
3386 else
3387   echo "configure: failed program was:" >&5
3388   cat conftest.$ac_ext >&5
3389   rm -rf conftest*
3390   eval "ac_cv_func_$ac_func=no"
3391 fi
3392 rm -f conftest*
3393 fi
3394
3395 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3396   echo "$ac_t""yes" 1>&6
3397     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3398   cat >> confdefs.h <<EOF
3399 #define $ac_tr_func 1
3400 EOF
3401  
3402 else
3403   echo "$ac_t""no" 1>&6
3404 fi
3405 done
3406
3407
3408                                                 for ac_func in \
3409                                 pthread_setconcurrency \
3410                                 thr_setconcurrency \
3411                         
3412 do
3413 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3414 echo "configure:3415: checking for $ac_func" >&5
3415 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3416   echo $ac_n "(cached) $ac_c" 1>&6
3417 else
3418   cat > conftest.$ac_ext <<EOF
3419 #line 3420 "configure"
3420 #include "confdefs.h"
3421 /* System header to define __stub macros and hopefully few prototypes,
3422     which can conflict with char $ac_func(); below.  */
3423 #include <assert.h>
3424 /* Override any gcc2 internal prototype to avoid an error.  */
3425 /* We use char because int might match the return type of a gcc2
3426     builtin and then its argument prototype would still apply.  */
3427 char $ac_func();
3428
3429 int main() {
3430
3431 /* The GNU C library defines this for functions which it implements
3432     to always fail with ENOSYS.  Some functions are actually named
3433     something starting with __ and the normal name is an alias.  */
3434 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3435 choke me
3436 #else
3437 $ac_func();
3438 #endif
3439
3440 ; return 0; }
3441 EOF
3442 if { (eval echo configure:3443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3443   rm -rf conftest*
3444   eval "ac_cv_func_$ac_func=yes"
3445 else
3446   echo "configure: failed program was:" >&5
3447   cat conftest.$ac_ext >&5
3448   rm -rf conftest*
3449   eval "ac_cv_func_$ac_func=no"
3450 fi
3451 rm -f conftest*
3452 fi
3453
3454 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3455   echo "$ac_t""yes" 1>&6
3456     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3457   cat >> confdefs.h <<EOF
3458 #define $ac_tr_func 1
3459 EOF
3460  
3461 else
3462   echo "$ac_t""no" 1>&6
3463 fi
3464 done
3465
3466
3467                                                 if test $ol_with_preemptive = auto ; then
3468                                 echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6
3469 echo "configure:3470: checking for preemptive Pthread implementation" >&5
3470                                 if test "$cross_compiling" = yes; then
3471   
3472                                 { echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; }
3473 else
3474   cat > conftest.$ac_ext <<EOF
3475 #line 3476 "configure"
3476 #include "confdefs.h"
3477
3478 #include <sys/types.h>
3479 #include <sys/time.h>
3480 #include <unistd.h>
3481 #include <pthread.h>
3482 #ifndef NULL
3483 #define NULL 0
3484 #endif
3485
3486 int task(arg)
3487         int *arg;
3488 {
3489         int i;
3490         struct timeval tv;
3491
3492         tv.tv_sec=5;
3493         tv.tv_usec=0;
3494
3495         /* we're not interested in any fds */
3496         i = select(FD_SETSIZE, NULL, NULL, NULL, &tv);
3497
3498         if(i < 0) {
3499                 perror("select");
3500         }
3501
3502         exit(1); /* if we exit here, the select blocked the whole process */
3503 }
3504
3505 main(argc, argv)
3506 int argc; char **argv;
3507 {
3508         pthread_t t;
3509
3510 #ifdef HAVE_PTHREAD_SETCONCURRENCY
3511         (void) pthread_setconcurrency(2);
3512 #else
3513 #ifdef HAVE_THR_SETCONCURRENCY
3514         /* Set Solaris LWP concurrency to 2 */
3515         thr_setconcurrency(2);
3516 #endif
3517 #endif
3518
3519         pthread_create(&t, NULL, (void *) task, NULL);
3520
3521 #if HAVE_SCHED_YIELD
3522         sched_yield();  /* make sure task runs first */
3523 #else
3524 #ifdef HAVE_PTHREAD_YIELD
3525         pthread_yield();        /* make sure task runs first */
3526 #endif
3527 #endif
3528         exit(0);
3529 }
3530                                 
3531 EOF
3532 if { (eval echo configure:3533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3533 then
3534   ol_pthread_preemptive=yes
3535 else
3536   echo "configure: failed program was:" >&5
3537   cat conftest.$ac_ext >&5
3538   rm -fr conftest*
3539   ol_pthread_preemptive=no
3540 fi
3541 rm -fr conftest*
3542 fi
3543
3544                                 echo "$ac_t""$ol_pthread_preemptive" 1>&6
3545
3546                                 if test $ol_pthread_preemptive = yes ; then
3547                                         cat >> confdefs.h <<\EOF
3548 #define HAVE_PREEMPTIVE_PTHREADS 1
3549 EOF
3550
3551                                         ol_with_preemptive=yes
3552                                 fi
3553                         fi
3554
3555
3556                                                 CPPFLAGS="$save_CPPFLAGS"
3557                         LIBS="$save_LIBS"
3558                 else
3559                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
3560                 fi
3561         fi
3562
3563         if test $ol_with_threads = posix ; then
3564                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
3565         fi
3566 fi
3567
3568 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
3569                 for ac_hdr in mach/cthreads.h
3570 do
3571 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3572 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3573 echo "configure:3574: checking for $ac_hdr" >&5
3574 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3575   echo $ac_n "(cached) $ac_c" 1>&6
3576 else
3577   cat > conftest.$ac_ext <<EOF
3578 #line 3579 "configure"
3579 #include "confdefs.h"
3580 #include <$ac_hdr>
3581 EOF
3582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3583 { (eval echo configure:3584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3584 ac_err=`grep -v '^ *+' conftest.out`
3585 if test -z "$ac_err"; then
3586   rm -rf conftest*
3587   eval "ac_cv_header_$ac_safe=yes"
3588 else
3589   echo "$ac_err" >&5
3590   echo "configure: failed program was:" >&5
3591   cat conftest.$ac_ext >&5
3592   rm -rf conftest*
3593   eval "ac_cv_header_$ac_safe=no"
3594 fi
3595 rm -f conftest*
3596 fi
3597 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3598   echo "$ac_t""yes" 1>&6
3599     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3600   cat >> confdefs.h <<EOF
3601 #define $ac_tr_hdr 1
3602 EOF
3603  
3604 else
3605   echo "$ac_t""no" 1>&6
3606 fi
3607 done
3608
3609         if test $ac_cv_header_mach_cthreads_h = yes ; then
3610                 ol_with_threads=found
3611
3612                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
3613 echo "configure:3614: checking for cthread_fork" >&5
3614 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
3615   echo $ac_n "(cached) $ac_c" 1>&6
3616 else
3617   cat > conftest.$ac_ext <<EOF
3618 #line 3619 "configure"
3619 #include "confdefs.h"
3620 /* System header to define __stub macros and hopefully few prototypes,
3621     which can conflict with char cthread_fork(); below.  */
3622 #include <assert.h>
3623 /* Override any gcc2 internal prototype to avoid an error.  */
3624 /* We use char because int might match the return type of a gcc2
3625     builtin and then its argument prototype would still apply.  */
3626 char cthread_fork();
3627
3628 int main() {
3629
3630 /* The GNU C library defines this for functions which it implements
3631     to always fail with ENOSYS.  Some functions are actually named
3632     something starting with __ and the normal name is an alias.  */
3633 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
3634 choke me
3635 #else
3636 cthread_fork();
3637 #endif
3638
3639 ; return 0; }
3640 EOF
3641 if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3642   rm -rf conftest*
3643   eval "ac_cv_func_cthread_fork=yes"
3644 else
3645   echo "configure: failed program was:" >&5
3646   cat conftest.$ac_ext >&5
3647   rm -rf conftest*
3648   eval "ac_cv_func_cthread_fork=no"
3649 fi
3650 rm -f conftest*
3651 fi
3652
3653 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
3654   echo "$ac_t""yes" 1>&6
3655   ol_link_threads=yes
3656 else
3657   echo "$ac_t""no" 1>&6
3658 fi
3659
3660
3661                 if test $ol_link_threads = no ; then
3662                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
3663 echo "configure:3664: checking for cthread_fork with -all_load" >&5
3664 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
3665   echo $ac_n "(cached) $ac_c" 1>&6
3666 else
3667   
3668                                                                 save_LIBS="$LIBS"
3669                                 LIBS="-all_load $LIBS"
3670                                 cat > conftest.$ac_ext <<EOF
3671 #line 3672 "configure"
3672 #include "confdefs.h"
3673 #include <mach/cthreads.h>
3674 int main() {
3675
3676                                         cthread_fork((void *)0, (void *)0);
3677                                         
3678 ; return 0; }
3679 EOF
3680 if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3681   rm -rf conftest*
3682   ol_cv_cthread_all_load=yes
3683 else
3684   echo "configure: failed program was:" >&5
3685   cat conftest.$ac_ext >&5
3686   rm -rf conftest*
3687   ol_cv_cthread_all_load=no
3688 fi
3689 rm -f conftest*
3690                                                                 LIBS="$save_LIBS"
3691                         
3692 fi
3693
3694 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
3695
3696                         if test $ol_cv_cthread_all_load = yes ; then
3697                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
3698                                 ol_link_threads=mach
3699                         fi
3700                 fi
3701
3702                 if test $ol_link_threads != no ; then
3703                         : check for cthread specific functionality here
3704                         cat >> confdefs.h <<\EOF
3705 #define HAVE_MACH_CTHREADS 1
3706 EOF
3707
3708                 else
3709                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
3710                 fi
3711         fi
3712
3713         if test $ol_with_threads = mach ; then
3714                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
3715         fi
3716 fi
3717
3718 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
3719                 for ac_hdr in thread.h synch.h
3720 do
3721 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3722 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3723 echo "configure:3724: checking for $ac_hdr" >&5
3724 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3725   echo $ac_n "(cached) $ac_c" 1>&6
3726 else
3727   cat > conftest.$ac_ext <<EOF
3728 #line 3729 "configure"
3729 #include "confdefs.h"
3730 #include <$ac_hdr>
3731 EOF
3732 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3733 { (eval echo configure:3734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3734 ac_err=`grep -v '^ *+' conftest.out`
3735 if test -z "$ac_err"; then
3736   rm -rf conftest*
3737   eval "ac_cv_header_$ac_safe=yes"
3738 else
3739   echo "$ac_err" >&5
3740   echo "configure: failed program was:" >&5
3741   cat conftest.$ac_ext >&5
3742   rm -rf conftest*
3743   eval "ac_cv_header_$ac_safe=no"
3744 fi
3745 rm -f conftest*
3746 fi
3747 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3748   echo "$ac_t""yes" 1>&6
3749     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3750   cat >> confdefs.h <<EOF
3751 #define $ac_tr_hdr 1
3752 EOF
3753  
3754 else
3755   echo "$ac_t""no" 1>&6
3756 fi
3757 done
3758
3759         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
3760                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
3761 echo "configure:3762: checking for thr_create in -lthread" >&5
3762 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
3763 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3764   echo $ac_n "(cached) $ac_c" 1>&6
3765 else
3766   ac_save_LIBS="$LIBS"
3767 LIBS="-lthread  $LIBS"
3768 cat > conftest.$ac_ext <<EOF
3769 #line 3770 "configure"
3770 #include "confdefs.h"
3771 /* Override any gcc2 internal prototype to avoid an error.  */
3772 /* We use char because int might match the return type of a gcc2
3773     builtin and then its argument prototype would still apply.  */
3774 char thr_create();
3775
3776 int main() {
3777 thr_create()
3778 ; return 0; }
3779 EOF
3780 if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3781   rm -rf conftest*
3782   eval "ac_cv_lib_$ac_lib_var=yes"
3783 else
3784   echo "configure: failed program was:" >&5
3785   cat conftest.$ac_ext >&5
3786   rm -rf conftest*
3787   eval "ac_cv_lib_$ac_lib_var=no"
3788 fi
3789 rm -f conftest*
3790 LIBS="$ac_save_LIBS"
3791
3792 fi
3793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3794   echo "$ac_t""yes" 1>&6
3795   have_thr=yes
3796 else
3797   echo "$ac_t""no" 1>&6
3798 have_thr=no
3799 fi
3800
3801
3802                 if test $have_thr = yes ; then
3803                         cat >> confdefs.h <<\EOF
3804 #define HAVE_THR 1
3805 EOF
3806
3807                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
3808                         ol_link_threads=thr
3809
3810                         if test $ol_with_preemptive = auto ; then
3811                                 ol_with_preemptive=yes
3812                         fi
3813                 fi
3814         fi
3815
3816                 for ac_hdr in lwp/lwp.h
3817 do
3818 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3819 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3820 echo "configure:3821: checking for $ac_hdr" >&5
3821 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3822   echo $ac_n "(cached) $ac_c" 1>&6
3823 else
3824   cat > conftest.$ac_ext <<EOF
3825 #line 3826 "configure"
3826 #include "confdefs.h"
3827 #include <$ac_hdr>
3828 EOF
3829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3830 { (eval echo configure:3831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3831 ac_err=`grep -v '^ *+' conftest.out`
3832 if test -z "$ac_err"; then
3833   rm -rf conftest*
3834   eval "ac_cv_header_$ac_safe=yes"
3835 else
3836   echo "$ac_err" >&5
3837   echo "configure: failed program was:" >&5
3838   cat conftest.$ac_ext >&5
3839   rm -rf conftest*
3840   eval "ac_cv_header_$ac_safe=no"
3841 fi
3842 rm -f conftest*
3843 fi
3844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3845   echo "$ac_t""yes" 1>&6
3846     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3847   cat >> confdefs.h <<EOF
3848 #define $ac_tr_hdr 1
3849 EOF
3850  
3851 else
3852   echo "$ac_t""no" 1>&6
3853 fi
3854 done
3855
3856         if test $ac_cv_header_lwp_lwp_h = yes ; then
3857                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
3858 echo "configure:3859: checking for lwp_create in -llwp" >&5
3859 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
3860 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863   ac_save_LIBS="$LIBS"
3864 LIBS="-llwp  $LIBS"
3865 cat > conftest.$ac_ext <<EOF
3866 #line 3867 "configure"
3867 #include "confdefs.h"
3868 /* Override any gcc2 internal prototype to avoid an error.  */
3869 /* We use char because int might match the return type of a gcc2
3870     builtin and then its argument prototype would still apply.  */
3871 char lwp_create();
3872
3873 int main() {
3874 lwp_create()
3875 ; return 0; }
3876 EOF
3877 if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3878   rm -rf conftest*
3879   eval "ac_cv_lib_$ac_lib_var=yes"
3880 else
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   eval "ac_cv_lib_$ac_lib_var=no"
3885 fi
3886 rm -f conftest*
3887 LIBS="$ac_save_LIBS"
3888
3889 fi
3890 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3891   echo "$ac_t""yes" 1>&6
3892   have_lwp=yes
3893 else
3894   echo "$ac_t""no" 1>&6
3895 have_lwp=no
3896 fi
3897
3898
3899                 if test $have_lwp = yes ; then
3900                         cat >> confdefs.h <<\EOF
3901 #define HAVE_LWP 1
3902 EOF
3903
3904                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
3905                         ol_link_threads=lwp
3906
3907                         if test $ol_with_preemptive = auto ; then
3908                                 ol_with_preemptive=no
3909                         fi
3910                 fi
3911         fi
3912 fi
3913
3914 if test $ol_with_preemptive = yes ; then
3915         cat >> confdefs.h <<\EOF
3916 #define PREEMPTIVE_THREADS 1
3917 EOF
3918
3919 fi
3920
3921 if test $ol_with_threads = manual ; then
3922                 ol_link_threads=yes
3923
3924         echo "configure: warning: thread defines and link options must be set manually" 1>&2
3925
3926         for ac_hdr in pthread.h sched.h
3927 do
3928 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3929 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3930 echo "configure:3931: checking for $ac_hdr" >&5
3931 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3932   echo $ac_n "(cached) $ac_c" 1>&6
3933 else
3934   cat > conftest.$ac_ext <<EOF
3935 #line 3936 "configure"
3936 #include "confdefs.h"
3937 #include <$ac_hdr>
3938 EOF
3939 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3940 { (eval echo configure:3941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3941 ac_err=`grep -v '^ *+' conftest.out`
3942 if test -z "$ac_err"; then
3943   rm -rf conftest*
3944   eval "ac_cv_header_$ac_safe=yes"
3945 else
3946   echo "$ac_err" >&5
3947   echo "configure: failed program was:" >&5
3948   cat conftest.$ac_ext >&5
3949   rm -rf conftest*
3950   eval "ac_cv_header_$ac_safe=no"
3951 fi
3952 rm -f conftest*
3953 fi
3954 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3955   echo "$ac_t""yes" 1>&6
3956     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3957   cat >> confdefs.h <<EOF
3958 #define $ac_tr_hdr 1
3959 EOF
3960  
3961 else
3962   echo "$ac_t""no" 1>&6
3963 fi
3964 done
3965
3966         for ac_func in sched_yield pthread_yield
3967 do
3968 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3969 echo "configure:3970: checking for $ac_func" >&5
3970 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3971   echo $ac_n "(cached) $ac_c" 1>&6
3972 else
3973   cat > conftest.$ac_ext <<EOF
3974 #line 3975 "configure"
3975 #include "confdefs.h"
3976 /* System header to define __stub macros and hopefully few prototypes,
3977     which can conflict with char $ac_func(); below.  */
3978 #include <assert.h>
3979 /* Override any gcc2 internal prototype to avoid an error.  */
3980 /* We use char because int might match the return type of a gcc2
3981     builtin and then its argument prototype would still apply.  */
3982 char $ac_func();
3983
3984 int main() {
3985
3986 /* The GNU C library defines this for functions which it implements
3987     to always fail with ENOSYS.  Some functions are actually named
3988     something starting with __ and the normal name is an alias.  */
3989 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3990 choke me
3991 #else
3992 $ac_func();
3993 #endif
3994
3995 ; return 0; }
3996 EOF
3997 if { (eval echo configure:3998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3998   rm -rf conftest*
3999   eval "ac_cv_func_$ac_func=yes"
4000 else
4001   echo "configure: failed program was:" >&5
4002   cat conftest.$ac_ext >&5
4003   rm -rf conftest*
4004   eval "ac_cv_func_$ac_func=no"
4005 fi
4006 rm -f conftest*
4007 fi
4008
4009 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4010   echo "$ac_t""yes" 1>&6
4011     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4012   cat >> confdefs.h <<EOF
4013 #define $ac_tr_func 1
4014 EOF
4015  
4016 else
4017   echo "$ac_t""no" 1>&6
4018 fi
4019 done
4020
4021         
4022 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4023 echo "configure:4024: checking for LinuxThreads" >&5
4024 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4025   echo $ac_n "(cached) $ac_c" 1>&6
4026 else
4027   
4028         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4029         if test "$res" -gt 0 ; then
4030                 ol_cv_linux_threads=yes
4031         else
4032                 ol_cv_linux_threads=no
4033         fi
4034
4035 fi
4036
4037 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4038
4039
4040         for ac_hdr in mach/cthreads.h
4041 do
4042 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4043 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4044 echo "configure:4045: checking for $ac_hdr" >&5
4045 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4046   echo $ac_n "(cached) $ac_c" 1>&6
4047 else
4048   cat > conftest.$ac_ext <<EOF
4049 #line 4050 "configure"
4050 #include "confdefs.h"
4051 #include <$ac_hdr>
4052 EOF
4053 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4054 { (eval echo configure:4055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4055 ac_err=`grep -v '^ *+' conftest.out`
4056 if test -z "$ac_err"; then
4057   rm -rf conftest*
4058   eval "ac_cv_header_$ac_safe=yes"
4059 else
4060   echo "$ac_err" >&5
4061   echo "configure: failed program was:" >&5
4062   cat conftest.$ac_ext >&5
4063   rm -rf conftest*
4064   eval "ac_cv_header_$ac_safe=no"
4065 fi
4066 rm -f conftest*
4067 fi
4068 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4069   echo "$ac_t""yes" 1>&6
4070     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4071   cat >> confdefs.h <<EOF
4072 #define $ac_tr_hdr 1
4073 EOF
4074  
4075 else
4076   echo "$ac_t""no" 1>&6
4077 fi
4078 done
4079
4080         for ac_hdr in lwp/lwp.h
4081 do
4082 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4083 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4084 echo "configure:4085: checking for $ac_hdr" >&5
4085 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4086   echo $ac_n "(cached) $ac_c" 1>&6
4087 else
4088   cat > conftest.$ac_ext <<EOF
4089 #line 4090 "configure"
4090 #include "confdefs.h"
4091 #include <$ac_hdr>
4092 EOF
4093 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4094 { (eval echo configure:4095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4095 ac_err=`grep -v '^ *+' conftest.out`
4096 if test -z "$ac_err"; then
4097   rm -rf conftest*
4098   eval "ac_cv_header_$ac_safe=yes"
4099 else
4100   echo "$ac_err" >&5
4101   echo "configure: failed program was:" >&5
4102   cat conftest.$ac_ext >&5
4103   rm -rf conftest*
4104   eval "ac_cv_header_$ac_safe=no"
4105 fi
4106 rm -f conftest*
4107 fi
4108 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4109   echo "$ac_t""yes" 1>&6
4110     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4111   cat >> confdefs.h <<EOF
4112 #define $ac_tr_hdr 1
4113 EOF
4114  
4115 else
4116   echo "$ac_t""no" 1>&6
4117 fi
4118 done
4119
4120         for ac_hdr in thread.h synch.h
4121 do
4122 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4123 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4124 echo "configure:4125: checking for $ac_hdr" >&5
4125 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4126   echo $ac_n "(cached) $ac_c" 1>&6
4127 else
4128   cat > conftest.$ac_ext <<EOF
4129 #line 4130 "configure"
4130 #include "confdefs.h"
4131 #include <$ac_hdr>
4132 EOF
4133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4134 { (eval echo configure:4135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4135 ac_err=`grep -v '^ *+' conftest.out`
4136 if test -z "$ac_err"; then
4137   rm -rf conftest*
4138   eval "ac_cv_header_$ac_safe=yes"
4139 else
4140   echo "$ac_err" >&5
4141   echo "configure: failed program was:" >&5
4142   cat conftest.$ac_ext >&5
4143   rm -rf conftest*
4144   eval "ac_cv_header_$ac_safe=no"
4145 fi
4146 rm -f conftest*
4147 fi
4148 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4149   echo "$ac_t""yes" 1>&6
4150     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4151   cat >> confdefs.h <<EOF
4152 #define $ac_tr_hdr 1
4153 EOF
4154  
4155 else
4156   echo "$ac_t""no" 1>&6
4157 fi
4158 done
4159
4160 fi
4161
4162 if test $ol_with_threads != no ; then  
4163                         cat >> confdefs.h <<\EOF
4164 #define _REENTRANT 1
4165 EOF
4166
4167         cat >> confdefs.h <<\EOF
4168 #define _THREAD_SAFE 1
4169 EOF
4170
4171         cat >> confdefs.h <<\EOF
4172 #define _THREADSAFE 1
4173 EOF
4174
4175
4176                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
4177 echo "configure:4178: checking for thread specific errno" >&5
4178 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
4179   echo $ac_n "(cached) $ac_c" 1>&6
4180 else
4181   
4182                 cat > conftest.$ac_ext <<EOF
4183 #line 4184 "configure"
4184 #include "confdefs.h"
4185
4186 #include <errno.h>
4187                         
4188 int main() {
4189
4190 int x = errno;
4191                         
4192 ; return 0; }
4193 EOF
4194 if { (eval echo configure:4195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4195   rm -rf conftest*
4196   ol_cv_errno_thread_specific=yes
4197 else
4198   echo "configure: failed program was:" >&5
4199   cat conftest.$ac_ext >&5
4200   rm -rf conftest*
4201   ol_cv_errno_thread_specific=no
4202 fi
4203 rm -f conftest*
4204         
4205 fi
4206
4207 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
4208
4209         if test $ol_cv_errno_thread_specific != yes ; then
4210                 LIBS="$LTHREAD_LIBS $LIBS"
4211                 LTHREAD_LIBS=""
4212         fi
4213 fi  
4214
4215
4216 if test $ol_link_threads = no ; then
4217         if test $ol_with_threads = yes ; then
4218                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
4219         fi
4220
4221         if test $ol_with_threads = auto ; then
4222                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
4223                 ol_with_threads=no
4224         fi
4225
4226         cat >> confdefs.h <<\EOF
4227 #define NO_THREADS 1
4228 EOF
4229
4230         cat >> confdefs.h <<\EOF
4231 #define PREEMPTIVE_THREADS 1
4232 EOF
4233
4234         LTHREAD_LIBS=""
4235 fi
4236
4237 ol_link_ldbm=no 
4238 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
4239         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
4240 echo "configure:4241: checking for DB2 library" >&5
4241 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
4242   echo $ac_n "(cached) $ac_c" 1>&6
4243 else
4244         ol_LIBS="$LIBS"
4245         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
4246 echo "configure:4247: checking for db_open in -ldb" >&5
4247 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
4248 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4249   echo $ac_n "(cached) $ac_c" 1>&6
4250 else
4251   ac_save_LIBS="$LIBS"
4252 LIBS="-ldb  $LIBS"
4253 cat > conftest.$ac_ext <<EOF
4254 #line 4255 "configure"
4255 #include "confdefs.h"
4256 /* Override any gcc2 internal prototype to avoid an error.  */
4257 /* We use char because int might match the return type of a gcc2
4258     builtin and then its argument prototype would still apply.  */
4259 char db_open();
4260
4261 int main() {
4262 db_open()
4263 ; return 0; }
4264 EOF
4265 if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4266   rm -rf conftest*
4267   eval "ac_cv_lib_$ac_lib_var=yes"
4268 else
4269   echo "configure: failed program was:" >&5
4270   cat conftest.$ac_ext >&5
4271   rm -rf conftest*
4272   eval "ac_cv_lib_$ac_lib_var=no"
4273 fi
4274 rm -f conftest*
4275 LIBS="$ac_save_LIBS"
4276
4277 fi
4278 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4279   echo "$ac_t""yes" 1>&6
4280   ol_cv_lib_db2=-ldb
4281 else
4282   echo "$ac_t""no" 1>&6
4283 ol_cv_lib_db2=no
4284 fi
4285
4286         LIBS="$ol_LIBS"
4287
4288 fi
4289
4290 echo "$ac_t""$ol_cv_lib_db2" 1>&6
4291
4292 for ac_hdr in db.h
4293 do
4294 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4295 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4296 echo "configure:4297: checking for $ac_hdr" >&5
4297 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4298   echo $ac_n "(cached) $ac_c" 1>&6
4299 else
4300   cat > conftest.$ac_ext <<EOF
4301 #line 4302 "configure"
4302 #include "confdefs.h"
4303 #include <$ac_hdr>
4304 EOF
4305 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4306 { (eval echo configure:4307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4307 ac_err=`grep -v '^ *+' conftest.out`
4308 if test -z "$ac_err"; then
4309   rm -rf conftest*
4310   eval "ac_cv_header_$ac_safe=yes"
4311 else
4312   echo "$ac_err" >&5
4313   echo "configure: failed program was:" >&5
4314   cat conftest.$ac_ext >&5
4315   rm -rf conftest*
4316   eval "ac_cv_header_$ac_safe=no"
4317 fi
4318 rm -f conftest*
4319 fi
4320 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4321   echo "$ac_t""yes" 1>&6
4322     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4323   cat >> confdefs.h <<EOF
4324 #define $ac_tr_hdr 1
4325 EOF
4326  
4327 else
4328   echo "$ac_t""no" 1>&6
4329 fi
4330 done
4331
4332 if test $ac_cv_header_db_h = yes ; then
4333         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
4334 echo "configure:4335: checking if db.h is DB2" >&5
4335 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
4336   echo $ac_n "(cached) $ac_c" 1>&6
4337 else
4338   
4339                 cat > conftest.$ac_ext <<EOF
4340 #line 4341 "configure"
4341 #include "confdefs.h"
4342
4343 #                       include <db.h>
4344                         /* this check could be improved */
4345 #                       ifdef DB_VERSION_MAJOR
4346 #                               if DB_VERSION_MAJOR == 2
4347                                         __db_version_2
4348 #                               endif
4349 #                       endif
4350                 
4351 EOF
4352 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4353   egrep "__db_version_2" >/dev/null 2>&1; then
4354   rm -rf conftest*
4355   ol_cv_header_db2=yes
4356 else
4357   rm -rf conftest*
4358   ol_cv_header_db2=no
4359 fi
4360 rm -f conftest*
4361
4362 fi
4363
4364 echo "$ac_t""$ol_cv_header_db2" 1>&6
4365 else
4366         ol_cv_header_db2=no
4367 fi
4368
4369
4370  
4371  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
4372 echo "configure:4373: checking for Berkeley DB2" >&5
4373 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
4374   echo $ac_n "(cached) $ac_c" 1>&6
4375 else
4376   
4377         if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
4378                 ol_cv_berkeley_db2=no
4379         else
4380                 ol_cv_berkeley_db2=yes
4381         fi
4382
4383 fi
4384
4385 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
4386  if test $ol_cv_berkeley_db2 = yes ; then
4387         cat >> confdefs.h <<\EOF
4388 #define HAVE_BERKELEY_DB2 1
4389 EOF
4390
4391  fi
4392
4393
4394         if test $ol_cv_berkeley_db2 = yes ; then
4395                 ol_link_ldbm=db2
4396                 ol_with_ldbm_api=db2
4397
4398                 if test $ol_with_ldbm_type = hash ; then
4399                         cat >> confdefs.h <<\EOF
4400 #define LDBM_USE_DBHASH 1
4401 EOF
4402
4403                 else
4404                         cat >> confdefs.h <<\EOF
4405 #define LDBM_USE_DBBTREE 1
4406 EOF
4407
4408                 fi
4409
4410                                                 if test $ol_cv_lib_db2 != yes ; then
4411                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
4412                 fi
4413         fi
4414 fi
4415
4416 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
4417         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
4418 echo "configure:4419: checking for Berkeley DB library" >&5
4419 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
4420   echo $ac_n "(cached) $ac_c" 1>&6
4421 else
4422         ol_LIBS="$LIBS"
4423         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
4424 echo "configure:4425: checking for dbopen" >&5
4425 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
4426   echo $ac_n "(cached) $ac_c" 1>&6
4427 else
4428   cat > conftest.$ac_ext <<EOF
4429 #line 4430 "configure"
4430 #include "confdefs.h"
4431 /* System header to define __stub macros and hopefully few prototypes,
4432     which can conflict with char dbopen(); below.  */
4433 #include <assert.h>
4434 /* Override any gcc2 internal prototype to avoid an error.  */
4435 /* We use char because int might match the return type of a gcc2
4436     builtin and then its argument prototype would still apply.  */
4437 char dbopen();
4438
4439 int main() {
4440
4441 /* The GNU C library defines this for functions which it implements
4442     to always fail with ENOSYS.  Some functions are actually named
4443     something starting with __ and the normal name is an alias.  */
4444 #if defined (__stub_dbopen) || defined (__stub___dbopen)
4445 choke me
4446 #else
4447 dbopen();
4448 #endif
4449
4450 ; return 0; }
4451 EOF
4452 if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4453   rm -rf conftest*
4454   eval "ac_cv_func_dbopen=yes"
4455 else
4456   echo "configure: failed program was:" >&5
4457   cat conftest.$ac_ext >&5
4458   rm -rf conftest*
4459   eval "ac_cv_func_dbopen=no"
4460 fi
4461 rm -f conftest*
4462 fi
4463
4464 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
4465   echo "$ac_t""yes" 1>&6
4466   ol_cv_lib_db=yes
4467 else
4468   echo "$ac_t""no" 1>&6
4469
4470                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
4471 echo "configure:4472: checking for dbopen in -ldb" >&5
4472 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
4473 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4474   echo $ac_n "(cached) $ac_c" 1>&6
4475 else
4476   ac_save_LIBS="$LIBS"
4477 LIBS="-ldb  $LIBS"
4478 cat > conftest.$ac_ext <<EOF
4479 #line 4480 "configure"
4480 #include "confdefs.h"
4481 /* Override any gcc2 internal prototype to avoid an error.  */
4482 /* We use char because int might match the return type of a gcc2
4483     builtin and then its argument prototype would still apply.  */
4484 char dbopen();
4485
4486 int main() {
4487 dbopen()
4488 ; return 0; }
4489 EOF
4490 if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4491   rm -rf conftest*
4492   eval "ac_cv_lib_$ac_lib_var=yes"
4493 else
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496   rm -rf conftest*
4497   eval "ac_cv_lib_$ac_lib_var=no"
4498 fi
4499 rm -f conftest*
4500 LIBS="$ac_save_LIBS"
4501
4502 fi
4503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4504   echo "$ac_t""yes" 1>&6
4505   ol_cv_lib_db=-ldb
4506 else
4507   echo "$ac_t""no" 1>&6
4508 ol_cv_lib_db=no
4509 fi
4510
4511         
4512 fi
4513
4514         LIBS="$ol_LIBS"
4515
4516 fi
4517
4518 echo "$ac_t""$ol_cv_lib_db" 1>&6
4519
4520
4521 for ac_hdr in db_185.h
4522 do
4523 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4524 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4525 echo "configure:4526: checking for $ac_hdr" >&5
4526 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4527   echo $ac_n "(cached) $ac_c" 1>&6
4528 else
4529   cat > conftest.$ac_ext <<EOF
4530 #line 4531 "configure"
4531 #include "confdefs.h"
4532 #include <$ac_hdr>
4533 EOF
4534 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4535 { (eval echo configure:4536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4536 ac_err=`grep -v '^ *+' conftest.out`
4537 if test -z "$ac_err"; then
4538   rm -rf conftest*
4539   eval "ac_cv_header_$ac_safe=yes"
4540 else
4541   echo "$ac_err" >&5
4542   echo "configure: failed program was:" >&5
4543   cat conftest.$ac_ext >&5
4544   rm -rf conftest*
4545   eval "ac_cv_header_$ac_safe=no"
4546 fi
4547 rm -f conftest*
4548 fi
4549 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4550   echo "$ac_t""yes" 1>&6
4551     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4552   cat >> confdefs.h <<EOF
4553 #define $ac_tr_hdr 1
4554 EOF
4555  
4556 else
4557   echo "$ac_t""no" 1>&6
4558 fi
4559 done
4560
4561 if test $ol_cv_header_db2 = yes ; then
4562         
4563         ol_cv_header_db=$ac_cv_header_db_185_h
4564 else
4565         ol_cv_header_db=$ac_cv_header_db_h
4566 fi
4567
4568
4569  
4570  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
4571 echo "configure:4572: checking for Berkeley DB" >&5
4572 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
4573   echo $ac_n "(cached) $ac_c" 1>&6
4574 else
4575   
4576         if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
4577                 ol_cv_berkeley_db=no
4578         else
4579                 ol_cv_berkeley_db=yes
4580         fi
4581
4582 fi
4583
4584 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
4585  if test $ol_cv_berkeley_db = yes ; then
4586         cat >> confdefs.h <<\EOF
4587 #define HAVE_BERKELEY_DB 1
4588 EOF
4589
4590  fi
4591
4592
4593         if test $ol_cv_berkeley_db = yes ; then
4594                 ol_link_ldbm=db
4595                 ol_with_ldbm_api=db
4596
4597                 if test $ol_with_ldbm_type = hash ; then
4598                         cat >> confdefs.h <<\EOF
4599 #define LDBM_USE_DBHASH 1
4600 EOF
4601
4602                 else
4603                         cat >> confdefs.h <<\EOF
4604 #define LDBM_USE_DBBTREE 1
4605 EOF
4606
4607                 fi
4608
4609                                                 if test $ol_cv_lib_db != yes ; then
4610                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
4611                 fi
4612         fi
4613 fi
4614
4615 if test $ol_with_ldbm_api = manual ; then
4616                 ol_link_ldbm=yes
4617
4618         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
4619
4620         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
4621 do
4622 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4623 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4624 echo "configure:4625: checking for $ac_hdr" >&5
4625 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4626   echo $ac_n "(cached) $ac_c" 1>&6
4627 else
4628   cat > conftest.$ac_ext <<EOF
4629 #line 4630 "configure"
4630 #include "confdefs.h"
4631 #include <$ac_hdr>
4632 EOF
4633 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4634 { (eval echo configure:4635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4635 ac_err=`grep -v '^ *+' conftest.out`
4636 if test -z "$ac_err"; then
4637   rm -rf conftest*
4638   eval "ac_cv_header_$ac_safe=yes"
4639 else
4640   echo "$ac_err" >&5
4641   echo "configure: failed program was:" >&5
4642   cat conftest.$ac_ext >&5
4643   rm -rf conftest*
4644   eval "ac_cv_header_$ac_safe=no"
4645 fi
4646 rm -f conftest*
4647 fi
4648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4649   echo "$ac_t""yes" 1>&6
4650     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4651   cat >> confdefs.h <<EOF
4652 #define $ac_tr_hdr 1
4653 EOF
4654  
4655 else
4656   echo "$ac_t""no" 1>&6
4657 fi
4658 done
4659
4660 fi
4661
4662 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
4663         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
4664         ol_with_ldbm_api=none
4665 fi
4666
4667 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
4668         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
4669 echo "configure:4670: checking for GDBM library" >&5
4670 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
4671   echo $ac_n "(cached) $ac_c" 1>&6
4672 else
4673         ol_LIBS="$LIBS"
4674         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
4675 echo "configure:4676: checking for gdbm_open" >&5
4676 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
4677   echo $ac_n "(cached) $ac_c" 1>&6
4678 else
4679   cat > conftest.$ac_ext <<EOF
4680 #line 4681 "configure"
4681 #include "confdefs.h"
4682 /* System header to define __stub macros and hopefully few prototypes,
4683     which can conflict with char gdbm_open(); below.  */
4684 #include <assert.h>
4685 /* Override any gcc2 internal prototype to avoid an error.  */
4686 /* We use char because int might match the return type of a gcc2
4687     builtin and then its argument prototype would still apply.  */
4688 char gdbm_open();
4689
4690 int main() {
4691
4692 /* The GNU C library defines this for functions which it implements
4693     to always fail with ENOSYS.  Some functions are actually named
4694     something starting with __ and the normal name is an alias.  */
4695 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
4696 choke me
4697 #else
4698 gdbm_open();
4699 #endif
4700
4701 ; return 0; }
4702 EOF
4703 if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4704   rm -rf conftest*
4705   eval "ac_cv_func_gdbm_open=yes"
4706 else
4707   echo "configure: failed program was:" >&5
4708   cat conftest.$ac_ext >&5
4709   rm -rf conftest*
4710   eval "ac_cv_func_gdbm_open=no"
4711 fi
4712 rm -f conftest*
4713 fi
4714
4715 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
4716   echo "$ac_t""yes" 1>&6
4717   ol_cv_lib_gdbm=yes
4718 else
4719   echo "$ac_t""no" 1>&6
4720
4721                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
4722 echo "configure:4723: checking for gdbm_open in -lgdbm" >&5
4723 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
4724 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4725   echo $ac_n "(cached) $ac_c" 1>&6
4726 else
4727   ac_save_LIBS="$LIBS"
4728 LIBS="-lgdbm  $LIBS"
4729 cat > conftest.$ac_ext <<EOF
4730 #line 4731 "configure"
4731 #include "confdefs.h"
4732 /* Override any gcc2 internal prototype to avoid an error.  */
4733 /* We use char because int might match the return type of a gcc2
4734     builtin and then its argument prototype would still apply.  */
4735 char gdbm_open();
4736
4737 int main() {
4738 gdbm_open()
4739 ; return 0; }
4740 EOF
4741 if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4742   rm -rf conftest*
4743   eval "ac_cv_lib_$ac_lib_var=yes"
4744 else
4745   echo "configure: failed program was:" >&5
4746   cat conftest.$ac_ext >&5
4747   rm -rf conftest*
4748   eval "ac_cv_lib_$ac_lib_var=no"
4749 fi
4750 rm -f conftest*
4751 LIBS="$ac_save_LIBS"
4752
4753 fi
4754 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4755   echo "$ac_t""yes" 1>&6
4756   ol_cv_lib_gdbm=-lgdbm
4757 else
4758   echo "$ac_t""no" 1>&6
4759 ol_cv_lib_gdbm=no
4760 fi
4761
4762         
4763 fi
4764
4765         LIBS="$ol_LIBS"
4766
4767 fi
4768
4769 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
4770
4771
4772  for ac_hdr in gdbm.h
4773 do
4774 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4775 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4776 echo "configure:4777: checking for $ac_hdr" >&5
4777 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4778   echo $ac_n "(cached) $ac_c" 1>&6
4779 else
4780   cat > conftest.$ac_ext <<EOF
4781 #line 4782 "configure"
4782 #include "confdefs.h"
4783 #include <$ac_hdr>
4784 EOF
4785 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4786 { (eval echo configure:4787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4787 ac_err=`grep -v '^ *+' conftest.out`
4788 if test -z "$ac_err"; then
4789   rm -rf conftest*
4790   eval "ac_cv_header_$ac_safe=yes"
4791 else
4792   echo "$ac_err" >&5
4793   echo "configure: failed program was:" >&5
4794   cat conftest.$ac_ext >&5
4795   rm -rf conftest*
4796   eval "ac_cv_header_$ac_safe=no"
4797 fi
4798 rm -f conftest*
4799 fi
4800 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4801   echo "$ac_t""yes" 1>&6
4802     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4803   cat >> confdefs.h <<EOF
4804 #define $ac_tr_hdr 1
4805 EOF
4806  
4807 else
4808   echo "$ac_t""no" 1>&6
4809 fi
4810 done
4811
4812  echo $ac_n "checking for db""... $ac_c" 1>&6
4813 echo "configure:4814: checking for db" >&5
4814 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
4815   echo $ac_n "(cached) $ac_c" 1>&6
4816 else
4817   
4818         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
4819                 ol_cv_gdbm=no
4820         else
4821                 ol_cv_gdbm=yes
4822         fi
4823
4824 fi
4825
4826 echo "$ac_t""$ol_cv_gdbm" 1>&6
4827  if test $ol_cv_gdbm = yes ; then
4828         cat >> confdefs.h <<\EOF
4829 #define HAVE_GDBM 1
4830 EOF
4831
4832  fi
4833
4834
4835         if test $ol_cv_gdbm = yes ; then
4836                 ol_link_ldbm=gdbm
4837                 ol_with_ldbm_api=gdbm
4838
4839                 if test $ol_cv_lib_gdbm != yes ; then
4840                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
4841                 fi
4842         fi
4843 fi
4844
4845 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
4846         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
4847 echo "configure:4848: checking for NDBM library" >&5
4848 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
4849   echo $ac_n "(cached) $ac_c" 1>&6
4850 else
4851         ol_LIBS="$LIBS"
4852         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
4853 echo "configure:4854: checking for dbm_open" >&5
4854 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
4855   echo $ac_n "(cached) $ac_c" 1>&6
4856 else
4857   cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860 /* System header to define __stub macros and hopefully few prototypes,
4861     which can conflict with char dbm_open(); below.  */
4862 #include <assert.h>
4863 /* Override any gcc2 internal prototype to avoid an error.  */
4864 /* We use char because int might match the return type of a gcc2
4865     builtin and then its argument prototype would still apply.  */
4866 char dbm_open();
4867
4868 int main() {
4869
4870 /* The GNU C library defines this for functions which it implements
4871     to always fail with ENOSYS.  Some functions are actually named
4872     something starting with __ and the normal name is an alias.  */
4873 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
4874 choke me
4875 #else
4876 dbm_open();
4877 #endif
4878
4879 ; return 0; }
4880 EOF
4881 if { (eval echo configure:4882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4882   rm -rf conftest*
4883   eval "ac_cv_func_dbm_open=yes"
4884 else
4885   echo "configure: failed program was:" >&5
4886   cat conftest.$ac_ext >&5
4887   rm -rf conftest*
4888   eval "ac_cv_func_dbm_open=no"
4889 fi
4890 rm -f conftest*
4891 fi
4892
4893 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
4894   echo "$ac_t""yes" 1>&6
4895   ol_cv_lib_ndbm=yes
4896 else
4897   echo "$ac_t""no" 1>&6
4898
4899                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
4900 echo "configure:4901: checking for dbm_open in -lndbm" >&5
4901 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
4902 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4903   echo $ac_n "(cached) $ac_c" 1>&6
4904 else
4905   ac_save_LIBS="$LIBS"
4906 LIBS="-lndbm  $LIBS"
4907 cat > conftest.$ac_ext <<EOF
4908 #line 4909 "configure"
4909 #include "confdefs.h"
4910 /* Override any gcc2 internal prototype to avoid an error.  */
4911 /* We use char because int might match the return type of a gcc2
4912     builtin and then its argument prototype would still apply.  */
4913 char dbm_open();
4914
4915 int main() {
4916 dbm_open()
4917 ; return 0; }
4918 EOF
4919 if { (eval echo configure:4920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4920   rm -rf conftest*
4921   eval "ac_cv_lib_$ac_lib_var=yes"
4922 else
4923   echo "configure: failed program was:" >&5
4924   cat conftest.$ac_ext >&5
4925   rm -rf conftest*
4926   eval "ac_cv_lib_$ac_lib_var=no"
4927 fi
4928 rm -f conftest*
4929 LIBS="$ac_save_LIBS"
4930
4931 fi
4932 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4933   echo "$ac_t""yes" 1>&6
4934   ol_cv_lib_ndbm=-lndbm
4935 else
4936   echo "$ac_t""no" 1>&6
4937
4938                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
4939 echo "configure:4940: checking for dbm_open in -ldbm" >&5
4940 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
4941 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4942   echo $ac_n "(cached) $ac_c" 1>&6
4943 else
4944   ac_save_LIBS="$LIBS"
4945 LIBS="-ldbm  $LIBS"
4946 cat > conftest.$ac_ext <<EOF
4947 #line 4948 "configure"
4948 #include "confdefs.h"
4949 /* Override any gcc2 internal prototype to avoid an error.  */
4950 /* We use char because int might match the return type of a gcc2
4951     builtin and then its argument prototype would still apply.  */
4952 char dbm_open();
4953
4954 int main() {
4955 dbm_open()
4956 ; return 0; }
4957 EOF
4958 if { (eval echo configure:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4959   rm -rf conftest*
4960   eval "ac_cv_lib_$ac_lib_var=yes"
4961 else
4962   echo "configure: failed program was:" >&5
4963   cat conftest.$ac_ext >&5
4964   rm -rf conftest*
4965   eval "ac_cv_lib_$ac_lib_var=no"
4966 fi
4967 rm -f conftest*
4968 LIBS="$ac_save_LIBS"
4969
4970 fi
4971 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4972   echo "$ac_t""yes" 1>&6
4973   ol_cv_lib_ndbm=-ldbm
4974 else
4975   echo "$ac_t""no" 1>&6
4976 ol_cv_lib_ndbm=no
4977 fi
4978                 
4979 fi
4980
4981         
4982 fi
4983
4984         LIBS="$ol_LIBS"
4985
4986 fi
4987
4988 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
4989
4990
4991  for ac_hdr in ndbm.h
4992 do
4993 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4994 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4995 echo "configure:4996: checking for $ac_hdr" >&5
4996 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4997   echo $ac_n "(cached) $ac_c" 1>&6
4998 else
4999   cat > conftest.$ac_ext <<EOF
5000 #line 5001 "configure"
5001 #include "confdefs.h"
5002 #include <$ac_hdr>
5003 EOF
5004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5005 { (eval echo configure:5006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5006 ac_err=`grep -v '^ *+' conftest.out`
5007 if test -z "$ac_err"; then
5008   rm -rf conftest*
5009   eval "ac_cv_header_$ac_safe=yes"
5010 else
5011   echo "$ac_err" >&5
5012   echo "configure: failed program was:" >&5
5013   cat conftest.$ac_ext >&5
5014   rm -rf conftest*
5015   eval "ac_cv_header_$ac_safe=no"
5016 fi
5017 rm -f conftest*
5018 fi
5019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5020   echo "$ac_t""yes" 1>&6
5021     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5022   cat >> confdefs.h <<EOF
5023 #define $ac_tr_hdr 1
5024 EOF
5025  
5026 else
5027   echo "$ac_t""no" 1>&6
5028 fi
5029 done
5030
5031  echo $ac_n "checking for db""... $ac_c" 1>&6
5032 echo "configure:5033: checking for db" >&5
5033 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
5034   echo $ac_n "(cached) $ac_c" 1>&6
5035 else
5036   
5037         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
5038                 ol_cv_ndbm=no
5039         else
5040                 ol_cv_ndbm=yes
5041         fi
5042
5043 fi
5044
5045 echo "$ac_t""$ol_cv_ndbm" 1>&6
5046  if test $ol_cv_ndbm = yes ; then
5047         cat >> confdefs.h <<\EOF
5048 #define HAVE_NDBM 1
5049 EOF
5050
5051  fi
5052
5053
5054         if test $ol_cv_ndbm = yes ; then
5055                 ol_link_ldbm=ndbm
5056                 ol_with_ldbm_api=ndbm
5057
5058                 if test $ol_with_ldbm_api = ndbm ; then
5059                         echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
5060                 fi
5061
5062                 if test $ol_cv_lib_ndbm != yes ; then
5063                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
5064                 fi
5065         fi
5066 fi
5067
5068 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
5069         echo "configure: warning: could not find suitable LDBM backend" 1>&2
5070         if test $ol_enable_ldbm = yes ; then
5071                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
5072         fi
5073
5074         echo "configure: warning: disabling LDBM" 1>&2
5075         ol_enable_ldbm=no
5076 fi
5077
5078 if test $ol_enable_wrappers = yes ; then
5079         echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
5080 echo "configure:5081: checking for hosts_access in -lwrap" >&5
5081 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
5082 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5083   echo $ac_n "(cached) $ac_c" 1>&6
5084 else
5085   ac_save_LIBS="$LIBS"
5086 LIBS="-lwrap  $LIBS"
5087 cat > conftest.$ac_ext <<EOF
5088 #line 5089 "configure"
5089 #include "confdefs.h"
5090 /* Override any gcc2 internal prototype to avoid an error.  */
5091 /* We use char because int might match the return type of a gcc2
5092     builtin and then its argument prototype would still apply.  */
5093 char hosts_access();
5094
5095 int main() {
5096 hosts_access()
5097 ; return 0; }
5098 EOF
5099 if { (eval echo configure:5100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5100   rm -rf conftest*
5101   eval "ac_cv_lib_$ac_lib_var=yes"
5102 else
5103   echo "configure: failed program was:" >&5
5104   cat conftest.$ac_ext >&5
5105   rm -rf conftest*
5106   eval "ac_cv_lib_$ac_lib_var=no"
5107 fi
5108 rm -f conftest*
5109 LIBS="$ac_save_LIBS"
5110
5111 fi
5112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5113   echo "$ac_t""yes" 1>&6
5114   have_wrappers=yes
5115 else
5116   echo "$ac_t""no" 1>&6
5117 have_wrappers=no
5118 fi
5119
5120
5121         if test $have_wrappers = yes ; then
5122                 cat >> confdefs.h <<\EOF
5123 #define HAVE_TCPD 1
5124 EOF
5125
5126                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
5127         else
5128                 echo "configure: warning: could not find -lwrap" 1>&2
5129                 if test $ol_enable_wrappers = yes ; then
5130                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
5131                 fi
5132
5133                 echo "configure: warning: disabling wrappers support" 1>&2
5134                 ol_enable_wrappers=no
5135         fi
5136
5137 fi
5138
5139 # ud needs termcap (should insert check here)
5140 ol_link_termcap=no
5141 for ac_hdr in termcap.h ncurses.h
5142 do
5143 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5144 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5145 echo "configure:5146: checking for $ac_hdr" >&5
5146 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5147   echo $ac_n "(cached) $ac_c" 1>&6
5148 else
5149   cat > conftest.$ac_ext <<EOF
5150 #line 5151 "configure"
5151 #include "confdefs.h"
5152 #include <$ac_hdr>
5153 EOF
5154 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5155 { (eval echo configure:5156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5156 ac_err=`grep -v '^ *+' conftest.out`
5157 if test -z "$ac_err"; then
5158   rm -rf conftest*
5159   eval "ac_cv_header_$ac_safe=yes"
5160 else
5161   echo "$ac_err" >&5
5162   echo "configure: failed program was:" >&5
5163   cat conftest.$ac_ext >&5
5164   rm -rf conftest*
5165   eval "ac_cv_header_$ac_safe=no"
5166 fi
5167 rm -f conftest*
5168 fi
5169 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5170   echo "$ac_t""yes" 1>&6
5171     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5172   cat >> confdefs.h <<EOF
5173 #define $ac_tr_hdr 1
5174 EOF
5175  
5176 else
5177   echo "$ac_t""no" 1>&6
5178 fi
5179 done
5180
5181
5182 if test $ol_link_termcap = no ; then
5183         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
5184 echo "configure:5185: checking for tputs in -ltermcap" >&5
5185 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
5186 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5187   echo $ac_n "(cached) $ac_c" 1>&6
5188 else
5189   ac_save_LIBS="$LIBS"
5190 LIBS="-ltermcap  $LIBS"
5191 cat > conftest.$ac_ext <<EOF
5192 #line 5193 "configure"
5193 #include "confdefs.h"
5194 /* Override any gcc2 internal prototype to avoid an error.  */
5195 /* We use char because int might match the return type of a gcc2
5196     builtin and then its argument prototype would still apply.  */
5197 char tputs();
5198
5199 int main() {
5200 tputs()
5201 ; return 0; }
5202 EOF
5203 if { (eval echo configure:5204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5204   rm -rf conftest*
5205   eval "ac_cv_lib_$ac_lib_var=yes"
5206 else
5207   echo "configure: failed program was:" >&5
5208   cat conftest.$ac_ext >&5
5209   rm -rf conftest*
5210   eval "ac_cv_lib_$ac_lib_var=no"
5211 fi
5212 rm -f conftest*
5213 LIBS="$ac_save_LIBS"
5214
5215 fi
5216 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5217   echo "$ac_t""yes" 1>&6
5218   have_termcap=yes
5219 else
5220   echo "$ac_t""no" 1>&6
5221 have_termcap=no
5222 fi
5223
5224         if test $have_termcap = yes ; then
5225                 cat >> confdefs.h <<\EOF
5226 #define HAVE_TERMCAP 1
5227 EOF
5228
5229                 ol_link_termcap=yes
5230                 TERMCAP_LIBS=-ltermcap
5231         fi
5232 fi
5233
5234 if test $ol_link_termcap = no ; then
5235         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
5236 echo "configure:5237: checking for initscr in -lncurses" >&5
5237 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
5238 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5239   echo $ac_n "(cached) $ac_c" 1>&6
5240 else
5241   ac_save_LIBS="$LIBS"
5242 LIBS="-lncurses  $LIBS"
5243 cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246 /* Override any gcc2 internal prototype to avoid an error.  */
5247 /* We use char because int might match the return type of a gcc2
5248     builtin and then its argument prototype would still apply.  */
5249 char initscr();
5250
5251 int main() {
5252 initscr()
5253 ; return 0; }
5254 EOF
5255 if { (eval echo configure:5256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5256   rm -rf conftest*
5257   eval "ac_cv_lib_$ac_lib_var=yes"
5258 else
5259   echo "configure: failed program was:" >&5
5260   cat conftest.$ac_ext >&5
5261   rm -rf conftest*
5262   eval "ac_cv_lib_$ac_lib_var=no"
5263 fi
5264 rm -f conftest*
5265 LIBS="$ac_save_LIBS"
5266
5267 fi
5268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5269   echo "$ac_t""yes" 1>&6
5270   have_ncurses=yes
5271 else
5272   echo "$ac_t""no" 1>&6
5273 have_ncurses=no
5274 fi
5275
5276         if test $have_ncurses = yes ; then
5277                 cat >> confdefs.h <<\EOF
5278 #define HAVE_NCURSES 1
5279 EOF
5280
5281                 ol_link_termcap=yes
5282                 TERMCAP_LIBS=-lncurses
5283         fi
5284 fi
5285
5286 if test $ol_link_termcap = no ; then
5287         cat >> confdefs.h <<\EOF
5288 #define NO_TERMCAP 1
5289 EOF
5290
5291         TERMCAP_LIBS=
5292 fi
5293
5294 # FreeBSD (and others) have crypt(3) in -lcrypt
5295 if test $ol_enable_crypt != no ; then
5296         echo $ac_n "checking for crypt""... $ac_c" 1>&6
5297 echo "configure:5298: checking for crypt" >&5
5298 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
5299   echo $ac_n "(cached) $ac_c" 1>&6
5300 else
5301   cat > conftest.$ac_ext <<EOF
5302 #line 5303 "configure"
5303 #include "confdefs.h"
5304 /* System header to define __stub macros and hopefully few prototypes,
5305     which can conflict with char crypt(); below.  */
5306 #include <assert.h>
5307 /* Override any gcc2 internal prototype to avoid an error.  */
5308 /* We use char because int might match the return type of a gcc2
5309     builtin and then its argument prototype would still apply.  */
5310 char crypt();
5311
5312 int main() {
5313
5314 /* The GNU C library defines this for functions which it implements
5315     to always fail with ENOSYS.  Some functions are actually named
5316     something starting with __ and the normal name is an alias.  */
5317 #if defined (__stub_crypt) || defined (__stub___crypt)
5318 choke me
5319 #else
5320 crypt();
5321 #endif
5322
5323 ; return 0; }
5324 EOF
5325 if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5326   rm -rf conftest*
5327   eval "ac_cv_func_crypt=yes"
5328 else
5329   echo "configure: failed program was:" >&5
5330   cat conftest.$ac_ext >&5
5331   rm -rf conftest*
5332   eval "ac_cv_func_crypt=no"
5333 fi
5334 rm -f conftest*
5335 fi
5336
5337 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
5338   echo "$ac_t""yes" 1>&6
5339   have_crypt=yes
5340 else
5341   echo "$ac_t""no" 1>&6
5342
5343                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
5344 echo "configure:5345: checking for crypt in -lcrypt" >&5
5345 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
5346 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5347   echo $ac_n "(cached) $ac_c" 1>&6
5348 else
5349   ac_save_LIBS="$LIBS"
5350 LIBS="-lcrypt  $LIBS"
5351 cat > conftest.$ac_ext <<EOF
5352 #line 5353 "configure"
5353 #include "confdefs.h"
5354 /* Override any gcc2 internal prototype to avoid an error.  */
5355 /* We use char because int might match the return type of a gcc2
5356     builtin and then its argument prototype would still apply.  */
5357 char crypt();
5358
5359 int main() {
5360 crypt()
5361 ; return 0; }
5362 EOF
5363 if { (eval echo configure:5364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5364   rm -rf conftest*
5365   eval "ac_cv_lib_$ac_lib_var=yes"
5366 else
5367   echo "configure: failed program was:" >&5
5368   cat conftest.$ac_ext >&5
5369   rm -rf conftest*
5370   eval "ac_cv_lib_$ac_lib_var=no"
5371 fi
5372 rm -f conftest*
5373 LIBS="$ac_save_LIBS"
5374
5375 fi
5376 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5377   echo "$ac_t""yes" 1>&6
5378   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
5379                         have_crypt=yes
5380 else
5381   echo "$ac_t""no" 1>&6
5382 have_crypt=no
5383 fi
5384
5385 fi
5386
5387
5388         if test $have_crypt = yes ; then
5389                 cat >> confdefs.h <<\EOF
5390 #define HAVE_CRYPT 1
5391 EOF
5392
5393         else
5394                 echo "configure: warning: could not find crypt" 1>&2
5395                 if test $ol_enable_crypt = yes ; then
5396                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
5397                 fi
5398
5399                 echo "configure: warning: disabling crypt support" 1>&2
5400                 ol_enable_crypt=no
5401         fi
5402 fi
5403
5404 # FreeBSD (and others) have setproctitle(3) in -lutil
5405 if test $ol_enable_proctitle != no ; then
5406         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
5407 echo "configure:5408: checking for setproctitle" >&5
5408 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
5409   echo $ac_n "(cached) $ac_c" 1>&6
5410 else
5411   cat > conftest.$ac_ext <<EOF
5412 #line 5413 "configure"
5413 #include "confdefs.h"
5414 /* System header to define __stub macros and hopefully few prototypes,
5415     which can conflict with char setproctitle(); below.  */
5416 #include <assert.h>
5417 /* Override any gcc2 internal prototype to avoid an error.  */
5418 /* We use char because int might match the return type of a gcc2
5419     builtin and then its argument prototype would still apply.  */
5420 char setproctitle();
5421
5422 int main() {
5423
5424 /* The GNU C library defines this for functions which it implements
5425     to always fail with ENOSYS.  Some functions are actually named
5426     something starting with __ and the normal name is an alias.  */
5427 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
5428 choke me
5429 #else
5430 setproctitle();
5431 #endif
5432
5433 ; return 0; }
5434 EOF
5435 if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5436   rm -rf conftest*
5437   eval "ac_cv_func_setproctitle=yes"
5438 else
5439   echo "configure: failed program was:" >&5
5440   cat conftest.$ac_ext >&5
5441   rm -rf conftest*
5442   eval "ac_cv_func_setproctitle=no"
5443 fi
5444 rm -f conftest*
5445 fi
5446
5447 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
5448   echo "$ac_t""yes" 1>&6
5449   have_setproctitle=yes
5450 else
5451   echo "$ac_t""no" 1>&6
5452
5453                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
5454 echo "configure:5455: checking for setproctitle in -lutil" >&5
5455 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
5456 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5457   echo $ac_n "(cached) $ac_c" 1>&6
5458 else
5459   ac_save_LIBS="$LIBS"
5460 LIBS="-lutil  $LIBS"
5461 cat > conftest.$ac_ext <<EOF
5462 #line 5463 "configure"
5463 #include "confdefs.h"
5464 /* Override any gcc2 internal prototype to avoid an error.  */
5465 /* We use char because int might match the return type of a gcc2
5466     builtin and then its argument prototype would still apply.  */
5467 char setproctitle();
5468
5469 int main() {
5470 setproctitle()
5471 ; return 0; }
5472 EOF
5473 if { (eval echo configure:5474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5474   rm -rf conftest*
5475   eval "ac_cv_lib_$ac_lib_var=yes"
5476 else
5477   echo "configure: failed program was:" >&5
5478   cat conftest.$ac_ext >&5
5479   rm -rf conftest*
5480   eval "ac_cv_lib_$ac_lib_var=no"
5481 fi
5482 rm -f conftest*
5483 LIBS="$ac_save_LIBS"
5484
5485 fi
5486 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5487   echo "$ac_t""yes" 1>&6
5488   have_setproctitle=yes
5489                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
5490 else
5491   echo "$ac_t""no" 1>&6
5492 have_setproctitle=no
5493                         LIBOBJS="$LIBOBJS setproctitle.o"
5494 fi
5495
5496 fi
5497
5498
5499         if test $have_setproctitle = yes ; then
5500                 cat >> confdefs.h <<\EOF
5501 #define HAVE_SETPROCTITLE 1
5502 EOF
5503
5504         fi
5505 fi
5506
5507 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
5508 echo "configure:5509: checking for ANSI C header files" >&5
5509 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
5510   echo $ac_n "(cached) $ac_c" 1>&6
5511 else
5512   cat > conftest.$ac_ext <<EOF
5513 #line 5514 "configure"
5514 #include "confdefs.h"
5515 #include <stdlib.h>
5516 #include <stdarg.h>
5517 #include <string.h>
5518 #include <float.h>
5519 EOF
5520 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5521 { (eval echo configure:5522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5522 ac_err=`grep -v '^ *+' conftest.out`
5523 if test -z "$ac_err"; then
5524   rm -rf conftest*
5525   ac_cv_header_stdc=yes
5526 else
5527   echo "$ac_err" >&5
5528   echo "configure: failed program was:" >&5
5529   cat conftest.$ac_ext >&5
5530   rm -rf conftest*
5531   ac_cv_header_stdc=no
5532 fi
5533 rm -f conftest*
5534
5535 if test $ac_cv_header_stdc = yes; then
5536   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5537 cat > conftest.$ac_ext <<EOF
5538 #line 5539 "configure"
5539 #include "confdefs.h"
5540 #include <string.h>
5541 EOF
5542 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5543   egrep "memchr" >/dev/null 2>&1; then
5544   :
5545 else
5546   rm -rf conftest*
5547   ac_cv_header_stdc=no
5548 fi
5549 rm -f conftest*
5550
5551 fi
5552
5553 if test $ac_cv_header_stdc = yes; then
5554   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5555 cat > conftest.$ac_ext <<EOF
5556 #line 5557 "configure"
5557 #include "confdefs.h"
5558 #include <stdlib.h>
5559 EOF
5560 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5561   egrep "free" >/dev/null 2>&1; then
5562   :
5563 else
5564   rm -rf conftest*
5565   ac_cv_header_stdc=no
5566 fi
5567 rm -f conftest*
5568
5569 fi
5570
5571 if test $ac_cv_header_stdc = yes; then
5572   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5573 if test "$cross_compiling" = yes; then
5574   :
5575 else
5576   cat > conftest.$ac_ext <<EOF
5577 #line 5578 "configure"
5578 #include "confdefs.h"
5579 #include <ctype.h>
5580 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5581 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5582 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5583 int main () { int i; for (i = 0; i < 256; i++)
5584 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
5585 exit (0); }
5586
5587 EOF
5588 if { (eval echo configure:5589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5589 then
5590   :
5591 else
5592   echo "configure: failed program was:" >&5
5593   cat conftest.$ac_ext >&5
5594   rm -fr conftest*
5595   ac_cv_header_stdc=no
5596 fi
5597 rm -fr conftest*
5598 fi
5599
5600 fi
5601 fi
5602
5603 echo "$ac_t""$ac_cv_header_stdc" 1>&6
5604 if test $ac_cv_header_stdc = yes; then
5605   cat >> confdefs.h <<\EOF
5606 #define STDC_HEADERS 1
5607 EOF
5608
5609 fi
5610
5611
5612 if test $ac_cv_header_stdc != yes; then
5613         echo "configure: warning: could not Standard C compliant headers" 1>&2
5614 fi
5615
5616 ac_header_dirent=no
5617 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
5618 do
5619 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5620 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
5621 echo "configure:5622: checking for $ac_hdr that defines DIR" >&5
5622 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
5623   echo $ac_n "(cached) $ac_c" 1>&6
5624 else
5625   cat > conftest.$ac_ext <<EOF
5626 #line 5627 "configure"
5627 #include "confdefs.h"
5628 #include <sys/types.h>
5629 #include <$ac_hdr>
5630 int main() {
5631 DIR *dirp = 0;
5632 ; return 0; }
5633 EOF
5634 if { (eval echo configure:5635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5635   rm -rf conftest*
5636   eval "ac_cv_header_dirent_$ac_safe=yes"
5637 else
5638   echo "configure: failed program was:" >&5
5639   cat conftest.$ac_ext >&5
5640   rm -rf conftest*
5641   eval "ac_cv_header_dirent_$ac_safe=no"
5642 fi
5643 rm -f conftest*
5644 fi
5645 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
5646   echo "$ac_t""yes" 1>&6
5647     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5648   cat >> confdefs.h <<EOF
5649 #define $ac_tr_hdr 1
5650 EOF
5651  ac_header_dirent=$ac_hdr; break
5652 else
5653   echo "$ac_t""no" 1>&6
5654 fi
5655 done
5656 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
5657 if test $ac_header_dirent = dirent.h; then
5658 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
5659 echo "configure:5660: checking for opendir in -ldir" >&5
5660 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
5661 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5662   echo $ac_n "(cached) $ac_c" 1>&6
5663 else
5664   ac_save_LIBS="$LIBS"
5665 LIBS="-ldir  $LIBS"
5666 cat > conftest.$ac_ext <<EOF
5667 #line 5668 "configure"
5668 #include "confdefs.h"
5669 /* Override any gcc2 internal prototype to avoid an error.  */
5670 /* We use char because int might match the return type of a gcc2
5671     builtin and then its argument prototype would still apply.  */
5672 char opendir();
5673
5674 int main() {
5675 opendir()
5676 ; return 0; }
5677 EOF
5678 if { (eval echo configure:5679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5679   rm -rf conftest*
5680   eval "ac_cv_lib_$ac_lib_var=yes"
5681 else
5682   echo "configure: failed program was:" >&5
5683   cat conftest.$ac_ext >&5
5684   rm -rf conftest*
5685   eval "ac_cv_lib_$ac_lib_var=no"
5686 fi
5687 rm -f conftest*
5688 LIBS="$ac_save_LIBS"
5689
5690 fi
5691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5692   echo "$ac_t""yes" 1>&6
5693   LIBS="$LIBS -ldir"
5694 else
5695   echo "$ac_t""no" 1>&6
5696 fi
5697
5698 else
5699 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
5700 echo "configure:5701: checking for opendir in -lx" >&5
5701 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
5702 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5703   echo $ac_n "(cached) $ac_c" 1>&6
5704 else
5705   ac_save_LIBS="$LIBS"
5706 LIBS="-lx  $LIBS"
5707 cat > conftest.$ac_ext <<EOF
5708 #line 5709 "configure"
5709 #include "confdefs.h"
5710 /* Override any gcc2 internal prototype to avoid an error.  */
5711 /* We use char because int might match the return type of a gcc2
5712     builtin and then its argument prototype would still apply.  */
5713 char opendir();
5714
5715 int main() {
5716 opendir()
5717 ; return 0; }
5718 EOF
5719 if { (eval echo configure:5720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5720   rm -rf conftest*
5721   eval "ac_cv_lib_$ac_lib_var=yes"
5722 else
5723   echo "configure: failed program was:" >&5
5724   cat conftest.$ac_ext >&5
5725   rm -rf conftest*
5726   eval "ac_cv_lib_$ac_lib_var=no"
5727 fi
5728 rm -f conftest*
5729 LIBS="$ac_save_LIBS"
5730
5731 fi
5732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5733   echo "$ac_t""yes" 1>&6
5734   LIBS="$LIBS -lx"
5735 else
5736   echo "$ac_t""no" 1>&6
5737 fi
5738
5739 fi
5740
5741 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
5742 echo "configure:5743: checking for sys/wait.h that is POSIX.1 compatible" >&5
5743 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
5744   echo $ac_n "(cached) $ac_c" 1>&6
5745 else
5746   cat > conftest.$ac_ext <<EOF
5747 #line 5748 "configure"
5748 #include "confdefs.h"
5749 #include <sys/types.h>
5750 #include <sys/wait.h>
5751 #ifndef WEXITSTATUS
5752 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
5753 #endif
5754 #ifndef WIFEXITED
5755 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
5756 #endif
5757 int main() {
5758 int s;
5759 wait (&s);
5760 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
5761 ; return 0; }
5762 EOF
5763 if { (eval echo configure:5764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5764   rm -rf conftest*
5765   ac_cv_header_sys_wait_h=yes
5766 else
5767   echo "configure: failed program was:" >&5
5768   cat conftest.$ac_ext >&5
5769   rm -rf conftest*
5770   ac_cv_header_sys_wait_h=no
5771 fi
5772 rm -f conftest*
5773 fi
5774
5775 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
5776 if test $ac_cv_header_sys_wait_h = yes; then
5777   cat >> confdefs.h <<\EOF
5778 #define HAVE_SYS_WAIT_H 1
5779 EOF
5780
5781 fi
5782
5783 for ac_hdr in \
5784         crypt.h                 \
5785         errno.h                 \
5786         fcntl.h                 \
5787         filio.h                 \
5788         getopt.h                \
5789         libutil.h               \
5790         limits.h                \
5791         malloc.h                \
5792         memory.h                \
5793         regex.h                 \
5794         psap.h                  \
5795         pwd.h                   \
5796         sgtty.h                 \
5797         stdarg.h                \
5798         stddef.h                \
5799         string.h                \
5800         strings.h               \
5801         sys/file.h              \
5802         sys/filio.h             \
5803         sys/errno.h             \
5804         sys/ioctl.h             \
5805         sys/param.h             \
5806         sys/resource.h  \
5807         sys/socket.h    \
5808         sys/syslog.h    \
5809         sys/time.h              \
5810         sys/types.h             \
5811         syslog.h                \
5812         termios.h               \
5813         unistd.h                \
5814
5815 do
5816 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5817 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5818 echo "configure:5819: checking for $ac_hdr" >&5
5819 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5820   echo $ac_n "(cached) $ac_c" 1>&6
5821 else
5822   cat > conftest.$ac_ext <<EOF
5823 #line 5824 "configure"
5824 #include "confdefs.h"
5825 #include <$ac_hdr>
5826 EOF
5827 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5828 { (eval echo configure:5829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5829 ac_err=`grep -v '^ *+' conftest.out`
5830 if test -z "$ac_err"; then
5831   rm -rf conftest*
5832   eval "ac_cv_header_$ac_safe=yes"
5833 else
5834   echo "$ac_err" >&5
5835   echo "configure: failed program was:" >&5
5836   cat conftest.$ac_ext >&5
5837   rm -rf conftest*
5838   eval "ac_cv_header_$ac_safe=no"
5839 fi
5840 rm -f conftest*
5841 fi
5842 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5843   echo "$ac_t""yes" 1>&6
5844     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5845   cat >> confdefs.h <<EOF
5846 #define $ac_tr_hdr 1
5847 EOF
5848  
5849 else
5850   echo "$ac_t""no" 1>&6
5851 fi
5852 done
5853
5854
5855 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
5856 echo "configure:5857: checking for uid_t in sys/types.h" >&5
5857 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
5858   echo $ac_n "(cached) $ac_c" 1>&6
5859 else
5860   cat > conftest.$ac_ext <<EOF
5861 #line 5862 "configure"
5862 #include "confdefs.h"
5863 #include <sys/types.h>
5864 EOF
5865 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5866   egrep "uid_t" >/dev/null 2>&1; then
5867   rm -rf conftest*
5868   ac_cv_type_uid_t=yes
5869 else
5870   rm -rf conftest*
5871   ac_cv_type_uid_t=no
5872 fi
5873 rm -f conftest*
5874
5875 fi
5876
5877 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
5878 if test $ac_cv_type_uid_t = no; then
5879   cat >> confdefs.h <<\EOF
5880 #define uid_t int
5881 EOF
5882
5883   cat >> confdefs.h <<\EOF
5884 #define gid_t int
5885 EOF
5886
5887 fi
5888
5889 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
5890 echo "configure:5891: checking type of array argument to getgroups" >&5
5891 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
5892   echo $ac_n "(cached) $ac_c" 1>&6
5893 else
5894   if test "$cross_compiling" = yes; then
5895   ac_cv_type_getgroups=cross
5896 else
5897   cat > conftest.$ac_ext <<EOF
5898 #line 5899 "configure"
5899 #include "confdefs.h"
5900
5901 /* Thanks to Mike Rendell for this test.  */
5902 #include <sys/types.h>
5903 #define NGID 256
5904 #undef MAX
5905 #define MAX(x, y) ((x) > (y) ? (x) : (y))
5906 main()
5907 {
5908   gid_t gidset[NGID];
5909   int i, n;
5910   union { gid_t gval; long lval; }  val;
5911
5912   val.lval = -1;
5913   for (i = 0; i < NGID; i++)
5914     gidset[i] = val.gval;
5915   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
5916                  gidset);
5917   /* Exit non-zero if getgroups seems to require an array of ints.  This
5918      happens when gid_t is short but getgroups modifies an array of ints.  */
5919   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
5920 }
5921
5922 EOF
5923 if { (eval echo configure:5924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
5924 then
5925     ac_cv_type_getgroups=gid_t
5926 else
5927   echo "configure: failed program was:" >&5
5928   cat conftest.$ac_ext >&5
5929   rm -fr conftest*
5930   ac_cv_type_getgroups=int
5931 fi
5932 rm -fr conftest*
5933 fi
5934
5935 if test $ac_cv_type_getgroups = cross; then
5936         cat > conftest.$ac_ext <<EOF
5937 #line 5938 "configure"
5938 #include "confdefs.h"
5939 #include <unistd.h>
5940 EOF
5941 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5942   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
5943   rm -rf conftest*
5944   ac_cv_type_getgroups=gid_t
5945 else
5946   rm -rf conftest*
5947   ac_cv_type_getgroups=int
5948 fi
5949 rm -f conftest*
5950
5951 fi
5952 fi
5953
5954 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
5955 cat >> confdefs.h <<EOF
5956 #define GETGROUPS_T $ac_cv_type_getgroups
5957 EOF
5958
5959
5960 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
5961 echo "configure:5962: checking for mode_t" >&5
5962 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
5963   echo $ac_n "(cached) $ac_c" 1>&6
5964 else
5965   cat > conftest.$ac_ext <<EOF
5966 #line 5967 "configure"
5967 #include "confdefs.h"
5968 #include <sys/types.h>
5969 #if STDC_HEADERS
5970 #include <stdlib.h>
5971 #include <stddef.h>
5972 #endif
5973 EOF
5974 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5975   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
5976   rm -rf conftest*
5977   ac_cv_type_mode_t=yes
5978 else
5979   rm -rf conftest*
5980   ac_cv_type_mode_t=no
5981 fi
5982 rm -f conftest*
5983
5984 fi
5985 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
5986 if test $ac_cv_type_mode_t = no; then
5987   cat >> confdefs.h <<\EOF
5988 #define mode_t int
5989 EOF
5990
5991 fi
5992
5993 echo $ac_n "checking for off_t""... $ac_c" 1>&6
5994 echo "configure:5995: checking for off_t" >&5
5995 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
5996   echo $ac_n "(cached) $ac_c" 1>&6
5997 else
5998   cat > conftest.$ac_ext <<EOF
5999 #line 6000 "configure"
6000 #include "confdefs.h"
6001 #include <sys/types.h>
6002 #if STDC_HEADERS
6003 #include <stdlib.h>
6004 #include <stddef.h>
6005 #endif
6006 EOF
6007 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6008   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6009   rm -rf conftest*
6010   ac_cv_type_off_t=yes
6011 else
6012   rm -rf conftest*
6013   ac_cv_type_off_t=no
6014 fi
6015 rm -f conftest*
6016
6017 fi
6018 echo "$ac_t""$ac_cv_type_off_t" 1>&6
6019 if test $ac_cv_type_off_t = no; then
6020   cat >> confdefs.h <<\EOF
6021 #define off_t long
6022 EOF
6023
6024 fi
6025
6026 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
6027 echo "configure:6028: checking for pid_t" >&5
6028 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
6029   echo $ac_n "(cached) $ac_c" 1>&6
6030 else
6031   cat > conftest.$ac_ext <<EOF
6032 #line 6033 "configure"
6033 #include "confdefs.h"
6034 #include <sys/types.h>
6035 #if STDC_HEADERS
6036 #include <stdlib.h>
6037 #include <stddef.h>
6038 #endif
6039 EOF
6040 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6041   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6042   rm -rf conftest*
6043   ac_cv_type_pid_t=yes
6044 else
6045   rm -rf conftest*
6046   ac_cv_type_pid_t=no
6047 fi
6048 rm -f conftest*
6049
6050 fi
6051 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
6052 if test $ac_cv_type_pid_t = no; then
6053   cat >> confdefs.h <<\EOF
6054 #define pid_t int
6055 EOF
6056
6057 fi
6058
6059 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
6060 echo "configure:6061: checking return type of signal handlers" >&5
6061 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
6062   echo $ac_n "(cached) $ac_c" 1>&6
6063 else
6064   cat > conftest.$ac_ext <<EOF
6065 #line 6066 "configure"
6066 #include "confdefs.h"
6067 #include <sys/types.h>
6068 #include <signal.h>
6069 #ifdef signal
6070 #undef signal
6071 #endif
6072 #ifdef __cplusplus
6073 extern "C" void (*signal (int, void (*)(int)))(int);
6074 #else
6075 void (*signal ()) ();
6076 #endif
6077
6078 int main() {
6079 int i;
6080 ; return 0; }
6081 EOF
6082 if { (eval echo configure:6083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6083   rm -rf conftest*
6084   ac_cv_type_signal=void
6085 else
6086   echo "configure: failed program was:" >&5
6087   cat conftest.$ac_ext >&5
6088   rm -rf conftest*
6089   ac_cv_type_signal=int
6090 fi
6091 rm -f conftest*
6092 fi
6093
6094 echo "$ac_t""$ac_cv_type_signal" 1>&6
6095 cat >> confdefs.h <<EOF
6096 #define RETSIGTYPE $ac_cv_type_signal
6097 EOF
6098
6099
6100 echo $ac_n "checking for size_t""... $ac_c" 1>&6
6101 echo "configure:6102: checking for size_t" >&5
6102 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
6103   echo $ac_n "(cached) $ac_c" 1>&6
6104 else
6105   cat > conftest.$ac_ext <<EOF
6106 #line 6107 "configure"
6107 #include "confdefs.h"
6108 #include <sys/types.h>
6109 #if STDC_HEADERS
6110 #include <stdlib.h>
6111 #include <stddef.h>
6112 #endif
6113 EOF
6114 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6115   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
6116   rm -rf conftest*
6117   ac_cv_type_size_t=yes
6118 else
6119   rm -rf conftest*
6120   ac_cv_type_size_t=no
6121 fi
6122 rm -f conftest*
6123
6124 fi
6125 echo "$ac_t""$ac_cv_type_size_t" 1>&6
6126 if test $ac_cv_type_size_t = no; then
6127   cat >> confdefs.h <<\EOF
6128 #define size_t unsigned
6129 EOF
6130
6131 fi
6132
6133 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
6134 echo "configure:6135: checking for uid_t in sys/types.h" >&5
6135 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
6136   echo $ac_n "(cached) $ac_c" 1>&6
6137 else
6138   cat > conftest.$ac_ext <<EOF
6139 #line 6140 "configure"
6140 #include "confdefs.h"
6141 #include <sys/types.h>
6142 EOF
6143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6144   egrep "uid_t" >/dev/null 2>&1; then
6145   rm -rf conftest*
6146   ac_cv_type_uid_t=yes
6147 else
6148   rm -rf conftest*
6149   ac_cv_type_uid_t=no
6150 fi
6151 rm -f conftest*
6152
6153 fi
6154
6155 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
6156 if test $ac_cv_type_uid_t = no; then
6157   cat >> confdefs.h <<\EOF
6158 #define uid_t int
6159 EOF
6160
6161   cat >> confdefs.h <<\EOF
6162 #define gid_t int
6163 EOF
6164
6165 fi
6166
6167 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
6168 echo "configure:6169: checking for st_blksize in struct stat" >&5
6169 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
6170   echo $ac_n "(cached) $ac_c" 1>&6
6171 else
6172   cat > conftest.$ac_ext <<EOF
6173 #line 6174 "configure"
6174 #include "confdefs.h"
6175 #include <sys/types.h>
6176 #include <sys/stat.h>
6177 int main() {
6178 struct stat s; s.st_blksize;
6179 ; return 0; }
6180 EOF
6181 if { (eval echo configure:6182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6182   rm -rf conftest*
6183   ac_cv_struct_st_blksize=yes
6184 else
6185   echo "configure: failed program was:" >&5
6186   cat conftest.$ac_ext >&5
6187   rm -rf conftest*
6188   ac_cv_struct_st_blksize=no
6189 fi
6190 rm -f conftest*
6191 fi
6192
6193 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
6194 if test $ac_cv_struct_st_blksize = yes; then
6195   cat >> confdefs.h <<\EOF
6196 #define HAVE_ST_BLKSIZE 1
6197 EOF
6198
6199 fi
6200
6201 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6202 echo "configure:6203: checking whether time.h and sys/time.h may both be included" >&5
6203 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
6204   echo $ac_n "(cached) $ac_c" 1>&6
6205 else
6206   cat > conftest.$ac_ext <<EOF
6207 #line 6208 "configure"
6208 #include "confdefs.h"
6209 #include <sys/types.h>
6210 #include <sys/time.h>
6211 #include <time.h>
6212 int main() {
6213 struct tm *tp;
6214 ; return 0; }
6215 EOF
6216 if { (eval echo configure:6217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6217   rm -rf conftest*
6218   ac_cv_header_time=yes
6219 else
6220   echo "configure: failed program was:" >&5
6221   cat conftest.$ac_ext >&5
6222   rm -rf conftest*
6223   ac_cv_header_time=no
6224 fi
6225 rm -f conftest*
6226 fi
6227
6228 echo "$ac_t""$ac_cv_header_time" 1>&6
6229 if test $ac_cv_header_time = yes; then
6230   cat >> confdefs.h <<\EOF
6231 #define TIME_WITH_SYS_TIME 1
6232 EOF
6233
6234 fi
6235
6236 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
6237 echo "configure:6238: checking whether struct tm is in sys/time.h or time.h" >&5
6238 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
6239   echo $ac_n "(cached) $ac_c" 1>&6
6240 else
6241   cat > conftest.$ac_ext <<EOF
6242 #line 6243 "configure"
6243 #include "confdefs.h"
6244 #include <sys/types.h>
6245 #include <time.h>
6246 int main() {
6247 struct tm *tp; tp->tm_sec;
6248 ; return 0; }
6249 EOF
6250 if { (eval echo configure:6251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6251   rm -rf conftest*
6252   ac_cv_struct_tm=time.h
6253 else
6254   echo "configure: failed program was:" >&5
6255   cat conftest.$ac_ext >&5
6256   rm -rf conftest*
6257   ac_cv_struct_tm=sys/time.h
6258 fi
6259 rm -f conftest*
6260 fi
6261
6262 echo "$ac_t""$ac_cv_struct_tm" 1>&6
6263 if test $ac_cv_struct_tm = sys/time.h; then
6264   cat >> confdefs.h <<\EOF
6265 #define TM_IN_SYS_TIME 1
6266 EOF
6267
6268 fi
6269
6270
6271
6272 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
6273 echo "configure:6274: checking if toupper() requires islower()" >&5
6274 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
6275   echo $ac_n "(cached) $ac_c" 1>&6
6276 else
6277   
6278         if test "$cross_compiling" = yes; then
6279   ol_cv_c_upper_lower=safe
6280 else
6281   cat > conftest.$ac_ext <<EOF
6282 #line 6283 "configure"
6283 #include "confdefs.h"
6284
6285 #include <ctype.h>
6286 main()
6287 {
6288         if ('C' == toupper('C'))
6289                 exit(0);
6290         else
6291                 exit(1);
6292 }
6293 EOF
6294 if { (eval echo configure:6295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6295 then
6296   ol_cv_c_upper_lower=no
6297 else
6298   echo "configure: failed program was:" >&5
6299   cat conftest.$ac_ext >&5
6300   rm -fr conftest*
6301   ol_cv_c_upper_lower=yes
6302 fi
6303 rm -fr conftest*
6304 fi
6305
6306 fi
6307
6308 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
6309 if test $ol_cv_c_upper_lower != no ; then
6310         cat >> confdefs.h <<\EOF
6311 #define C_UPPER_LOWER 1
6312 EOF
6313
6314 fi
6315
6316 echo $ac_n "checking for working const""... $ac_c" 1>&6
6317 echo "configure:6318: checking for working const" >&5
6318 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
6319   echo $ac_n "(cached) $ac_c" 1>&6
6320 else
6321   cat > conftest.$ac_ext <<EOF
6322 #line 6323 "configure"
6323 #include "confdefs.h"
6324
6325 int main() {
6326
6327 /* Ultrix mips cc rejects this.  */
6328 typedef int charset[2]; const charset x;
6329 /* SunOS 4.1.1 cc rejects this.  */
6330 char const *const *ccp;
6331 char **p;
6332 /* NEC SVR4.0.2 mips cc rejects this.  */
6333 struct point {int x, y;};
6334 static struct point const zero = {0,0};
6335 /* AIX XL C 1.02.0.0 rejects this.
6336    It does not let you subtract one const X* pointer from another in an arm
6337    of an if-expression whose if-part is not a constant expression */
6338 const char *g = "string";
6339 ccp = &g + (g ? g-g : 0);
6340 /* HPUX 7.0 cc rejects these. */
6341 ++ccp;
6342 p = (char**) ccp;
6343 ccp = (char const *const *) p;
6344 { /* SCO 3.2v4 cc rejects this.  */
6345   char *t;
6346   char const *s = 0 ? (char *) 0 : (char const *) 0;
6347
6348   *t++ = 0;
6349 }
6350 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
6351   int x[] = {25, 17};
6352   const int *foo = &x[0];
6353   ++foo;
6354 }
6355 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
6356   typedef const int *iptr;
6357   iptr p = 0;
6358   ++p;
6359 }
6360 { /* AIX XL C 1.02.0.0 rejects this saying
6361      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
6362   struct s { int j; const int *ap[3]; };
6363   struct s *b; b->j = 5;
6364 }
6365 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
6366   const int foo = 10;
6367 }
6368
6369 ; return 0; }
6370 EOF
6371 if { (eval echo configure:6372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6372   rm -rf conftest*
6373   ac_cv_c_const=yes
6374 else
6375   echo "configure: failed program was:" >&5
6376   cat conftest.$ac_ext >&5
6377   rm -rf conftest*
6378   ac_cv_c_const=no
6379 fi
6380 rm -f conftest*
6381 fi
6382
6383 echo "$ac_t""$ac_cv_c_const" 1>&6
6384 if test $ac_cv_c_const = no; then
6385   cat >> confdefs.h <<\EOF
6386 #define const 
6387 EOF
6388
6389 fi
6390
6391
6392 if test $cross_compiling = yes ; then
6393         cat >> confdefs.h <<\EOF
6394 #define CROSS_COMPILING 1
6395 EOF
6396
6397 else
6398         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
6399 echo "configure:6400: checking whether byte ordering is bigendian" >&5
6400 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
6401   echo $ac_n "(cached) $ac_c" 1>&6
6402 else
6403   ac_cv_c_bigendian=unknown
6404 # See if sys/param.h defines the BYTE_ORDER macro.
6405 cat > conftest.$ac_ext <<EOF
6406 #line 6407 "configure"
6407 #include "confdefs.h"
6408 #include <sys/types.h>
6409 #include <sys/param.h>
6410 int main() {
6411
6412 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
6413  bogus endian macros
6414 #endif
6415 ; return 0; }
6416 EOF
6417 if { (eval echo configure:6418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6418   rm -rf conftest*
6419   # It does; now see whether it defined to BIG_ENDIAN or not.
6420 cat > conftest.$ac_ext <<EOF
6421 #line 6422 "configure"
6422 #include "confdefs.h"
6423 #include <sys/types.h>
6424 #include <sys/param.h>
6425 int main() {
6426
6427 #if BYTE_ORDER != BIG_ENDIAN
6428  not big endian
6429 #endif
6430 ; return 0; }
6431 EOF
6432 if { (eval echo configure:6433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6433   rm -rf conftest*
6434   ac_cv_c_bigendian=yes
6435 else
6436   echo "configure: failed program was:" >&5
6437   cat conftest.$ac_ext >&5
6438   rm -rf conftest*
6439   ac_cv_c_bigendian=no
6440 fi
6441 rm -f conftest*
6442 else
6443   echo "configure: failed program was:" >&5
6444   cat conftest.$ac_ext >&5
6445 fi
6446 rm -f conftest*
6447 if test $ac_cv_c_bigendian = unknown; then
6448 if test "$cross_compiling" = yes; then
6449     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
6450 else
6451   cat > conftest.$ac_ext <<EOF
6452 #line 6453 "configure"
6453 #include "confdefs.h"
6454 main () {
6455   /* Are we little or big endian?  From Harbison&Steele.  */
6456   union
6457   {
6458     long l;
6459     char c[sizeof (long)];
6460   } u;
6461   u.l = 1;
6462   exit (u.c[sizeof (long) - 1] == 1);
6463 }
6464 EOF
6465 if { (eval echo configure:6466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6466 then
6467   ac_cv_c_bigendian=no
6468 else
6469   echo "configure: failed program was:" >&5
6470   cat conftest.$ac_ext >&5
6471   rm -fr conftest*
6472   ac_cv_c_bigendian=yes
6473 fi
6474 rm -fr conftest*
6475 fi
6476
6477 fi
6478 fi
6479
6480 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
6481 if test $ac_cv_c_bigendian = yes; then
6482   cat >> confdefs.h <<\EOF
6483 #define WORDS_BIGENDIAN 1
6484 EOF
6485
6486 fi
6487
6488         echo $ac_n "checking size of short""... $ac_c" 1>&6
6489 echo "configure:6490: checking size of short" >&5
6490 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
6491   echo $ac_n "(cached) $ac_c" 1>&6
6492 else
6493   if test "$cross_compiling" = yes; then
6494     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
6495 else
6496   cat > conftest.$ac_ext <<EOF
6497 #line 6498 "configure"
6498 #include "confdefs.h"
6499 #include <stdio.h>
6500 main()
6501 {
6502   FILE *f=fopen("conftestval", "w");
6503   if (!f) exit(1);
6504   fprintf(f, "%d\n", sizeof(short));
6505   exit(0);
6506 }
6507 EOF
6508 if { (eval echo configure:6509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6509 then
6510   ac_cv_sizeof_short=`cat conftestval`
6511 else
6512   echo "configure: failed program was:" >&5
6513   cat conftest.$ac_ext >&5
6514   rm -fr conftest*
6515   ac_cv_sizeof_short=0
6516 fi
6517 rm -fr conftest*
6518 fi
6519
6520 fi
6521 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
6522 cat >> confdefs.h <<EOF
6523 #define SIZEOF_SHORT $ac_cv_sizeof_short
6524 EOF
6525
6526  
6527         echo $ac_n "checking size of int""... $ac_c" 1>&6
6528 echo "configure:6529: checking size of int" >&5
6529 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
6530   echo $ac_n "(cached) $ac_c" 1>&6
6531 else
6532   if test "$cross_compiling" = yes; then
6533     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
6534 else
6535   cat > conftest.$ac_ext <<EOF
6536 #line 6537 "configure"
6537 #include "confdefs.h"
6538 #include <stdio.h>
6539 main()
6540 {
6541   FILE *f=fopen("conftestval", "w");
6542   if (!f) exit(1);
6543   fprintf(f, "%d\n", sizeof(int));
6544   exit(0);
6545 }
6546 EOF
6547 if { (eval echo configure:6548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6548 then
6549   ac_cv_sizeof_int=`cat conftestval`
6550 else
6551   echo "configure: failed program was:" >&5
6552   cat conftest.$ac_ext >&5
6553   rm -fr conftest*
6554   ac_cv_sizeof_int=0
6555 fi
6556 rm -fr conftest*
6557 fi
6558
6559 fi
6560 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
6561 cat >> confdefs.h <<EOF
6562 #define SIZEOF_INT $ac_cv_sizeof_int
6563 EOF
6564
6565  
6566         echo $ac_n "checking size of long""... $ac_c" 1>&6
6567 echo "configure:6568: checking size of long" >&5
6568 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
6569   echo $ac_n "(cached) $ac_c" 1>&6
6570 else
6571   if test "$cross_compiling" = yes; then
6572     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
6573 else
6574   cat > conftest.$ac_ext <<EOF
6575 #line 6576 "configure"
6576 #include "confdefs.h"
6577 #include <stdio.h>
6578 main()
6579 {
6580   FILE *f=fopen("conftestval", "w");
6581   if (!f) exit(1);
6582   fprintf(f, "%d\n", sizeof(long));
6583   exit(0);
6584 }
6585 EOF
6586 if { (eval echo configure:6587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6587 then
6588   ac_cv_sizeof_long=`cat conftestval`
6589 else
6590   echo "configure: failed program was:" >&5
6591   cat conftest.$ac_ext >&5
6592   rm -fr conftest*
6593   ac_cv_sizeof_long=0
6594 fi
6595 rm -fr conftest*
6596 fi
6597
6598 fi
6599 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
6600 cat >> confdefs.h <<EOF
6601 #define SIZEOF_LONG $ac_cv_sizeof_long
6602 EOF
6603
6604
6605 fi
6606
6607 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
6608 echo "configure:6609: checking for 8-bit clean memcmp" >&5
6609 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
6610   echo $ac_n "(cached) $ac_c" 1>&6
6611 else
6612   if test "$cross_compiling" = yes; then
6613   ac_cv_func_memcmp_clean=no
6614 else
6615   cat > conftest.$ac_ext <<EOF
6616 #line 6617 "configure"
6617 #include "confdefs.h"
6618
6619 main()
6620 {
6621   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
6622   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
6623 }
6624
6625 EOF
6626 if { (eval echo configure:6627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6627 then
6628   ac_cv_func_memcmp_clean=yes
6629 else
6630   echo "configure: failed program was:" >&5
6631   cat conftest.$ac_ext >&5
6632   rm -fr conftest*
6633   ac_cv_func_memcmp_clean=no
6634 fi
6635 rm -fr conftest*
6636 fi
6637
6638 fi
6639
6640 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
6641 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
6642
6643 echo $ac_n "checking for strftime""... $ac_c" 1>&6
6644 echo "configure:6645: checking for strftime" >&5
6645 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
6646   echo $ac_n "(cached) $ac_c" 1>&6
6647 else
6648   cat > conftest.$ac_ext <<EOF
6649 #line 6650 "configure"
6650 #include "confdefs.h"
6651 /* System header to define __stub macros and hopefully few prototypes,
6652     which can conflict with char strftime(); below.  */
6653 #include <assert.h>
6654 /* Override any gcc2 internal prototype to avoid an error.  */
6655 /* We use char because int might match the return type of a gcc2
6656     builtin and then its argument prototype would still apply.  */
6657 char strftime();
6658
6659 int main() {
6660
6661 /* The GNU C library defines this for functions which it implements
6662     to always fail with ENOSYS.  Some functions are actually named
6663     something starting with __ and the normal name is an alias.  */
6664 #if defined (__stub_strftime) || defined (__stub___strftime)
6665 choke me
6666 #else
6667 strftime();
6668 #endif
6669
6670 ; return 0; }
6671 EOF
6672 if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6673   rm -rf conftest*
6674   eval "ac_cv_func_strftime=yes"
6675 else
6676   echo "configure: failed program was:" >&5
6677   cat conftest.$ac_ext >&5
6678   rm -rf conftest*
6679   eval "ac_cv_func_strftime=no"
6680 fi
6681 rm -f conftest*
6682 fi
6683
6684 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
6685   echo "$ac_t""yes" 1>&6
6686   cat >> confdefs.h <<\EOF
6687 #define HAVE_STRFTIME 1
6688 EOF
6689
6690 else
6691   echo "$ac_t""no" 1>&6
6692 # strftime is in -lintl on SCO UNIX.
6693 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
6694 echo "configure:6695: checking for strftime in -lintl" >&5
6695 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
6696 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6697   echo $ac_n "(cached) $ac_c" 1>&6
6698 else
6699   ac_save_LIBS="$LIBS"
6700 LIBS="-lintl  $LIBS"
6701 cat > conftest.$ac_ext <<EOF
6702 #line 6703 "configure"
6703 #include "confdefs.h"
6704 /* Override any gcc2 internal prototype to avoid an error.  */
6705 /* We use char because int might match the return type of a gcc2
6706     builtin and then its argument prototype would still apply.  */
6707 char strftime();
6708
6709 int main() {
6710 strftime()
6711 ; return 0; }
6712 EOF
6713 if { (eval echo configure:6714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6714   rm -rf conftest*
6715   eval "ac_cv_lib_$ac_lib_var=yes"
6716 else
6717   echo "configure: failed program was:" >&5
6718   cat conftest.$ac_ext >&5
6719   rm -rf conftest*
6720   eval "ac_cv_lib_$ac_lib_var=no"
6721 fi
6722 rm -f conftest*
6723 LIBS="$ac_save_LIBS"
6724
6725 fi
6726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6727   echo "$ac_t""yes" 1>&6
6728   cat >> confdefs.h <<\EOF
6729 #define HAVE_STRFTIME 1
6730 EOF
6731
6732 LIBS="-lintl $LIBS"
6733 else
6734   echo "$ac_t""no" 1>&6
6735 fi
6736
6737 fi
6738
6739 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
6740 echo "configure:6741: checking for vprintf" >&5
6741 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
6742   echo $ac_n "(cached) $ac_c" 1>&6
6743 else
6744   cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747 /* System header to define __stub macros and hopefully few prototypes,
6748     which can conflict with char vprintf(); below.  */
6749 #include <assert.h>
6750 /* Override any gcc2 internal prototype to avoid an error.  */
6751 /* We use char because int might match the return type of a gcc2
6752     builtin and then its argument prototype would still apply.  */
6753 char vprintf();
6754
6755 int main() {
6756
6757 /* The GNU C library defines this for functions which it implements
6758     to always fail with ENOSYS.  Some functions are actually named
6759     something starting with __ and the normal name is an alias.  */
6760 #if defined (__stub_vprintf) || defined (__stub___vprintf)
6761 choke me
6762 #else
6763 vprintf();
6764 #endif
6765
6766 ; return 0; }
6767 EOF
6768 if { (eval echo configure:6769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6769   rm -rf conftest*
6770   eval "ac_cv_func_vprintf=yes"
6771 else
6772   echo "configure: failed program was:" >&5
6773   cat conftest.$ac_ext >&5
6774   rm -rf conftest*
6775   eval "ac_cv_func_vprintf=no"
6776 fi
6777 rm -f conftest*
6778 fi
6779
6780 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
6781   echo "$ac_t""yes" 1>&6
6782   cat >> confdefs.h <<\EOF
6783 #define HAVE_VPRINTF 1
6784 EOF
6785
6786 else
6787   echo "$ac_t""no" 1>&6
6788 fi
6789
6790 if test "$ac_cv_func_vprintf" != yes; then
6791 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
6792 echo "configure:6793: checking for _doprnt" >&5
6793 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
6794   echo $ac_n "(cached) $ac_c" 1>&6
6795 else
6796   cat > conftest.$ac_ext <<EOF
6797 #line 6798 "configure"
6798 #include "confdefs.h"
6799 /* System header to define __stub macros and hopefully few prototypes,
6800     which can conflict with char _doprnt(); below.  */
6801 #include <assert.h>
6802 /* Override any gcc2 internal prototype to avoid an error.  */
6803 /* We use char because int might match the return type of a gcc2
6804     builtin and then its argument prototype would still apply.  */
6805 char _doprnt();
6806
6807 int main() {
6808
6809 /* The GNU C library defines this for functions which it implements
6810     to always fail with ENOSYS.  Some functions are actually named
6811     something starting with __ and the normal name is an alias.  */
6812 #if defined (__stub__doprnt) || defined (__stub____doprnt)
6813 choke me
6814 #else
6815 _doprnt();
6816 #endif
6817
6818 ; return 0; }
6819 EOF
6820 if { (eval echo configure:6821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6821   rm -rf conftest*
6822   eval "ac_cv_func__doprnt=yes"
6823 else
6824   echo "configure: failed program was:" >&5
6825   cat conftest.$ac_ext >&5
6826   rm -rf conftest*
6827   eval "ac_cv_func__doprnt=no"
6828 fi
6829 rm -f conftest*
6830 fi
6831
6832 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
6833   echo "$ac_t""yes" 1>&6
6834   cat >> confdefs.h <<\EOF
6835 #define HAVE_DOPRNT 1
6836 EOF
6837
6838 else
6839   echo "$ac_t""no" 1>&6
6840 fi
6841
6842 fi
6843
6844
6845 if test $ac_cv_func_vprintf = yes ; then
6846                 for ac_func in vsnprintf
6847 do
6848 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6849 echo "configure:6850: checking for $ac_func" >&5
6850 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6851   echo $ac_n "(cached) $ac_c" 1>&6
6852 else
6853   cat > conftest.$ac_ext <<EOF
6854 #line 6855 "configure"
6855 #include "confdefs.h"
6856 /* System header to define __stub macros and hopefully few prototypes,
6857     which can conflict with char $ac_func(); below.  */
6858 #include <assert.h>
6859 /* Override any gcc2 internal prototype to avoid an error.  */
6860 /* We use char because int might match the return type of a gcc2
6861     builtin and then its argument prototype would still apply.  */
6862 char $ac_func();
6863
6864 int main() {
6865
6866 /* The GNU C library defines this for functions which it implements
6867     to always fail with ENOSYS.  Some functions are actually named
6868     something starting with __ and the normal name is an alias.  */
6869 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6870 choke me
6871 #else
6872 $ac_func();
6873 #endif
6874
6875 ; return 0; }
6876 EOF
6877 if { (eval echo configure:6878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6878   rm -rf conftest*
6879   eval "ac_cv_func_$ac_func=yes"
6880 else
6881   echo "configure: failed program was:" >&5
6882   cat conftest.$ac_ext >&5
6883   rm -rf conftest*
6884   eval "ac_cv_func_$ac_func=no"
6885 fi
6886 rm -f conftest*
6887 fi
6888
6889 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6890   echo "$ac_t""yes" 1>&6
6891     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6892   cat >> confdefs.h <<EOF
6893 #define $ac_tr_func 1
6894 EOF
6895  
6896 else
6897   echo "$ac_t""no" 1>&6
6898 fi
6899 done
6900
6901 fi
6902
6903 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
6904 echo "configure:6905: checking for wait3 that fills in rusage" >&5
6905 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
6906   echo $ac_n "(cached) $ac_c" 1>&6
6907 else
6908   if test "$cross_compiling" = yes; then
6909   ac_cv_func_wait3_rusage=no
6910 else
6911   cat > conftest.$ac_ext <<EOF
6912 #line 6913 "configure"
6913 #include "confdefs.h"
6914 #include <sys/types.h>
6915 #include <sys/time.h>
6916 #include <sys/resource.h>
6917 #include <stdio.h>
6918 /* HP-UX has wait3 but does not fill in rusage at all.  */
6919 main() {
6920   struct rusage r;
6921   int i;
6922   /* Use a field that we can force nonzero --
6923      voluntary context switches.
6924      For systems like NeXT and OSF/1 that don't set it,
6925      also use the system CPU time.  And page faults (I/O) for Linux.  */
6926   r.ru_nvcsw = 0;
6927   r.ru_stime.tv_sec = 0;
6928   r.ru_stime.tv_usec = 0;
6929   r.ru_majflt = r.ru_minflt = 0;
6930   switch (fork()) {
6931   case 0: /* Child.  */
6932     sleep(1); /* Give up the CPU.  */
6933     _exit(0);
6934   case -1: _exit(0); /* What can we do?  */
6935   default: /* Parent.  */
6936     wait3(&i, 0, &r);
6937     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
6938     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
6939          && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
6940   }
6941 }
6942 EOF
6943 if { (eval echo configure:6944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
6944 then
6945   ac_cv_func_wait3_rusage=yes
6946 else
6947   echo "configure: failed program was:" >&5
6948   cat conftest.$ac_ext >&5
6949   rm -fr conftest*
6950   ac_cv_func_wait3_rusage=no
6951 fi
6952 rm -fr conftest*
6953 fi
6954
6955 fi
6956
6957 echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
6958 if test $ac_cv_func_wait3_rusage = yes; then
6959   cat >> confdefs.h <<\EOF
6960 #define HAVE_WAIT3 1
6961 EOF
6962
6963 fi
6964
6965
6966 for ac_func in \
6967         bcopy                   \
6968         flock                   \
6969         getdtablesize   \
6970         gethostname             \
6971         getpwuid                \
6972         gettimeofday    \
6973         lockf                   \
6974         memcpy                  \
6975         memmove                 \
6976         mkstemp                 \
6977         mktime                  \
6978         res_search              \
6979         select                  \
6980         setpwfile               \
6981         setsid                  \
6982         signal                  \
6983         sigset                  \
6984         snprintf                \
6985         socket                  \
6986         strerror                \
6987         strpbrk                 \
6988         strrchr                 \
6989         strsep                  \
6990         strstr                  \
6991         strtod                  \
6992         strtok                  \
6993         strtol                  \
6994         strtoul                 \
6995         sysconf                 \
6996         waitpid                 \
6997
6998 do
6999 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7000 echo "configure:7001: checking for $ac_func" >&5
7001 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7002   echo $ac_n "(cached) $ac_c" 1>&6
7003 else
7004   cat > conftest.$ac_ext <<EOF
7005 #line 7006 "configure"
7006 #include "confdefs.h"
7007 /* System header to define __stub macros and hopefully few prototypes,
7008     which can conflict with char $ac_func(); below.  */
7009 #include <assert.h>
7010 /* Override any gcc2 internal prototype to avoid an error.  */
7011 /* We use char because int might match the return type of a gcc2
7012     builtin and then its argument prototype would still apply.  */
7013 char $ac_func();
7014
7015 int main() {
7016
7017 /* The GNU C library defines this for functions which it implements
7018     to always fail with ENOSYS.  Some functions are actually named
7019     something starting with __ and the normal name is an alias.  */
7020 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7021 choke me
7022 #else
7023 $ac_func();
7024 #endif
7025
7026 ; return 0; }
7027 EOF
7028 if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7029   rm -rf conftest*
7030   eval "ac_cv_func_$ac_func=yes"
7031 else
7032   echo "configure: failed program was:" >&5
7033   cat conftest.$ac_ext >&5
7034   rm -rf conftest*
7035   eval "ac_cv_func_$ac_func=no"
7036 fi
7037 rm -f conftest*
7038 fi
7039
7040 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7041   echo "$ac_t""yes" 1>&6
7042     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7043   cat >> confdefs.h <<EOF
7044 #define $ac_tr_func 1
7045 EOF
7046  
7047 else
7048   echo "$ac_t""no" 1>&6
7049 fi
7050 done
7051
7052
7053 for ac_func in getopt strdup tempnam
7054 do
7055 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7056 echo "configure:7057: checking for $ac_func" >&5
7057 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7058   echo $ac_n "(cached) $ac_c" 1>&6
7059 else
7060   cat > conftest.$ac_ext <<EOF
7061 #line 7062 "configure"
7062 #include "confdefs.h"
7063 /* System header to define __stub macros and hopefully few prototypes,
7064     which can conflict with char $ac_func(); below.  */
7065 #include <assert.h>
7066 /* Override any gcc2 internal prototype to avoid an error.  */
7067 /* We use char because int might match the return type of a gcc2
7068     builtin and then its argument prototype would still apply.  */
7069 char $ac_func();
7070
7071 int main() {
7072
7073 /* The GNU C library defines this for functions which it implements
7074     to always fail with ENOSYS.  Some functions are actually named
7075     something starting with __ and the normal name is an alias.  */
7076 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7077 choke me
7078 #else
7079 $ac_func();
7080 #endif
7081
7082 ; return 0; }
7083 EOF
7084 if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7085   rm -rf conftest*
7086   eval "ac_cv_func_$ac_func=yes"
7087 else
7088   echo "configure: failed program was:" >&5
7089   cat conftest.$ac_ext >&5
7090   rm -rf conftest*
7091   eval "ac_cv_func_$ac_func=no"
7092 fi
7093 rm -f conftest*
7094 fi
7095
7096 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7097   echo "$ac_t""yes" 1>&6
7098     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7099   cat >> confdefs.h <<EOF
7100 #define $ac_tr_func 1
7101 EOF
7102  
7103 else
7104   echo "$ac_t""no" 1>&6
7105 LIBOBJS="$LIBOBJS ${ac_func}.o"
7106 fi
7107 done
7108
7109
7110
7111 # Check Configuration
7112
7113 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
7114 echo "configure:7115: checking declaration of sys_errlist" >&5
7115 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
7116   echo $ac_n "(cached) $ac_c" 1>&6
7117 else
7118   
7119         cat > conftest.$ac_ext <<EOF
7120 #line 7121 "configure"
7121 #include "confdefs.h"
7122
7123 #include <stdio.h>
7124 #include <sys/types.h>
7125 #include <errno.h> 
7126 int main() {
7127 char *c = (char *) *sys_errlist
7128 ; return 0; }
7129 EOF
7130 if { (eval echo configure:7131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7131   rm -rf conftest*
7132   ol_cv_dcl_sys_errlist=yes
7133 else
7134   echo "configure: failed program was:" >&5
7135   cat conftest.$ac_ext >&5
7136   rm -rf conftest*
7137   ol_cv_dcl_sys_errlist=no
7138 fi
7139 rm -f conftest*
7140 fi
7141
7142 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
7143
7144 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
7145 if test $ol_cv_dcl_sys_errlist = no ; then
7146         cat >> confdefs.h <<\EOF
7147 #define DECL_SYS_ERRLIST 1
7148 EOF
7149
7150         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
7151 echo "configure:7152: checking existence of sys_errlist" >&5
7152         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
7153   echo $ac_n "(cached) $ac_c" 1>&6
7154 else
7155   
7156                 cat > conftest.$ac_ext <<EOF
7157 #line 7158 "configure"
7158 #include "confdefs.h"
7159 #include <errno.h>
7160 int main() {
7161 char *c = (char *) *sys_errlist
7162 ; return 0; }
7163 EOF
7164 if { (eval echo configure:7165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7165   rm -rf conftest*
7166   ol_cv_have_sys_errlist=yes
7167 else
7168   echo "configure: failed program was:" >&5
7169   cat conftest.$ac_ext >&5
7170   rm -rf conftest*
7171   ol_cv_have_sys_errlist=no
7172 fi
7173 rm -f conftest*
7174 fi
7175
7176         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
7177 fi
7178
7179
7180
7181 if test $ol_enable_debug != no ; then
7182         cat >> confdefs.h <<\EOF
7183 #define LDAP_DEBUG 1
7184 EOF
7185
7186 fi
7187 if test $ol_enable_libui = yes ; then
7188         cat >> confdefs.h <<\EOF
7189 #define LDAP_LIBUI 1
7190 EOF
7191
7192 fi
7193 if test $ol_enable_cache = no ; then
7194         cat >> confdefs.h <<\EOF
7195 #define LDAP_NOCACHE 1
7196 EOF
7197
7198 fi
7199 if test $ol_enable_dns != no ; then
7200         cat >> confdefs.h <<\EOF
7201 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS 1
7202 EOF
7203
7204 fi
7205 if test $ol_enable_proctitle != no ; then
7206         cat >> confdefs.h <<\EOF
7207 #define LDAP_PROCTITLE 1
7208 EOF
7209
7210 fi
7211 if test $ol_enable_referrals != no ; then
7212         cat >> confdefs.h <<\EOF
7213 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS 1
7214 EOF
7215
7216 fi
7217 if test $ol_enable_cldap != no ; then
7218         cat >> confdefs.h <<\EOF
7219 #define LDAP_CONNECTIONLESS 1
7220 EOF
7221
7222 fi
7223
7224 if test $ol_enable_aclgroups != no ; then
7225         cat >> confdefs.h <<\EOF
7226 #define SLAPD_ACLGROUPS 1
7227 EOF
7228
7229 fi
7230 if test $ol_enable_crypt != no ; then
7231         cat >> confdefs.h <<\EOF
7232 #define SLAPD_CRYPT 1
7233 EOF
7234
7235 fi
7236 if test $ol_enable_md5 != no ; then
7237         cat >> confdefs.h <<\EOF
7238 #define SLAPD_MD5 1
7239 EOF
7240
7241 fi
7242 if test $ol_enable_sha1 != no ; then
7243         cat >> confdefs.h <<\EOF
7244 #define SLAPD_SHA1 1
7245 EOF
7246
7247 fi
7248 if test $ol_enable_phonetic != no ; then
7249         cat >> confdefs.h <<\EOF
7250 #define SLAPD_PHONETIC 1
7251 EOF
7252
7253 fi
7254 if test $ol_enable_rlookups != no ; then
7255         cat >> confdefs.h <<\EOF
7256 #define SLAPD_RLOOKUPS 1
7257 EOF
7258
7259 fi
7260
7261 if test $ol_link_ldbm != no ; then
7262         cat >> confdefs.h <<\EOF
7263 #define SLAPD_LDBM 1
7264 EOF
7265
7266         BUILD_SLAPD=yes
7267         BUILD_LDBM=yes
7268 fi
7269
7270 if test $ol_enable_passwd != no ; then
7271         cat >> confdefs.h <<\EOF
7272 #define SLAPD_PASSWD 1
7273 EOF
7274
7275         BUILD_SLAPD=yes
7276         BUILD_PASSWD=yes
7277 fi
7278
7279 if test $ol_enable_shell != no ; then
7280         cat >> confdefs.h <<\EOF
7281 #define SLAPD_SHELL 1
7282 EOF
7283
7284         BUILD_SLAPD=yes
7285         BUILD_SHELL=yes
7286 fi
7287
7288 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
7289         $BUILD_SLAPD = yes ; then
7290         BUILD_SLURPD=yes
7291 fi
7292
7293 if test $ol_link_isode != no ; then
7294         BUILD_LDAPD=yes
7295 fi
7296
7297
7298
7299
7300   
7301   
7302   
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318 trap '' 1 2 15
7319 cat > confcache <<\EOF
7320 # This file is a shell script that caches the results of configure
7321 # tests run on this system so they can be shared between configure
7322 # scripts and configure runs.  It is not useful on other systems.
7323 # If it contains results you don't want to keep, you may remove or edit it.
7324 #
7325 # By default, configure uses ./config.cache as the cache file,
7326 # creating it if it does not exist already.  You can give configure
7327 # the --cache-file=FILE option to use a different cache file; that is
7328 # what configure does when it calls configure scripts in
7329 # subdirectories, so they share the cache.
7330 # Giving --cache-file=/dev/null disables caching, for debugging configure.
7331 # config.status only pays attention to the cache file if you give it the
7332 # --recheck option to rerun configure.
7333 #
7334 EOF
7335 # The following way of writing the cache mishandles newlines in values,
7336 # but we know of no workaround that is simple, portable, and efficient.
7337 # So, don't put newlines in cache variables' values.
7338 # Ultrix sh set writes to stderr and can't be redirected directly,
7339 # and sets the high bit in the cache file unless we assign to the vars.
7340 (set) 2>&1 |
7341   case `(ac_space=' '; set) 2>&1` in
7342   *ac_space=\ *)
7343     # `set' does not quote correctly, so add quotes (double-quote substitution
7344     # turns \\\\ into \\, and sed turns \\ into \).
7345     sed -n \
7346       -e "s/'/'\\\\''/g" \
7347       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
7348     ;;
7349   *)
7350     # `set' quotes correctly as required by POSIX, so do not add quotes.
7351     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
7352     ;;
7353   esac >> confcache
7354 if cmp -s $cache_file confcache; then
7355   :
7356 else
7357   if test -w $cache_file; then
7358     echo "updating cache $cache_file"
7359     cat confcache > $cache_file
7360   else
7361     echo "not updating unwritable cache $cache_file"
7362   fi
7363 fi
7364 rm -f confcache
7365
7366 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
7367
7368 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7369 # Let make expand exec_prefix.
7370 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7371
7372 # Any assignment to VPATH causes Sun make to only execute
7373 # the first set of double-colon rules, so remove it if not needed.
7374 # If there is a colon in the path, we need to keep it.
7375 if test "x$srcdir" = x.; then
7376   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
7377 fi
7378
7379 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
7380
7381 DEFS=-DHAVE_CONFIG_H
7382
7383 # Without the "./", some shells look in PATH for config.status.
7384 : ${CONFIG_STATUS=./config.status}
7385
7386 echo creating $CONFIG_STATUS
7387 rm -f $CONFIG_STATUS
7388 cat > $CONFIG_STATUS <<EOF
7389 #! /bin/sh
7390 # Generated automatically by configure.
7391 # Run this file to recreate the current configuration.
7392 # This directory was configured as follows,
7393 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7394 #
7395 # $0 $ac_configure_args
7396 #
7397 # Compiler output produced by configure, useful for debugging
7398 # configure, is in ./config.log if it exists.
7399
7400 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
7401 for ac_option
7402 do
7403   case "\$ac_option" in
7404   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
7405     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
7406     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
7407   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
7408     echo "$CONFIG_STATUS generated by autoconf version 2.12"
7409     exit 0 ;;
7410   -help | --help | --hel | --he | --h)
7411     echo "\$ac_cs_usage"; exit 0 ;;
7412   *) echo "\$ac_cs_usage"; exit 1 ;;
7413   esac
7414 done
7415
7416 ac_given_srcdir=$srcdir
7417 ac_given_INSTALL="$INSTALL"
7418
7419 trap 'rm -fr `echo "\
7420 Makefile:build/top.mk:Makefile.in:build/dir.mk \
7421 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
7422 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
7423 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
7424 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
7425 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
7426 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
7427 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
7428 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
7429 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
7430 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
7431 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
7432 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
7433 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
7434 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
7435 include/Makefile:build/top.mk:include/Makefile.in \
7436 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
7437 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
7438 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
7439 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
7440 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
7441 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
7442 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
7443 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
7444 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
7445 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
7446 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
7447 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
7448 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
7449 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
7450 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
7451 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
7452 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
7453 tests/Makefile:build/top.mk:tests/Makefile.in \
7454  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
7455 EOF
7456 cat >> $CONFIG_STATUS <<EOF
7457
7458 # Protect against being on the right side of a sed subst in config.status.
7459 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
7460  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
7461 $ac_vpsub
7462 $extrasub
7463 s%@CFLAGS@%$CFLAGS%g
7464 s%@CPPFLAGS@%$CPPFLAGS%g
7465 s%@CXXFLAGS@%$CXXFLAGS%g
7466 s%@DEFS@%$DEFS%g
7467 s%@LDFLAGS@%$LDFLAGS%g
7468 s%@LIBS@%$LIBS%g
7469 s%@exec_prefix@%$exec_prefix%g
7470 s%@prefix@%$prefix%g
7471 s%@program_transform_name@%$program_transform_name%g
7472 s%@bindir@%$bindir%g
7473 s%@sbindir@%$sbindir%g
7474 s%@libexecdir@%$libexecdir%g
7475 s%@datadir@%$datadir%g
7476 s%@sysconfdir@%$sysconfdir%g
7477 s%@sharedstatedir@%$sharedstatedir%g
7478 s%@localstatedir@%$localstatedir%g
7479 s%@libdir@%$libdir%g
7480 s%@includedir@%$includedir%g
7481 s%@oldincludedir@%$oldincludedir%g
7482 s%@infodir@%$infodir%g
7483 s%@mandir@%$mandir%g
7484 s%@LN_S@%$LN_S%g
7485 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
7486 s%@INSTALL_DATA@%$INSTALL_DATA%g
7487 s%@RANLIB@%$RANLIB%g
7488 s%@SET_MAKE@%$SET_MAKE%g
7489 s%@SENDMAIL@%$SENDMAIL%g
7490 s%@EDITOR@%$EDITOR%g
7491 s%@FINGER@%$FINGER%g
7492 s%@CC@%$CC%g
7493 s%@CPP@%$CPP%g
7494 s%@PEPSY@%$PEPSY%g
7495 s%@LIBOBJS@%$LIBOBJS%g
7496 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
7497 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
7498 s%@BUILD_LDBM@%$BUILD_LDBM%g
7499 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
7500 s%@BUILD_SHELL@%$BUILD_SHELL%g
7501 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
7502 s%@LDAP_LIBS@%$LDAP_LIBS%g
7503 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
7504 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
7505 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
7506 s%@LDBM_LIBS@%$LDBM_LIBS%g
7507 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
7508 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
7509 s%@KRB_LIBS@%$KRB_LIBS%g
7510 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
7511
7512 CEOF
7513 EOF
7514
7515 cat >> $CONFIG_STATUS <<\EOF
7516
7517 # Split the substitutions into bite-sized pieces for seds with
7518 # small command number limits, like on Digital OSF/1 and HP-UX.
7519 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7520 ac_file=1 # Number of current file.
7521 ac_beg=1 # First line for current file.
7522 ac_end=$ac_max_sed_cmds # Line after last line for current file.
7523 ac_more_lines=:
7524 ac_sed_cmds=""
7525 while $ac_more_lines; do
7526   if test $ac_beg -gt 1; then
7527     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7528   else
7529     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7530   fi
7531   if test ! -s conftest.s$ac_file; then
7532     ac_more_lines=false
7533     rm -f conftest.s$ac_file
7534   else
7535     if test -z "$ac_sed_cmds"; then
7536       ac_sed_cmds="sed -f conftest.s$ac_file"
7537     else
7538       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7539     fi
7540     ac_file=`expr $ac_file + 1`
7541     ac_beg=$ac_end
7542     ac_end=`expr $ac_end + $ac_max_sed_cmds`
7543   fi
7544 done
7545 if test -z "$ac_sed_cmds"; then
7546   ac_sed_cmds=cat
7547 fi
7548 EOF
7549
7550 cat >> $CONFIG_STATUS <<EOF
7551
7552 CONFIG_FILES=\${CONFIG_FILES-"\
7553 Makefile:build/top.mk:Makefile.in:build/dir.mk \
7554 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
7555 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
7556 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
7557 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
7558 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
7559 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
7560 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
7561 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
7562 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
7563 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
7564 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
7565 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
7566 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
7567 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
7568 include/Makefile:build/top.mk:include/Makefile.in \
7569 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
7570 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
7571 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
7572 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
7573 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
7574 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
7575 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
7576 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
7577 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
7578 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
7579 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
7580 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
7581 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
7582 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
7583 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
7584 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
7585 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
7586 tests/Makefile:build/top.mk:tests/Makefile.in \
7587 "}
7588 EOF
7589 cat >> $CONFIG_STATUS <<\EOF
7590 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7591   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7592   case "$ac_file" in
7593   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7594        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7595   *) ac_file_in="${ac_file}.in" ;;
7596   esac
7597
7598   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7599
7600   # Remove last slash and all that follows it.  Not all systems have dirname.
7601   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7602   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7603     # The file is in a subdirectory.
7604     test ! -d "$ac_dir" && mkdir "$ac_dir"
7605     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7606     # A "../" for each directory in $ac_dir_suffix.
7607     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7608   else
7609     ac_dir_suffix= ac_dots=
7610   fi
7611
7612   case "$ac_given_srcdir" in
7613   .)  srcdir=.
7614       if test -z "$ac_dots"; then top_srcdir=.
7615       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7616   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7617   *) # Relative path.
7618     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7619     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7620   esac
7621
7622   case "$ac_given_INSTALL" in
7623   [/$]*) INSTALL="$ac_given_INSTALL" ;;
7624   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
7625   esac
7626
7627   echo creating "$ac_file"
7628   rm -f "$ac_file"
7629   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7630   case "$ac_file" in
7631   *Makefile*) ac_comsub="1i\\
7632 # $configure_input" ;;
7633   *) ac_comsub= ;;
7634   esac
7635
7636   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7637   sed -e "$ac_comsub
7638 s%@configure_input@%$configure_input%g
7639 s%@srcdir@%$srcdir%g
7640 s%@top_srcdir@%$top_srcdir%g
7641 s%@INSTALL@%$INSTALL%g
7642 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7643 fi; done
7644 rm -f conftest.s*
7645
7646 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7647 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7648 #
7649 # ac_d sets the value in "#define NAME VALUE" lines.
7650 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7651 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7652 ac_dC='\3'
7653 ac_dD='%g'
7654 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7655 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7656 ac_uB='\([      ]\)%\1#\2define\3'
7657 ac_uC=' '
7658 ac_uD='\4%g'
7659 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7660 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7661 ac_eB='$%\1#\2define\3'
7662 ac_eC=' '
7663 ac_eD='%g'
7664
7665 if test "${CONFIG_HEADERS+set}" != set; then
7666 EOF
7667 cat >> $CONFIG_STATUS <<EOF
7668   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
7669 EOF
7670 cat >> $CONFIG_STATUS <<\EOF
7671 fi
7672 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7673   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7674   case "$ac_file" in
7675   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7676        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7677   *) ac_file_in="${ac_file}.in" ;;
7678   esac
7679
7680   echo creating $ac_file
7681
7682   rm -f conftest.frag conftest.in conftest.out
7683   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7684   cat $ac_file_inputs > conftest.in
7685
7686 EOF
7687
7688 # Transform confdefs.h into a sed script conftest.vals that substitutes
7689 # the proper values into config.h.in to produce config.h.  And first:
7690 # Protect against being on the right side of a sed subst in config.status.
7691 # Protect against being in an unquoted here document in config.status.
7692 rm -f conftest.vals
7693 cat > conftest.hdr <<\EOF
7694 s/[\\&%]/\\&/g
7695 s%[\\$`]%\\&%g
7696 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
7697 s%ac_d%ac_u%gp
7698 s%ac_u%ac_e%gp
7699 EOF
7700 sed -n -f conftest.hdr confdefs.h > conftest.vals
7701 rm -f conftest.hdr
7702
7703 # This sed command replaces #undef with comments.  This is necessary, for
7704 # example, in the case of _POSIX_SOURCE, which is predefined and required
7705 # on some systems where configure will not decide to define it.
7706 cat >> conftest.vals <<\EOF
7707 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
7708 EOF
7709
7710 # Break up conftest.vals because some shells have a limit on
7711 # the size of here documents, and old seds have small limits too.
7712
7713 rm -f conftest.tail
7714 while :
7715 do
7716   ac_lines=`grep -c . conftest.vals`
7717   # grep -c gives empty output for an empty file on some AIX systems.
7718   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7719   # Write a limited-size here document to conftest.frag.
7720   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
7721   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7722   echo 'CEOF
7723   sed -f conftest.frag conftest.in > conftest.out
7724   rm -f conftest.in
7725   mv conftest.out conftest.in
7726 ' >> $CONFIG_STATUS
7727   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7728   rm -f conftest.vals
7729   mv conftest.tail conftest.vals
7730 done
7731 rm -f conftest.vals
7732
7733 cat >> $CONFIG_STATUS <<\EOF
7734   rm -f conftest.frag conftest.h
7735   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7736   cat conftest.in >> conftest.h
7737   rm -f conftest.in
7738   if cmp -s $ac_file conftest.h 2>/dev/null; then
7739     echo "$ac_file is unchanged"
7740     rm -f conftest.h
7741   else
7742     # Remove last slash and all that follows it.  Not all systems have dirname.
7743       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7744       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7745       # The file is in a subdirectory.
7746       test ! -d "$ac_dir" && mkdir "$ac_dir"
7747     fi
7748     rm -f $ac_file
7749     mv conftest.h $ac_file
7750   fi
7751 fi; done
7752
7753 EOF
7754 cat >> $CONFIG_STATUS <<EOF
7755
7756 EOF
7757 cat >> $CONFIG_STATUS <<\EOF
7758
7759 date > stamp-h
7760 echo Please \"make depend\" to build dependencies
7761
7762 exit 0
7763 EOF
7764 chmod +x $CONFIG_STATUS
7765 rm -fr confdefs* $ac_clean_files
7766 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7767