]> git.sur5r.net Git - openldap/blob - configure
_SGI_MP_SOURCE errno/h_errno experiment
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
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   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72     --enable-ldbm       enable ldbm backend (yes)"
73 ac_help="$ac_help
74       --with-ldbm-api   use LDBM API (auto)"
75 ac_help="$ac_help
76       --with-ldbm-type  use LDBM type (auto)"
77 ac_help="$ac_help
78     --enable-passwd     enable passwd backend (no)"
79 ac_help="$ac_help
80     --enable-perl       enable perl backend (no)"
81 ac_help="$ac_help
82     --enable-shell      enable shell backend (no)"
83 ac_help="$ac_help
84     --enable-tcl        enable tcl backend (no)"
85 ac_help="$ac_help
86 SLURPD Options:"
87 ac_help="$ac_help
88   --enable-slurpd       enable building slurpd (auto)"
89 ac_help="$ac_help
90 Library Generation & Linking Options"
91 ac_help="$ac_help
92   --enable-static         build static libraries [default=yes]
93   --enable-static=PKGS    only build shared libraries if the current package
94                           appears as an element in the PKGS list"
95 ac_help="$ac_help
96   --enable-shared         build shared libraries [default=yes]
97   --enable-shared=PKGS    only build shared libraries if the current package
98                           appears as an element in the PKGS list"
99 ac_help="$ac_help
100   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
101
102 # Initialize some variables set by options.
103 # The variables have the same names as the options, with
104 # dashes changed to underlines.
105 build=NONE
106 cache_file=./config.cache
107 exec_prefix=NONE
108 host=NONE
109 no_create=
110 nonopt=NONE
111 no_recursion=
112 prefix=NONE
113 program_prefix=NONE
114 program_suffix=NONE
115 program_transform_name=s,x,x,
116 silent=
117 site=
118 srcdir=
119 target=NONE
120 verbose=
121 x_includes=NONE
122 x_libraries=NONE
123 bindir='${exec_prefix}/bin'
124 sbindir='${exec_prefix}/sbin'
125 libexecdir='${exec_prefix}/libexec'
126 datadir='${prefix}/share'
127 sysconfdir='${prefix}/etc'
128 sharedstatedir='${prefix}/com'
129 localstatedir='${prefix}/var'
130 libdir='${exec_prefix}/lib'
131 includedir='${prefix}/include'
132 oldincludedir='/usr/include'
133 infodir='${prefix}/info'
134 mandir='${prefix}/man'
135
136 # Initialize some other variables.
137 subdirs=
138 MFLAGS= MAKEFLAGS=
139 SHELL=${CONFIG_SHELL-/bin/sh}
140 # Maximum number of lines to put in a shell here document.
141 ac_max_here_lines=12
142
143 ac_prev=
144 for ac_option
145 do
146
147   # If the previous option needs an argument, assign it.
148   if test -n "$ac_prev"; then
149     eval "$ac_prev=\$ac_option"
150     ac_prev=
151     continue
152   fi
153
154   case "$ac_option" in
155   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
156   *) ac_optarg= ;;
157   esac
158
159   # Accept the important Cygnus configure options, so we can diagnose typos.
160
161   case "$ac_option" in
162
163   -bindir | --bindir | --bindi | --bind | --bin | --bi)
164     ac_prev=bindir ;;
165   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
166     bindir="$ac_optarg" ;;
167
168   -build | --build | --buil | --bui | --bu)
169     ac_prev=build ;;
170   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
171     build="$ac_optarg" ;;
172
173   -cache-file | --cache-file | --cache-fil | --cache-fi \
174   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
175     ac_prev=cache_file ;;
176   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
177   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
178     cache_file="$ac_optarg" ;;
179
180   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
181     ac_prev=datadir ;;
182   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
183   | --da=*)
184     datadir="$ac_optarg" ;;
185
186   -disable-* | --disable-*)
187     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
188     # Reject names that are not valid shell variable names.
189     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
190       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
191     fi
192     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
193     eval "enable_${ac_feature}=no" ;;
194
195   -enable-* | --enable-*)
196     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
197     # Reject names that are not valid shell variable names.
198     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
199       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
200     fi
201     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
202     case "$ac_option" in
203       *=*) ;;
204       *) ac_optarg=yes ;;
205     esac
206     eval "enable_${ac_feature}='$ac_optarg'" ;;
207
208   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
209   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
210   | --exec | --exe | --ex)
211     ac_prev=exec_prefix ;;
212   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
213   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
214   | --exec=* | --exe=* | --ex=*)
215     exec_prefix="$ac_optarg" ;;
216
217   -gas | --gas | --ga | --g)
218     # Obsolete; use --with-gas.
219     with_gas=yes ;;
220
221   -help | --help | --hel | --he)
222     # Omit some internal or obsolete options to make the list less imposing.
223     # This message is too long to be a string in the A/UX 3.1 sh.
224     cat << EOF
225 Usage: configure [options] [host]
226 Options: [defaults in brackets after descriptions]
227 Configuration:
228   --cache-file=FILE       cache test results in FILE
229   --help                  print this message
230   --no-create             do not create output files
231   --quiet, --silent       do not print \`checking...' messages
232   --version               print the version of autoconf that created configure
233 Directory and file names:
234   --prefix=PREFIX         install architecture-independent files in PREFIX
235                           [$ac_default_prefix]
236   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
237                           [same as prefix]
238   --bindir=DIR            user executables in DIR [EPREFIX/bin]
239   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
240   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
241   --datadir=DIR           read-only architecture-independent data in DIR
242                           [PREFIX/share]
243   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
244   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
245                           [PREFIX/com]
246   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
247   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
248   --includedir=DIR        C header files in DIR [PREFIX/include]
249   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
250   --infodir=DIR           info documentation in DIR [PREFIX/info]
251   --mandir=DIR            man documentation in DIR [PREFIX/man]
252   --srcdir=DIR            find the sources in DIR [configure dir or ..]
253   --program-prefix=PREFIX prepend PREFIX to installed program names
254   --program-suffix=SUFFIX append SUFFIX to installed program names
255   --program-transform-name=PROGRAM
256                           run sed PROGRAM on installed program names
257 EOF
258     cat << EOF
259 Host type:
260   --build=BUILD           configure for building on BUILD [BUILD=HOST]
261   --host=HOST             configure for HOST [guessed]
262   --target=TARGET         configure for TARGET [TARGET=HOST]
263 Features and packages:
264   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
265   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
266   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
267   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
268   --x-includes=DIR        X include files are in DIR
269   --x-libraries=DIR       X library files are in DIR
270 EOF
271     if test -n "$ac_help"; then
272       echo "--enable and --with options recognized:$ac_help"
273     fi
274     exit 0 ;;
275
276   -host | --host | --hos | --ho)
277     ac_prev=host ;;
278   -host=* | --host=* | --hos=* | --ho=*)
279     host="$ac_optarg" ;;
280
281   -includedir | --includedir | --includedi | --included | --include \
282   | --includ | --inclu | --incl | --inc)
283     ac_prev=includedir ;;
284   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
285   | --includ=* | --inclu=* | --incl=* | --inc=*)
286     includedir="$ac_optarg" ;;
287
288   -infodir | --infodir | --infodi | --infod | --info | --inf)
289     ac_prev=infodir ;;
290   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
291     infodir="$ac_optarg" ;;
292
293   -libdir | --libdir | --libdi | --libd)
294     ac_prev=libdir ;;
295   -libdir=* | --libdir=* | --libdi=* | --libd=*)
296     libdir="$ac_optarg" ;;
297
298   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
299   | --libexe | --libex | --libe)
300     ac_prev=libexecdir ;;
301   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
302   | --libexe=* | --libex=* | --libe=*)
303     libexecdir="$ac_optarg" ;;
304
305   -localstatedir | --localstatedir | --localstatedi | --localstated \
306   | --localstate | --localstat | --localsta | --localst \
307   | --locals | --local | --loca | --loc | --lo)
308     ac_prev=localstatedir ;;
309   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
310   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
311   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
312     localstatedir="$ac_optarg" ;;
313
314   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
315     ac_prev=mandir ;;
316   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
317     mandir="$ac_optarg" ;;
318
319   -nfp | --nfp | --nf)
320     # Obsolete; use --without-fp.
321     with_fp=no ;;
322
323   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
324   | --no-cr | --no-c)
325     no_create=yes ;;
326
327   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
328   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
329     no_recursion=yes ;;
330
331   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
332   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
333   | --oldin | --oldi | --old | --ol | --o)
334     ac_prev=oldincludedir ;;
335   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
336   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
337   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
338     oldincludedir="$ac_optarg" ;;
339
340   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
341     ac_prev=prefix ;;
342   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
343     prefix="$ac_optarg" ;;
344
345   -program-prefix | --program-prefix | --program-prefi | --program-pref \
346   | --program-pre | --program-pr | --program-p)
347     ac_prev=program_prefix ;;
348   -program-prefix=* | --program-prefix=* | --program-prefi=* \
349   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
350     program_prefix="$ac_optarg" ;;
351
352   -program-suffix | --program-suffix | --program-suffi | --program-suff \
353   | --program-suf | --program-su | --program-s)
354     ac_prev=program_suffix ;;
355   -program-suffix=* | --program-suffix=* | --program-suffi=* \
356   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
357     program_suffix="$ac_optarg" ;;
358
359   -program-transform-name | --program-transform-name \
360   | --program-transform-nam | --program-transform-na \
361   | --program-transform-n | --program-transform- \
362   | --program-transform | --program-transfor \
363   | --program-transfo | --program-transf \
364   | --program-trans | --program-tran \
365   | --progr-tra | --program-tr | --program-t)
366     ac_prev=program_transform_name ;;
367   -program-transform-name=* | --program-transform-name=* \
368   | --program-transform-nam=* | --program-transform-na=* \
369   | --program-transform-n=* | --program-transform-=* \
370   | --program-transform=* | --program-transfor=* \
371   | --program-transfo=* | --program-transf=* \
372   | --program-trans=* | --program-tran=* \
373   | --progr-tra=* | --program-tr=* | --program-t=*)
374     program_transform_name="$ac_optarg" ;;
375
376   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
377   | -silent | --silent | --silen | --sile | --sil)
378     silent=yes ;;
379
380   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
381     ac_prev=sbindir ;;
382   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
383   | --sbi=* | --sb=*)
384     sbindir="$ac_optarg" ;;
385
386   -sharedstatedir | --sharedstatedir | --sharedstatedi \
387   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
388   | --sharedst | --shareds | --shared | --share | --shar \
389   | --sha | --sh)
390     ac_prev=sharedstatedir ;;
391   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
392   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
393   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
394   | --sha=* | --sh=*)
395     sharedstatedir="$ac_optarg" ;;
396
397   -site | --site | --sit)
398     ac_prev=site ;;
399   -site=* | --site=* | --sit=*)
400     site="$ac_optarg" ;;
401
402   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
403     ac_prev=srcdir ;;
404   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
405     srcdir="$ac_optarg" ;;
406
407   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
408   | --syscon | --sysco | --sysc | --sys | --sy)
409     ac_prev=sysconfdir ;;
410   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
411   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
412     sysconfdir="$ac_optarg" ;;
413
414   -target | --target | --targe | --targ | --tar | --ta | --t)
415     ac_prev=target ;;
416   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
417     target="$ac_optarg" ;;
418
419   -v | -verbose | --verbose | --verbos | --verbo | --verb)
420     verbose=yes ;;
421
422   -version | --version | --versio | --versi | --vers)
423     echo "configure generated by autoconf version 2.13"
424     exit 0 ;;
425
426   -with-* | --with-*)
427     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
428     # Reject names that are not valid shell variable names.
429     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
430       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
431     fi
432     ac_package=`echo $ac_package| sed 's/-/_/g'`
433     case "$ac_option" in
434       *=*) ;;
435       *) ac_optarg=yes ;;
436     esac
437     eval "with_${ac_package}='$ac_optarg'" ;;
438
439   -without-* | --without-*)
440     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
441     # Reject names that are not valid shell variable names.
442     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
443       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
444     fi
445     ac_package=`echo $ac_package| sed 's/-/_/g'`
446     eval "with_${ac_package}=no" ;;
447
448   --x)
449     # Obsolete; use --with-x.
450     with_x=yes ;;
451
452   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
453   | --x-incl | --x-inc | --x-in | --x-i)
454     ac_prev=x_includes ;;
455   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
456   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
457     x_includes="$ac_optarg" ;;
458
459   -x-libraries | --x-libraries | --x-librarie | --x-librari \
460   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
461     ac_prev=x_libraries ;;
462   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
463   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
464     x_libraries="$ac_optarg" ;;
465
466   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
467     ;;
468
469   *)
470     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
471       echo "configure: warning: $ac_option: invalid host type" 1>&2
472     fi
473     if test "x$nonopt" != xNONE; then
474       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
475     fi
476     nonopt="$ac_option"
477     ;;
478
479   esac
480 done
481
482 if test -n "$ac_prev"; then
483   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
484 fi
485
486 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
487
488 # File descriptor usage:
489 # 0 standard input
490 # 1 file creation
491 # 2 errors and warnings
492 # 3 some systems may open it to /dev/tty
493 # 4 used on the Kubota Titan
494 # 6 checking for... messages and results
495 # 5 compiler messages saved in config.log
496 if test "$silent" = yes; then
497   exec 6>/dev/null
498 else
499   exec 6>&1
500 fi
501 exec 5>./config.log
502
503 echo "\
504 This file contains any messages produced by compilers while
505 running configure, to aid debugging if configure makes a mistake.
506 " 1>&5
507
508 # Strip out --no-create and --no-recursion so they do not pile up.
509 # Also quote any args containing shell metacharacters.
510 ac_configure_args=
511 for ac_arg
512 do
513   case "$ac_arg" in
514   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
515   | --no-cr | --no-c) ;;
516   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
517   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
518   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
519   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
520   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
521   esac
522 done
523
524 # NLS nuisances.
525 # Only set these to C if already set.  These must not be set unconditionally
526 # because not all systems understand e.g. LANG=C (notably SCO).
527 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
528 # Non-C LC_CTYPE values break the ctype check.
529 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
530 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
531 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
532 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
533
534 # confdefs.h avoids OS command line length limits that DEFS can exceed.
535 rm -rf conftest* confdefs.h
536 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
537 echo > confdefs.h
538
539 # A filename unique to this package, relative to the directory that
540 # configure is in, which we can look for to find out if srcdir is correct.
541 ac_unique_file=build/version
542
543 # Find the source files, if location was not specified.
544 if test -z "$srcdir"; then
545   ac_srcdir_defaulted=yes
546   # Try the directory containing this script, then its parent.
547   ac_prog=$0
548   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
549   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
550   srcdir=$ac_confdir
551   if test ! -r $srcdir/$ac_unique_file; then
552     srcdir=..
553   fi
554 else
555   ac_srcdir_defaulted=no
556 fi
557 if test ! -r $srcdir/$ac_unique_file; then
558   if test "$ac_srcdir_defaulted" = yes; then
559     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
560   else
561     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
562   fi
563 fi
564 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
565
566 # Prefer explicitly selected file to automatically selected ones.
567 if test -z "$CONFIG_SITE"; then
568   if test "x$prefix" != xNONE; then
569     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
570   else
571     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
572   fi
573 fi
574 for ac_site_file in $CONFIG_SITE; do
575   if test -r "$ac_site_file"; then
576     echo "loading site script $ac_site_file"
577     . "$ac_site_file"
578   fi
579 done
580
581
582 ac_ext=c
583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
584 ac_cpp='$CPP $CPPFLAGS'
585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
587 cross_compiling=$ac_cv_prog_cc_cross
588
589 ac_exeext=
590 ac_objext=o
591 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
592   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
593   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
594     ac_n= ac_c='
595 ' ac_t='        '
596   else
597     ac_n=-n ac_c= ac_t=
598   fi
599 else
600   ac_n= ac_c='\c' ac_t=
601 fi
602
603 ac_aux_dir=
604 for ac_dir in build $srcdir/build; do
605   if test -f $ac_dir/install-sh; then
606     ac_aux_dir=$ac_dir
607     ac_install_sh="$ac_aux_dir/install-sh -c"
608     break
609   elif test -f $ac_dir/install.sh; then
610     ac_aux_dir=$ac_dir
611     ac_install_sh="$ac_aux_dir/install.sh -c"
612     break
613   fi
614 done
615 if test -z "$ac_aux_dir"; then
616   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
617 fi
618 ac_config_guess=$ac_aux_dir/config.guess
619 ac_config_sub=$ac_aux_dir/config.sub
620 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
621
622 OL_VERSION=`cat $ac_aux_dir/version`
623 if test -z "$OL_VERSION"; then
624         { echo "configure: error: could not determine version" 1>&2; exit 1; }
625 fi
626
627 # Find a good install program.  We prefer a C program (faster),
628 # so one script is as good as another.  But avoid the broken or
629 # incompatible versions:
630 # SysV /etc/install, /usr/sbin/install
631 # SunOS /usr/etc/install
632 # IRIX /sbin/install
633 # AIX /bin/install
634 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
635 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
636 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
637 # ./install, which can be erroneously created by make from ./install.sh.
638 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
639 echo "configure:640: checking for a BSD compatible install" >&5
640 if test -z "$INSTALL"; then
641 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
642   echo $ac_n "(cached) $ac_c" 1>&6
643 else
644     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
645   for ac_dir in $PATH; do
646     # Account for people who put trailing slashes in PATH elements.
647     case "$ac_dir/" in
648     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
649     *)
650       # OSF1 and SCO ODT 3.0 have their own names for install.
651       # Don't use installbsd from OSF since it installs stuff as root
652       # by default.
653       for ac_prog in ginstall scoinst install; do
654         if test -f $ac_dir/$ac_prog; then
655           if test $ac_prog = install &&
656             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
657             # AIX install.  It has an incompatible calling convention.
658             :
659           else
660             ac_cv_path_install="$ac_dir/$ac_prog -c"
661             break 2
662           fi
663         fi
664       done
665       ;;
666     esac
667   done
668   IFS="$ac_save_IFS"
669
670 fi
671   if test "${ac_cv_path_install+set}" = set; then
672     INSTALL="$ac_cv_path_install"
673   else
674     # As a last resort, use the slow shell script.  We don't cache a
675     # path for INSTALL within a source directory, because that will
676     # break other packages using the cache if that directory is
677     # removed, or if the path is relative.
678     INSTALL="$ac_install_sh"
679   fi
680 fi
681 echo "$ac_t""$INSTALL" 1>&6
682
683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
684 # It thinks the first close brace ends the variable substitution.
685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
686
687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
688
689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
690
691 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
692 echo "configure:693: checking whether build environment is sane" >&5
693 # Just in case
694 sleep 1
695 echo timestamp > conftestfile
696 # Do `set' in a subshell so we don't clobber the current shell's
697 # arguments.  Must try -L first in case configure is actually a
698 # symlink; some systems play weird games with the mod time of symlinks
699 # (eg FreeBSD returns the mod time of the symlink's containing
700 # directory).
701 if (
702    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
703    if test "$*" = "X"; then
704       # -L didn't work.
705       set X `ls -t $srcdir/configure conftestfile`
706    fi
707    if test "$*" != "X $srcdir/configure conftestfile" \
708       && test "$*" != "X conftestfile $srcdir/configure"; then
709
710       # If neither matched, then we have a broken ls.  This can happen
711       # if, for instance, CONFIG_SHELL is bash and it inherits a
712       # broken ls alias from the environment.  This has actually
713       # happened.  Such a system could not be considered "sane".
714       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
715 alias in your environment" 1>&2; exit 1; }
716    fi
717
718    test "$2" = conftestfile
719    )
720 then
721    # Ok.
722    :
723 else
724    { echo "configure: error: newly created file is older than distributed files!
725 Check your system clock" 1>&2; exit 1; }
726 fi
727 rm -f conftest*
728 echo "$ac_t""yes" 1>&6
729 if test "$program_transform_name" = s,x,x,; then
730   program_transform_name=
731 else
732   # Double any \ or $.  echo might interpret backslashes.
733   cat <<\EOF_SED > conftestsed
734 s,\\,\\\\,g; s,\$,$$,g
735 EOF_SED
736   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
737   rm -f conftestsed
738 fi
739 test "$program_prefix" != NONE &&
740   program_transform_name="s,^,${program_prefix},; $program_transform_name"
741 # Use a double $ so make ignores it.
742 test "$program_suffix" != NONE &&
743   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
744
745 # sed with no file args requires a program.
746 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
747
748 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
749 echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
750 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
751 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
752   echo $ac_n "(cached) $ac_c" 1>&6
753 else
754   cat > conftestmake <<\EOF
755 all:
756         @echo 'ac_maketemp="${MAKE}"'
757 EOF
758 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
759 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
760 if test -n "$ac_maketemp"; then
761   eval ac_cv_prog_make_${ac_make}_set=yes
762 else
763   eval ac_cv_prog_make_${ac_make}_set=no
764 fi
765 rm -f conftestmake
766 fi
767 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
768   echo "$ac_t""yes" 1>&6
769   SET_MAKE=
770 else
771   echo "$ac_t""no" 1>&6
772   SET_MAKE="MAKE=${MAKE-make}"
773 fi
774
775
776 PACKAGE=OpenLDAP
777
778 VERSION=$OL_VERSION
779
780 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
781   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
782 fi
783
784
785
786 missing_dir=`cd $ac_aux_dir && pwd`
787 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
788 echo "configure:789: checking for working aclocal" >&5
789 # Run test in a subshell; some versions of sh will print an error if
790 # an executable is not found, even if stderr is redirected.
791 # Redirect stdin to placate older versions of autoconf.  Sigh.
792 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
793    ACLOCAL=aclocal
794    echo "$ac_t""found" 1>&6
795 else
796    ACLOCAL="$missing_dir/missing aclocal"
797    echo "$ac_t""missing" 1>&6
798 fi
799
800 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
801 echo "configure:802: checking for working autoconf" >&5
802 # Run test in a subshell; some versions of sh will print an error if
803 # an executable is not found, even if stderr is redirected.
804 # Redirect stdin to placate older versions of autoconf.  Sigh.
805 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
806    AUTOCONF=autoconf
807    echo "$ac_t""found" 1>&6
808 else
809    AUTOCONF="$missing_dir/missing autoconf"
810    echo "$ac_t""missing" 1>&6
811 fi
812
813 echo $ac_n "checking for working automake""... $ac_c" 1>&6
814 echo "configure:815: checking for working automake" >&5
815 # Run test in a subshell; some versions of sh will print an error if
816 # an executable is not found, even if stderr is redirected.
817 # Redirect stdin to placate older versions of autoconf.  Sigh.
818 if (automake --version) < /dev/null > /dev/null 2>&1; then
819    AUTOMAKE=automake
820    echo "$ac_t""found" 1>&6
821 else
822    AUTOMAKE="$missing_dir/missing automake"
823    echo "$ac_t""missing" 1>&6
824 fi
825
826 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
827 echo "configure:828: checking for working autoheader" >&5
828 # Run test in a subshell; some versions of sh will print an error if
829 # an executable is not found, even if stderr is redirected.
830 # Redirect stdin to placate older versions of autoconf.  Sigh.
831 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
832    AUTOHEADER=autoheader
833    echo "$ac_t""found" 1>&6
834 else
835    AUTOHEADER="$missing_dir/missing autoheader"
836    echo "$ac_t""missing" 1>&6
837 fi
838
839 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
840 echo "configure:841: checking for working makeinfo" >&5
841 # Run test in a subshell; some versions of sh will print an error if
842 # an executable is not found, even if stderr is redirected.
843 # Redirect stdin to placate older versions of autoconf.  Sigh.
844 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
845    MAKEINFO=makeinfo
846    echo "$ac_t""found" 1>&6
847 else
848    MAKEINFO="$missing_dir/missing makeinfo"
849    echo "$ac_t""missing" 1>&6
850 fi
851
852
853
854 cat >> confdefs.h <<EOF
855 #define OPENLDAP_PACKAGE "$PACKAGE"
856 EOF
857
858 cat >> confdefs.h <<EOF
859 #define OPENLDAP_VERSION "$VERSION"
860 EOF
861
862
863
864
865 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
866 echo "configure:867: checking configure arguments" >&5
867
868
869 top_builddir=`pwd`
870
871 cat >> confdefs.h <<\EOF
872 #define HAVE_MKVERSION 1
873 EOF
874
875
876 ldap_subdir="openldap"
877
878 # Check whether --with-subdir or --without-subdir was given.
879 if test "${with_subdir+set}" = set; then
880   withval="$with_subdir"
881   
882         if test "$withval" = "no"; then
883                 ldap_subdir=""
884         elif test "$withval" != "yes"; then
885                 ldap_subdir="$withval"
886         fi
887
888 fi
889
890
891 # OpenLDAP --enable-debug
892         # Check whether --enable-debug or --disable-debug was given.
893 if test "${enable_debug+set}" = set; then
894   enableval="$enable_debug"
895   
896         ol_arg=invalid
897         for ol_val in auto yes no ; do
898                 if test "$enableval" = "$ol_val" ; then
899                         ol_arg="$ol_val"
900                 fi
901         done
902         if test "$ol_arg" = "invalid" ; then
903                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
904         fi
905         ol_enable_debug="$ol_arg"
906
907 else
908         ol_enable_debug="yes"
909 fi
910 # end --enable-debug
911 # OpenLDAP --enable-syslog
912         # Check whether --enable-syslog or --disable-syslog was given.
913 if test "${enable_syslog+set}" = set; then
914   enableval="$enable_syslog"
915   
916         ol_arg=invalid
917         for ol_val in auto yes no ; do
918                 if test "$enableval" = "$ol_val" ; then
919                         ol_arg="$ol_val"
920                 fi
921         done
922         if test "$ol_arg" = "invalid" ; then
923                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
924         fi
925         ol_enable_syslog="$ol_arg"
926
927 else
928         ol_enable_syslog="auto"
929 fi
930 # end --enable-syslog
931 # OpenLDAP --enable-proctitle
932         # Check whether --enable-proctitle or --disable-proctitle was given.
933 if test "${enable_proctitle+set}" = set; then
934   enableval="$enable_proctitle"
935   
936         ol_arg=invalid
937         for ol_val in auto yes no ; do
938                 if test "$enableval" = "$ol_val" ; then
939                         ol_arg="$ol_val"
940                 fi
941         done
942         if test "$ol_arg" = "invalid" ; then
943                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
944         fi
945         ol_enable_proctitle="$ol_arg"
946
947 else
948         ol_enable_proctitle="yes"
949 fi
950 # end --enable-proctitle
951 # OpenLDAP --enable-cache
952         # Check whether --enable-cache or --disable-cache was given.
953 if test "${enable_cache+set}" = set; then
954   enableval="$enable_cache"
955   
956         ol_arg=invalid
957         for ol_val in auto yes no ; do
958                 if test "$enableval" = "$ol_val" ; then
959                         ol_arg="$ol_val"
960                 fi
961         done
962         if test "$ol_arg" = "invalid" ; then
963                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
964         fi
965         ol_enable_cache="$ol_arg"
966
967 else
968         ol_enable_cache="yes"
969 fi
970 # end --enable-cache
971 # OpenLDAP --enable-dns
972         # Check whether --enable-dns or --disable-dns was given.
973 if test "${enable_dns+set}" = set; then
974   enableval="$enable_dns"
975   
976         ol_arg=invalid
977         for ol_val in auto yes no ; do
978                 if test "$enableval" = "$ol_val" ; then
979                         ol_arg="$ol_val"
980                 fi
981         done
982         if test "$ol_arg" = "invalid" ; then
983                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
984         fi
985         ol_enable_dns="$ol_arg"
986
987 else
988         ol_enable_dns="no"
989 fi
990 # end --enable-dns
991 # OpenLDAP --enable-referrals
992         # Check whether --enable-referrals or --disable-referrals was given.
993 if test "${enable_referrals+set}" = set; then
994   enableval="$enable_referrals"
995   
996         ol_arg=invalid
997         for ol_val in auto yes no ; do
998                 if test "$enableval" = "$ol_val" ; then
999                         ol_arg="$ol_val"
1000                 fi
1001         done
1002         if test "$ol_arg" = "invalid" ; then
1003                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1004         fi
1005         ol_enable_referrals="$ol_arg"
1006
1007 else
1008         ol_enable_referrals="yes"
1009 fi
1010 # end --enable-referrals
1011 # OpenLDAP --enable-cldap
1012         # Check whether --enable-cldap or --disable-cldap was given.
1013 if test "${enable_cldap+set}" = set; then
1014   enableval="$enable_cldap"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1024         fi
1025         ol_enable_cldap="$ol_arg"
1026
1027 else
1028         ol_enable_cldap="no"
1029 fi
1030 # end --enable-cldap
1031 # OpenLDAP --enable-x_compile
1032         # Check whether --enable-x_compile or --disable-x_compile was given.
1033 if test "${enable_x_compile+set}" = set; then
1034   enableval="$enable_x_compile"
1035   
1036         ol_arg=invalid
1037         for ol_val in yes no ; do
1038                 if test "$enableval" = "$ol_val" ; then
1039                         ol_arg="$ol_val"
1040                 fi
1041         done
1042         if test "$ol_arg" = "invalid" ; then
1043                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1044         fi
1045         ol_enable_x_compile="$ol_arg"
1046
1047 else
1048         ol_enable_x_compile="no"
1049 fi
1050 # end --enable-x_compile
1051
1052 # OpenLDAP --enable-dmalloc
1053         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1054 if test "${enable_dmalloc+set}" = set; then
1055   enableval="$enable_dmalloc"
1056   
1057         ol_arg=invalid
1058         for ol_val in auto yes no ; do
1059                 if test "$enableval" = "$ol_val" ; then
1060                         ol_arg="$ol_val"
1061                 fi
1062         done
1063         if test "$ol_arg" = "invalid" ; then
1064                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1065         fi
1066         ol_enable_dmalloc="$ol_arg"
1067
1068 else
1069         ol_enable_dmalloc="no"
1070 fi
1071 # end --enable-dmalloc
1072
1073 # OpenLDAP --with-kerberos
1074         # Check whether --with-kerberos or --without-kerberos was given.
1075 if test "${with_kerberos+set}" = set; then
1076   withval="$with_kerberos"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto k5 k4 afs yes no ; do
1080                 if test "$withval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1086         fi
1087         ol_with_kerberos="$ol_arg"
1088
1089 else
1090         ol_with_kerberos="auto"
1091 fi
1092 # end --with-kerberos
1093
1094 # OpenLDAP --with-readline
1095         # Check whether --with-readline or --without-readline was given.
1096 if test "${with_readline+set}" = set; then
1097   withval="$with_readline"
1098   
1099         ol_arg=invalid
1100         for ol_val in auto yes no  ; do
1101                 if test "$withval" = "$ol_val" ; then
1102                         ol_arg="$ol_val"
1103                 fi
1104         done
1105         if test "$ol_arg" = "invalid" ; then
1106                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1107         fi
1108         ol_with_readline="$ol_arg"
1109
1110 else
1111         ol_with_readline="auto"
1112 fi
1113 # end --with-readline
1114
1115 # OpenLDAP --with-threads
1116         # Check whether --with-threads or --without-threads was given.
1117 if test "${with_threads+set}" = set; then
1118   withval="$with_threads"
1119   
1120         ol_arg=invalid
1121         for ol_val in auto posix mach lwp yes no manual  ; do
1122                 if test "$withval" = "$ol_val" ; then
1123                         ol_arg="$ol_val"
1124                 fi
1125         done
1126         if test "$ol_arg" = "invalid" ; then
1127                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1128         fi
1129         ol_with_threads="$ol_arg"
1130
1131 else
1132         ol_with_threads="auto"
1133 fi
1134 # end --with-threads
1135
1136 # OpenLDAP --with-tls
1137         # Check whether --with-tls or --without-tls was given.
1138 if test "${with_tls+set}" = set; then
1139   withval="$with_tls"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto ssleay openssl yes no  ; do
1143                 if test "$withval" = "$ol_val" ; then
1144                         ol_arg="$ol_val"
1145                 fi
1146         done
1147         if test "$ol_arg" = "invalid" ; then
1148                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1149         fi
1150         ol_with_tls="$ol_arg"
1151
1152 else
1153         ol_with_tls="auto"
1154 fi
1155 # end --with-tls
1156
1157 # OpenLDAP --with-yielding_select
1158         # Check whether --with-yielding_select or --without-yielding_select was given.
1159 if test "${with_yielding_select+set}" = set; then
1160   withval="$with_yielding_select"
1161   
1162         ol_arg=invalid
1163         for ol_val in auto yes no manual  ; do
1164                 if test "$withval" = "$ol_val" ; then
1165                         ol_arg="$ol_val"
1166                 fi
1167         done
1168         if test "$ol_arg" = "invalid" ; then
1169                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1170         fi
1171         ol_with_yielding_select="$ol_arg"
1172
1173 else
1174         ol_with_yielding_select="auto"
1175 fi
1176 # end --with-yielding_select
1177
1178
1179
1180 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1181 if test "${with_xxldapdoptions+set}" = set; then
1182   withval="$with_xxldapdoptions"
1183   :
1184 fi
1185
1186 # OpenLDAP --enable-ldapd
1187         # Check whether --enable-ldapd or --disable-ldapd was given.
1188 if test "${enable_ldapd+set}" = set; then
1189   enableval="$enable_ldapd"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1199         fi
1200         ol_enable_ldapd="$ol_arg"
1201
1202 else
1203         ol_enable_ldapd="no"
1204 fi
1205 # end --enable-ldapd
1206
1207 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1208 if test "${with_xxslapdoptions+set}" = set; then
1209   withval="$with_xxslapdoptions"
1210   :
1211 fi
1212
1213 # OpenLDAP --enable-slapd
1214         # Check whether --enable-slapd or --disable-slapd was given.
1215 if test "${enable_slapd+set}" = set; then
1216   enableval="$enable_slapd"
1217   
1218         ol_arg=invalid
1219         for ol_val in auto yes no ; do
1220                 if test "$enableval" = "$ol_val" ; then
1221                         ol_arg="$ol_val"
1222                 fi
1223         done
1224         if test "$ol_arg" = "invalid" ; then
1225                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1226         fi
1227         ol_enable_slapd="$ol_arg"
1228
1229 else
1230         ol_enable_slapd="yes"
1231 fi
1232 # end --enable-slapd
1233 # OpenLDAP --enable-aclgroups
1234         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1235 if test "${enable_aclgroups+set}" = set; then
1236   enableval="$enable_aclgroups"
1237   
1238         ol_arg=invalid
1239         for ol_val in auto yes no ; do
1240                 if test "$enableval" = "$ol_val" ; then
1241                         ol_arg="$ol_val"
1242                 fi
1243         done
1244         if test "$ol_arg" = "invalid" ; then
1245                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1246         fi
1247         ol_enable_aclgroups="$ol_arg"
1248
1249 else
1250         ol_enable_aclgroups="auto"
1251 fi
1252 # end --enable-aclgroups
1253 # OpenLDAP --enable-cleartext
1254         # Check whether --enable-cleartext or --disable-cleartext was given.
1255 if test "${enable_cleartext+set}" = set; then
1256   enableval="$enable_cleartext"
1257   
1258         ol_arg=invalid
1259         for ol_val in auto yes no ; do
1260                 if test "$enableval" = "$ol_val" ; then
1261                         ol_arg="$ol_val"
1262                 fi
1263         done
1264         if test "$ol_arg" = "invalid" ; then
1265                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1266         fi
1267         ol_enable_cleartext="$ol_arg"
1268
1269 else
1270         ol_enable_cleartext="yes"
1271 fi
1272 # end --enable-cleartext
1273 # OpenLDAP --enable-crypt
1274         # Check whether --enable-crypt or --disable-crypt was given.
1275 if test "${enable_crypt+set}" = set; then
1276   enableval="$enable_crypt"
1277   
1278         ol_arg=invalid
1279         for ol_val in auto yes no ; do
1280                 if test "$enableval" = "$ol_val" ; then
1281                         ol_arg="$ol_val"
1282                 fi
1283         done
1284         if test "$ol_arg" = "invalid" ; then
1285                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1286         fi
1287         ol_enable_crypt="$ol_arg"
1288
1289 else
1290         ol_enable_crypt="auto"
1291 fi
1292 # end --enable-crypt
1293 # OpenLDAP --enable-modules
1294         # Check whether --enable-modules or --disable-modules was given.
1295 if test "${enable_modules+set}" = set; then
1296   enableval="$enable_modules"
1297   
1298         ol_arg=invalid
1299         for ol_val in auto yes no ; do
1300                 if test "$enableval" = "$ol_val" ; then
1301                         ol_arg="$ol_val"
1302                 fi
1303         done
1304         if test "$ol_arg" = "invalid" ; then
1305                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1306         fi
1307         ol_enable_modules="$ol_arg"
1308
1309 else
1310         ol_enable_modules="no"
1311 fi
1312 # end --enable-modules
1313 # OpenLDAP --enable-phonetic
1314         # Check whether --enable-phonetic or --disable-phonetic was given.
1315 if test "${enable_phonetic+set}" = set; then
1316   enableval="$enable_phonetic"
1317   
1318         ol_arg=invalid
1319         for ol_val in auto yes no ; do
1320                 if test "$enableval" = "$ol_val" ; then
1321                         ol_arg="$ol_val"
1322                 fi
1323         done
1324         if test "$ol_arg" = "invalid" ; then
1325                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1326         fi
1327         ol_enable_phonetic="$ol_arg"
1328
1329 else
1330         ol_enable_phonetic="no"
1331 fi
1332 # end --enable-phonetic
1333 # OpenLDAP --enable-rlookups
1334         # Check whether --enable-rlookups or --disable-rlookups was given.
1335 if test "${enable_rlookups+set}" = set; then
1336   enableval="$enable_rlookups"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no ; do
1340                 if test "$enableval" = "$ol_val" ; then
1341                         ol_arg="$ol_val"
1342                 fi
1343         done
1344         if test "$ol_arg" = "invalid" ; then
1345                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1346         fi
1347         ol_enable_rlookups="$ol_arg"
1348
1349 else
1350         ol_enable_rlookups="auto"
1351 fi
1352 # end --enable-rlookups
1353 # OpenLDAP --enable-wrappers
1354         # Check whether --enable-wrappers or --disable-wrappers was given.
1355 if test "${enable_wrappers+set}" = set; then
1356   enableval="$enable_wrappers"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto yes no ; do
1360                 if test "$enableval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1366         fi
1367         ol_enable_wrappers="$ol_arg"
1368
1369 else
1370         ol_enable_wrappers="no"
1371 fi
1372 # end --enable-wrappers
1373
1374 # OpenLDAP --enable-bdb2
1375         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1376 if test "${enable_bdb2+set}" = set; then
1377   enableval="$enable_bdb2"
1378   
1379         ol_arg=invalid
1380         for ol_val in auto yes no ; do
1381                 if test "$enableval" = "$ol_val" ; then
1382                         ol_arg="$ol_val"
1383                 fi
1384         done
1385         if test "$ol_arg" = "invalid" ; then
1386                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1387         fi
1388         ol_enable_bdb2="$ol_arg"
1389
1390 else
1391         ol_enable_bdb2="no"
1392 fi
1393 # end --enable-bdb2
1394 # OpenLDAP --enable-ldap
1395         # Check whether --enable-ldap or --disable-ldap was given.
1396 if test "${enable_ldap+set}" = set; then
1397   enableval="$enable_ldap"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1407         fi
1408         ol_enable_ldap="$ol_arg"
1409
1410 else
1411         ol_enable_ldap="no"
1412 fi
1413 # end --enable-ldap
1414 # OpenLDAP --enable-ldbm
1415         # Check whether --enable-ldbm or --disable-ldbm was given.
1416 if test "${enable_ldbm+set}" = set; then
1417   enableval="$enable_ldbm"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1427         fi
1428         ol_enable_ldbm="$ol_arg"
1429
1430 else
1431         ol_enable_ldbm="yes"
1432 fi
1433 # end --enable-ldbm
1434 # OpenLDAP --with-ldbm_api
1435         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1436 if test "${with_ldbm_api+set}" = set; then
1437   withval="$with_ldbm_api"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1441                 if test "$withval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1447         fi
1448         ol_with_ldbm_api="$ol_arg"
1449
1450 else
1451         ol_with_ldbm_api="auto"
1452 fi
1453 # end --with-ldbm_api
1454
1455 # OpenLDAP --with-ldbm_type
1456         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1457 if test "${with_ldbm_type+set}" = set; then
1458   withval="$with_ldbm_type"
1459   
1460         ol_arg=invalid
1461         for ol_val in auto btree hash ; do
1462                 if test "$withval" = "$ol_val" ; then
1463                         ol_arg="$ol_val"
1464                 fi
1465         done
1466         if test "$ol_arg" = "invalid" ; then
1467                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1468         fi
1469         ol_with_ldbm_type="$ol_arg"
1470
1471 else
1472         ol_with_ldbm_type="auto"
1473 fi
1474 # end --with-ldbm_type
1475
1476
1477 # OpenLDAP --enable-passwd
1478         # Check whether --enable-passwd or --disable-passwd was given.
1479 if test "${enable_passwd+set}" = set; then
1480   enableval="$enable_passwd"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no ; do
1484                 if test "$enableval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1490         fi
1491         ol_enable_passwd="$ol_arg"
1492
1493 else
1494         ol_enable_passwd="no"
1495 fi
1496 # end --enable-passwd
1497 # OpenLDAP --enable-perl
1498         # Check whether --enable-perl or --disable-perl was given.
1499 if test "${enable_perl+set}" = set; then
1500   enableval="$enable_perl"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1510         fi
1511         ol_enable_perl="$ol_arg"
1512
1513 else
1514         ol_enable_perl="no"
1515 fi
1516 # end --enable-perl
1517 # OpenLDAP --enable-shell
1518         # Check whether --enable-shell or --disable-shell was given.
1519 if test "${enable_shell+set}" = set; then
1520   enableval="$enable_shell"
1521   
1522         ol_arg=invalid
1523         for ol_val in auto yes no ; do
1524                 if test "$enableval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1530         fi
1531         ol_enable_shell="$ol_arg"
1532
1533 else
1534         ol_enable_shell="no"
1535 fi
1536 # end --enable-shell
1537 # OpenLDAP --enable-tcl
1538         # Check whether --enable-tcl or --disable-tcl was given.
1539 if test "${enable_tcl+set}" = set; then
1540   enableval="$enable_tcl"
1541   
1542         ol_arg=invalid
1543         for ol_val in auto yes no ; do
1544                 if test "$enableval" = "$ol_val" ; then
1545                         ol_arg="$ol_val"
1546                 fi
1547         done
1548         if test "$ol_arg" = "invalid" ; then
1549                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1550         fi
1551         ol_enable_tcl="$ol_arg"
1552
1553 else
1554         ol_enable_tcl="no"
1555 fi
1556 # end --enable-tcl
1557
1558 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1559 if test "${with_xxslurpdoptions+set}" = set; then
1560   withval="$with_xxslurpdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slurpd
1565         # Check whether --enable-slurpd or --disable-slurpd was given.
1566 if test "${enable_slurpd+set}" = set; then
1567   enableval="$enable_slurpd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slurpd="$ol_arg"
1579
1580 else
1581         ol_enable_slurpd="auto"
1582 fi
1583 # end --enable-slurpd
1584
1585 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1586 if test "${with_xxliboptions+set}" = set; then
1587   withval="$with_xxliboptions"
1588   :
1589 fi
1590
1591 # Check whether --enable-static or --disable-static was given.
1592 if test "${enable_static+set}" = set; then
1593   enableval="$enable_static"
1594   p=${PACKAGE-default}
1595 case "$enableval" in
1596 yes) enable_static=yes ;;
1597 no) enable_static=no ;;
1598 *)
1599   enable_static=no
1600   # Look at the argument we got.  We use all the common list separators.
1601   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1602   for pkg in $enableval; do
1603     if test "X$pkg" = "X$p"; then
1604       enable_static=yes
1605     fi
1606   done
1607   IFS="$ac_save_ifs"
1608   ;;
1609 esac
1610 else
1611   enable_static=yes
1612 fi
1613
1614 # Check whether --enable-shared or --disable-shared was given.
1615 if test "${enable_shared+set}" = set; then
1616   enableval="$enable_shared"
1617   p=${PACKAGE-default}
1618 case "$enableval" in
1619 yes) enable_shared=yes ;;
1620 no) enable_shared=no ;;
1621 *)
1622   enable_shared=no
1623   # Look at the argument we got.  We use all the common list separators.
1624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1625   for pkg in $enableval; do
1626     if test "X$pkg" = "X$p"; then
1627       enable_shared=yes
1628     fi
1629   done
1630   IFS="$ac_save_ifs"
1631   ;;
1632 esac
1633 else
1634   enable_shared=yes
1635 fi
1636
1637
1638 # validate options
1639 if test $ol_enable_dns = yes ; then
1640         if test $ol_enable_referrals = no ; then
1641                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1642         fi
1643         if test $ol_enable_referrals = auto ; then
1644                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1645                 ol_enable_referrals=yes
1646         fi
1647 fi
1648
1649 if test $ol_enable_slapd = no ; then
1650                 if test $ol_enable_bdb2 = yes ; then
1651                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
1652         fi
1653         if test $ol_enable_ldap = yes ; then
1654                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
1655         fi
1656         if test $ol_enable_ldbm = yes ; then
1657                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
1658         fi
1659         if test $ol_enable_passwd = yes ; then
1660                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
1661         fi
1662         if test $ol_enable_perl = yes ; then
1663                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
1664         fi
1665         if test $ol_enable_shell = yes ; then
1666                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
1667         fi
1668         if test $ol_enable_tcl = yes ; then
1669                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
1670         fi
1671         if test $ol_enable_aclgroups = yes ; then
1672                 echo "configure: warning: slapd disabled, ignoring --enable-aclgroups argument" 1>&2
1673         fi
1674         if test $ol_enable_modules = yes ; then
1675                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
1676         fi
1677         if test $ol_enable_wrappers = yes ; then
1678                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
1679         fi
1680         if test $ol_enable_phonetic = yes ; then
1681                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
1682         fi
1683         if test $ol_enable_rlookups = yes ; then
1684                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
1685         fi
1686         if test $ol_with_ldbm_api != auto ; then
1687                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
1688         fi
1689         if test $ol_with_ldbm_type != auto ; then
1690                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
1691         fi
1692         if test $ol_enable_slurpd = yes ; then
1693                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1694         fi
1695
1696         # force settings to no
1697         ol_enable_bdb2=no
1698         ol_enable_ldap=no
1699         ol_enable_ldbm=no
1700         ol_enable_passwd=no
1701         ol_enable_perl=no
1702         ol_enable_shell=no
1703         ol_enable_tcl=no
1704
1705         ol_enable_aclgroups=no
1706         ol_enable_modules=no
1707         ol_enable_phonetic=no
1708         ol_enable_rlookups=no
1709         ol_enable_wrappers=no
1710
1711         ol_with_ldbm_api=no
1712         ol_with_ldbm_type=no
1713
1714         ol_enable_slurpd=no
1715
1716 elif test $ol_enable_ldbm = no ; then
1717         
1718         if test $ol_with_ldbm_api != auto ; then
1719                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
1720         fi
1721
1722         if test $ol_with_ldbm_type != auto ; then
1723                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
1724         fi
1725
1726         if test $ol_enable_bdb2 = yes ; then
1727                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1728         fi
1729
1730         if test $ol_enable_modules != yes -a \
1731                 $ol_enable_ldap = no -a \
1732                 $ol_enable_passwd = no -a \
1733                 $ol_enable_perl = no -a \
1734                 $ol_enable_shell = no -a \
1735                 $ol_enable_tcl = no ; then
1736                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1737         fi
1738
1739         ol_with_ldbm_api=no
1740         ol_with_ldbm_type=no
1741
1742 elif test $ol_enable_bdb2 = yes ; then
1743         
1744         if test $ol_with_ldbm_api != auto -a \
1745                 $ol_with_ldbm_api != db2 ; then
1746                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1747         fi
1748
1749         ol_with_ldbm_api=db2
1750
1751 else
1752         
1753         if test $ol_enable_bdb2 != no ; then
1754                 if test $ol_with_ldbm_api != auto -a \
1755                         $ol_with_ldbm_api != db2 ; then
1756                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1757                         ol_enable_bdb2=no
1758                 fi
1759         fi
1760
1761         if test $ol_with_ldbm_api = gdbm -a \
1762                 $ol_with_ldbm_type = btree ; then
1763                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1764         fi
1765         if test $ol_with_ldbm_api = mdbm -a \
1766                 $ol_with_ldbm_type = btree ; then
1767                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1768         fi
1769         if test $ol_with_ldbm_api = ndbm -a \
1770                 $ol_with_ldbm_type = btree ; then
1771                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1772         fi
1773 fi
1774
1775 if test $ol_enable_slurpd = yes ; then
1776                 if test $ol_with_threads = no ; then
1777                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1778         fi
1779 fi
1780
1781 echo "$ac_t""done" 1>&6
1782
1783 ## Initialize vars
1784 LDAP_LIBS=
1785 LDBM_LIBS=
1786 LTHREAD_LIBS=
1787 LUTIL_LIBS=
1788
1789 LDAPD_LIBS=
1790 SLAPD_LIBS=
1791 SLURPD_LIBS=
1792
1793 BUILD_LDAPD=no
1794 BUILD_SLAPD=no
1795 BUILD_SLURPD=no
1796
1797 BUILD_BDB2=no
1798 BUILD_LDAP=no
1799 BUILD_LDBM=no
1800 BUILD_PASSWD=no
1801 BUILD_PERL=no
1802 BUILD_SHELL=no
1803 BUILD_TCL=no
1804 BUILD_THREAD=no
1805
1806 SLAPD_MODULES_LDFLAGS=
1807 SLAPD_MODULES_CPPFLAGS=
1808
1809 SLAPD_PERL_LDFLAGS=
1810 SLAPD_PERL_CPPFLAGS=
1811
1812 KRB_LIBS=
1813 READLINE_LIBS=
1814 TERMCAP_LIBS=
1815 TLS_LIBS=
1816
1817
1818 # Make sure we can run config.sub.
1819 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1820 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1821 fi
1822
1823 echo $ac_n "checking host system type""... $ac_c" 1>&6
1824 echo "configure:1825: checking host system type" >&5
1825
1826 host_alias=$host
1827 case "$host_alias" in
1828 NONE)
1829   case $nonopt in
1830   NONE)
1831     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1832     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1833     fi ;;
1834   *) host_alias=$nonopt ;;
1835   esac ;;
1836 esac
1837
1838 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1839 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1840 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1841 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1842 echo "$ac_t""$host" 1>&6
1843
1844
1845
1846
1847
1848 ol_aix_threads=no
1849 case "$host" in
1850 *-*-aix*)       if test -z "CC" -a "$ol_host_os" = aix ; then
1851                 case "$ol_with_threads" in
1852                 auto | yes |  posix) ol_aix_threads=yes ;;
1853                 esac
1854         fi
1855 ;;
1856 esac
1857
1858 if test -z "${CC}" -a $ol_aix_threads = yes ; then
1859         for ac_prog in cc_r xlc_r cc
1860 do
1861 # Extract the first word of "$ac_prog", so it can be a program name with args.
1862 set dummy $ac_prog; ac_word=$2
1863 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1864 echo "configure:1865: checking for $ac_word" >&5
1865 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1866   echo $ac_n "(cached) $ac_c" 1>&6
1867 else
1868   if test -n "$CC"; then
1869   ac_cv_prog_CC="$CC" # Let the user override the test.
1870 else
1871   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1872   ac_dummy="$PATH"
1873   for ac_dir in $ac_dummy; do
1874     test -z "$ac_dir" && ac_dir=.
1875     if test -f $ac_dir/$ac_word; then
1876       ac_cv_prog_CC="$ac_prog"
1877       break
1878     fi
1879   done
1880   IFS="$ac_save_ifs"
1881 fi
1882 fi
1883 CC="$ac_cv_prog_CC"
1884 if test -n "$CC"; then
1885   echo "$ac_t""$CC" 1>&6
1886 else
1887   echo "$ac_t""no" 1>&6
1888 fi
1889
1890 test -n "$CC" && break
1891 done
1892
1893
1894         if test "$CC" = cc ; then
1895                                 if test $ol_with_threads != auto ; then
1896                         { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
1897                 else
1898                         echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
1899                 fi
1900                 ol_with_threads=no
1901
1902         elif test "$CC" ; then
1903                 ol_with_threads=posix
1904                 ol_cv_pthread_create=yes
1905         fi
1906 fi
1907
1908 if test -z "${CC}"; then
1909         for ac_prog in cc
1910 do
1911 # Extract the first word of "$ac_prog", so it can be a program name with args.
1912 set dummy $ac_prog; ac_word=$2
1913 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1914 echo "configure:1915: checking for $ac_word" >&5
1915 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1916   echo $ac_n "(cached) $ac_c" 1>&6
1917 else
1918   if test -n "$CC"; then
1919   ac_cv_prog_CC="$CC" # Let the user override the test.
1920 else
1921   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1922   ac_dummy="$PATH"
1923   for ac_dir in $ac_dummy; do
1924     test -z "$ac_dir" && ac_dir=.
1925     if test -f $ac_dir/$ac_word; then
1926       ac_cv_prog_CC="$ac_prog"
1927       break
1928     fi
1929   done
1930   IFS="$ac_save_ifs"
1931 fi
1932 fi
1933 CC="$ac_cv_prog_CC"
1934 if test -n "$CC"; then
1935   echo "$ac_t""$CC" 1>&6
1936 else
1937   echo "$ac_t""no" 1>&6
1938 fi
1939
1940 test -n "$CC" && break
1941 done
1942
1943 fi
1944
1945
1946 # Extract the first word of "ranlib", so it can be a program name with args.
1947 set dummy ranlib; ac_word=$2
1948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1949 echo "configure:1950: checking for $ac_word" >&5
1950 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1951   echo $ac_n "(cached) $ac_c" 1>&6
1952 else
1953   if test -n "$RANLIB"; then
1954   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1955 else
1956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1957   ac_dummy="$PATH"
1958   for ac_dir in $ac_dummy; do
1959     test -z "$ac_dir" && ac_dir=.
1960     if test -f $ac_dir/$ac_word; then
1961       ac_cv_prog_RANLIB="ranlib"
1962       break
1963     fi
1964   done
1965   IFS="$ac_save_ifs"
1966   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1967 fi
1968 fi
1969 RANLIB="$ac_cv_prog_RANLIB"
1970 if test -n "$RANLIB"; then
1971   echo "$ac_t""$RANLIB" 1>&6
1972 else
1973   echo "$ac_t""no" 1>&6
1974 fi
1975
1976 # Extract the first word of "gcc", so it can be a program name with args.
1977 set dummy gcc; ac_word=$2
1978 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1979 echo "configure:1980: checking for $ac_word" >&5
1980 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1981   echo $ac_n "(cached) $ac_c" 1>&6
1982 else
1983   if test -n "$CC"; then
1984   ac_cv_prog_CC="$CC" # Let the user override the test.
1985 else
1986   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1987   ac_dummy="$PATH"
1988   for ac_dir in $ac_dummy; do
1989     test -z "$ac_dir" && ac_dir=.
1990     if test -f $ac_dir/$ac_word; then
1991       ac_cv_prog_CC="gcc"
1992       break
1993     fi
1994   done
1995   IFS="$ac_save_ifs"
1996 fi
1997 fi
1998 CC="$ac_cv_prog_CC"
1999 if test -n "$CC"; then
2000   echo "$ac_t""$CC" 1>&6
2001 else
2002   echo "$ac_t""no" 1>&6
2003 fi
2004
2005 if test -z "$CC"; then
2006   # Extract the first word of "cc", so it can be a program name with args.
2007 set dummy cc; ac_word=$2
2008 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2009 echo "configure:2010: checking for $ac_word" >&5
2010 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   if test -n "$CC"; then
2014   ac_cv_prog_CC="$CC" # Let the user override the test.
2015 else
2016   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2017   ac_prog_rejected=no
2018   ac_dummy="$PATH"
2019   for ac_dir in $ac_dummy; do
2020     test -z "$ac_dir" && ac_dir=.
2021     if test -f $ac_dir/$ac_word; then
2022       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2023         ac_prog_rejected=yes
2024         continue
2025       fi
2026       ac_cv_prog_CC="cc"
2027       break
2028     fi
2029   done
2030   IFS="$ac_save_ifs"
2031 if test $ac_prog_rejected = yes; then
2032   # We found a bogon in the path, so make sure we never use it.
2033   set dummy $ac_cv_prog_CC
2034   shift
2035   if test $# -gt 0; then
2036     # We chose a different compiler from the bogus one.
2037     # However, it has the same basename, so the bogon will be chosen
2038     # first if we set CC to just the basename; use the full file name.
2039     shift
2040     set dummy "$ac_dir/$ac_word" "$@"
2041     shift
2042     ac_cv_prog_CC="$@"
2043   fi
2044 fi
2045 fi
2046 fi
2047 CC="$ac_cv_prog_CC"
2048 if test -n "$CC"; then
2049   echo "$ac_t""$CC" 1>&6
2050 else
2051   echo "$ac_t""no" 1>&6
2052 fi
2053
2054   if test -z "$CC"; then
2055     case "`uname -s`" in
2056     *win32* | *WIN32*)
2057       # Extract the first word of "cl", so it can be a program name with args.
2058 set dummy cl; ac_word=$2
2059 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2060 echo "configure:2061: checking for $ac_word" >&5
2061 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2062   echo $ac_n "(cached) $ac_c" 1>&6
2063 else
2064   if test -n "$CC"; then
2065   ac_cv_prog_CC="$CC" # Let the user override the test.
2066 else
2067   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2068   ac_dummy="$PATH"
2069   for ac_dir in $ac_dummy; do
2070     test -z "$ac_dir" && ac_dir=.
2071     if test -f $ac_dir/$ac_word; then
2072       ac_cv_prog_CC="cl"
2073       break
2074     fi
2075   done
2076   IFS="$ac_save_ifs"
2077 fi
2078 fi
2079 CC="$ac_cv_prog_CC"
2080 if test -n "$CC"; then
2081   echo "$ac_t""$CC" 1>&6
2082 else
2083   echo "$ac_t""no" 1>&6
2084 fi
2085  ;;
2086     esac
2087   fi
2088   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2089 fi
2090
2091 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2092 echo "configure:2093: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2093
2094 ac_ext=c
2095 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2096 ac_cpp='$CPP $CPPFLAGS'
2097 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2098 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2099 cross_compiling=$ac_cv_prog_cc_cross
2100
2101 cat > conftest.$ac_ext << EOF
2102
2103 #line 2104 "configure"
2104 #include "confdefs.h"
2105
2106 main(){return(0);}
2107 EOF
2108 if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2109   ac_cv_prog_cc_works=yes
2110   # If we can't run a trivial program, we are probably using a cross compiler.
2111   if (./conftest; exit) 2>/dev/null; then
2112     ac_cv_prog_cc_cross=no
2113   else
2114     ac_cv_prog_cc_cross=yes
2115   fi
2116 else
2117   echo "configure: failed program was:" >&5
2118   cat conftest.$ac_ext >&5
2119   ac_cv_prog_cc_works=no
2120 fi
2121 rm -fr conftest*
2122 ac_ext=c
2123 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2124 ac_cpp='$CPP $CPPFLAGS'
2125 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2126 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2127 cross_compiling=$ac_cv_prog_cc_cross
2128
2129 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2130 if test $ac_cv_prog_cc_works = no; then
2131   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2132 fi
2133 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2134 echo "configure:2135: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2135 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2136 cross_compiling=$ac_cv_prog_cc_cross
2137
2138 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2139 echo "configure:2140: checking whether we are using GNU C" >&5
2140 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2141   echo $ac_n "(cached) $ac_c" 1>&6
2142 else
2143   cat > conftest.c <<EOF
2144 #ifdef __GNUC__
2145   yes;
2146 #endif
2147 EOF
2148 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2149   ac_cv_prog_gcc=yes
2150 else
2151   ac_cv_prog_gcc=no
2152 fi
2153 fi
2154
2155 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2156
2157 if test $ac_cv_prog_gcc = yes; then
2158   GCC=yes
2159 else
2160   GCC=
2161 fi
2162
2163 ac_test_CFLAGS="${CFLAGS+set}"
2164 ac_save_CFLAGS="$CFLAGS"
2165 CFLAGS=
2166 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2167 echo "configure:2168: checking whether ${CC-cc} accepts -g" >&5
2168 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2169   echo $ac_n "(cached) $ac_c" 1>&6
2170 else
2171   echo 'void f(){}' > conftest.c
2172 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2173   ac_cv_prog_cc_g=yes
2174 else
2175   ac_cv_prog_cc_g=no
2176 fi
2177 rm -f conftest*
2178
2179 fi
2180
2181 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2182 if test "$ac_test_CFLAGS" = set; then
2183   CFLAGS="$ac_save_CFLAGS"
2184 elif test $ac_cv_prog_cc_g = yes; then
2185   if test "$GCC" = yes; then
2186     CFLAGS="-g -O2"
2187   else
2188     CFLAGS="-g"
2189   fi
2190 else
2191   if test "$GCC" = yes; then
2192     CFLAGS="-O2"
2193   else
2194     CFLAGS=
2195   fi
2196 fi
2197
2198 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2199 if test "${with_gnu_ld+set}" = set; then
2200   withval="$with_gnu_ld"
2201   test "$withval" = no || with_gnu_ld=yes
2202 else
2203   with_gnu_ld=no
2204 fi
2205
2206
2207 ac_prog=ld
2208 if test "$ac_cv_prog_gcc" = yes; then
2209   # Check if gcc -print-prog-name=ld gives a path.
2210   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2211 echo "configure:2212: checking for ld used by GCC" >&5
2212   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2213   case "$ac_prog" in
2214   # Accept absolute paths.
2215   /* | A-Za-z:\\*)
2216     test -z "$LD" && LD="$ac_prog"
2217     ;;
2218   "")
2219     # If it fails, then pretend we aren't using GCC.
2220     ac_prog=ld
2221     ;;
2222   *)
2223     # If it is relative, then search for the first ld in PATH.
2224     with_gnu_ld=unknown
2225     ;;
2226   esac
2227 elif test "$with_gnu_ld" = yes; then
2228   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2229 echo "configure:2230: checking for GNU ld" >&5
2230 else
2231   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2232 echo "configure:2233: checking for non-GNU ld" >&5
2233 fi
2234 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2235   echo $ac_n "(cached) $ac_c" 1>&6
2236 else
2237   if test -z "$LD"; then
2238   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2239   for ac_dir in $PATH; do
2240     test -z "$ac_dir" && ac_dir=.
2241     if test -f "$ac_dir/$ac_prog"; then
2242       ac_cv_path_LD="$ac_dir/$ac_prog"
2243       # Check to see if the program is GNU ld.  I'd rather use --version,
2244       # but apparently some GNU ld's only accept -v.
2245       # Break only if it was the GNU/non-GNU ld that we prefer.
2246       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2247         test "$with_gnu_ld" != no && break
2248       else
2249         test "$with_gnu_ld" != yes && break
2250       fi
2251     fi
2252   done
2253   IFS="$ac_save_ifs"
2254 else
2255   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2256 fi
2257 fi
2258
2259 LD="$ac_cv_path_LD"
2260 if test -n "$LD"; then
2261   echo "$ac_t""$LD" 1>&6
2262 else
2263   echo "$ac_t""no" 1>&6
2264 fi
2265 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2266
2267 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2268 echo "configure:2269: checking if the linker ($LD) is GNU ld" >&5
2269 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2270   echo $ac_n "(cached) $ac_c" 1>&6
2271 else
2272   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2273 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2274   ac_cv_prog_gnu_ld=yes
2275 else
2276   ac_cv_prog_gnu_ld=no
2277 fi
2278 fi
2279
2280 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2281
2282
2283 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2284 echo "configure:2285: checking for BSD-compatible nm" >&5
2285 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2286   echo $ac_n "(cached) $ac_c" 1>&6
2287 else
2288   case "$NM" in
2289 /* | A-Za-z:\\*)
2290   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2291   ;;
2292 *)
2293   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2294   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2295     test -z "$ac_dir" && ac_dir=.
2296     if test -f $ac_dir/nm; then
2297       # Check to see if the nm accepts a BSD-compat flag.
2298       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2299       #   nm: unknown option "B" ignored
2300       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2301         ac_cv_path_NM="$ac_dir/nm -B"
2302       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2303         ac_cv_path_NM="$ac_dir/nm -p"
2304       else
2305         ac_cv_path_NM="$ac_dir/nm"
2306       fi
2307       break
2308     fi
2309   done
2310   IFS="$ac_save_ifs"
2311   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2312   ;;
2313 esac
2314 fi
2315
2316 NM="$ac_cv_path_NM"
2317 echo "$ac_t""$NM" 1>&6
2318
2319
2320 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2321 echo "configure:2322: checking whether ln -s works" >&5
2322 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2323   echo $ac_n "(cached) $ac_c" 1>&6
2324 else
2325   rm -f conftestdata
2326 if ln -s X conftestdata 2>/dev/null
2327 then
2328   rm -f conftestdata
2329   ac_cv_prog_LN_S="ln -s"
2330 else
2331   ac_cv_prog_LN_S=ln
2332 fi
2333 fi
2334 LN_S="$ac_cv_prog_LN_S"
2335 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2336   echo "$ac_t""yes" 1>&6
2337 else
2338   echo "$ac_t""no" 1>&6
2339 fi
2340
2341 # Always use our own libtool.
2342 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2343
2344 # Check for any special flags to pass to ltconfig.
2345 libtool_flags=
2346 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2347 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2348 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2349 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2350 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2351
2352 # Some flags need to be propagated to the compiler or linker for good
2353 # libtool support.
2354 case "$host" in
2355 *-*-irix6*)
2356   # Find out which ABI we are using.
2357   echo '#line 2358 "configure"' > conftest.$ac_ext
2358   if { (eval echo configure:2359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2359     case "`/usr/bin/file conftest.o`" in
2360     *32-bit*)
2361       LD="${LD-ld} -32"
2362       ;;
2363     *N32*)
2364       LD="${LD-ld} -n32"
2365       ;;
2366     *64-bit*)
2367       LD="${LD-ld} -64"
2368       ;;
2369     esac
2370   fi
2371   rm -rf conftest*
2372   ;;
2373
2374 *-*-sco3.2v5*)
2375   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2376   CFLAGS="$CFLAGS -belf"
2377   ;;
2378 esac
2379
2380 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2381 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2382 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2383 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2384 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2385 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2386
2387
2388 for ac_prog in mawk gawk nawk awk
2389 do
2390 # Extract the first word of "$ac_prog", so it can be a program name with args.
2391 set dummy $ac_prog; ac_word=$2
2392 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2393 echo "configure:2394: checking for $ac_word" >&5
2394 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2395   echo $ac_n "(cached) $ac_c" 1>&6
2396 else
2397   if test -n "$AWK"; then
2398   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2399 else
2400   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2401   ac_dummy="$PATH"
2402   for ac_dir in $ac_dummy; do
2403     test -z "$ac_dir" && ac_dir=.
2404     if test -f $ac_dir/$ac_word; then
2405       ac_cv_prog_AWK="$ac_prog"
2406       break
2407     fi
2408   done
2409   IFS="$ac_save_ifs"
2410 fi
2411 fi
2412 AWK="$ac_cv_prog_AWK"
2413 if test -n "$AWK"; then
2414   echo "$ac_t""$AWK" 1>&6
2415 else
2416   echo "$ac_t""no" 1>&6
2417 fi
2418
2419 test -n "$AWK" && break
2420 done
2421
2422 # test for ln hardlink support
2423 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2424 echo "configure:2425: checking whether ln works" >&5
2425 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2426   echo $ac_n "(cached) $ac_c" 1>&6
2427 else
2428   rm -f conftest.src conftest.dst
2429 echo "conftest" > conftest.src
2430 if ln conftest.src conftest.dst 2>/dev/null
2431 then
2432   ol_cv_prog_LN_H="ln"
2433 else
2434   ol_cv_prog_LN_H="cp"
2435 fi
2436 rm -f conftest.src conftest.dst
2437
2438 fi
2439 LN_H="$ol_cv_prog_LN_H"
2440 if test "$ol_cv_prog_LN_H" = "ln"; then
2441         echo "$ac_t""yes" 1>&6
2442 else
2443         echo "$ac_t""no" 1>&6
2444 fi
2445
2446 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2447 echo "configure:2448: checking whether ln -s works" >&5
2448 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2449   echo $ac_n "(cached) $ac_c" 1>&6
2450 else
2451   rm -f conftestdata
2452 if ln -s X conftestdata 2>/dev/null
2453 then
2454   rm -f conftestdata
2455   ac_cv_prog_LN_S="ln -s"
2456 else
2457   ac_cv_prog_LN_S=ln
2458 fi
2459 fi
2460 LN_S="$ac_cv_prog_LN_S"
2461 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2462   echo "$ac_t""yes" 1>&6
2463 else
2464   echo "$ac_t""no" 1>&6
2465 fi
2466
2467
2468 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2469         LN_S="$LN_H"
2470 fi
2471
2472 # Extract the first word of "sendmail", so it can be a program name with args.
2473 set dummy sendmail; ac_word=$2
2474 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2475 echo "configure:2476: checking for $ac_word" >&5
2476 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2477   echo $ac_n "(cached) $ac_c" 1>&6
2478 else
2479   case "$SENDMAIL" in
2480   /*)
2481   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2482   ;;
2483   ?:/*)                  
2484   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2485   ;;
2486   *)
2487   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2488   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2489   for ac_dir in $ac_dummy; do 
2490     test -z "$ac_dir" && ac_dir=.
2491     if test -f $ac_dir/$ac_word; then
2492       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2493       break
2494     fi
2495   done
2496   IFS="$ac_save_ifs"
2497   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2498   ;;
2499 esac
2500 fi
2501 SENDMAIL="$ac_cv_path_SENDMAIL"
2502 if test -n "$SENDMAIL"; then
2503   echo "$ac_t""$SENDMAIL" 1>&6
2504 else
2505   echo "$ac_t""no" 1>&6
2506 fi
2507
2508 # Extract the first word of "vi", so it can be a program name with args.
2509 set dummy vi; ac_word=$2
2510 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2511 echo "configure:2512: checking for $ac_word" >&5
2512 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2513   echo $ac_n "(cached) $ac_c" 1>&6
2514 else
2515   case "$EDITOR" in
2516   /*)
2517   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2518   ;;
2519   ?:/*)                  
2520   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2521   ;;
2522   *)
2523   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2524   ac_dummy="$PATH:/usr/ucb"
2525   for ac_dir in $ac_dummy; do 
2526     test -z "$ac_dir" && ac_dir=.
2527     if test -f $ac_dir/$ac_word; then
2528       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2529       break
2530     fi
2531   done
2532   IFS="$ac_save_ifs"
2533   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2534   ;;
2535 esac
2536 fi
2537 EDITOR="$ac_cv_path_EDITOR"
2538 if test -n "$EDITOR"; then
2539   echo "$ac_t""$EDITOR" 1>&6
2540 else
2541   echo "$ac_t""no" 1>&6
2542 fi
2543
2544 # Extract the first word of "finger", so it can be a program name with args.
2545 set dummy finger; ac_word=$2
2546 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2547 echo "configure:2548: checking for $ac_word" >&5
2548 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2549   echo $ac_n "(cached) $ac_c" 1>&6
2550 else
2551   case "$FINGER" in
2552   /*)
2553   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2554   ;;
2555   ?:/*)                  
2556   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2557   ;;
2558   *)
2559   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2560   ac_dummy="$PATH:/usr/ucb"
2561   for ac_dir in $ac_dummy; do 
2562     test -z "$ac_dir" && ac_dir=.
2563     if test -f $ac_dir/$ac_word; then
2564       ac_cv_path_FINGER="$ac_dir/$ac_word"
2565       break
2566     fi
2567   done
2568   IFS="$ac_save_ifs"
2569   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2570   ;;
2571 esac
2572 fi
2573 FINGER="$ac_cv_path_FINGER"
2574 if test -n "$FINGER"; then
2575   echo "$ac_t""$FINGER" 1>&6
2576 else
2577   echo "$ac_t""no" 1>&6
2578 fi
2579
2580
2581 ol_link_modules=no
2582 if test $ol_enable_modules != no ; then
2583         # Extract the first word of "glib-config", so it can be a program name with args.
2584 set dummy glib-config; ac_word=$2
2585 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2586 echo "configure:2587: checking for $ac_word" >&5
2587 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2588   echo $ac_n "(cached) $ac_c" 1>&6
2589 else
2590   case "$GLIBCONFIG" in
2591   /*)
2592   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2593   ;;
2594   ?:/*)                  
2595   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2596   ;;
2597   *)
2598   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2599   ac_dummy="$PATH"
2600   for ac_dir in $ac_dummy; do 
2601     test -z "$ac_dir" && ac_dir=.
2602     if test -f $ac_dir/$ac_word; then
2603       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2604       break
2605     fi
2606   done
2607   IFS="$ac_save_ifs"
2608   ;;
2609 esac
2610 fi
2611 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2612 if test -n "$GLIBCONFIG"; then
2613   echo "$ac_t""$GLIBCONFIG" 1>&6
2614 else
2615   echo "$ac_t""no" 1>&6
2616 fi
2617
2618
2619         if test "no$GLIBCONFIG" = "no" ; then
2620                 if test $ol_enable_modules = yes ; then
2621                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2622                 fi
2623
2624         else
2625                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2626                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2627                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2628
2629                                 ol_link_modules=yes
2630         fi
2631 fi
2632
2633 ol_link_perl=no
2634 if test $ol_enable_perl != no ; then
2635         # Extract the first word of "perl", so it can be a program name with args.
2636 set dummy perl; ac_word=$2
2637 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2638 echo "configure:2639: checking for $ac_word" >&5
2639 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2640   echo $ac_n "(cached) $ac_c" 1>&6
2641 else
2642   case "$PERLBIN" in
2643   /*)
2644   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2645   ;;
2646   ?:/*)                  
2647   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2648   ;;
2649   *)
2650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2651   ac_dummy="$PATH"
2652   for ac_dir in $ac_dummy; do 
2653     test -z "$ac_dir" && ac_dir=.
2654     if test -f $ac_dir/$ac_word; then
2655       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2656       break
2657     fi
2658   done
2659   IFS="$ac_save_ifs"
2660   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2661   ;;
2662 esac
2663 fi
2664 PERLBIN="$ac_cv_path_PERLBIN"
2665 if test -n "$PERLBIN"; then
2666   echo "$ac_t""$PERLBIN" 1>&6
2667 else
2668   echo "$ac_t""no" 1>&6
2669 fi
2670
2671
2672         if test "no$PERLBIN" = "no" ; then
2673                 if test $ol_enable_perl = yes ; then
2674                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2675                 fi
2676
2677         else
2678                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2679                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2680
2681                                 ol_link_perl=yes
2682         fi
2683 fi
2684
2685 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2686 echo "configure:2687: checking how to run the C preprocessor" >&5
2687 # On Suns, sometimes $CPP names a directory.
2688 if test -n "$CPP" && test -d "$CPP"; then
2689   CPP=
2690 fi
2691 if test -z "$CPP"; then
2692 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2693   echo $ac_n "(cached) $ac_c" 1>&6
2694 else
2695     # This must be in double quotes, not single quotes, because CPP may get
2696   # substituted into the Makefile and "${CC-cc}" will confuse make.
2697   CPP="${CC-cc} -E"
2698   # On the NeXT, cc -E runs the code through the compiler's parser,
2699   # not just through cpp.
2700   cat > conftest.$ac_ext <<EOF
2701 #line 2702 "configure"
2702 #include "confdefs.h"
2703 #include <assert.h>
2704 Syntax Error
2705 EOF
2706 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2707 { (eval echo configure:2708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2708 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2709 if test -z "$ac_err"; then
2710   :
2711 else
2712   echo "$ac_err" >&5
2713   echo "configure: failed program was:" >&5
2714   cat conftest.$ac_ext >&5
2715   rm -rf conftest*
2716   CPP="${CC-cc} -E -traditional-cpp"
2717   cat > conftest.$ac_ext <<EOF
2718 #line 2719 "configure"
2719 #include "confdefs.h"
2720 #include <assert.h>
2721 Syntax Error
2722 EOF
2723 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2724 { (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2725 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2726 if test -z "$ac_err"; then
2727   :
2728 else
2729   echo "$ac_err" >&5
2730   echo "configure: failed program was:" >&5
2731   cat conftest.$ac_ext >&5
2732   rm -rf conftest*
2733   CPP="${CC-cc} -nologo -E"
2734   cat > conftest.$ac_ext <<EOF
2735 #line 2736 "configure"
2736 #include "confdefs.h"
2737 #include <assert.h>
2738 Syntax Error
2739 EOF
2740 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2741 { (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2742 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2743 if test -z "$ac_err"; then
2744   :
2745 else
2746   echo "$ac_err" >&5
2747   echo "configure: failed program was:" >&5
2748   cat conftest.$ac_ext >&5
2749   rm -rf conftest*
2750   CPP=/lib/cpp
2751 fi
2752 rm -f conftest*
2753 fi
2754 rm -f conftest*
2755 fi
2756 rm -f conftest*
2757   ac_cv_prog_CPP="$CPP"
2758 fi
2759   CPP="$ac_cv_prog_CPP"
2760 else
2761   ac_cv_prog_CPP="$CPP"
2762 fi
2763 echo "$ac_t""$CPP" 1>&6
2764
2765
2766 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2767         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2768
2769 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2770         echo "configure: warning: programs compiled here do run here..." 1>&2
2771         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2772
2773 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2774         echo "configure: warning: programs compiled here do not run here..." 1>&2
2775         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2776 fi
2777
2778 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2779 echo "configure:2780: checking for AIX" >&5
2780 cat > conftest.$ac_ext <<EOF
2781 #line 2782 "configure"
2782 #include "confdefs.h"
2783 #ifdef _AIX
2784   yes
2785 #endif
2786
2787 EOF
2788 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2789   egrep "yes" >/dev/null 2>&1; then
2790   rm -rf conftest*
2791   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2792 #define _ALL_SOURCE 1
2793 EOF
2794
2795 else
2796   rm -rf conftest*
2797   echo "$ac_t""no" 1>&6
2798 fi
2799 rm -f conftest*
2800
2801
2802 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2803 echo "configure:2804: checking for POSIXized ISC" >&5
2804 if test -d /etc/conf/kconfig.d &&
2805   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2806 then
2807   echo "$ac_t""yes" 1>&6
2808   ISC=yes # If later tests want to check for ISC.
2809   cat >> confdefs.h <<\EOF
2810 #define _POSIX_SOURCE 1
2811 EOF
2812
2813   if test "$GCC" = yes; then
2814     CC="$CC -posix"
2815   else
2816     CC="$CC -Xp"
2817   fi
2818 else
2819   echo "$ac_t""no" 1>&6
2820   ISC=
2821 fi
2822
2823 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2824 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2825 echo "configure:2826: checking for minix/config.h" >&5
2826 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2827   echo $ac_n "(cached) $ac_c" 1>&6
2828 else
2829   cat > conftest.$ac_ext <<EOF
2830 #line 2831 "configure"
2831 #include "confdefs.h"
2832 #include <minix/config.h>
2833 EOF
2834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2835 { (eval echo configure:2836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2837 if test -z "$ac_err"; then
2838   rm -rf conftest*
2839   eval "ac_cv_header_$ac_safe=yes"
2840 else
2841   echo "$ac_err" >&5
2842   echo "configure: failed program was:" >&5
2843   cat conftest.$ac_ext >&5
2844   rm -rf conftest*
2845   eval "ac_cv_header_$ac_safe=no"
2846 fi
2847 rm -f conftest*
2848 fi
2849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2850   echo "$ac_t""yes" 1>&6
2851   MINIX=yes
2852 else
2853   echo "$ac_t""no" 1>&6
2854 MINIX=
2855 fi
2856
2857 if test "$MINIX" = yes; then
2858   cat >> confdefs.h <<\EOF
2859 #define _POSIX_SOURCE 1
2860 EOF
2861
2862   cat >> confdefs.h <<\EOF
2863 #define _POSIX_1_SOURCE 2
2864 EOF
2865
2866   cat >> confdefs.h <<\EOF
2867 #define _MINIX 1
2868 EOF
2869
2870 fi
2871
2872
2873 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2874 echo "configure:2875: checking for be_app in -lbe" >&5
2875 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2876 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2877   echo $ac_n "(cached) $ac_c" 1>&6
2878 else
2879   ac_save_LIBS="$LIBS"
2880 LIBS="-lbe -lroot -lnet $LIBS"
2881 cat > conftest.$ac_ext <<EOF
2882 #line 2883 "configure"
2883 #include "confdefs.h"
2884 /* Override any gcc2 internal prototype to avoid an error.  */
2885 /* We use char because int might match the return type of a gcc2
2886     builtin and then its argument prototype would still apply.  */
2887 char be_app();
2888
2889 int main() {
2890 be_app()
2891 ; return 0; }
2892 EOF
2893 if { (eval echo configure:2894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2894   rm -rf conftest*
2895   eval "ac_cv_lib_$ac_lib_var=yes"
2896 else
2897   echo "configure: failed program was:" >&5
2898   cat conftest.$ac_ext >&5
2899   rm -rf conftest*
2900   eval "ac_cv_lib_$ac_lib_var=no"
2901 fi
2902 rm -f conftest*
2903 LIBS="$ac_save_LIBS"
2904
2905 fi
2906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2907   echo "$ac_t""yes" 1>&6
2908   LIBS="$LIBS -lbe -lroot -lnet"
2909 else
2910   echo "$ac_t""no" 1>&6
2911 :
2912 fi
2913
2914
2915 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2916 echo "configure:2917: checking for Cygwin environment" >&5
2917 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2918   echo $ac_n "(cached) $ac_c" 1>&6
2919 else
2920   cat > conftest.$ac_ext <<EOF
2921 #line 2922 "configure"
2922 #include "confdefs.h"
2923
2924 int main() {
2925
2926 #ifndef __CYGWIN__
2927 #define __CYGWIN__ __CYGWIN32__
2928 #endif
2929 return __CYGWIN__;
2930 ; return 0; }
2931 EOF
2932 if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2933   rm -rf conftest*
2934   ac_cv_cygwin=yes
2935 else
2936   echo "configure: failed program was:" >&5
2937   cat conftest.$ac_ext >&5
2938   rm -rf conftest*
2939   ac_cv_cygwin=no
2940 fi
2941 rm -f conftest*
2942 rm -f conftest*
2943 fi
2944
2945 echo "$ac_t""$ac_cv_cygwin" 1>&6
2946 CYGWIN=
2947 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2948 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2949 echo "configure:2950: checking for mingw32 environment" >&5
2950 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   cat > conftest.$ac_ext <<EOF
2954 #line 2955 "configure"
2955 #include "confdefs.h"
2956
2957 int main() {
2958 return __MINGW32__;
2959 ; return 0; }
2960 EOF
2961 if { (eval echo configure:2962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2962   rm -rf conftest*
2963   ac_cv_mingw32=yes
2964 else
2965   echo "configure: failed program was:" >&5
2966   cat conftest.$ac_ext >&5
2967   rm -rf conftest*
2968   ac_cv_mingw32=no
2969 fi
2970 rm -f conftest*
2971 rm -f conftest*
2972 fi
2973
2974 echo "$ac_t""$ac_cv_mingw32" 1>&6
2975 MINGW32=
2976 test "$ac_cv_mingw32" = yes && MINGW32=yes
2977
2978
2979 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2980 echo "configure:2981: checking for executable suffix" >&5
2981 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2982   echo $ac_n "(cached) $ac_c" 1>&6
2983 else
2984   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2985   ac_cv_exeext=.exe
2986 else
2987   rm -f conftest*
2988   echo 'int main () { return 0; }' > conftest.$ac_ext
2989   ac_cv_exeext=
2990   if { (eval echo configure:2991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2991     for file in conftest.*; do
2992       case $file in
2993       *.c | *.o | *.obj) ;;
2994       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2995       esac
2996     done
2997   else
2998     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2999   fi
3000   rm -f conftest*
3001   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3002 fi
3003 fi
3004
3005 EXEEXT=""
3006 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3007 echo "$ac_t""${ac_cv_exeext}" 1>&6
3008 ac_exeext=$EXEEXT
3009
3010 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3011 echo "configure:3012: checking for object suffix" >&5
3012 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
3013   echo $ac_n "(cached) $ac_c" 1>&6
3014 else
3015   rm -f conftest*
3016 echo 'int i = 1;' > conftest.$ac_ext
3017 if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3018   for ac_file in conftest.*; do
3019     case $ac_file in
3020     *.c) ;;
3021     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3022     esac
3023   done
3024 else
3025   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3026 fi
3027 rm -f conftest*
3028 fi
3029
3030 echo "$ac_t""$ac_cv_objext" 1>&6
3031 OBJEXT=$ac_cv_objext
3032 ac_objext=$ac_cv_objext
3033
3034
3035 cat >> confdefs.h <<EOF
3036 #define EXEEXT "${EXEEXT}"
3037 EOF
3038
3039
3040
3041
3042
3043 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3044 echo "configure:3045: checking for ${CC-cc} option to accept ANSI C" >&5
3045 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
3046   echo $ac_n "(cached) $ac_c" 1>&6
3047 else
3048   am_cv_prog_cc_stdc=no
3049 ac_save_CC="$CC"
3050 # Don't try gcc -ansi; that turns off useful extensions and
3051 # breaks some systems' header files.
3052 # AIX                   -qlanglvl=ansi
3053 # Ultrix and OSF/1      -std1
3054 # HP-UX                 -Aa -D_HPUX_SOURCE
3055 # SVR4                  -Xc -D__EXTENSIONS__
3056 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3057 do
3058   CC="$ac_save_CC $ac_arg"
3059   cat > conftest.$ac_ext <<EOF
3060 #line 3061 "configure"
3061 #include "confdefs.h"
3062 #include <stdarg.h>
3063 #include <stdio.h>
3064 #include <sys/types.h>
3065 #include <sys/stat.h>
3066 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3067 struct buf { int x; };
3068 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3069 static char *e (p, i)
3070      char **p;
3071      int i;
3072 {
3073   return p[i];
3074 }
3075 static char *f (char * (*g) (char **, int), char **p, ...)
3076 {
3077   char *s;
3078   va_list v;
3079   va_start (v,p);
3080   s = g (p, va_arg (v,int));
3081   va_end (v);
3082   return s;
3083 }
3084 int test (int i, double x);
3085 struct s1 {int (*f) (int a);};
3086 struct s2 {int (*f) (double a);};
3087 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3088 int argc;
3089 char **argv;
3090
3091 int main() {
3092
3093 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3094
3095 ; return 0; }
3096 EOF
3097 if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3098   rm -rf conftest*
3099   am_cv_prog_cc_stdc="$ac_arg"; break
3100 else
3101   echo "configure: failed program was:" >&5
3102   cat conftest.$ac_ext >&5
3103 fi
3104 rm -f conftest*
3105 done
3106 CC="$ac_save_CC"
3107
3108 fi
3109
3110 if test -z "$am_cv_prog_cc_stdc"; then
3111   echo "$ac_t""none needed" 1>&6
3112 else
3113   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3114 fi
3115 case "x$am_cv_prog_cc_stdc" in
3116   x|xno) ;;
3117   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3118 esac
3119
3120 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3121         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3122 fi
3123
3124
3125 # test for make depend flag
3126 OL_MKDEP=
3127 OL_MKDEP_FLAGS=
3128 if test -z "${MKDEP}"; then
3129         OL_MKDEP="${CC-cc}"
3130         if test -z "${MKDEP_FLAGS}"; then
3131                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3132 echo "configure:3133: checking for ${OL_MKDEP} depend flag" >&5
3133 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
3134   echo $ac_n "(cached) $ac_c" 1>&6
3135 else
3136   
3137                         ol_cv_mkdep=no
3138                         for flag in "-M" "-xM"; do
3139                                 cat > conftest.c <<EOF
3140  noCode;
3141 EOF
3142                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3143                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3144                                 then
3145                                         if test ! -f conftest."${ac_object}" ; then
3146                                                 ol_cv_mkdep=$flag
3147                                                 OL_MKDEP_FLAGS="$flag"
3148                                                 break
3149                                         fi
3150                                 fi
3151                         done
3152                         rm -f conftest*
3153                 
3154 fi
3155
3156 echo "$ac_t""$ol_cv_mkdep" 1>&6
3157         else
3158                 cc_cv_mkdep=yes
3159                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3160         fi
3161 else
3162         cc_cv_mkdep=yes
3163         OL_MKDEP="${MKDEP}"
3164         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3165 fi
3166
3167
3168
3169 if test "${ol_cv_mkdep}" = no ; then
3170         # this will soon become an error
3171         echo "configure: warning: do not know how to generate dependencies" 1>&2
3172 fi
3173
3174
3175
3176 echo $ac_n "checking for socket""... $ac_c" 1>&6
3177 echo "configure:3178: checking for socket" >&5
3178 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3179   echo $ac_n "(cached) $ac_c" 1>&6
3180 else
3181   cat > conftest.$ac_ext <<EOF
3182 #line 3183 "configure"
3183 #include "confdefs.h"
3184 /* System header to define __stub macros and hopefully few prototypes,
3185     which can conflict with char socket(); below.  */
3186 #include <assert.h>
3187 /* Override any gcc2 internal prototype to avoid an error.  */
3188 /* We use char because int might match the return type of a gcc2
3189     builtin and then its argument prototype would still apply.  */
3190 char socket();
3191
3192 int main() {
3193
3194 /* The GNU C library defines this for functions which it implements
3195     to always fail with ENOSYS.  Some functions are actually named
3196     something starting with __ and the normal name is an alias.  */
3197 #if defined (__stub_socket) || defined (__stub___socket)
3198 choke me
3199 #else
3200 socket();
3201 #endif
3202
3203 ; return 0; }
3204 EOF
3205 if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3206   rm -rf conftest*
3207   eval "ac_cv_func_socket=yes"
3208 else
3209   echo "configure: failed program was:" >&5
3210   cat conftest.$ac_ext >&5
3211   rm -rf conftest*
3212   eval "ac_cv_func_socket=no"
3213 fi
3214 rm -f conftest*
3215 fi
3216
3217 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3218   echo "$ac_t""yes" 1>&6
3219   :
3220 else
3221   echo "$ac_t""no" 1>&6
3222         
3223         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3224 echo "configure:3225: checking for main in -lsocket" >&5
3225 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3226 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3227   echo $ac_n "(cached) $ac_c" 1>&6
3228 else
3229   ac_save_LIBS="$LIBS"
3230 LIBS="-lsocket  $LIBS"
3231 cat > conftest.$ac_ext <<EOF
3232 #line 3233 "configure"
3233 #include "confdefs.h"
3234
3235 int main() {
3236 main()
3237 ; return 0; }
3238 EOF
3239 if { (eval echo configure:3240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3240   rm -rf conftest*
3241   eval "ac_cv_lib_$ac_lib_var=yes"
3242 else
3243   echo "configure: failed program was:" >&5
3244   cat conftest.$ac_ext >&5
3245   rm -rf conftest*
3246   eval "ac_cv_lib_$ac_lib_var=no"
3247 fi
3248 rm -f conftest*
3249 LIBS="$ac_save_LIBS"
3250
3251 fi
3252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3253   echo "$ac_t""yes" 1>&6
3254     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3255     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3256   cat >> confdefs.h <<EOF
3257 #define $ac_tr_lib 1
3258 EOF
3259
3260   LIBS="-lsocket $LIBS"
3261
3262 else
3263   echo "$ac_t""no" 1>&6
3264 fi
3265
3266         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3267 echo "configure:3268: checking for main in -lnet" >&5
3268 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3269 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3270   echo $ac_n "(cached) $ac_c" 1>&6
3271 else
3272   ac_save_LIBS="$LIBS"
3273 LIBS="-lnet  $LIBS"
3274 cat > conftest.$ac_ext <<EOF
3275 #line 3276 "configure"
3276 #include "confdefs.h"
3277
3278 int main() {
3279 main()
3280 ; return 0; }
3281 EOF
3282 if { (eval echo configure:3283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3283   rm -rf conftest*
3284   eval "ac_cv_lib_$ac_lib_var=yes"
3285 else
3286   echo "configure: failed program was:" >&5
3287   cat conftest.$ac_ext >&5
3288   rm -rf conftest*
3289   eval "ac_cv_lib_$ac_lib_var=no"
3290 fi
3291 rm -f conftest*
3292 LIBS="$ac_save_LIBS"
3293
3294 fi
3295 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3296   echo "$ac_t""yes" 1>&6
3297     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3298     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3299   cat >> confdefs.h <<EOF
3300 #define $ac_tr_lib 1
3301 EOF
3302
3303   LIBS="-lnet $LIBS"
3304
3305 else
3306   echo "$ac_t""no" 1>&6
3307 fi
3308
3309         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3310 echo "configure:3311: checking for socket in -lnet" >&5
3311 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3312 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3313   echo $ac_n "(cached) $ac_c" 1>&6
3314 else
3315   ac_save_LIBS="$LIBS"
3316 LIBS="-lnet  $LIBS"
3317 cat > conftest.$ac_ext <<EOF
3318 #line 3319 "configure"
3319 #include "confdefs.h"
3320 /* Override any gcc2 internal prototype to avoid an error.  */
3321 /* We use char because int might match the return type of a gcc2
3322     builtin and then its argument prototype would still apply.  */
3323 char socket();
3324
3325 int main() {
3326 socket()
3327 ; return 0; }
3328 EOF
3329 if { (eval echo configure:3330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3330   rm -rf conftest*
3331   eval "ac_cv_lib_$ac_lib_var=yes"
3332 else
3333   echo "configure: failed program was:" >&5
3334   cat conftest.$ac_ext >&5
3335   rm -rf conftest*
3336   eval "ac_cv_lib_$ac_lib_var=no"
3337 fi
3338 rm -f conftest*
3339 LIBS="$ac_save_LIBS"
3340
3341 fi
3342 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3343   echo "$ac_t""yes" 1>&6
3344     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3345     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3346   cat >> confdefs.h <<EOF
3347 #define $ac_tr_lib 1
3348 EOF
3349
3350   LIBS="-lnet $LIBS"
3351
3352 else
3353   echo "$ac_t""no" 1>&6
3354 fi
3355
3356         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3357 echo "configure:3358: checking for main in -lnsl_s" >&5
3358 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3359 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3360   echo $ac_n "(cached) $ac_c" 1>&6
3361 else
3362   ac_save_LIBS="$LIBS"
3363 LIBS="-lnsl_s  $LIBS"
3364 cat > conftest.$ac_ext <<EOF
3365 #line 3366 "configure"
3366 #include "confdefs.h"
3367
3368 int main() {
3369 main()
3370 ; return 0; }
3371 EOF
3372 if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3373   rm -rf conftest*
3374   eval "ac_cv_lib_$ac_lib_var=yes"
3375 else
3376   echo "configure: failed program was:" >&5
3377   cat conftest.$ac_ext >&5
3378   rm -rf conftest*
3379   eval "ac_cv_lib_$ac_lib_var=no"
3380 fi
3381 rm -f conftest*
3382 LIBS="$ac_save_LIBS"
3383
3384 fi
3385 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3386   echo "$ac_t""yes" 1>&6
3387     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3388     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3389   cat >> confdefs.h <<EOF
3390 #define $ac_tr_lib 1
3391 EOF
3392
3393   LIBS="-lnsl_s $LIBS"
3394
3395 else
3396   echo "$ac_t""no" 1>&6
3397 fi
3398
3399         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3400 echo "configure:3401: checking for main in -lnsl" >&5
3401 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3402 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3403   echo $ac_n "(cached) $ac_c" 1>&6
3404 else
3405   ac_save_LIBS="$LIBS"
3406 LIBS="-lnsl  $LIBS"
3407 cat > conftest.$ac_ext <<EOF
3408 #line 3409 "configure"
3409 #include "confdefs.h"
3410
3411 int main() {
3412 main()
3413 ; return 0; }
3414 EOF
3415 if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3416   rm -rf conftest*
3417   eval "ac_cv_lib_$ac_lib_var=yes"
3418 else
3419   echo "configure: failed program was:" >&5
3420   cat conftest.$ac_ext >&5
3421   rm -rf conftest*
3422   eval "ac_cv_lib_$ac_lib_var=no"
3423 fi
3424 rm -f conftest*
3425 LIBS="$ac_save_LIBS"
3426
3427 fi
3428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3429   echo "$ac_t""yes" 1>&6
3430     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3431     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3432   cat >> confdefs.h <<EOF
3433 #define $ac_tr_lib 1
3434 EOF
3435
3436   LIBS="-lnsl $LIBS"
3437
3438 else
3439   echo "$ac_t""no" 1>&6
3440 fi
3441
3442         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3443 echo "configure:3444: checking for socket in -linet" >&5
3444 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3445 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3446   echo $ac_n "(cached) $ac_c" 1>&6
3447 else
3448   ac_save_LIBS="$LIBS"
3449 LIBS="-linet  $LIBS"
3450 cat > conftest.$ac_ext <<EOF
3451 #line 3452 "configure"
3452 #include "confdefs.h"
3453 /* Override any gcc2 internal prototype to avoid an error.  */
3454 /* We use char because int might match the return type of a gcc2
3455     builtin and then its argument prototype would still apply.  */
3456 char socket();
3457
3458 int main() {
3459 socket()
3460 ; return 0; }
3461 EOF
3462 if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3463   rm -rf conftest*
3464   eval "ac_cv_lib_$ac_lib_var=yes"
3465 else
3466   echo "configure: failed program was:" >&5
3467   cat conftest.$ac_ext >&5
3468   rm -rf conftest*
3469   eval "ac_cv_lib_$ac_lib_var=no"
3470 fi
3471 rm -f conftest*
3472 LIBS="$ac_save_LIBS"
3473
3474 fi
3475 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3476   echo "$ac_t""yes" 1>&6
3477     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3478     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3479   cat >> confdefs.h <<EOF
3480 #define $ac_tr_lib 1
3481 EOF
3482
3483   LIBS="-linet $LIBS"
3484
3485 else
3486   echo "$ac_t""no" 1>&6
3487 fi
3488
3489         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3490 echo "configure:3491: checking for main in -lgen" >&5
3491 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3492 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3493   echo $ac_n "(cached) $ac_c" 1>&6
3494 else
3495   ac_save_LIBS="$LIBS"
3496 LIBS="-lgen  $LIBS"
3497 cat > conftest.$ac_ext <<EOF
3498 #line 3499 "configure"
3499 #include "confdefs.h"
3500
3501 int main() {
3502 main()
3503 ; return 0; }
3504 EOF
3505 if { (eval echo configure:3506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3506   rm -rf conftest*
3507   eval "ac_cv_lib_$ac_lib_var=yes"
3508 else
3509   echo "configure: failed program was:" >&5
3510   cat conftest.$ac_ext >&5
3511   rm -rf conftest*
3512   eval "ac_cv_lib_$ac_lib_var=no"
3513 fi
3514 rm -f conftest*
3515 LIBS="$ac_save_LIBS"
3516
3517 fi
3518 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3519   echo "$ac_t""yes" 1>&6
3520     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3521     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3522   cat >> confdefs.h <<EOF
3523 #define $ac_tr_lib 1
3524 EOF
3525
3526   LIBS="-lgen $LIBS"
3527
3528 else
3529   echo "$ac_t""no" 1>&6
3530 fi
3531
3532
3533 fi
3534
3535
3536 for ac_func in res_search
3537 do
3538 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3539 echo "configure:3540: checking for $ac_func" >&5
3540 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3541   echo $ac_n "(cached) $ac_c" 1>&6
3542 else
3543   cat > conftest.$ac_ext <<EOF
3544 #line 3545 "configure"
3545 #include "confdefs.h"
3546 /* System header to define __stub macros and hopefully few prototypes,
3547     which can conflict with char $ac_func(); below.  */
3548 #include <assert.h>
3549 /* Override any gcc2 internal prototype to avoid an error.  */
3550 /* We use char because int might match the return type of a gcc2
3551     builtin and then its argument prototype would still apply.  */
3552 char $ac_func();
3553
3554 int main() {
3555
3556 /* The GNU C library defines this for functions which it implements
3557     to always fail with ENOSYS.  Some functions are actually named
3558     something starting with __ and the normal name is an alias.  */
3559 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3560 choke me
3561 #else
3562 $ac_func();
3563 #endif
3564
3565 ; return 0; }
3566 EOF
3567 if { (eval echo configure:3568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3568   rm -rf conftest*
3569   eval "ac_cv_func_$ac_func=yes"
3570 else
3571   echo "configure: failed program was:" >&5
3572   cat conftest.$ac_ext >&5
3573   rm -rf conftest*
3574   eval "ac_cv_func_$ac_func=no"
3575 fi
3576 rm -f conftest*
3577 fi
3578
3579 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3580   echo "$ac_t""yes" 1>&6
3581     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3582   cat >> confdefs.h <<EOF
3583 #define $ac_tr_func 1
3584 EOF
3585  
3586 else
3587   echo "$ac_t""no" 1>&6
3588 fi
3589 done
3590
3591 if test $ac_cv_func_res_search = "no" ; then 
3592         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3593 echo "configure:3594: checking for res_search in -lbind" >&5
3594 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3595 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3596   echo $ac_n "(cached) $ac_c" 1>&6
3597 else
3598   ac_save_LIBS="$LIBS"
3599 LIBS="-lbind  $LIBS"
3600 cat > conftest.$ac_ext <<EOF
3601 #line 3602 "configure"
3602 #include "confdefs.h"
3603 /* Override any gcc2 internal prototype to avoid an error.  */
3604 /* We use char because int might match the return type of a gcc2
3605     builtin and then its argument prototype would still apply.  */
3606 char res_search();
3607
3608 int main() {
3609 res_search()
3610 ; return 0; }
3611 EOF
3612 if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3613   rm -rf conftest*
3614   eval "ac_cv_lib_$ac_lib_var=yes"
3615 else
3616   echo "configure: failed program was:" >&5
3617   cat conftest.$ac_ext >&5
3618   rm -rf conftest*
3619   eval "ac_cv_lib_$ac_lib_var=no"
3620 fi
3621 rm -f conftest*
3622 LIBS="$ac_save_LIBS"
3623
3624 fi
3625 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3626   echo "$ac_t""yes" 1>&6
3627     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3628     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3629   cat >> confdefs.h <<EOF
3630 #define $ac_tr_lib 1
3631 EOF
3632
3633   LIBS="-lbind $LIBS"
3634
3635 else
3636   echo "$ac_t""no" 1>&6
3637 fi
3638
3639         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3640                 cat >> confdefs.h <<\EOF
3641 #define HAVE_RES_SEARCH 1
3642 EOF
3643
3644         else
3645                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3646 echo "configure:3647: checking for res_search in -lresolv" >&5
3647 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3648 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3649   echo $ac_n "(cached) $ac_c" 1>&6
3650 else
3651   ac_save_LIBS="$LIBS"
3652 LIBS="-lresolv  $LIBS"
3653 cat > conftest.$ac_ext <<EOF
3654 #line 3655 "configure"
3655 #include "confdefs.h"
3656 /* Override any gcc2 internal prototype to avoid an error.  */
3657 /* We use char because int might match the return type of a gcc2
3658     builtin and then its argument prototype would still apply.  */
3659 char res_search();
3660
3661 int main() {
3662 res_search()
3663 ; return 0; }
3664 EOF
3665 if { (eval echo configure:3666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3666   rm -rf conftest*
3667   eval "ac_cv_lib_$ac_lib_var=yes"
3668 else
3669   echo "configure: failed program was:" >&5
3670   cat conftest.$ac_ext >&5
3671   rm -rf conftest*
3672   eval "ac_cv_lib_$ac_lib_var=no"
3673 fi
3674 rm -f conftest*
3675 LIBS="$ac_save_LIBS"
3676
3677 fi
3678 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3679   echo "$ac_t""yes" 1>&6
3680     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3681     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3682   cat >> confdefs.h <<EOF
3683 #define $ac_tr_lib 1
3684 EOF
3685
3686   LIBS="-lresolv $LIBS"
3687
3688 else
3689   echo "$ac_t""no" 1>&6
3690 fi
3691
3692                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3693                         cat >> confdefs.h <<\EOF
3694 #define HAVE_RES_SEARCH 1
3695 EOF
3696
3697                 fi
3698         fi
3699 fi
3700
3701 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3702 echo "configure:3703: checking for sigset in -lV3" >&5
3703 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3704 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3705   echo $ac_n "(cached) $ac_c" 1>&6
3706 else
3707   ac_save_LIBS="$LIBS"
3708 LIBS="-lV3  $LIBS"
3709 cat > conftest.$ac_ext <<EOF
3710 #line 3711 "configure"
3711 #include "confdefs.h"
3712 /* Override any gcc2 internal prototype to avoid an error.  */
3713 /* We use char because int might match the return type of a gcc2
3714     builtin and then its argument prototype would still apply.  */
3715 char sigset();
3716
3717 int main() {
3718 sigset()
3719 ; return 0; }
3720 EOF
3721 if { (eval echo configure:3722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3722   rm -rf conftest*
3723   eval "ac_cv_lib_$ac_lib_var=yes"
3724 else
3725   echo "configure: failed program was:" >&5
3726   cat conftest.$ac_ext >&5
3727   rm -rf conftest*
3728   eval "ac_cv_lib_$ac_lib_var=no"
3729 fi
3730 rm -f conftest*
3731 LIBS="$ac_save_LIBS"
3732
3733 fi
3734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3735   echo "$ac_t""yes" 1>&6
3736     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3737     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3738   cat >> confdefs.h <<EOF
3739 #define $ac_tr_lib 1
3740 EOF
3741
3742   LIBS="-lV3 $LIBS"
3743
3744 else
3745   echo "$ac_t""no" 1>&6
3746 fi
3747
3748
3749 for ac_hdr in regex.h 
3750 do
3751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3753 echo "configure:3754: checking for $ac_hdr" >&5
3754 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3755   echo $ac_n "(cached) $ac_c" 1>&6
3756 else
3757   cat > conftest.$ac_ext <<EOF
3758 #line 3759 "configure"
3759 #include "confdefs.h"
3760 #include <$ac_hdr>
3761 EOF
3762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3763 { (eval echo configure:3764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3765 if test -z "$ac_err"; then
3766   rm -rf conftest*
3767   eval "ac_cv_header_$ac_safe=yes"
3768 else
3769   echo "$ac_err" >&5
3770   echo "configure: failed program was:" >&5
3771   cat conftest.$ac_ext >&5
3772   rm -rf conftest*
3773   eval "ac_cv_header_$ac_safe=no"
3774 fi
3775 rm -f conftest*
3776 fi
3777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3778   echo "$ac_t""yes" 1>&6
3779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3780   cat >> confdefs.h <<EOF
3781 #define $ac_tr_hdr 1
3782 EOF
3783  
3784 else
3785   echo "$ac_t""no" 1>&6
3786 fi
3787 done
3788
3789 if test "$ac_cv_header_regex_h" != yes ; then
3790         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
3791 fi
3792 echo $ac_n "checking for regfree""... $ac_c" 1>&6
3793 echo "configure:3794: checking for regfree" >&5
3794 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
3795   echo $ac_n "(cached) $ac_c" 1>&6
3796 else
3797   cat > conftest.$ac_ext <<EOF
3798 #line 3799 "configure"
3799 #include "confdefs.h"
3800 /* System header to define __stub macros and hopefully few prototypes,
3801     which can conflict with char regfree(); below.  */
3802 #include <assert.h>
3803 /* Override any gcc2 internal prototype to avoid an error.  */
3804 /* We use char because int might match the return type of a gcc2
3805     builtin and then its argument prototype would still apply.  */
3806 char regfree();
3807
3808 int main() {
3809
3810 /* The GNU C library defines this for functions which it implements
3811     to always fail with ENOSYS.  Some functions are actually named
3812     something starting with __ and the normal name is an alias.  */
3813 #if defined (__stub_regfree) || defined (__stub___regfree)
3814 choke me
3815 #else
3816 regfree();
3817 #endif
3818
3819 ; return 0; }
3820 EOF
3821 if { (eval echo configure:3822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3822   rm -rf conftest*
3823   eval "ac_cv_func_regfree=yes"
3824 else
3825   echo "configure: failed program was:" >&5
3826   cat conftest.$ac_ext >&5
3827   rm -rf conftest*
3828   eval "ac_cv_func_regfree=no"
3829 fi
3830 rm -f conftest*
3831 fi
3832
3833 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
3834   echo "$ac_t""yes" 1>&6
3835   :
3836 else
3837   echo "$ac_t""no" 1>&6
3838 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
3839 fi
3840
3841
3842
3843 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
3844 echo "configure:3845: checking for compatible POSIX regex" >&5
3845 if eval "test \"`echo '$''{'ol_cv_c_posix_regex'+set}'`\" = set"; then
3846   echo $ac_n "(cached) $ac_c" 1>&6
3847 else
3848   
3849         if test "$cross_compiling" = yes; then
3850   ol_cv_c_posix_regex=cross
3851 else
3852   cat > conftest.$ac_ext <<EOF
3853 #line 3854 "configure"
3854 #include "confdefs.h"
3855
3856 #include <sys/types.h>
3857 #include <regex.h>
3858 static char *pattern, *string;
3859 main()
3860 {
3861         int rc;
3862         regex_t re;
3863
3864         pattern = "^A";
3865
3866         if(regcomp(&re, pattern, 0)) {
3867                 return -1;
3868         }
3869         
3870         string = "ALL MATCH";
3871         
3872         rc = regexec(&re, string, 0, (void*)0, 0);
3873
3874         regfree(&re);
3875
3876         return rc;
3877 }
3878 EOF
3879 if { (eval echo configure:3880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3880 then
3881   ol_cv_c_posix_regex=yes
3882 else
3883   echo "configure: failed program was:" >&5
3884   cat conftest.$ac_ext >&5
3885   rm -fr conftest*
3886   ol_cv_c_posix_regex=no
3887 fi
3888 rm -fr conftest*
3889 fi
3890
3891 fi
3892
3893 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
3894
3895 if test "$ol_cv_c_posix_regex" = no ; then
3896         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
3897 fi
3898
3899 echo $ac_n "checking for select""... $ac_c" 1>&6
3900 echo "configure:3901: checking for select" >&5
3901 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3902   echo $ac_n "(cached) $ac_c" 1>&6
3903 else
3904   cat > conftest.$ac_ext <<EOF
3905 #line 3906 "configure"
3906 #include "confdefs.h"
3907 /* System header to define __stub macros and hopefully few prototypes,
3908     which can conflict with char select(); below.  */
3909 #include <assert.h>
3910 /* Override any gcc2 internal prototype to avoid an error.  */
3911 /* We use char because int might match the return type of a gcc2
3912     builtin and then its argument prototype would still apply.  */
3913 char select();
3914
3915 int main() {
3916
3917 /* The GNU C library defines this for functions which it implements
3918     to always fail with ENOSYS.  Some functions are actually named
3919     something starting with __ and the normal name is an alias.  */
3920 #if defined (__stub_select) || defined (__stub___select)
3921 choke me
3922 #else
3923 select();
3924 #endif
3925
3926 ; return 0; }
3927 EOF
3928 if { (eval echo configure:3929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3929   rm -rf conftest*
3930   eval "ac_cv_func_select=yes"
3931 else
3932   echo "configure: failed program was:" >&5
3933   cat conftest.$ac_ext >&5
3934   rm -rf conftest*
3935   eval "ac_cv_func_select=no"
3936 fi
3937 rm -f conftest*
3938 fi
3939
3940 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3941   echo "$ac_t""yes" 1>&6
3942   :
3943 else
3944   echo "$ac_t""no" 1>&6
3945 { echo "configure: error: select() required." 1>&2; exit 1; }
3946 fi
3947
3948
3949 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3950 echo "configure:3951: checking types of arguments for select()" >&5
3951  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3952   echo $ac_n "(cached) $ac_c" 1>&6
3953 else
3954    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3955   echo $ac_n "(cached) $ac_c" 1>&6
3956 else
3957     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3958   echo $ac_n "(cached) $ac_c" 1>&6
3959 else
3960      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3961      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3962       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3963        cat > conftest.$ac_ext <<EOF
3964 #line 3965 "configure"
3965 #include "confdefs.h"
3966 #ifdef HAVE_SYS_TYPES_H
3967 #include <sys/types.h>
3968 #endif
3969 #ifdef HAVE_SYS_TIME_H
3970 #include <sys/time.h>
3971 #endif
3972 #ifdef HAVE_SYS_SELECT_H
3973 #include <sys/select.h>
3974 #endif
3975 #ifdef HAVE_SYS_SOCKET_H
3976 #include <sys/socket.h>
3977 #endif
3978 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
3979 int main() {
3980
3981 ; return 0; }
3982 EOF
3983 if { (eval echo configure:3984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3984   rm -rf conftest*
3985           ac_not_found=no ; break 3
3986 else
3987   echo "configure: failed program was:" >&5
3988   cat conftest.$ac_ext >&5
3989   rm -rf conftest*
3990   ac_not_found=yes
3991 fi
3992 rm -f conftest*
3993       done
3994      done
3995     done
3996    
3997 fi
3998   
3999 fi
4000  
4001 fi
4002  if test "$ac_not_found" = yes; then
4003   ac_cv_func_select_arg1=int 
4004   ac_cv_func_select_arg234='int *' 
4005   ac_cv_func_select_arg5='struct timeval *'
4006  fi
4007  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4008  cat >> confdefs.h <<EOF
4009 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4010 EOF
4011
4012  cat >> confdefs.h <<EOF
4013 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4014 EOF
4015
4016  cat >> confdefs.h <<EOF
4017 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4018 EOF
4019
4020
4021
4022 # ISODE tests
4023 ol_link_isode=no
4024 if test $ol_enable_ldapd != no ; then
4025         echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
4026
4027                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
4028 echo "configure:4029: checking for main in -lxtpp" >&5
4029 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
4030 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4031   echo $ac_n "(cached) $ac_c" 1>&6
4032 else
4033   ac_save_LIBS="$LIBS"
4034 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
4035 cat > conftest.$ac_ext <<EOF
4036 #line 4037 "configure"
4037 #include "confdefs.h"
4038
4039 int main() {
4040 main()
4041 ; return 0; }
4042 EOF
4043 if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4044   rm -rf conftest*
4045   eval "ac_cv_lib_$ac_lib_var=yes"
4046 else
4047   echo "configure: failed program was:" >&5
4048   cat conftest.$ac_ext >&5
4049   rm -rf conftest*
4050   eval "ac_cv_lib_$ac_lib_var=no"
4051 fi
4052 rm -f conftest*
4053 LIBS="$ac_save_LIBS"
4054
4055 fi
4056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4057   echo "$ac_t""yes" 1>&6
4058   
4059                 ol_link_isode=yes
4060                 cat >> confdefs.h <<\EOF
4061 #define HAVE_XTPP 1
4062 EOF
4063
4064                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
4065                 
4066 else
4067   echo "$ac_t""no" 1>&6
4068 :
4069 fi
4070
4071         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
4072 echo "configure:4073: checking for main in -ldsap" >&5
4073 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
4074 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4075   echo $ac_n "(cached) $ac_c" 1>&6
4076 else
4077   ac_save_LIBS="$LIBS"
4078 LIBS="-ldsap -lisode $LIBS"
4079 cat > conftest.$ac_ext <<EOF
4080 #line 4081 "configure"
4081 #include "confdefs.h"
4082
4083 int main() {
4084 main()
4085 ; return 0; }
4086 EOF
4087 if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4088   rm -rf conftest*
4089   eval "ac_cv_lib_$ac_lib_var=yes"
4090 else
4091   echo "configure: failed program was:" >&5
4092   cat conftest.$ac_ext >&5
4093   rm -rf conftest*
4094   eval "ac_cv_lib_$ac_lib_var=no"
4095 fi
4096 rm -f conftest*
4097 LIBS="$ac_save_LIBS"
4098
4099 fi
4100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4101   echo "$ac_t""yes" 1>&6
4102   
4103                 ol_link_isode=yes
4104                 cat >> confdefs.h <<\EOF
4105 #define HAVE_DSAP 1
4106 EOF
4107
4108                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
4109                 
4110 else
4111   echo "$ac_t""no" 1>&6
4112 :
4113 fi
4114
4115         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
4116 echo "configure:4117: checking for main in -lisode" >&5
4117 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
4118 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4119   echo $ac_n "(cached) $ac_c" 1>&6
4120 else
4121   ac_save_LIBS="$LIBS"
4122 LIBS="-lisode  $LIBS"
4123 cat > conftest.$ac_ext <<EOF
4124 #line 4125 "configure"
4125 #include "confdefs.h"
4126
4127 int main() {
4128 main()
4129 ; return 0; }
4130 EOF
4131 if { (eval echo configure:4132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4132   rm -rf conftest*
4133   eval "ac_cv_lib_$ac_lib_var=yes"
4134 else
4135   echo "configure: failed program was:" >&5
4136   cat conftest.$ac_ext >&5
4137   rm -rf conftest*
4138   eval "ac_cv_lib_$ac_lib_var=no"
4139 fi
4140 rm -f conftest*
4141 LIBS="$ac_save_LIBS"
4142
4143 fi
4144 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4145   echo "$ac_t""yes" 1>&6
4146   
4147                 ol_link_isode=yes
4148                 cat >> confdefs.h <<\EOF
4149 #define HAVE_ISODE 1
4150 EOF
4151
4152                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
4153                 
4154 else
4155   echo "$ac_t""no" 1>&6
4156 :
4157 fi
4158
4159 fi
4160
4161 if test $ol_link_isode != no; then
4162         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
4163 echo "configure:4164: checking for main in -lpp" >&5
4164 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
4165 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4166   echo $ac_n "(cached) $ac_c" 1>&6
4167 else
4168   ac_save_LIBS="$LIBS"
4169 LIBS="-lpp  $LIBS"
4170 cat > conftest.$ac_ext <<EOF
4171 #line 4172 "configure"
4172 #include "confdefs.h"
4173
4174 int main() {
4175 main()
4176 ; return 0; }
4177 EOF
4178 if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4179   rm -rf conftest*
4180   eval "ac_cv_lib_$ac_lib_var=yes"
4181 else
4182   echo "configure: failed program was:" >&5
4183   cat conftest.$ac_ext >&5
4184   rm -rf conftest*
4185   eval "ac_cv_lib_$ac_lib_var=no"
4186 fi
4187 rm -f conftest*
4188 LIBS="$ac_save_LIBS"
4189
4190 fi
4191 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4192   echo "$ac_t""yes" 1>&6
4193   
4194                 cat >> confdefs.h <<\EOF
4195 #define HAVE_PP 1
4196 EOF
4197
4198                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
4199                 
4200 else
4201   echo "$ac_t""no" 1>&6
4202 :
4203 fi
4204
4205
4206         # Extract the first word of "pepsy", so it can be a program name with args.
4207 set dummy pepsy; ac_word=$2
4208 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4209 echo "configure:4210: checking for $ac_word" >&5
4210 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
4211   echo $ac_n "(cached) $ac_c" 1>&6
4212 else
4213   case "$PEPSY" in
4214   /*)
4215   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
4216   ;;
4217   ?:/*)                  
4218   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
4219   ;;
4220   *)
4221   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4222   ac_dummy="$PATH"
4223   for ac_dir in $ac_dummy; do 
4224     test -z "$ac_dir" && ac_dir=.
4225     if test -f $ac_dir/$ac_word; then
4226       ac_cv_path_PEPSY="$ac_dir/$ac_word"
4227       break
4228     fi
4229   done
4230   IFS="$ac_save_ifs"
4231   ;;
4232 esac
4233 fi
4234 PEPSY="$ac_cv_path_PEPSY"
4235 if test -n "$PEPSY"; then
4236   echo "$ac_t""$PEPSY" 1>&6
4237 else
4238   echo "$ac_t""no" 1>&6
4239 fi
4240
4241 fi
4242
4243 ol_link_kerberos=no
4244
4245 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
4246         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
4247 do
4248 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4249 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4250 echo "configure:4251: checking for $ac_hdr" >&5
4251 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4252   echo $ac_n "(cached) $ac_c" 1>&6
4253 else
4254   cat > conftest.$ac_ext <<EOF
4255 #line 4256 "configure"
4256 #include "confdefs.h"
4257 #include <$ac_hdr>
4258 EOF
4259 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4260 { (eval echo configure:4261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4261 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4262 if test -z "$ac_err"; then
4263   rm -rf conftest*
4264   eval "ac_cv_header_$ac_safe=yes"
4265 else
4266   echo "$ac_err" >&5
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -rf conftest*
4270   eval "ac_cv_header_$ac_safe=no"
4271 fi
4272 rm -f conftest*
4273 fi
4274 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4275   echo "$ac_t""yes" 1>&6
4276     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4277   cat >> confdefs.h <<EOF
4278 #define $ac_tr_hdr 1
4279 EOF
4280  
4281 else
4282   echo "$ac_t""no" 1>&6
4283 fi
4284 done
4285
4286
4287         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4288                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4289 echo "configure:4290: checking for main in -lkrb4" >&5
4290 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4291 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4292   echo $ac_n "(cached) $ac_c" 1>&6
4293 else
4294   ac_save_LIBS="$LIBS"
4295 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4296 cat > conftest.$ac_ext <<EOF
4297 #line 4298 "configure"
4298 #include "confdefs.h"
4299
4300 int main() {
4301 main()
4302 ; return 0; }
4303 EOF
4304 if { (eval echo configure:4305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4305   rm -rf conftest*
4306   eval "ac_cv_lib_$ac_lib_var=yes"
4307 else
4308   echo "configure: failed program was:" >&5
4309   cat conftest.$ac_ext >&5
4310   rm -rf conftest*
4311   eval "ac_cv_lib_$ac_lib_var=no"
4312 fi
4313 rm -f conftest*
4314 LIBS="$ac_save_LIBS"
4315
4316 fi
4317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4318   echo "$ac_t""yes" 1>&6
4319   have_k5=yes
4320 else
4321   echo "$ac_t""no" 1>&6
4322 have_k5=no
4323 fi
4324
4325
4326                 if test $have_k5 = yes ; then
4327                         ol_with_kerberos=found
4328                         ol_link_kerberos=yes
4329
4330                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4331
4332                         LIBS="$KRB_LIBS $LIBS"
4333
4334                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4335 echo "configure:4336: checking for des_debug in Kerberos libraries" >&5
4336 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4337   echo $ac_n "(cached) $ac_c" 1>&6
4338 else
4339   
4340                                                                 save_LIBS="$LIBS"
4341                                 LIBS="$KRB_LIBS $LIBS"
4342                                 cat > conftest.$ac_ext <<EOF
4343 #line 4344 "configure"
4344 #include "confdefs.h"
4345
4346 #include <kerberosIV/krb.h>
4347 #include <kerberosIV/des.h>
4348 extern int des_debug;
4349
4350 int main() {
4351
4352 des_debug = 1;
4353
4354 ; return 0; }
4355 EOF
4356 if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4357   rm -rf conftest*
4358   ol_cv_var_des_debug=yes
4359 else
4360   echo "configure: failed program was:" >&5
4361   cat conftest.$ac_ext >&5
4362   rm -rf conftest*
4363   ol_cv_var_des_debug=no
4364 fi
4365 rm -f conftest*
4366                                                                 LIBS="$save_LIBS"
4367                         
4368 fi
4369
4370 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4371
4372                         if test $ol_cv_var_des_debug = yes ; then
4373                                 cat >> confdefs.h <<\EOF
4374 #define HAVE_DES_DEBUG 1
4375 EOF
4376
4377                         fi
4378
4379                         LIBS="$save_LIBS"
4380                 fi
4381         fi
4382 fi
4383
4384 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4385         for ac_hdr in krb.h des.h
4386 do
4387 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4388 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4389 echo "configure:4390: checking for $ac_hdr" >&5
4390 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4391   echo $ac_n "(cached) $ac_c" 1>&6
4392 else
4393   cat > conftest.$ac_ext <<EOF
4394 #line 4395 "configure"
4395 #include "confdefs.h"
4396 #include <$ac_hdr>
4397 EOF
4398 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4399 { (eval echo configure:4400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4400 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4401 if test -z "$ac_err"; then
4402   rm -rf conftest*
4403   eval "ac_cv_header_$ac_safe=yes"
4404 else
4405   echo "$ac_err" >&5
4406   echo "configure: failed program was:" >&5
4407   cat conftest.$ac_ext >&5
4408   rm -rf conftest*
4409   eval "ac_cv_header_$ac_safe=no"
4410 fi
4411 rm -f conftest*
4412 fi
4413 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4414   echo "$ac_t""yes" 1>&6
4415     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4416   cat >> confdefs.h <<EOF
4417 #define $ac_tr_hdr 1
4418 EOF
4419  
4420 else
4421   echo "$ac_t""no" 1>&6
4422 fi
4423 done
4424
4425
4426         if test $ac_cv_header_krb_h = yes ; then
4427                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4428 echo "configure:4429: checking for main in -lkrb" >&5
4429 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4430 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   ac_save_LIBS="$LIBS"
4434 LIBS="-lkrb -ldes $LIBS"
4435 cat > conftest.$ac_ext <<EOF
4436 #line 4437 "configure"
4437 #include "confdefs.h"
4438
4439 int main() {
4440 main()
4441 ; return 0; }
4442 EOF
4443 if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4444   rm -rf conftest*
4445   eval "ac_cv_lib_$ac_lib_var=yes"
4446 else
4447   echo "configure: failed program was:" >&5
4448   cat conftest.$ac_ext >&5
4449   rm -rf conftest*
4450   eval "ac_cv_lib_$ac_lib_var=no"
4451 fi
4452 rm -f conftest*
4453 LIBS="$ac_save_LIBS"
4454
4455 fi
4456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4457   echo "$ac_t""yes" 1>&6
4458   have_k4=yes
4459 else
4460   echo "$ac_t""no" 1>&6
4461 have_k4=no
4462 fi
4463
4464
4465                 if test $have_k4 = yes ; then
4466                         ol_with_kerberos=found
4467                         ol_link_kerberos=yes
4468
4469                         KRB_LIBS="-lkrb -ldes"
4470                 fi
4471         fi
4472 fi
4473
4474 if test $ol_link_kerberos = yes ; then
4475         cat >> confdefs.h <<\EOF
4476 #define HAVE_KERBEROS 1
4477 EOF
4478
4479 fi
4480
4481 ol_link_tls=no
4482 if test $ol_with_tls != no ; then
4483         
4484         for ac_hdr in ssl.h
4485 do
4486 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4487 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4488 echo "configure:4489: checking for $ac_hdr" >&5
4489 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4490   echo $ac_n "(cached) $ac_c" 1>&6
4491 else
4492   cat > conftest.$ac_ext <<EOF
4493 #line 4494 "configure"
4494 #include "confdefs.h"
4495 #include <$ac_hdr>
4496 EOF
4497 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4498 { (eval echo configure:4499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4499 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4500 if test -z "$ac_err"; then
4501   rm -rf conftest*
4502   eval "ac_cv_header_$ac_safe=yes"
4503 else
4504   echo "$ac_err" >&5
4505   echo "configure: failed program was:" >&5
4506   cat conftest.$ac_ext >&5
4507   rm -rf conftest*
4508   eval "ac_cv_header_$ac_safe=no"
4509 fi
4510 rm -f conftest*
4511 fi
4512 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4513   echo "$ac_t""yes" 1>&6
4514     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4515   cat >> confdefs.h <<EOF
4516 #define $ac_tr_hdr 1
4517 EOF
4518  
4519 else
4520   echo "$ac_t""no" 1>&6
4521 fi
4522 done
4523
4524         
4525         if test $ac_cv_header_ssl_h = yes ; then
4526                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4527 echo "configure:4528: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4528 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4529 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4530   echo $ac_n "(cached) $ac_c" 1>&6
4531 else
4532   ac_save_LIBS="$LIBS"
4533 LIBS="-lssl -lcrypto $LIBS"
4534 cat > conftest.$ac_ext <<EOF
4535 #line 4536 "configure"
4536 #include "confdefs.h"
4537 /* Override any gcc2 internal prototype to avoid an error.  */
4538 /* We use char because int might match the return type of a gcc2
4539     builtin and then its argument prototype would still apply.  */
4540 char SSLeay_add_ssl_algorithms();
4541
4542 int main() {
4543 SSLeay_add_ssl_algorithms()
4544 ; return 0; }
4545 EOF
4546 if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4547   rm -rf conftest*
4548   eval "ac_cv_lib_$ac_lib_var=yes"
4549 else
4550   echo "configure: failed program was:" >&5
4551   cat conftest.$ac_ext >&5
4552   rm -rf conftest*
4553   eval "ac_cv_lib_$ac_lib_var=no"
4554 fi
4555 rm -f conftest*
4556 LIBS="$ac_save_LIBS"
4557
4558 fi
4559 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4560   echo "$ac_t""yes" 1>&6
4561   have_ssleay=yes
4562                         need_rsaref=no
4563 else
4564   echo "$ac_t""no" 1>&6
4565 have_ssleay=no
4566 fi
4567
4568                         
4569                 if test $have_ssleay = no ; then
4570                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4571 echo "configure:4572: checking for ssl3_accept in -lssl" >&5
4572 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4573 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4574   echo $ac_n "(cached) $ac_c" 1>&6
4575 else
4576   ac_save_LIBS="$LIBS"
4577 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4578 cat > conftest.$ac_ext <<EOF
4579 #line 4580 "configure"
4580 #include "confdefs.h"
4581 /* Override any gcc2 internal prototype to avoid an error.  */
4582 /* We use char because int might match the return type of a gcc2
4583     builtin and then its argument prototype would still apply.  */
4584 char ssl3_accept();
4585
4586 int main() {
4587 ssl3_accept()
4588 ; return 0; }
4589 EOF
4590 if { (eval echo configure:4591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4591   rm -rf conftest*
4592   eval "ac_cv_lib_$ac_lib_var=yes"
4593 else
4594   echo "configure: failed program was:" >&5
4595   cat conftest.$ac_ext >&5
4596   rm -rf conftest*
4597   eval "ac_cv_lib_$ac_lib_var=no"
4598 fi
4599 rm -f conftest*
4600 LIBS="$ac_save_LIBS"
4601
4602 fi
4603 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4604   echo "$ac_t""yes" 1>&6
4605   have_ssleay=yes
4606                                 need_rsaref=yes
4607 else
4608   echo "$ac_t""no" 1>&6
4609 have_ssleay=no
4610 fi
4611
4612                 fi
4613
4614                 if test $have_ssleay = yes ; then
4615                         ol_with_tls=found
4616                         ol_link_tls=yes
4617
4618                         cat >> confdefs.h <<\EOF
4619 #define HAVE_SSLEAY 1
4620 EOF
4621
4622
4623                         if test $need_rsaref = yes; then
4624                                 cat >> confdefs.h <<\EOF
4625 #define HAVE_RSAREF 1
4626 EOF
4627
4628
4629                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4630                         else
4631                                 TLS_LIBS="-lssl -lcrypto"
4632                         fi
4633                 fi
4634         fi
4635 fi
4636
4637 if test $ol_link_tls = yes ; then
4638         cat >> confdefs.h <<\EOF
4639 #define HAVE_TLS 1
4640 EOF
4641
4642 fi      
4643
4644 for ac_func in \
4645         ctime_r                 \
4646         gethostbyname_r gethostbyaddr_r \
4647
4648 do
4649 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4650 echo "configure:4651: checking for $ac_func" >&5
4651 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4652   echo $ac_n "(cached) $ac_c" 1>&6
4653 else
4654   cat > conftest.$ac_ext <<EOF
4655 #line 4656 "configure"
4656 #include "confdefs.h"
4657 /* System header to define __stub macros and hopefully few prototypes,
4658     which can conflict with char $ac_func(); below.  */
4659 #include <assert.h>
4660 /* Override any gcc2 internal prototype to avoid an error.  */
4661 /* We use char because int might match the return type of a gcc2
4662     builtin and then its argument prototype would still apply.  */
4663 char $ac_func();
4664
4665 int main() {
4666
4667 /* The GNU C library defines this for functions which it implements
4668     to always fail with ENOSYS.  Some functions are actually named
4669     something starting with __ and the normal name is an alias.  */
4670 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4671 choke me
4672 #else
4673 $ac_func();
4674 #endif
4675
4676 ; return 0; }
4677 EOF
4678 if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4679   rm -rf conftest*
4680   eval "ac_cv_func_$ac_func=yes"
4681 else
4682   echo "configure: failed program was:" >&5
4683   cat conftest.$ac_ext >&5
4684   rm -rf conftest*
4685   eval "ac_cv_func_$ac_func=no"
4686 fi
4687 rm -f conftest*
4688 fi
4689
4690 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4691   echo "$ac_t""yes" 1>&6
4692     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4693   cat >> confdefs.h <<EOF
4694 #define $ac_tr_func 1
4695 EOF
4696  
4697 else
4698   echo "$ac_t""no" 1>&6
4699 fi
4700 done
4701
4702
4703 if test "$ac_cv_func_ctime_r" = no ; then
4704         ol_cv_func_ctime_r_nargs=0
4705 else
4706         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4707 echo "configure:4708: checking number of arguments of ctime_r" >&5
4708 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4709   echo $ac_n "(cached) $ac_c" 1>&6
4710 else
4711   cat > conftest.$ac_ext <<EOF
4712 #line 4713 "configure"
4713 #include "confdefs.h"
4714 #include <time.h>
4715 int main() {
4716 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4717 ; return 0; }
4718 EOF
4719 if { (eval echo configure:4720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4720   rm -rf conftest*
4721   ol_cv_func_ctime_r_nargs=3
4722 else
4723   echo "configure: failed program was:" >&5
4724   cat conftest.$ac_ext >&5
4725   rm -rf conftest*
4726   cat > conftest.$ac_ext <<EOF
4727 #line 4728 "configure"
4728 #include "confdefs.h"
4729 #include <time.h>
4730 int main() {
4731 time_t ti; char *buffer; ctime_r(&ti,buffer);
4732 ; return 0; }
4733 EOF
4734 if { (eval echo configure:4735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4735   rm -rf conftest*
4736   ol_cv_func_ctime_r_nargs=2
4737 else
4738   echo "configure: failed program was:" >&5
4739   cat conftest.$ac_ext >&5
4740   rm -rf conftest*
4741   ol_cv_func_ctime_r_nargs=0
4742 fi
4743 rm -f conftest*
4744 fi
4745 rm -f conftest*
4746 fi
4747
4748 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4749   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4750     cat >> confdefs.h <<EOF
4751 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4752 EOF
4753
4754   fi
4755
4756 fi
4757
4758 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4759         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4760 echo "configure:4761: checking number of arguments of gethostbyname_r" >&5
4761 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4762   echo $ac_n "(cached) $ac_c" 1>&6
4763 else
4764   cat > conftest.$ac_ext <<EOF
4765 #line 4766 "configure"
4766 #include "confdefs.h"
4767 #include <sys/types.h>
4768 #include <sys/socket.h>
4769 #include <netinet/in.h>
4770 #include <netdb.h>
4771 #define BUFSIZE (sizeof(struct hostent)+10)
4772 int main() {
4773 struct hostent hent; char buffer[BUFSIZE];
4774                 int bufsize=BUFSIZE;int h_errno;
4775                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4776                         buffer, bufsize, &h_errno);
4777 ; return 0; }
4778 EOF
4779 if { (eval echo configure:4780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4780   rm -rf conftest*
4781   ol_cv_func_gethostbyname_r_nargs=5
4782 else
4783   echo "configure: failed program was:" >&5
4784   cat conftest.$ac_ext >&5
4785   rm -rf conftest*
4786   cat > conftest.$ac_ext <<EOF
4787 #line 4788 "configure"
4788 #include "confdefs.h"
4789 #include <sys/types.h>
4790 #include <sys/socket.h>
4791 #include <netinet/in.h>
4792 #include <netdb.h>
4793 #define BUFSIZE (sizeof(struct hostent)+10)
4794 int main() {
4795 struct hostent hent;struct hostent *rhent;
4796                         char buffer[BUFSIZE];
4797                         int bufsize=BUFSIZE;int h_errno;
4798                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4799                                 &rhent, &h_errno);
4800 ; return 0; }
4801 EOF
4802 if { (eval echo configure:4803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4803   rm -rf conftest*
4804   ol_cv_func_gethostbyname_r_nargs=6
4805 else
4806   echo "configure: failed program was:" >&5
4807   cat conftest.$ac_ext >&5
4808   rm -rf conftest*
4809   ol_cv_func_gethostbyname_r_nargs=0
4810 fi
4811 rm -f conftest*
4812 fi
4813 rm -f conftest*
4814 fi
4815
4816 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4817   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4818         cat >> confdefs.h <<EOF
4819 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4820 EOF
4821
4822   fi
4823
4824 else
4825         ol_cv_func_gethostbyname_r_nargs=0
4826 fi
4827  
4828 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4829         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4830 echo "configure:4831: checking number of arguments of gethostbyaddr_r" >&5
4831 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4832   echo $ac_n "(cached) $ac_c" 1>&6
4833 else
4834   cat > conftest.$ac_ext <<EOF
4835 #line 4836 "configure"
4836 #include "confdefs.h"
4837 #include <sys/types.h>
4838 #include <sys/socket.h>
4839 #include <netinet/in.h>
4840 #include <netdb.h>
4841 #define BUFSIZE (sizeof(struct hostent)+10)
4842 int main() {
4843 struct hostent hent; char buffer[BUFSIZE]; 
4844             struct in_addr add;
4845             size_t alen=sizeof(struct in_addr);
4846             int bufsize=BUFSIZE;int h_errno;
4847                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4848                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4849 ; return 0; }
4850 EOF
4851 if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4852   rm -rf conftest*
4853   ol_cv_func_gethostbyaddr_r_nargs=7
4854 else
4855   echo "configure: failed program was:" >&5
4856   cat conftest.$ac_ext >&5
4857   rm -rf conftest*
4858   cat > conftest.$ac_ext <<EOF
4859 #line 4860 "configure"
4860 #include "confdefs.h"
4861 #include <sys/types.h>
4862 #include <sys/socket.h>
4863 #include <netinet/in.h>
4864 #include <netdb.h>
4865 #define BUFSIZE (sizeof(struct hostent)+10)
4866 int main() {
4867 struct hostent hent;
4868                         struct hostent *rhent; char buffer[BUFSIZE]; 
4869                         struct in_addr add;
4870                         size_t alen=sizeof(struct in_addr);
4871                         int bufsize=BUFSIZE;int h_errno;
4872                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4873                                 alen, AF_INET, &hent, buffer, bufsize, 
4874                                 &rhent, &h_errno);
4875 ; return 0; }
4876 EOF
4877 if { (eval echo configure:4878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4878   rm -rf conftest*
4879   ol_cv_func_gethostbyaddr_r_nargs=8
4880 else
4881   echo "configure: failed program was:" >&5
4882   cat conftest.$ac_ext >&5
4883   rm -rf conftest*
4884   ol_cv_func_gethostbyaddr_r_nargs=0
4885 fi
4886 rm -f conftest*
4887 fi
4888 rm -f conftest*
4889 fi
4890
4891 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4892   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4893     cat >> confdefs.h <<EOF
4894 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4895 EOF
4896
4897   fi
4898
4899 else
4900         ol_cv_func_gethostbyaddr_r_nargs=0
4901 fi
4902
4903 if test "$ac_cv_func_ctime_r" = yes \
4904         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4905         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4906         -a "$ac_cv_func_gethostbyname_r" = yes \
4907         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4908         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4909         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4910         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4911         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4912         ; then
4913  
4914         cat >> confdefs.h <<\EOF
4915 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4916 EOF
4917
4918 fi
4919
4920 ol_link_threads=no
4921 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4922         -o $ol_with_threads = posix ; then
4923
4924         for ac_hdr in pthread.h sched.h
4925 do
4926 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4927 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4928 echo "configure:4929: checking for $ac_hdr" >&5
4929 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4930   echo $ac_n "(cached) $ac_c" 1>&6
4931 else
4932   cat > conftest.$ac_ext <<EOF
4933 #line 4934 "configure"
4934 #include "confdefs.h"
4935 #include <$ac_hdr>
4936 EOF
4937 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4938 { (eval echo configure:4939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4939 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4940 if test -z "$ac_err"; then
4941   rm -rf conftest*
4942   eval "ac_cv_header_$ac_safe=yes"
4943 else
4944   echo "$ac_err" >&5
4945   echo "configure: failed program was:" >&5
4946   cat conftest.$ac_ext >&5
4947   rm -rf conftest*
4948   eval "ac_cv_header_$ac_safe=no"
4949 fi
4950 rm -f conftest*
4951 fi
4952 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4953   echo "$ac_t""yes" 1>&6
4954     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4955   cat >> confdefs.h <<EOF
4956 #define $ac_tr_hdr 1
4957 EOF
4958  
4959 else
4960   echo "$ac_t""no" 1>&6
4961 fi
4962 done
4963
4964
4965         if test $ac_cv_header_pthread_h = yes ; then
4966                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4967 echo "configure:4968: checking POSIX thread version" >&5
4968 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4969   echo $ac_n "(cached) $ac_c" 1>&6
4970 else
4971   
4972         cat > conftest.$ac_ext <<EOF
4973 #line 4974 "configure"
4974 #include "confdefs.h"
4975
4976 #               include <pthread.h>
4977                 /* this check could be improved */
4978 #               ifdef PTHREAD_ONCE_INIT
4979                         pthread_version_final
4980 #               endif
4981         
4982 EOF
4983 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4984   egrep "pthread_version_final" >/dev/null 2>&1; then
4985   rm -rf conftest*
4986   ol_pthread_final=yes
4987 else
4988   rm -rf conftest*
4989   ol_pthread_final=no
4990 fi
4991 rm -f conftest*
4992
4993
4994         cat > conftest.$ac_ext <<EOF
4995 #line 4996 "configure"
4996 #include "confdefs.h"
4997
4998 #               include <pthread.h>
4999                 /* this check could be improved */
5000 #               ifdef pthread_once_init
5001                         pthread_version_draft4
5002 #               endif
5003         
5004 EOF
5005 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5006   egrep "pthread_version_draft4" >/dev/null 2>&1; then
5007   rm -rf conftest*
5008   ol_pthread_draft4=yes
5009 else
5010   rm -rf conftest*
5011   ol_pthread_draft4=no
5012 fi
5013 rm -f conftest*
5014
5015
5016         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
5017                 ol_cv_pthread_version=final
5018         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
5019                 ol_cv_pthread_version=draft4
5020         else
5021                 ol_cv_pthread_version=unknown
5022         fi
5023
5024 fi
5025
5026 echo "$ac_t""$ol_cv_pthread_version" 1>&6
5027
5028
5029                 if test $ol_cv_pthread_version = final ; then
5030                         cat >> confdefs.h <<\EOF
5031 #define HAVE_PTHREADS_FINAL 1
5032 EOF
5033
5034                 elif test $ol_cv_pthread_version = draft4 ; then
5035                         cat >> confdefs.h <<\EOF
5036 #define HAVE_PTHREADS_D4 1
5037 EOF
5038
5039                 else
5040                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
5041                 fi
5042
5043                 # consider threads found
5044                 ol_with_threads=found
5045
5046                 
5047         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
5048 echo "configure:5049: checking for LinuxThreads pthread.h" >&5
5049 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
5050   echo $ac_n "(cached) $ac_c" 1>&6
5051 else
5052   cat > conftest.$ac_ext <<EOF
5053 #line 5054 "configure"
5054 #include "confdefs.h"
5055 #include <pthread.h>
5056 EOF
5057 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5058   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
5059   rm -rf conftest*
5060   ol_cv_header_linux_threads=yes
5061 else
5062   rm -rf conftest*
5063   ol_cv_header_linux_threads=no
5064 fi
5065 rm -f conftest*
5066
5067                 
5068 fi
5069
5070 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
5071         if test $ol_cv_header_linux_threads = yes; then
5072                 cat >> confdefs.h <<\EOF
5073 #define HAVE_LINUX_THREADS 1
5074 EOF
5075
5076         fi
5077
5078
5079                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5080                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
5081 echo "configure:5082: checking for pthread_create in default libraries" >&5
5082                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
5083   echo $ac_n "(cached) $ac_c" 1>&6
5084 else
5085   
5086                 if test "$cross_compiling" = yes; then
5087                         ol_cv_pthread_create=yes
5088 else
5089   cat > conftest.$ac_ext <<EOF
5090 #line 5091 "configure"
5091 #include "confdefs.h"
5092
5093 #include <pthread.h>
5094 #ifndef NULL
5095 #define NULL (void*)0
5096 #endif
5097
5098 static void *task(p)
5099         void *p;
5100 {
5101         return (void *) (p == NULL);
5102 }
5103
5104 int main(argc, argv)
5105         int argc;
5106         char **argv;
5107 {
5108         pthread_t t;
5109         int status;
5110
5111         /* make sure pthread_create() isn't just a stub */
5112 #if HAVE_PTHREADS_D4
5113         status = pthread_create(&t, pthread_attr_default, task, NULL);
5114 #else
5115         status = pthread_create(&t, NULL, task, NULL);
5116 #endif
5117
5118         if( status ) return status;
5119
5120         /* make sure pthread_detach() isn't just a stub */
5121 #if HAVE_PTHREADS_D4
5122         status = pthread_detach( &t );
5123 #else
5124         status = pthread_detach( t );
5125 #endif
5126
5127         if( status ) return status;
5128
5129         return status;
5130 }
5131
5132 EOF
5133 if { (eval echo configure:5134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5134 then
5135   ol_cv_pthread_create=yes
5136 else
5137   echo "configure: failed program was:" >&5
5138   cat conftest.$ac_ext >&5
5139   rm -fr conftest*
5140   ol_cv_pthread_create=no
5141 fi
5142 rm -fr conftest*
5143 fi
5144
5145 fi
5146
5147                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
5148
5149                 if test $ol_cv_pthread_create != no ; then
5150                         ol_link_threads=posix
5151                         ol_link_pthreads=""
5152                 fi
5153                 
5154                 # Pthread try link: -mt (ol_cv_pthread_mt)
5155         if test "$ol_link_threads" = no ; then
5156                 # try -mt
5157                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
5158 echo "configure:5159: checking for pthread link with -mt" >&5
5159 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
5160   echo $ac_n "(cached) $ac_c" 1>&6
5161 else
5162   
5163                         # save the flags
5164                         ol_LIBS="$LIBS"
5165                         LIBS="-mt $LIBS"
5166
5167                         cat > conftest.$ac_ext <<EOF
5168 #line 5169 "configure"
5169 #include "confdefs.h"
5170
5171 #include <pthread.h>
5172 #ifndef NULL
5173 #define NULL (void*)0
5174 #endif
5175
5176 int main() {
5177
5178         pthread_t t;
5179
5180 #if HAVE_PTHREADS_D4
5181         pthread_create(&t, pthread_attr_default, NULL, NULL);
5182         pthread_detach( &t );
5183 #else
5184         pthread_create(&t, NULL, NULL, NULL);
5185         pthread_detach( t );
5186 #endif
5187 #ifdef HAVE_LINUX_THREADS
5188         pthread_kill_other_threads_np();
5189 #endif
5190
5191 ; return 0; }
5192 EOF
5193 if { (eval echo configure:5194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5194   rm -rf conftest*
5195   ol_cv_pthread_mt=yes
5196 else
5197   echo "configure: failed program was:" >&5
5198   cat conftest.$ac_ext >&5
5199   rm -rf conftest*
5200   ol_cv_pthread_mt=no
5201 fi
5202 rm -f conftest*
5203
5204                 # restore the LIBS
5205                 LIBS="$ol_LIBS"
5206                 
5207 fi
5208
5209 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
5210
5211                 if test $ol_cv_pthread_mt = yes ; then
5212                         ol_link_pthreads="-mt"
5213                         ol_link_threads=posix
5214                 fi
5215         fi
5216
5217                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
5218         if test "$ol_link_threads" = no ; then
5219                 # try -kthread
5220                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
5221 echo "configure:5222: checking for pthread link with -kthread" >&5
5222 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
5223   echo $ac_n "(cached) $ac_c" 1>&6
5224 else
5225   
5226                         # save the flags
5227                         ol_LIBS="$LIBS"
5228                         LIBS="-kthread $LIBS"
5229
5230                         cat > conftest.$ac_ext <<EOF
5231 #line 5232 "configure"
5232 #include "confdefs.h"
5233
5234 #include <pthread.h>
5235 #ifndef NULL
5236 #define NULL (void*)0
5237 #endif
5238
5239 int main() {
5240
5241         pthread_t t;
5242
5243 #if HAVE_PTHREADS_D4
5244         pthread_create(&t, pthread_attr_default, NULL, NULL);
5245         pthread_detach( &t );
5246 #else
5247         pthread_create(&t, NULL, NULL, NULL);
5248         pthread_detach( t );
5249 #endif
5250 #ifdef HAVE_LINUX_THREADS
5251         pthread_kill_other_threads_np();
5252 #endif
5253
5254 ; return 0; }
5255 EOF
5256 if { (eval echo configure:5257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5257   rm -rf conftest*
5258   ol_cv_pthread_kthread=yes
5259 else
5260   echo "configure: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   rm -rf conftest*
5263   ol_cv_pthread_kthread=no
5264 fi
5265 rm -f conftest*
5266
5267                 # restore the LIBS
5268                 LIBS="$ol_LIBS"
5269                 
5270 fi
5271
5272 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5273
5274                 if test $ol_cv_pthread_kthread = yes ; then
5275                         ol_link_pthreads="-kthread"
5276                         ol_link_threads=posix
5277                 fi
5278         fi
5279
5280                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5281         if test "$ol_link_threads" = no ; then
5282                 # try -pthread
5283                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5284 echo "configure:5285: checking for pthread link with -pthread" >&5
5285 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5286   echo $ac_n "(cached) $ac_c" 1>&6
5287 else
5288   
5289                         # save the flags
5290                         ol_LIBS="$LIBS"
5291                         LIBS="-pthread $LIBS"
5292
5293                         cat > conftest.$ac_ext <<EOF
5294 #line 5295 "configure"
5295 #include "confdefs.h"
5296
5297 #include <pthread.h>
5298 #ifndef NULL
5299 #define NULL (void*)0
5300 #endif
5301
5302 int main() {
5303
5304         pthread_t t;
5305
5306 #if HAVE_PTHREADS_D4
5307         pthread_create(&t, pthread_attr_default, NULL, NULL);
5308         pthread_detach( &t );
5309 #else
5310         pthread_create(&t, NULL, NULL, NULL);
5311         pthread_detach( t );
5312 #endif
5313 #ifdef HAVE_LINUX_THREADS
5314         pthread_kill_other_threads_np();
5315 #endif
5316
5317 ; return 0; }
5318 EOF
5319 if { (eval echo configure:5320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5320   rm -rf conftest*
5321   ol_cv_pthread_pthread=yes
5322 else
5323   echo "configure: failed program was:" >&5
5324   cat conftest.$ac_ext >&5
5325   rm -rf conftest*
5326   ol_cv_pthread_pthread=no
5327 fi
5328 rm -f conftest*
5329
5330                 # restore the LIBS
5331                 LIBS="$ol_LIBS"
5332                 
5333 fi
5334
5335 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5336
5337                 if test $ol_cv_pthread_pthread = yes ; then
5338                         ol_link_pthreads="-pthread"
5339                         ol_link_threads=posix
5340                 fi
5341         fi
5342
5343                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5344         if test "$ol_link_threads" = no ; then
5345                 # try -pthreads
5346                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5347 echo "configure:5348: checking for pthread link with -pthreads" >&5
5348 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5349   echo $ac_n "(cached) $ac_c" 1>&6
5350 else
5351   
5352                         # save the flags
5353                         ol_LIBS="$LIBS"
5354                         LIBS="-pthreads $LIBS"
5355
5356                         cat > conftest.$ac_ext <<EOF
5357 #line 5358 "configure"
5358 #include "confdefs.h"
5359
5360 #include <pthread.h>
5361 #ifndef NULL
5362 #define NULL (void*)0
5363 #endif
5364
5365 int main() {
5366
5367         pthread_t t;
5368
5369 #if HAVE_PTHREADS_D4
5370         pthread_create(&t, pthread_attr_default, NULL, NULL);
5371         pthread_detach( &t );
5372 #else
5373         pthread_create(&t, NULL, NULL, NULL);
5374         pthread_detach( t );
5375 #endif
5376 #ifdef HAVE_LINUX_THREADS
5377         pthread_kill_other_threads_np();
5378 #endif
5379
5380 ; return 0; }
5381 EOF
5382 if { (eval echo configure:5383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5383   rm -rf conftest*
5384   ol_cv_pthread_pthreads=yes
5385 else
5386   echo "configure: failed program was:" >&5
5387   cat conftest.$ac_ext >&5
5388   rm -rf conftest*
5389   ol_cv_pthread_pthreads=no
5390 fi
5391 rm -f conftest*
5392
5393                 # restore the LIBS
5394                 LIBS="$ol_LIBS"
5395                 
5396 fi
5397
5398 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5399
5400                 if test $ol_cv_pthread_pthreads = yes ; then
5401                         ol_link_pthreads="-pthreads"
5402                         ol_link_threads=posix
5403                 fi
5404         fi
5405
5406                 # Pthread try link: -thread (ol_cv_pthread_thread)
5407         if test "$ol_link_threads" = no ; then
5408                 # try -thread
5409                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5410 echo "configure:5411: checking for pthread link with -thread" >&5
5411 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5412   echo $ac_n "(cached) $ac_c" 1>&6
5413 else
5414   
5415                         # save the flags
5416                         ol_LIBS="$LIBS"
5417                         LIBS="-thread $LIBS"
5418
5419                         cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422
5423 #include <pthread.h>
5424 #ifndef NULL
5425 #define NULL (void*)0
5426 #endif
5427
5428 int main() {
5429
5430         pthread_t t;
5431
5432 #if HAVE_PTHREADS_D4
5433         pthread_create(&t, pthread_attr_default, NULL, NULL);
5434         pthread_detach( &t );
5435 #else
5436         pthread_create(&t, NULL, NULL, NULL);
5437         pthread_detach( t );
5438 #endif
5439 #ifdef HAVE_LINUX_THREADS
5440         pthread_kill_other_threads_np();
5441 #endif
5442
5443 ; return 0; }
5444 EOF
5445 if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5446   rm -rf conftest*
5447   ol_cv_pthread_thread=yes
5448 else
5449   echo "configure: failed program was:" >&5
5450   cat conftest.$ac_ext >&5
5451   rm -rf conftest*
5452   ol_cv_pthread_thread=no
5453 fi
5454 rm -f conftest*
5455
5456                 # restore the LIBS
5457                 LIBS="$ol_LIBS"
5458                 
5459 fi
5460
5461 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5462
5463                 if test $ol_cv_pthread_thread = yes ; then
5464                         ol_link_pthreads="-thread"
5465                         ol_link_threads=posix
5466                 fi
5467         fi
5468
5469
5470                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5471         if test "$ol_link_threads" = no ; then
5472                 # try -lpthread -lmach -lexc -lc_r
5473                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5474 echo "configure:5475: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5475 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5476   echo $ac_n "(cached) $ac_c" 1>&6
5477 else
5478   
5479                         # save the flags
5480                         ol_LIBS="$LIBS"
5481                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5482
5483                         cat > conftest.$ac_ext <<EOF
5484 #line 5485 "configure"
5485 #include "confdefs.h"
5486
5487 #include <pthread.h>
5488 #ifndef NULL
5489 #define NULL (void*)0
5490 #endif
5491
5492 int main() {
5493
5494         pthread_t t;
5495
5496 #if HAVE_PTHREADS_D4
5497         pthread_create(&t, pthread_attr_default, NULL, NULL);
5498         pthread_detach( &t );
5499 #else
5500         pthread_create(&t, NULL, NULL, NULL);
5501         pthread_detach( t );
5502 #endif
5503 #ifdef HAVE_LINUX_THREADS
5504         pthread_kill_other_threads_np();
5505 #endif
5506
5507 ; return 0; }
5508 EOF
5509 if { (eval echo configure:5510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5510   rm -rf conftest*
5511   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5512 else
5513   echo "configure: failed program was:" >&5
5514   cat conftest.$ac_ext >&5
5515   rm -rf conftest*
5516   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5517 fi
5518 rm -f conftest*
5519
5520                 # restore the LIBS
5521                 LIBS="$ol_LIBS"
5522                 
5523 fi
5524
5525 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5526
5527                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5528                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5529                         ol_link_threads=posix
5530                 fi
5531         fi
5532
5533                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5534         if test "$ol_link_threads" = no ; then
5535                 # try -lpthread -lmach -lexc
5536                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5537 echo "configure:5538: checking for pthread link with -lpthread -lmach -lexc" >&5
5538 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5539   echo $ac_n "(cached) $ac_c" 1>&6
5540 else
5541   
5542                         # save the flags
5543                         ol_LIBS="$LIBS"
5544                         LIBS="-lpthread -lmach -lexc $LIBS"
5545
5546                         cat > conftest.$ac_ext <<EOF
5547 #line 5548 "configure"
5548 #include "confdefs.h"
5549
5550 #include <pthread.h>
5551 #ifndef NULL
5552 #define NULL (void*)0
5553 #endif
5554
5555 int main() {
5556
5557         pthread_t t;
5558
5559 #if HAVE_PTHREADS_D4
5560         pthread_create(&t, pthread_attr_default, NULL, NULL);
5561         pthread_detach( &t );
5562 #else
5563         pthread_create(&t, NULL, NULL, NULL);
5564         pthread_detach( t );
5565 #endif
5566 #ifdef HAVE_LINUX_THREADS
5567         pthread_kill_other_threads_np();
5568 #endif
5569
5570 ; return 0; }
5571 EOF
5572 if { (eval echo configure:5573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5573   rm -rf conftest*
5574   ol_cv_pthread_lpthread_lmach_lexc=yes
5575 else
5576   echo "configure: failed program was:" >&5
5577   cat conftest.$ac_ext >&5
5578   rm -rf conftest*
5579   ol_cv_pthread_lpthread_lmach_lexc=no
5580 fi
5581 rm -f conftest*
5582
5583                 # restore the LIBS
5584                 LIBS="$ol_LIBS"
5585                 
5586 fi
5587
5588 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5589
5590                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5591                         ol_link_pthreads="-lpthread -lmach -lexc"
5592                         ol_link_threads=posix
5593                 fi
5594         fi
5595
5596
5597                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5598         if test "$ol_link_threads" = no ; then
5599                 # try -lpthread -Wl,-woff,85
5600                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5601 echo "configure:5602: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5602 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5603   echo $ac_n "(cached) $ac_c" 1>&6
5604 else
5605   
5606                         # save the flags
5607                         ol_LIBS="$LIBS"
5608                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5609
5610                         cat > conftest.$ac_ext <<EOF
5611 #line 5612 "configure"
5612 #include "confdefs.h"
5613
5614 #include <pthread.h>
5615 #ifndef NULL
5616 #define NULL (void*)0
5617 #endif
5618
5619 int main() {
5620
5621         pthread_t t;
5622
5623 #if HAVE_PTHREADS_D4
5624         pthread_create(&t, pthread_attr_default, NULL, NULL);
5625         pthread_detach( &t );
5626 #else
5627         pthread_create(&t, NULL, NULL, NULL);
5628         pthread_detach( t );
5629 #endif
5630 #ifdef HAVE_LINUX_THREADS
5631         pthread_kill_other_threads_np();
5632 #endif
5633
5634 ; return 0; }
5635 EOF
5636 if { (eval echo configure:5637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5637   rm -rf conftest*
5638   ol_cv_pthread_lib_lpthread_woff=yes
5639 else
5640   echo "configure: failed program was:" >&5
5641   cat conftest.$ac_ext >&5
5642   rm -rf conftest*
5643   ol_cv_pthread_lib_lpthread_woff=no
5644 fi
5645 rm -f conftest*
5646
5647                 # restore the LIBS
5648                 LIBS="$ol_LIBS"
5649                 
5650 fi
5651
5652 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5653
5654                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5655                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5656                         ol_link_threads=posix
5657                 fi
5658         fi
5659
5660
5661                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5662         if test "$ol_link_threads" = no ; then
5663                 # try -lpthread
5664                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5665 echo "configure:5666: checking for pthread link with -lpthread" >&5
5666 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5667   echo $ac_n "(cached) $ac_c" 1>&6
5668 else
5669   
5670                         # save the flags
5671                         ol_LIBS="$LIBS"
5672                         LIBS="-lpthread $LIBS"
5673
5674                         cat > conftest.$ac_ext <<EOF
5675 #line 5676 "configure"
5676 #include "confdefs.h"
5677
5678 #include <pthread.h>
5679 #ifndef NULL
5680 #define NULL (void*)0
5681 #endif
5682
5683 int main() {
5684
5685         pthread_t t;
5686
5687 #if HAVE_PTHREADS_D4
5688         pthread_create(&t, pthread_attr_default, NULL, NULL);
5689         pthread_detach( &t );
5690 #else
5691         pthread_create(&t, NULL, NULL, NULL);
5692         pthread_detach( t );
5693 #endif
5694 #ifdef HAVE_LINUX_THREADS
5695         pthread_kill_other_threads_np();
5696 #endif
5697
5698 ; return 0; }
5699 EOF
5700 if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5701   rm -rf conftest*
5702   ol_cv_pthread_lpthread=yes
5703 else
5704   echo "configure: failed program was:" >&5
5705   cat conftest.$ac_ext >&5
5706   rm -rf conftest*
5707   ol_cv_pthread_lpthread=no
5708 fi
5709 rm -f conftest*
5710
5711                 # restore the LIBS
5712                 LIBS="$ol_LIBS"
5713                 
5714 fi
5715
5716 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5717
5718                 if test $ol_cv_pthread_lpthread = yes ; then
5719                         ol_link_pthreads="-lpthread"
5720                         ol_link_threads=posix
5721                 fi
5722         fi
5723
5724                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5725         if test "$ol_link_threads" = no ; then
5726                 # try -lc_r
5727                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5728 echo "configure:5729: checking for pthread link with -lc_r" >&5
5729 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5730   echo $ac_n "(cached) $ac_c" 1>&6
5731 else
5732   
5733                         # save the flags
5734                         ol_LIBS="$LIBS"
5735                         LIBS="-lc_r $LIBS"
5736
5737                         cat > conftest.$ac_ext <<EOF
5738 #line 5739 "configure"
5739 #include "confdefs.h"
5740
5741 #include <pthread.h>
5742 #ifndef NULL
5743 #define NULL (void*)0
5744 #endif
5745
5746 int main() {
5747
5748         pthread_t t;
5749
5750 #if HAVE_PTHREADS_D4
5751         pthread_create(&t, pthread_attr_default, NULL, NULL);
5752         pthread_detach( &t );
5753 #else
5754         pthread_create(&t, NULL, NULL, NULL);
5755         pthread_detach( t );
5756 #endif
5757 #ifdef HAVE_LINUX_THREADS
5758         pthread_kill_other_threads_np();
5759 #endif
5760
5761 ; return 0; }
5762 EOF
5763 if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5764   rm -rf conftest*
5765   ol_cv_pthread_lc_r=yes
5766 else
5767   echo "configure: failed program was:" >&5
5768   cat conftest.$ac_ext >&5
5769   rm -rf conftest*
5770   ol_cv_pthread_lc_r=no
5771 fi
5772 rm -f conftest*
5773
5774                 # restore the LIBS
5775                 LIBS="$ol_LIBS"
5776                 
5777 fi
5778
5779 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5780
5781                 if test $ol_cv_pthread_lc_r = yes ; then
5782                         ol_link_pthreads="-lc_r"
5783                         ol_link_threads=posix
5784                 fi
5785         fi
5786
5787
5788                 # Pthread try link: -threads (ol_cv_pthread_threads)
5789         if test "$ol_link_threads" = no ; then
5790                 # try -threads
5791                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5792 echo "configure:5793: checking for pthread link with -threads" >&5
5793 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5794   echo $ac_n "(cached) $ac_c" 1>&6
5795 else
5796   
5797                         # save the flags
5798                         ol_LIBS="$LIBS"
5799                         LIBS="-threads $LIBS"
5800
5801                         cat > conftest.$ac_ext <<EOF
5802 #line 5803 "configure"
5803 #include "confdefs.h"
5804
5805 #include <pthread.h>
5806 #ifndef NULL
5807 #define NULL (void*)0
5808 #endif
5809
5810 int main() {
5811
5812         pthread_t t;
5813
5814 #if HAVE_PTHREADS_D4
5815         pthread_create(&t, pthread_attr_default, NULL, NULL);
5816         pthread_detach( &t );
5817 #else
5818         pthread_create(&t, NULL, NULL, NULL);
5819         pthread_detach( t );
5820 #endif
5821 #ifdef HAVE_LINUX_THREADS
5822         pthread_kill_other_threads_np();
5823 #endif
5824
5825 ; return 0; }
5826 EOF
5827 if { (eval echo configure:5828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5828   rm -rf conftest*
5829   ol_cv_pthread_threads=yes
5830 else
5831   echo "configure: failed program was:" >&5
5832   cat conftest.$ac_ext >&5
5833   rm -rf conftest*
5834   ol_cv_pthread_threads=no
5835 fi
5836 rm -f conftest*
5837
5838                 # restore the LIBS
5839                 LIBS="$ol_LIBS"
5840                 
5841 fi
5842
5843 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5844
5845                 if test $ol_cv_pthread_threads = yes ; then
5846                         ol_link_pthreads="-threads"
5847                         ol_link_threads=posix
5848                 fi
5849         fi
5850
5851
5852                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5853         if test "$ol_link_threads" = no ; then
5854                 # try -lpthreads -lmach -lexc -lc_r
5855                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5856 echo "configure:5857: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5857 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5858   echo $ac_n "(cached) $ac_c" 1>&6
5859 else
5860   
5861                         # save the flags
5862                         ol_LIBS="$LIBS"
5863                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5864
5865                         cat > conftest.$ac_ext <<EOF
5866 #line 5867 "configure"
5867 #include "confdefs.h"
5868
5869 #include <pthread.h>
5870 #ifndef NULL
5871 #define NULL (void*)0
5872 #endif
5873
5874 int main() {
5875
5876         pthread_t t;
5877
5878 #if HAVE_PTHREADS_D4
5879         pthread_create(&t, pthread_attr_default, NULL, NULL);
5880         pthread_detach( &t );
5881 #else
5882         pthread_create(&t, NULL, NULL, NULL);
5883         pthread_detach( t );
5884 #endif
5885 #ifdef HAVE_LINUX_THREADS
5886         pthread_kill_other_threads_np();
5887 #endif
5888
5889 ; return 0; }
5890 EOF
5891 if { (eval echo configure:5892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5892   rm -rf conftest*
5893   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5894 else
5895   echo "configure: failed program was:" >&5
5896   cat conftest.$ac_ext >&5
5897   rm -rf conftest*
5898   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5899 fi
5900 rm -f conftest*
5901
5902                 # restore the LIBS
5903                 LIBS="$ol_LIBS"
5904                 
5905 fi
5906
5907 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5908
5909                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5910                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5911                         ol_link_threads=posix
5912                 fi
5913         fi
5914
5915                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5916         if test "$ol_link_threads" = no ; then
5917                 # try -lpthreads -lmach -lexc
5918                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5919 echo "configure:5920: checking for pthread link with -lpthreads -lmach -lexc" >&5
5920 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5921   echo $ac_n "(cached) $ac_c" 1>&6
5922 else
5923   
5924                         # save the flags
5925                         ol_LIBS="$LIBS"
5926                         LIBS="-lpthreads -lmach -lexc $LIBS"
5927
5928                         cat > conftest.$ac_ext <<EOF
5929 #line 5930 "configure"
5930 #include "confdefs.h"
5931
5932 #include <pthread.h>
5933 #ifndef NULL
5934 #define NULL (void*)0
5935 #endif
5936
5937 int main() {
5938
5939         pthread_t t;
5940
5941 #if HAVE_PTHREADS_D4
5942         pthread_create(&t, pthread_attr_default, NULL, NULL);
5943         pthread_detach( &t );
5944 #else
5945         pthread_create(&t, NULL, NULL, NULL);
5946         pthread_detach( t );
5947 #endif
5948 #ifdef HAVE_LINUX_THREADS
5949         pthread_kill_other_threads_np();
5950 #endif
5951
5952 ; return 0; }
5953 EOF
5954 if { (eval echo configure:5955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5955   rm -rf conftest*
5956   ol_cv_pthread_lpthreads_lmach_lexc=yes
5957 else
5958   echo "configure: failed program was:" >&5
5959   cat conftest.$ac_ext >&5
5960   rm -rf conftest*
5961   ol_cv_pthread_lpthreads_lmach_lexc=no
5962 fi
5963 rm -f conftest*
5964
5965                 # restore the LIBS
5966                 LIBS="$ol_LIBS"
5967                 
5968 fi
5969
5970 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5971
5972                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5973                         ol_link_pthreads="-lpthreads -lmach -lexc"
5974                         ol_link_threads=posix
5975                 fi
5976         fi
5977
5978                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5979         if test "$ol_link_threads" = no ; then
5980                 # try -lpthreads -lexc
5981                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5982 echo "configure:5983: checking for pthread link with -lpthreads -lexc" >&5
5983 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5984   echo $ac_n "(cached) $ac_c" 1>&6
5985 else
5986   
5987                         # save the flags
5988                         ol_LIBS="$LIBS"
5989                         LIBS="-lpthreads -lexc $LIBS"
5990
5991                         cat > conftest.$ac_ext <<EOF
5992 #line 5993 "configure"
5993 #include "confdefs.h"
5994
5995 #include <pthread.h>
5996 #ifndef NULL
5997 #define NULL (void*)0
5998 #endif
5999
6000 int main() {
6001
6002         pthread_t t;
6003
6004 #if HAVE_PTHREADS_D4
6005         pthread_create(&t, pthread_attr_default, NULL, NULL);
6006         pthread_detach( &t );
6007 #else
6008         pthread_create(&t, NULL, NULL, NULL);
6009         pthread_detach( t );
6010 #endif
6011 #ifdef HAVE_LINUX_THREADS
6012         pthread_kill_other_threads_np();
6013 #endif
6014
6015 ; return 0; }
6016 EOF
6017 if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6018   rm -rf conftest*
6019   ol_cv_pthread_lpthreads_lexc=yes
6020 else
6021   echo "configure: failed program was:" >&5
6022   cat conftest.$ac_ext >&5
6023   rm -rf conftest*
6024   ol_cv_pthread_lpthreads_lexc=no
6025 fi
6026 rm -f conftest*
6027
6028                 # restore the LIBS
6029                 LIBS="$ol_LIBS"
6030                 
6031 fi
6032
6033 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
6034
6035                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
6036                         ol_link_pthreads="-lpthreads -lexc"
6037                         ol_link_threads=posix
6038                 fi
6039         fi
6040
6041
6042                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
6043         if test "$ol_link_threads" = no ; then
6044                 # try -lpthreads
6045                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
6046 echo "configure:6047: checking for pthread link with -lpthreads" >&5
6047 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
6048   echo $ac_n "(cached) $ac_c" 1>&6
6049 else
6050   
6051                         # save the flags
6052                         ol_LIBS="$LIBS"
6053                         LIBS="-lpthreads $LIBS"
6054
6055                         cat > conftest.$ac_ext <<EOF
6056 #line 6057 "configure"
6057 #include "confdefs.h"
6058
6059 #include <pthread.h>
6060 #ifndef NULL
6061 #define NULL (void*)0
6062 #endif
6063
6064 int main() {
6065
6066         pthread_t t;
6067
6068 #if HAVE_PTHREADS_D4
6069         pthread_create(&t, pthread_attr_default, NULL, NULL);
6070         pthread_detach( &t );
6071 #else
6072         pthread_create(&t, NULL, NULL, NULL);
6073         pthread_detach( t );
6074 #endif
6075 #ifdef HAVE_LINUX_THREADS
6076         pthread_kill_other_threads_np();
6077 #endif
6078
6079 ; return 0; }
6080 EOF
6081 if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6082   rm -rf conftest*
6083   ol_cv_pthread_lib_lpthreads=yes
6084 else
6085   echo "configure: failed program was:" >&5
6086   cat conftest.$ac_ext >&5
6087   rm -rf conftest*
6088   ol_cv_pthread_lib_lpthreads=no
6089 fi
6090 rm -f conftest*
6091
6092                 # restore the LIBS
6093                 LIBS="$ol_LIBS"
6094                 
6095 fi
6096
6097 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
6098
6099                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
6100                         ol_link_pthreads="-lpthreads"
6101                         ol_link_threads=posix
6102                 fi
6103         fi
6104
6105
6106                 if test $ol_link_threads != no ; then
6107                         cat >> confdefs.h <<\EOF
6108 #define HAVE_PTHREADS 1
6109 EOF
6110
6111
6112                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
6113
6114                                                 save_CPPFLAGS="$CPPFLAGS"
6115                         save_LIBS="$LIBS"
6116                         LIBS="$LTHREAD_LIBS $LIBS"
6117
6118                                                                                                 for ac_func in sched_yield pthread_yield
6119 do
6120 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6121 echo "configure:6122: checking for $ac_func" >&5
6122 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6123   echo $ac_n "(cached) $ac_c" 1>&6
6124 else
6125   cat > conftest.$ac_ext <<EOF
6126 #line 6127 "configure"
6127 #include "confdefs.h"
6128 /* System header to define __stub macros and hopefully few prototypes,
6129     which can conflict with char $ac_func(); below.  */
6130 #include <assert.h>
6131 /* Override any gcc2 internal prototype to avoid an error.  */
6132 /* We use char because int might match the return type of a gcc2
6133     builtin and then its argument prototype would still apply.  */
6134 char $ac_func();
6135
6136 int main() {
6137
6138 /* The GNU C library defines this for functions which it implements
6139     to always fail with ENOSYS.  Some functions are actually named
6140     something starting with __ and the normal name is an alias.  */
6141 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6142 choke me
6143 #else
6144 $ac_func();
6145 #endif
6146
6147 ; return 0; }
6148 EOF
6149 if { (eval echo configure:6150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6150   rm -rf conftest*
6151   eval "ac_cv_func_$ac_func=yes"
6152 else
6153   echo "configure: failed program was:" >&5
6154   cat conftest.$ac_ext >&5
6155   rm -rf conftest*
6156   eval "ac_cv_func_$ac_func=no"
6157 fi
6158 rm -f conftest*
6159 fi
6160
6161 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6162   echo "$ac_t""yes" 1>&6
6163     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6164   cat >> confdefs.h <<EOF
6165 #define $ac_tr_func 1
6166 EOF
6167  
6168 else
6169   echo "$ac_t""no" 1>&6
6170 fi
6171 done
6172
6173
6174                         if test $ac_cv_func_sched_yield = no -a \
6175                                 $ac_cv_func_pthread_yield = no ; then
6176                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
6177 echo "configure:6178: checking for sched_yield in -lrt" >&5
6178 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
6179 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6180   echo $ac_n "(cached) $ac_c" 1>&6
6181 else
6182   ac_save_LIBS="$LIBS"
6183 LIBS="-lrt  $LIBS"
6184 cat > conftest.$ac_ext <<EOF
6185 #line 6186 "configure"
6186 #include "confdefs.h"
6187 /* Override any gcc2 internal prototype to avoid an error.  */
6188 /* We use char because int might match the return type of a gcc2
6189     builtin and then its argument prototype would still apply.  */
6190 char sched_yield();
6191
6192 int main() {
6193 sched_yield()
6194 ; return 0; }
6195 EOF
6196 if { (eval echo configure:6197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6197   rm -rf conftest*
6198   eval "ac_cv_lib_$ac_lib_var=yes"
6199 else
6200   echo "configure: failed program was:" >&5
6201   cat conftest.$ac_ext >&5
6202   rm -rf conftest*
6203   eval "ac_cv_lib_$ac_lib_var=no"
6204 fi
6205 rm -f conftest*
6206 LIBS="$ac_save_LIBS"
6207
6208 fi
6209 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6210   echo "$ac_t""yes" 1>&6
6211   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
6212                                         cat >> confdefs.h <<\EOF
6213 #define HAVE_SCHED_YIELD 1
6214 EOF
6215
6216                                         ac_cv_func_sched_yield=yes
6217 else
6218   echo "$ac_t""no" 1>&6
6219 ac_cv_func_sched_yield=no
6220 fi
6221
6222                         fi
6223                         if test $ac_cv_func_sched_yield = no -a \
6224                                 $ac_cv_func_pthread_yield = no ; then
6225                                                                                                 for ac_func in thr_yield
6226 do
6227 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6228 echo "configure:6229: checking for $ac_func" >&5
6229 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6230   echo $ac_n "(cached) $ac_c" 1>&6
6231 else
6232   cat > conftest.$ac_ext <<EOF
6233 #line 6234 "configure"
6234 #include "confdefs.h"
6235 /* System header to define __stub macros and hopefully few prototypes,
6236     which can conflict with char $ac_func(); below.  */
6237 #include <assert.h>
6238 /* Override any gcc2 internal prototype to avoid an error.  */
6239 /* We use char because int might match the return type of a gcc2
6240     builtin and then its argument prototype would still apply.  */
6241 char $ac_func();
6242
6243 int main() {
6244
6245 /* The GNU C library defines this for functions which it implements
6246     to always fail with ENOSYS.  Some functions are actually named
6247     something starting with __ and the normal name is an alias.  */
6248 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6249 choke me
6250 #else
6251 $ac_func();
6252 #endif
6253
6254 ; return 0; }
6255 EOF
6256 if { (eval echo configure:6257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6257   rm -rf conftest*
6258   eval "ac_cv_func_$ac_func=yes"
6259 else
6260   echo "configure: failed program was:" >&5
6261   cat conftest.$ac_ext >&5
6262   rm -rf conftest*
6263   eval "ac_cv_func_$ac_func=no"
6264 fi
6265 rm -f conftest*
6266 fi
6267
6268 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6269   echo "$ac_t""yes" 1>&6
6270     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6271   cat >> confdefs.h <<EOF
6272 #define $ac_tr_func 1
6273 EOF
6274  
6275 else
6276   echo "$ac_t""no" 1>&6
6277 fi
6278 done
6279
6280                         fi
6281                         if test $ac_cv_func_sched_yield = no -a \
6282                                 $ac_cv_func_pthread_yield = no -a \
6283                                 "$ac_cv_func_thr_yield" = no ; then
6284                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6285                         fi
6286
6287                                                 for ac_func in pthread_kill
6288 do
6289 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6290 echo "configure:6291: checking for $ac_func" >&5
6291 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6292   echo $ac_n "(cached) $ac_c" 1>&6
6293 else
6294   cat > conftest.$ac_ext <<EOF
6295 #line 6296 "configure"
6296 #include "confdefs.h"
6297 /* System header to define __stub macros and hopefully few prototypes,
6298     which can conflict with char $ac_func(); below.  */
6299 #include <assert.h>
6300 /* Override any gcc2 internal prototype to avoid an error.  */
6301 /* We use char because int might match the return type of a gcc2
6302     builtin and then its argument prototype would still apply.  */
6303 char $ac_func();
6304
6305 int main() {
6306
6307 /* The GNU C library defines this for functions which it implements
6308     to always fail with ENOSYS.  Some functions are actually named
6309     something starting with __ and the normal name is an alias.  */
6310 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6311 choke me
6312 #else
6313 $ac_func();
6314 #endif
6315
6316 ; return 0; }
6317 EOF
6318 if { (eval echo configure:6319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6319   rm -rf conftest*
6320   eval "ac_cv_func_$ac_func=yes"
6321 else
6322   echo "configure: failed program was:" >&5
6323   cat conftest.$ac_ext >&5
6324   rm -rf conftest*
6325   eval "ac_cv_func_$ac_func=no"
6326 fi
6327 rm -f conftest*
6328 fi
6329
6330 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6331   echo "$ac_t""yes" 1>&6
6332     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6333   cat >> confdefs.h <<EOF
6334 #define $ac_tr_func 1
6335 EOF
6336  
6337 else
6338   echo "$ac_t""no" 1>&6
6339 fi
6340 done
6341
6342
6343                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6344 echo "configure:6345: checking for pthread_detach with <pthread.h>" >&5
6345 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6346   echo $ac_n "(cached) $ac_c" 1>&6
6347 else
6348   
6349                                                                 cat > conftest.$ac_ext <<EOF
6350 #line 6351 "configure"
6351 #include "confdefs.h"
6352
6353 #include <pthread.h>
6354 #ifndef NULL
6355 #define NULL (void*)0
6356 #endif
6357
6358 int main() {
6359 pthread_detach(NULL);
6360 ; return 0; }
6361 EOF
6362 if { (eval echo configure:6363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6363   rm -rf conftest*
6364   ol_cv_func_pthread_detach=yes
6365 else
6366   echo "configure: failed program was:" >&5
6367   cat conftest.$ac_ext >&5
6368   rm -rf conftest*
6369   ol_cv_func_pthread_detach=no
6370 fi
6371 rm -f conftest*
6372                         
6373 fi
6374
6375 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6376
6377                         if test $ol_cv_func_pthread_detach = no ; then
6378                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6379                         fi
6380
6381                         cat >> confdefs.h <<\EOF
6382 #define HAVE_PTHREAD_DETACH 1
6383 EOF
6384
6385
6386                                                 for ac_func in \
6387                                 pthread_setconcurrency \
6388                                 pthread_getconcurrency \
6389                                 thr_setconcurrency \
6390                                 thr_getconcurrency \
6391                         
6392 do
6393 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6394 echo "configure:6395: checking for $ac_func" >&5
6395 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6396   echo $ac_n "(cached) $ac_c" 1>&6
6397 else
6398   cat > conftest.$ac_ext <<EOF
6399 #line 6400 "configure"
6400 #include "confdefs.h"
6401 /* System header to define __stub macros and hopefully few prototypes,
6402     which can conflict with char $ac_func(); below.  */
6403 #include <assert.h>
6404 /* Override any gcc2 internal prototype to avoid an error.  */
6405 /* We use char because int might match the return type of a gcc2
6406     builtin and then its argument prototype would still apply.  */
6407 char $ac_func();
6408
6409 int main() {
6410
6411 /* The GNU C library defines this for functions which it implements
6412     to always fail with ENOSYS.  Some functions are actually named
6413     something starting with __ and the normal name is an alias.  */
6414 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6415 choke me
6416 #else
6417 $ac_func();
6418 #endif
6419
6420 ; return 0; }
6421 EOF
6422 if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6423   rm -rf conftest*
6424   eval "ac_cv_func_$ac_func=yes"
6425 else
6426   echo "configure: failed program was:" >&5
6427   cat conftest.$ac_ext >&5
6428   rm -rf conftest*
6429   eval "ac_cv_func_$ac_func=no"
6430 fi
6431 rm -f conftest*
6432 fi
6433
6434 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6435   echo "$ac_t""yes" 1>&6
6436     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6437   cat >> confdefs.h <<EOF
6438 #define $ac_tr_func 1
6439 EOF
6440  
6441 else
6442   echo "$ac_t""no" 1>&6
6443 fi
6444 done
6445
6446
6447                         
6448         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6449 echo "configure:6450: checking for pthread_kill_other_threads_np" >&5
6450 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6451   echo $ac_n "(cached) $ac_c" 1>&6
6452 else
6453   cat > conftest.$ac_ext <<EOF
6454 #line 6455 "configure"
6455 #include "confdefs.h"
6456 /* System header to define __stub macros and hopefully few prototypes,
6457     which can conflict with char pthread_kill_other_threads_np(); below.  */
6458 #include <assert.h>
6459 /* Override any gcc2 internal prototype to avoid an error.  */
6460 /* We use char because int might match the return type of a gcc2
6461     builtin and then its argument prototype would still apply.  */
6462 char pthread_kill_other_threads_np();
6463
6464 int main() {
6465
6466 /* The GNU C library defines this for functions which it implements
6467     to always fail with ENOSYS.  Some functions are actually named
6468     something starting with __ and the normal name is an alias.  */
6469 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6470 choke me
6471 #else
6472 pthread_kill_other_threads_np();
6473 #endif
6474
6475 ; return 0; }
6476 EOF
6477 if { (eval echo configure:6478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6478   rm -rf conftest*
6479   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6480 else
6481   echo "configure: failed program was:" >&5
6482   cat conftest.$ac_ext >&5
6483   rm -rf conftest*
6484   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6485 fi
6486 rm -f conftest*
6487 fi
6488
6489 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6490   echo "$ac_t""yes" 1>&6
6491   :
6492 else
6493   echo "$ac_t""no" 1>&6
6494 fi
6495
6496         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6497 echo "configure:6498: checking for LinuxThreads implementation" >&5
6498 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6499   echo $ac_n "(cached) $ac_c" 1>&6
6500 else
6501   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6502 fi
6503
6504 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6505
6506                         
6507         
6508         
6509         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6510 echo "configure:6511: checking for LinuxThreads consistency" >&5
6511 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6512   echo $ac_n "(cached) $ac_c" 1>&6
6513 else
6514   
6515                 if test $ol_cv_header_linux_threads = yes -a \
6516                         $ol_cv_sys_linux_threads = yes; then
6517                         ol_cv_linux_threads=yes
6518                 elif test $ol_cv_header_linux_threads = no -a \
6519                         $ol_cv_sys_linux_threads = no; then
6520                         ol_cv_linux_threads=no
6521                 else
6522                         ol_cv_linux_threads=error
6523                 fi
6524         
6525 fi
6526
6527 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6528
6529
6530                         if test $ol_cv_linux_threads = error; then
6531                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6532                         fi
6533
6534                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6535 echo "configure:6536: checking if pthread_create() works" >&5
6536                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6537   echo $ac_n "(cached) $ac_c" 1>&6
6538 else
6539   
6540                         if test "$cross_compiling" = yes; then
6541                                 ol_cv_pthread_create_works=yes
6542 else
6543   cat > conftest.$ac_ext <<EOF
6544 #line 6545 "configure"
6545 #include "confdefs.h"
6546
6547 #include <pthread.h>
6548 #ifndef NULL
6549 #define NULL (void*)0
6550 #endif
6551
6552 static void *task(p)
6553         void *p;
6554 {
6555         return (void *) (p == NULL);
6556 }
6557
6558 int main(argc, argv)
6559         int argc;
6560         char **argv;
6561 {
6562         pthread_t t;
6563 #if HAVE_PTHREADS_D4
6564         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6565 #else
6566         exit(pthread_create(&t, NULL, task, NULL));
6567 #endif
6568 }
6569
6570 EOF
6571 if { (eval echo configure:6572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6572 then
6573   ol_cv_pthread_create_works=yes
6574 else
6575   echo "configure: failed program was:" >&5
6576   cat conftest.$ac_ext >&5
6577   rm -fr conftest*
6578   ol_cv_pthread_create_works=no
6579 fi
6580 rm -fr conftest*
6581 fi
6582
6583 fi
6584
6585                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6586
6587                         if test $ol_cv_pthread_create_works = no ; then
6588                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6589                         fi
6590
6591                                                 if test $ol_with_yielding_select = auto ; then
6592                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6593 echo "configure:6594: checking if select yields when using pthreads" >&5
6594                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6595   echo $ac_n "(cached) $ac_c" 1>&6
6596 else
6597   
6598                                 if test "$cross_compiling" = yes; then
6599   
6600                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6601 else
6602   cat > conftest.$ac_ext <<EOF
6603 #line 6604 "configure"
6604 #include "confdefs.h"
6605
6606 #include <sys/types.h>
6607 #include <sys/time.h>
6608 #include <unistd.h>
6609 #include <pthread.h>
6610 #ifndef NULL
6611 #define NULL (void*) 0
6612 #endif
6613
6614 static int fildes[2];
6615
6616 static void *task(p)
6617         void *p;
6618 {
6619         int i;
6620         struct timeval tv;
6621
6622         fd_set rfds;
6623
6624         tv.tv_sec=10;
6625         tv.tv_usec=0;
6626
6627         FD_ZERO(&rfds);
6628         FD_SET(fildes[0], &rfds);
6629
6630         /* we're not interested in any fds */
6631         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6632
6633         if(i < 0) {
6634                 perror("select");
6635                 exit(10);
6636         }
6637
6638         exit(0); /* if we exit here, the select blocked the whole process */
6639 }
6640
6641 int main(argc, argv)
6642         int argc;
6643         char **argv;
6644 {
6645         pthread_t t;
6646
6647         /* create a pipe to select */
6648         if(pipe(&fildes[0])) {
6649                 perror("select");
6650                 exit(1);
6651         }
6652
6653 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6654         (void) pthread_setconcurrency(2);
6655 #else
6656 #ifdef HAVE_THR_SETCONCURRENCY
6657         /* Set Solaris LWP concurrency to 2 */
6658         thr_setconcurrency(2);
6659 #endif
6660 #endif
6661
6662 #if HAVE_PTHREADS_D4
6663         pthread_create(&t, pthread_attr_default, task, NULL);
6664 #else
6665         pthread_create(&t, NULL, task, NULL);
6666 #endif
6667
6668 #if HAVE_SCHED_YIELD
6669         sched_yield();  /* make sure task runs first */
6670 #else
6671 #ifdef HAVE_PTHREAD_YIELD
6672         pthread_yield();        /* make sure task runs first */
6673 #endif
6674 #endif
6675
6676         exit(2);
6677 }
6678 EOF
6679 if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6680 then
6681   ol_cv_pthread_select_yields=no
6682 else
6683   echo "configure: failed program was:" >&5
6684   cat conftest.$ac_ext >&5
6685   rm -fr conftest*
6686   ol_cv_pthread_select_yields=yes
6687 fi
6688 rm -fr conftest*
6689 fi
6690
6691 fi
6692
6693                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6694
6695                                 if test $ol_cv_pthread_select_yields = yes ; then
6696                                         ol_with_yielding_select=yes
6697                                 fi
6698                         fi
6699
6700                                                 CPPFLAGS="$save_CPPFLAGS"
6701                         LIBS="$save_LIBS"
6702                 else
6703                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6704                 fi
6705         fi
6706
6707         if test $ol_with_threads = posix ; then
6708                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6709         fi
6710 fi
6711
6712 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6713         -o $ol_with_threads = mach ; then
6714
6715                 for ac_hdr in mach/cthreads.h
6716 do
6717 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6718 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6719 echo "configure:6720: checking for $ac_hdr" >&5
6720 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6721   echo $ac_n "(cached) $ac_c" 1>&6
6722 else
6723   cat > conftest.$ac_ext <<EOF
6724 #line 6725 "configure"
6725 #include "confdefs.h"
6726 #include <$ac_hdr>
6727 EOF
6728 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6729 { (eval echo configure:6730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6730 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6731 if test -z "$ac_err"; then
6732   rm -rf conftest*
6733   eval "ac_cv_header_$ac_safe=yes"
6734 else
6735   echo "$ac_err" >&5
6736   echo "configure: failed program was:" >&5
6737   cat conftest.$ac_ext >&5
6738   rm -rf conftest*
6739   eval "ac_cv_header_$ac_safe=no"
6740 fi
6741 rm -f conftest*
6742 fi
6743 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6744   echo "$ac_t""yes" 1>&6
6745     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6746   cat >> confdefs.h <<EOF
6747 #define $ac_tr_hdr 1
6748 EOF
6749  
6750 else
6751   echo "$ac_t""no" 1>&6
6752 fi
6753 done
6754
6755         if test $ac_cv_header_mach_cthreads_h = yes ; then
6756                 ol_with_threads=found
6757
6758                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6759 echo "configure:6760: checking for cthread_fork" >&5
6760 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6761   echo $ac_n "(cached) $ac_c" 1>&6
6762 else
6763   cat > conftest.$ac_ext <<EOF
6764 #line 6765 "configure"
6765 #include "confdefs.h"
6766 /* System header to define __stub macros and hopefully few prototypes,
6767     which can conflict with char cthread_fork(); below.  */
6768 #include <assert.h>
6769 /* Override any gcc2 internal prototype to avoid an error.  */
6770 /* We use char because int might match the return type of a gcc2
6771     builtin and then its argument prototype would still apply.  */
6772 char cthread_fork();
6773
6774 int main() {
6775
6776 /* The GNU C library defines this for functions which it implements
6777     to always fail with ENOSYS.  Some functions are actually named
6778     something starting with __ and the normal name is an alias.  */
6779 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6780 choke me
6781 #else
6782 cthread_fork();
6783 #endif
6784
6785 ; return 0; }
6786 EOF
6787 if { (eval echo configure:6788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6788   rm -rf conftest*
6789   eval "ac_cv_func_cthread_fork=yes"
6790 else
6791   echo "configure: failed program was:" >&5
6792   cat conftest.$ac_ext >&5
6793   rm -rf conftest*
6794   eval "ac_cv_func_cthread_fork=no"
6795 fi
6796 rm -f conftest*
6797 fi
6798
6799 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6800   echo "$ac_t""yes" 1>&6
6801   ol_link_threads=yes
6802 else
6803   echo "$ac_t""no" 1>&6
6804 fi
6805
6806
6807                 if test $ol_link_threads = no ; then
6808                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6809 echo "configure:6810: checking for cthread_fork with -all_load" >&5
6810 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6811   echo $ac_n "(cached) $ac_c" 1>&6
6812 else
6813   
6814                                                                 save_LIBS="$LIBS"
6815                                 LIBS="-all_load $LIBS"
6816                                 cat > conftest.$ac_ext <<EOF
6817 #line 6818 "configure"
6818 #include "confdefs.h"
6819 #include <mach/cthreads.h>
6820 int main() {
6821
6822                                         cthread_fork((void *)0, (void *)0);
6823                                         
6824 ; return 0; }
6825 EOF
6826 if { (eval echo configure:6827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6827   rm -rf conftest*
6828   ol_cv_cthread_all_load=yes
6829 else
6830   echo "configure: failed program was:" >&5
6831   cat conftest.$ac_ext >&5
6832   rm -rf conftest*
6833   ol_cv_cthread_all_load=no
6834 fi
6835 rm -f conftest*
6836                                                                 LIBS="$save_LIBS"
6837                         
6838 fi
6839
6840 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6841
6842                         if test $ol_cv_cthread_all_load = yes ; then
6843                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6844                                 ol_link_threads=mach
6845                         fi
6846                 fi
6847
6848                 if test $ol_link_threads != no ; then
6849                         : check for cthread specific functionality here
6850                         cat >> confdefs.h <<\EOF
6851 #define HAVE_MACH_CTHREADS 1
6852 EOF
6853
6854                 else
6855                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6856                 fi
6857         fi
6858
6859         if test $ol_with_threads = mach ; then
6860                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6861         fi
6862 fi
6863
6864 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6865         -o $ol_with_threads = lwp ; then
6866
6867                 for ac_hdr in thread.h synch.h
6868 do
6869 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6870 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6871 echo "configure:6872: checking for $ac_hdr" >&5
6872 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6873   echo $ac_n "(cached) $ac_c" 1>&6
6874 else
6875   cat > conftest.$ac_ext <<EOF
6876 #line 6877 "configure"
6877 #include "confdefs.h"
6878 #include <$ac_hdr>
6879 EOF
6880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6881 { (eval echo configure:6882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6883 if test -z "$ac_err"; then
6884   rm -rf conftest*
6885   eval "ac_cv_header_$ac_safe=yes"
6886 else
6887   echo "$ac_err" >&5
6888   echo "configure: failed program was:" >&5
6889   cat conftest.$ac_ext >&5
6890   rm -rf conftest*
6891   eval "ac_cv_header_$ac_safe=no"
6892 fi
6893 rm -f conftest*
6894 fi
6895 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6896   echo "$ac_t""yes" 1>&6
6897     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6898   cat >> confdefs.h <<EOF
6899 #define $ac_tr_hdr 1
6900 EOF
6901  
6902 else
6903   echo "$ac_t""no" 1>&6
6904 fi
6905 done
6906
6907         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6908                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6909 echo "configure:6910: checking for thr_create in -lthread" >&5
6910 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6911 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6912   echo $ac_n "(cached) $ac_c" 1>&6
6913 else
6914   ac_save_LIBS="$LIBS"
6915 LIBS="-lthread  $LIBS"
6916 cat > conftest.$ac_ext <<EOF
6917 #line 6918 "configure"
6918 #include "confdefs.h"
6919 /* Override any gcc2 internal prototype to avoid an error.  */
6920 /* We use char because int might match the return type of a gcc2
6921     builtin and then its argument prototype would still apply.  */
6922 char thr_create();
6923
6924 int main() {
6925 thr_create()
6926 ; return 0; }
6927 EOF
6928 if { (eval echo configure:6929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6929   rm -rf conftest*
6930   eval "ac_cv_lib_$ac_lib_var=yes"
6931 else
6932   echo "configure: failed program was:" >&5
6933   cat conftest.$ac_ext >&5
6934   rm -rf conftest*
6935   eval "ac_cv_lib_$ac_lib_var=no"
6936 fi
6937 rm -f conftest*
6938 LIBS="$ac_save_LIBS"
6939
6940 fi
6941 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6942   echo "$ac_t""yes" 1>&6
6943   have_thr=yes
6944 else
6945   echo "$ac_t""no" 1>&6
6946 have_thr=no
6947 fi
6948
6949
6950                 if test $have_thr = yes ; then
6951                         cat >> confdefs.h <<\EOF
6952 #define HAVE_THR 1
6953 EOF
6954
6955                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6956                         ol_link_threads=thr
6957
6958                         if test $ol_with_yielding_select = auto ; then
6959                                 ol_with_yielding_select=yes
6960                         fi
6961
6962                                                 for ac_func in \
6963                                 thr_setconcurrency \
6964                                 thr_getconcurrency \
6965                         
6966 do
6967 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6968 echo "configure:6969: checking for $ac_func" >&5
6969 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6970   echo $ac_n "(cached) $ac_c" 1>&6
6971 else
6972   cat > conftest.$ac_ext <<EOF
6973 #line 6974 "configure"
6974 #include "confdefs.h"
6975 /* System header to define __stub macros and hopefully few prototypes,
6976     which can conflict with char $ac_func(); below.  */
6977 #include <assert.h>
6978 /* Override any gcc2 internal prototype to avoid an error.  */
6979 /* We use char because int might match the return type of a gcc2
6980     builtin and then its argument prototype would still apply.  */
6981 char $ac_func();
6982
6983 int main() {
6984
6985 /* The GNU C library defines this for functions which it implements
6986     to always fail with ENOSYS.  Some functions are actually named
6987     something starting with __ and the normal name is an alias.  */
6988 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6989 choke me
6990 #else
6991 $ac_func();
6992 #endif
6993
6994 ; return 0; }
6995 EOF
6996 if { (eval echo configure:6997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6997   rm -rf conftest*
6998   eval "ac_cv_func_$ac_func=yes"
6999 else
7000   echo "configure: failed program was:" >&5
7001   cat conftest.$ac_ext >&5
7002   rm -rf conftest*
7003   eval "ac_cv_func_$ac_func=no"
7004 fi
7005 rm -f conftest*
7006 fi
7007
7008 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7009   echo "$ac_t""yes" 1>&6
7010     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7011   cat >> confdefs.h <<EOF
7012 #define $ac_tr_func 1
7013 EOF
7014  
7015 else
7016   echo "$ac_t""no" 1>&6
7017 fi
7018 done
7019
7020                 fi
7021         fi
7022
7023                 for ac_hdr in lwp/lwp.h
7024 do
7025 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7026 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7027 echo "configure:7028: checking for $ac_hdr" >&5
7028 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7029   echo $ac_n "(cached) $ac_c" 1>&6
7030 else
7031   cat > conftest.$ac_ext <<EOF
7032 #line 7033 "configure"
7033 #include "confdefs.h"
7034 #include <$ac_hdr>
7035 EOF
7036 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7037 { (eval echo configure:7038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7038 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7039 if test -z "$ac_err"; then
7040   rm -rf conftest*
7041   eval "ac_cv_header_$ac_safe=yes"
7042 else
7043   echo "$ac_err" >&5
7044   echo "configure: failed program was:" >&5
7045   cat conftest.$ac_ext >&5
7046   rm -rf conftest*
7047   eval "ac_cv_header_$ac_safe=no"
7048 fi
7049 rm -f conftest*
7050 fi
7051 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7052   echo "$ac_t""yes" 1>&6
7053     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7054   cat >> confdefs.h <<EOF
7055 #define $ac_tr_hdr 1
7056 EOF
7057  
7058 else
7059   echo "$ac_t""no" 1>&6
7060 fi
7061 done
7062
7063         if test $ac_cv_header_lwp_lwp_h = yes ; then
7064                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
7065 echo "configure:7066: checking for lwp_create in -llwp" >&5
7066 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
7067 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7068   echo $ac_n "(cached) $ac_c" 1>&6
7069 else
7070   ac_save_LIBS="$LIBS"
7071 LIBS="-llwp  $LIBS"
7072 cat > conftest.$ac_ext <<EOF
7073 #line 7074 "configure"
7074 #include "confdefs.h"
7075 /* Override any gcc2 internal prototype to avoid an error.  */
7076 /* We use char because int might match the return type of a gcc2
7077     builtin and then its argument prototype would still apply.  */
7078 char lwp_create();
7079
7080 int main() {
7081 lwp_create()
7082 ; return 0; }
7083 EOF
7084 if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7085   rm -rf conftest*
7086   eval "ac_cv_lib_$ac_lib_var=yes"
7087 else
7088   echo "configure: failed program was:" >&5
7089   cat conftest.$ac_ext >&5
7090   rm -rf conftest*
7091   eval "ac_cv_lib_$ac_lib_var=no"
7092 fi
7093 rm -f conftest*
7094 LIBS="$ac_save_LIBS"
7095
7096 fi
7097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7098   echo "$ac_t""yes" 1>&6
7099   have_lwp=yes
7100 else
7101   echo "$ac_t""no" 1>&6
7102 have_lwp=no
7103 fi
7104
7105
7106                 if test $have_lwp = yes ; then
7107                         cat >> confdefs.h <<\EOF
7108 #define HAVE_LWP 1
7109 EOF
7110
7111                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
7112                         ol_link_threads=lwp
7113
7114                         if test $ol_with_yielding_select = auto ; then
7115                                 ol_with_yielding_select=no
7116                         fi
7117                 fi
7118         fi
7119 fi
7120
7121 if test $ol_with_yielding_select = yes ; then
7122         cat >> confdefs.h <<\EOF
7123 #define HAVE_YIELDING_SELECT 1
7124 EOF
7125
7126 fi
7127
7128 if test $ol_with_threads = manual ; then
7129                 ol_link_threads=yes
7130
7131         echo "configure: warning: thread defines and link options must be set manually" 1>&2
7132
7133         for ac_hdr in pthread.h sched.h
7134 do
7135 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7136 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7137 echo "configure:7138: checking for $ac_hdr" >&5
7138 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7139   echo $ac_n "(cached) $ac_c" 1>&6
7140 else
7141   cat > conftest.$ac_ext <<EOF
7142 #line 7143 "configure"
7143 #include "confdefs.h"
7144 #include <$ac_hdr>
7145 EOF
7146 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7147 { (eval echo configure:7148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7148 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7149 if test -z "$ac_err"; then
7150   rm -rf conftest*
7151   eval "ac_cv_header_$ac_safe=yes"
7152 else
7153   echo "$ac_err" >&5
7154   echo "configure: failed program was:" >&5
7155   cat conftest.$ac_ext >&5
7156   rm -rf conftest*
7157   eval "ac_cv_header_$ac_safe=no"
7158 fi
7159 rm -f conftest*
7160 fi
7161 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7162   echo "$ac_t""yes" 1>&6
7163     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7164   cat >> confdefs.h <<EOF
7165 #define $ac_tr_hdr 1
7166 EOF
7167  
7168 else
7169   echo "$ac_t""no" 1>&6
7170 fi
7171 done
7172
7173         for ac_func in sched_yield pthread_yield
7174 do
7175 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7176 echo "configure:7177: checking for $ac_func" >&5
7177 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7178   echo $ac_n "(cached) $ac_c" 1>&6
7179 else
7180   cat > conftest.$ac_ext <<EOF
7181 #line 7182 "configure"
7182 #include "confdefs.h"
7183 /* System header to define __stub macros and hopefully few prototypes,
7184     which can conflict with char $ac_func(); below.  */
7185 #include <assert.h>
7186 /* Override any gcc2 internal prototype to avoid an error.  */
7187 /* We use char because int might match the return type of a gcc2
7188     builtin and then its argument prototype would still apply.  */
7189 char $ac_func();
7190
7191 int main() {
7192
7193 /* The GNU C library defines this for functions which it implements
7194     to always fail with ENOSYS.  Some functions are actually named
7195     something starting with __ and the normal name is an alias.  */
7196 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7197 choke me
7198 #else
7199 $ac_func();
7200 #endif
7201
7202 ; return 0; }
7203 EOF
7204 if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7205   rm -rf conftest*
7206   eval "ac_cv_func_$ac_func=yes"
7207 else
7208   echo "configure: failed program was:" >&5
7209   cat conftest.$ac_ext >&5
7210   rm -rf conftest*
7211   eval "ac_cv_func_$ac_func=no"
7212 fi
7213 rm -f conftest*
7214 fi
7215
7216 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7217   echo "$ac_t""yes" 1>&6
7218     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7219   cat >> confdefs.h <<EOF
7220 #define $ac_tr_func 1
7221 EOF
7222  
7223 else
7224   echo "$ac_t""no" 1>&6
7225 fi
7226 done
7227
7228         
7229         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7230 echo "configure:7231: checking for LinuxThreads pthread.h" >&5
7231 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7232   echo $ac_n "(cached) $ac_c" 1>&6
7233 else
7234   cat > conftest.$ac_ext <<EOF
7235 #line 7236 "configure"
7236 #include "confdefs.h"
7237 #include <pthread.h>
7238 EOF
7239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7240   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7241   rm -rf conftest*
7242   ol_cv_header_linux_threads=yes
7243 else
7244   rm -rf conftest*
7245   ol_cv_header_linux_threads=no
7246 fi
7247 rm -f conftest*
7248
7249                 
7250 fi
7251
7252 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7253         if test $ol_cv_header_linux_threads = yes; then
7254                 cat >> confdefs.h <<\EOF
7255 #define HAVE_LINUX_THREADS 1
7256 EOF
7257
7258         fi
7259
7260
7261         for ac_hdr in mach/cthreads.h
7262 do
7263 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7264 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7265 echo "configure:7266: checking for $ac_hdr" >&5
7266 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7267   echo $ac_n "(cached) $ac_c" 1>&6
7268 else
7269   cat > conftest.$ac_ext <<EOF
7270 #line 7271 "configure"
7271 #include "confdefs.h"
7272 #include <$ac_hdr>
7273 EOF
7274 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7275 { (eval echo configure:7276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7276 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7277 if test -z "$ac_err"; then
7278   rm -rf conftest*
7279   eval "ac_cv_header_$ac_safe=yes"
7280 else
7281   echo "$ac_err" >&5
7282   echo "configure: failed program was:" >&5
7283   cat conftest.$ac_ext >&5
7284   rm -rf conftest*
7285   eval "ac_cv_header_$ac_safe=no"
7286 fi
7287 rm -f conftest*
7288 fi
7289 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7290   echo "$ac_t""yes" 1>&6
7291     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7292   cat >> confdefs.h <<EOF
7293 #define $ac_tr_hdr 1
7294 EOF
7295  
7296 else
7297   echo "$ac_t""no" 1>&6
7298 fi
7299 done
7300
7301         for ac_hdr in lwp/lwp.h
7302 do
7303 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7304 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7305 echo "configure:7306: checking for $ac_hdr" >&5
7306 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7307   echo $ac_n "(cached) $ac_c" 1>&6
7308 else
7309   cat > conftest.$ac_ext <<EOF
7310 #line 7311 "configure"
7311 #include "confdefs.h"
7312 #include <$ac_hdr>
7313 EOF
7314 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7315 { (eval echo configure:7316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7316 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7317 if test -z "$ac_err"; then
7318   rm -rf conftest*
7319   eval "ac_cv_header_$ac_safe=yes"
7320 else
7321   echo "$ac_err" >&5
7322   echo "configure: failed program was:" >&5
7323   cat conftest.$ac_ext >&5
7324   rm -rf conftest*
7325   eval "ac_cv_header_$ac_safe=no"
7326 fi
7327 rm -f conftest*
7328 fi
7329 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7330   echo "$ac_t""yes" 1>&6
7331     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7332   cat >> confdefs.h <<EOF
7333 #define $ac_tr_hdr 1
7334 EOF
7335  
7336 else
7337   echo "$ac_t""no" 1>&6
7338 fi
7339 done
7340
7341         for ac_hdr in thread.h synch.h
7342 do
7343 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7344 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7345 echo "configure:7346: checking for $ac_hdr" >&5
7346 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7347   echo $ac_n "(cached) $ac_c" 1>&6
7348 else
7349   cat > conftest.$ac_ext <<EOF
7350 #line 7351 "configure"
7351 #include "confdefs.h"
7352 #include <$ac_hdr>
7353 EOF
7354 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7355 { (eval echo configure:7356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7356 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7357 if test -z "$ac_err"; then
7358   rm -rf conftest*
7359   eval "ac_cv_header_$ac_safe=yes"
7360 else
7361   echo "$ac_err" >&5
7362   echo "configure: failed program was:" >&5
7363   cat conftest.$ac_ext >&5
7364   rm -rf conftest*
7365   eval "ac_cv_header_$ac_safe=no"
7366 fi
7367 rm -f conftest*
7368 fi
7369 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7370   echo "$ac_t""yes" 1>&6
7371     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7372   cat >> confdefs.h <<EOF
7373 #define $ac_tr_hdr 1
7374 EOF
7375  
7376 else
7377   echo "$ac_t""no" 1>&6
7378 fi
7379 done
7380
7381 fi
7382
7383 if test $ol_link_threads != no ; then  
7384                         cat >> confdefs.h <<\EOF
7385 #define REENTRANT 1
7386 EOF
7387
7388         cat >> confdefs.h <<\EOF
7389 #define _REENTRANT 1
7390 EOF
7391
7392         cat >> confdefs.h <<\EOF
7393 #define THREAD_SAFE 1
7394 EOF
7395
7396         cat >> confdefs.h <<\EOF
7397 #define _THREAD_SAFE 1
7398 EOF
7399
7400         cat >> confdefs.h <<\EOF
7401 #define THREADSAFE 1
7402 EOF
7403
7404         cat >> confdefs.h <<\EOF
7405 #define _THREADSAFE 1
7406 EOF
7407
7408         cat >> confdefs.h <<\EOF
7409 #define _SGI_MP_SOURCE 1
7410 EOF
7411
7412
7413                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7414 echo "configure:7415: checking for thread specific errno" >&5
7415 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7416   echo $ac_n "(cached) $ac_c" 1>&6
7417 else
7418   
7419                 cat > conftest.$ac_ext <<EOF
7420 #line 7421 "configure"
7421 #include "confdefs.h"
7422 #include <errno.h>
7423 int main() {
7424 errno = 0;
7425 ; return 0; }
7426 EOF
7427 if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7428   rm -rf conftest*
7429   ol_cv_errno_thread_specific=yes
7430 else
7431   echo "configure: failed program was:" >&5
7432   cat conftest.$ac_ext >&5
7433   rm -rf conftest*
7434   ol_cv_errno_thread_specific=no
7435 fi
7436 rm -f conftest*
7437         
7438 fi
7439
7440 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7441
7442                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
7443 echo "configure:7444: checking for thread specific h_errno" >&5
7444 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
7445   echo $ac_n "(cached) $ac_c" 1>&6
7446 else
7447   
7448                 cat > conftest.$ac_ext <<EOF
7449 #line 7450 "configure"
7450 #include "confdefs.h"
7451 #include <netdb.h>
7452 int main() {
7453 h_errno = 0;
7454 ; return 0; }
7455 EOF
7456 if { (eval echo configure:7457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7457   rm -rf conftest*
7458   ol_cv_h_errno_thread_specific=yes
7459 else
7460   echo "configure: failed program was:" >&5
7461   cat conftest.$ac_ext >&5
7462   rm -rf conftest*
7463   ol_cv_h_errno_thread_specific=no
7464 fi
7465 rm -f conftest*
7466         
7467 fi
7468
7469 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
7470
7471         if test $ol_cv_errno_thread_specific != yes \
7472                 -o $ol_cv_h_errno_thread_specific != yes ; then
7473                 LIBS="$LTHREAD_LIBS $LIBS"
7474                 LTHREAD_LIBS=""
7475         fi
7476
7477 fi  
7478
7479 if test $ol_link_threads = no ; then
7480         if test $ol_with_threads = yes ; then
7481                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7482         fi
7483
7484         if test $ol_with_threads = auto ; then
7485                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7486                 ol_with_threads=no
7487         fi
7488
7489         cat >> confdefs.h <<\EOF
7490 #define NO_THREADS 1
7491 EOF
7492
7493         LTHREAD_LIBS=""
7494 fi
7495
7496 if test $ol_link_threads != no ; then
7497         cat >> confdefs.h <<\EOF
7498 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7499 EOF
7500
7501 fi
7502
7503
7504 ol_link_ldbm=no 
7505 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7506         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7507 echo "configure:7508: checking for DB2 library" >&5
7508 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7509   echo $ac_n "(cached) $ac_c" 1>&6
7510 else
7511         ol_LIBS="$LIBS"
7512         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7513 echo "configure:7514: checking for db_open in -ldb" >&5
7514 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7515 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7516   echo $ac_n "(cached) $ac_c" 1>&6
7517 else
7518   ac_save_LIBS="$LIBS"
7519 LIBS="-ldb  $LIBS"
7520 cat > conftest.$ac_ext <<EOF
7521 #line 7522 "configure"
7522 #include "confdefs.h"
7523 /* Override any gcc2 internal prototype to avoid an error.  */
7524 /* We use char because int might match the return type of a gcc2
7525     builtin and then its argument prototype would still apply.  */
7526 char db_open();
7527
7528 int main() {
7529 db_open()
7530 ; return 0; }
7531 EOF
7532 if { (eval echo configure:7533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7533   rm -rf conftest*
7534   eval "ac_cv_lib_$ac_lib_var=yes"
7535 else
7536   echo "configure: failed program was:" >&5
7537   cat conftest.$ac_ext >&5
7538   rm -rf conftest*
7539   eval "ac_cv_lib_$ac_lib_var=no"
7540 fi
7541 rm -f conftest*
7542 LIBS="$ac_save_LIBS"
7543
7544 fi
7545 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7546   echo "$ac_t""yes" 1>&6
7547   ol_cv_lib_db2=-ldb
7548 else
7549   echo "$ac_t""no" 1>&6
7550 ol_cv_lib_db2=no
7551 fi
7552
7553         LIBS="$ol_LIBS"
7554
7555 fi
7556
7557 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7558
7559 for ac_hdr in db.h
7560 do
7561 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7562 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7563 echo "configure:7564: checking for $ac_hdr" >&5
7564 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7565   echo $ac_n "(cached) $ac_c" 1>&6
7566 else
7567   cat > conftest.$ac_ext <<EOF
7568 #line 7569 "configure"
7569 #include "confdefs.h"
7570 #include <$ac_hdr>
7571 EOF
7572 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7573 { (eval echo configure:7574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7574 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7575 if test -z "$ac_err"; then
7576   rm -rf conftest*
7577   eval "ac_cv_header_$ac_safe=yes"
7578 else
7579   echo "$ac_err" >&5
7580   echo "configure: failed program was:" >&5
7581   cat conftest.$ac_ext >&5
7582   rm -rf conftest*
7583   eval "ac_cv_header_$ac_safe=no"
7584 fi
7585 rm -f conftest*
7586 fi
7587 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7588   echo "$ac_t""yes" 1>&6
7589     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7590   cat >> confdefs.h <<EOF
7591 #define $ac_tr_hdr 1
7592 EOF
7593  
7594 else
7595   echo "$ac_t""no" 1>&6
7596 fi
7597 done
7598
7599 if test $ac_cv_header_db_h = yes ; then
7600         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7601 echo "configure:7602: checking if db.h is DB2" >&5
7602 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7603   echo $ac_n "(cached) $ac_c" 1>&6
7604 else
7605   
7606                 cat > conftest.$ac_ext <<EOF
7607 #line 7608 "configure"
7608 #include "confdefs.h"
7609
7610 #                       include <db.h>
7611                         /* this check could be improved */
7612 #                       ifdef DB_VERSION_MAJOR
7613 #                               if DB_VERSION_MAJOR == 2
7614                                         __db_version_2
7615 #                               endif
7616 #                       endif
7617                 
7618 EOF
7619 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7620   egrep "__db_version_2" >/dev/null 2>&1; then
7621   rm -rf conftest*
7622   ol_cv_header_db2=yes
7623 else
7624   rm -rf conftest*
7625   ol_cv_header_db2=no
7626 fi
7627 rm -f conftest*
7628
7629 fi
7630
7631 echo "$ac_t""$ol_cv_header_db2" 1>&6
7632 else
7633         ol_cv_header_db2=no
7634 fi
7635
7636
7637  
7638  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7639 echo "configure:7640: checking for Berkeley DB2" >&5
7640 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7641   echo $ac_n "(cached) $ac_c" 1>&6
7642 else
7643   
7644         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7645                 ol_cv_berkeley_db2=no
7646         else
7647                 ol_cv_berkeley_db2=yes
7648         fi
7649
7650 fi
7651
7652 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7653  if test $ol_cv_berkeley_db2 = yes ; then
7654         cat >> confdefs.h <<\EOF
7655 #define HAVE_BERKELEY_DB2 1
7656 EOF
7657
7658  fi
7659
7660
7661         if test $ol_cv_berkeley_db2 = yes ; then
7662                 ol_link_ldbm=db2
7663                 ol_with_ldbm_api=db2
7664
7665                 if test $ol_with_ldbm_type = hash ; then
7666                         cat >> confdefs.h <<\EOF
7667 #define LDBM_USE_DBHASH 1
7668 EOF
7669
7670                 else
7671                         cat >> confdefs.h <<\EOF
7672 #define LDBM_USE_DBBTREE 1
7673 EOF
7674
7675                 fi
7676
7677                                                 if test $ol_cv_lib_db2 != yes ; then
7678                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7679                 fi
7680         fi
7681 fi
7682
7683 ol_link_bdb2=no
7684 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7685         ol_link_bdb2=yes
7686 fi
7687
7688 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7689         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7690 echo "configure:7691: checking for Berkeley DB library" >&5
7691 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7692   echo $ac_n "(cached) $ac_c" 1>&6
7693 else
7694   
7695         for ac_hdr in db1/db.h
7696 do
7697 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7698 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7699 echo "configure:7700: checking for $ac_hdr" >&5
7700 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7701   echo $ac_n "(cached) $ac_c" 1>&6
7702 else
7703   cat > conftest.$ac_ext <<EOF
7704 #line 7705 "configure"
7705 #include "confdefs.h"
7706 #include <$ac_hdr>
7707 EOF
7708 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7709 { (eval echo configure:7710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7710 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7711 if test -z "$ac_err"; then
7712   rm -rf conftest*
7713   eval "ac_cv_header_$ac_safe=yes"
7714 else
7715   echo "$ac_err" >&5
7716   echo "configure: failed program was:" >&5
7717   cat conftest.$ac_ext >&5
7718   rm -rf conftest*
7719   eval "ac_cv_header_$ac_safe=no"
7720 fi
7721 rm -f conftest*
7722 fi
7723 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7724   echo "$ac_t""yes" 1>&6
7725     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7726   cat >> confdefs.h <<EOF
7727 #define $ac_tr_hdr 1
7728 EOF
7729  
7730 else
7731   echo "$ac_t""no" 1>&6
7732 fi
7733 done
7734
7735         ol_LIBS="$LIBS"
7736         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7737 echo "configure:7738: checking for dbopen" >&5
7738 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7739   echo $ac_n "(cached) $ac_c" 1>&6
7740 else
7741   cat > conftest.$ac_ext <<EOF
7742 #line 7743 "configure"
7743 #include "confdefs.h"
7744 /* System header to define __stub macros and hopefully few prototypes,
7745     which can conflict with char dbopen(); below.  */
7746 #include <assert.h>
7747 /* Override any gcc2 internal prototype to avoid an error.  */
7748 /* We use char because int might match the return type of a gcc2
7749     builtin and then its argument prototype would still apply.  */
7750 char dbopen();
7751
7752 int main() {
7753
7754 /* The GNU C library defines this for functions which it implements
7755     to always fail with ENOSYS.  Some functions are actually named
7756     something starting with __ and the normal name is an alias.  */
7757 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7758 choke me
7759 #else
7760 dbopen();
7761 #endif
7762
7763 ; return 0; }
7764 EOF
7765 if { (eval echo configure:7766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7766   rm -rf conftest*
7767   eval "ac_cv_func_dbopen=yes"
7768 else
7769   echo "configure: failed program was:" >&5
7770   cat conftest.$ac_ext >&5
7771   rm -rf conftest*
7772   eval "ac_cv_func_dbopen=no"
7773 fi
7774 rm -f conftest*
7775 fi
7776
7777 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7778   echo "$ac_t""yes" 1>&6
7779   ol_cv_lib_db=yes
7780 else
7781   echo "$ac_t""no" 1>&6
7782
7783                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7784 echo "configure:7785: checking for dbopen in -ldb1" >&5
7785 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7786 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7787   echo $ac_n "(cached) $ac_c" 1>&6
7788 else
7789   ac_save_LIBS="$LIBS"
7790 LIBS="-ldb1  $LIBS"
7791 cat > conftest.$ac_ext <<EOF
7792 #line 7793 "configure"
7793 #include "confdefs.h"
7794 /* Override any gcc2 internal prototype to avoid an error.  */
7795 /* We use char because int might match the return type of a gcc2
7796     builtin and then its argument prototype would still apply.  */
7797 char dbopen();
7798
7799 int main() {
7800 dbopen()
7801 ; return 0; }
7802 EOF
7803 if { (eval echo configure:7804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7804   rm -rf conftest*
7805   eval "ac_cv_lib_$ac_lib_var=yes"
7806 else
7807   echo "configure: failed program was:" >&5
7808   cat conftest.$ac_ext >&5
7809   rm -rf conftest*
7810   eval "ac_cv_lib_$ac_lib_var=no"
7811 fi
7812 rm -f conftest*
7813 LIBS="$ac_save_LIBS"
7814
7815 fi
7816 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7817   echo "$ac_t""yes" 1>&6
7818   ol_cv_lib_db=-ldb1
7819 else
7820   echo "$ac_t""no" 1>&6
7821
7822                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7823 echo "configure:7824: checking for dbopen in -ldb" >&5
7824 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7825 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7826   echo $ac_n "(cached) $ac_c" 1>&6
7827 else
7828   ac_save_LIBS="$LIBS"
7829 LIBS="-ldb  $LIBS"
7830 cat > conftest.$ac_ext <<EOF
7831 #line 7832 "configure"
7832 #include "confdefs.h"
7833 /* Override any gcc2 internal prototype to avoid an error.  */
7834 /* We use char because int might match the return type of a gcc2
7835     builtin and then its argument prototype would still apply.  */
7836 char dbopen();
7837
7838 int main() {
7839 dbopen()
7840 ; return 0; }
7841 EOF
7842 if { (eval echo configure:7843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7843   rm -rf conftest*
7844   eval "ac_cv_lib_$ac_lib_var=yes"
7845 else
7846   echo "configure: failed program was:" >&5
7847   cat conftest.$ac_ext >&5
7848   rm -rf conftest*
7849   eval "ac_cv_lib_$ac_lib_var=no"
7850 fi
7851 rm -f conftest*
7852 LIBS="$ac_save_LIBS"
7853
7854 fi
7855 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7856   echo "$ac_t""yes" 1>&6
7857   ol_cv_lib_db=-ldb
7858 else
7859   echo "$ac_t""no" 1>&6
7860 ol_cv_lib_db=no
7861 fi
7862
7863                 
7864 fi
7865
7866         
7867 fi
7868
7869         LIBS="$ol_LIBS"
7870
7871 fi
7872
7873 echo "$ac_t""$ol_cv_lib_db" 1>&6
7874
7875
7876 for ac_hdr in db_185.h
7877 do
7878 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7879 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7880 echo "configure:7881: checking for $ac_hdr" >&5
7881 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7882   echo $ac_n "(cached) $ac_c" 1>&6
7883 else
7884   cat > conftest.$ac_ext <<EOF
7885 #line 7886 "configure"
7886 #include "confdefs.h"
7887 #include <$ac_hdr>
7888 EOF
7889 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7890 { (eval echo configure:7891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7891 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7892 if test -z "$ac_err"; then
7893   rm -rf conftest*
7894   eval "ac_cv_header_$ac_safe=yes"
7895 else
7896   echo "$ac_err" >&5
7897   echo "configure: failed program was:" >&5
7898   cat conftest.$ac_ext >&5
7899   rm -rf conftest*
7900   eval "ac_cv_header_$ac_safe=no"
7901 fi
7902 rm -f conftest*
7903 fi
7904 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7905   echo "$ac_t""yes" 1>&6
7906     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7907   cat >> confdefs.h <<EOF
7908 #define $ac_tr_hdr 1
7909 EOF
7910  
7911 else
7912   echo "$ac_t""no" 1>&6
7913 fi
7914 done
7915
7916 if test "$ol_cv_header_db2" = yes ; then
7917         
7918         ol_cv_header_db=$ac_cv_header_db_185_h
7919 else
7920         ol_cv_header_db=$ac_cv_header_db_h
7921 fi
7922
7923
7924  
7925  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7926 echo "configure:7927: checking for Berkeley DB" >&5
7927 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7928   echo $ac_n "(cached) $ac_c" 1>&6
7929 else
7930   
7931         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7932                 ol_cv_berkeley_db=no
7933         else
7934                 ol_cv_berkeley_db=yes
7935         fi
7936
7937 fi
7938
7939 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7940  if test $ol_cv_berkeley_db = yes ; then
7941         cat >> confdefs.h <<\EOF
7942 #define HAVE_BERKELEY_DB 1
7943 EOF
7944
7945  fi
7946
7947
7948         if test $ol_cv_berkeley_db = yes ; then
7949                 ol_link_ldbm=db
7950                 ol_with_ldbm_api=db
7951
7952                 if test $ol_with_ldbm_type = hash ; then
7953                         cat >> confdefs.h <<\EOF
7954 #define LDBM_USE_DBHASH 1
7955 EOF
7956
7957                 else
7958                         cat >> confdefs.h <<\EOF
7959 #define LDBM_USE_DBBTREE 1
7960 EOF
7961
7962                 fi
7963
7964                                                 if test $ol_cv_lib_db != yes ; then
7965                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7966                 fi
7967         fi
7968 fi
7969
7970 if test $ol_with_ldbm_api = manual ; then
7971                 ol_link_ldbm=yes
7972
7973         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7974
7975         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7976 do
7977 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7978 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7979 echo "configure:7980: checking for $ac_hdr" >&5
7980 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7981   echo $ac_n "(cached) $ac_c" 1>&6
7982 else
7983   cat > conftest.$ac_ext <<EOF
7984 #line 7985 "configure"
7985 #include "confdefs.h"
7986 #include <$ac_hdr>
7987 EOF
7988 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7989 { (eval echo configure:7990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7990 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7991 if test -z "$ac_err"; then
7992   rm -rf conftest*
7993   eval "ac_cv_header_$ac_safe=yes"
7994 else
7995   echo "$ac_err" >&5
7996   echo "configure: failed program was:" >&5
7997   cat conftest.$ac_ext >&5
7998   rm -rf conftest*
7999   eval "ac_cv_header_$ac_safe=no"
8000 fi
8001 rm -f conftest*
8002 fi
8003 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8004   echo "$ac_t""yes" 1>&6
8005     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8006   cat >> confdefs.h <<EOF
8007 #define $ac_tr_hdr 1
8008 EOF
8009  
8010 else
8011   echo "$ac_t""no" 1>&6
8012 fi
8013 done
8014
8015 fi
8016
8017 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
8018         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
8019         ol_with_ldbm_api=none
8020 fi
8021
8022 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
8023         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
8024 echo "configure:8025: checking for MDBM library" >&5
8025 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
8026   echo $ac_n "(cached) $ac_c" 1>&6
8027 else
8028         ol_LIBS="$LIBS"
8029         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
8030 echo "configure:8031: checking for mdbm_set_chain" >&5
8031 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
8032   echo $ac_n "(cached) $ac_c" 1>&6
8033 else
8034   cat > conftest.$ac_ext <<EOF
8035 #line 8036 "configure"
8036 #include "confdefs.h"
8037 /* System header to define __stub macros and hopefully few prototypes,
8038     which can conflict with char mdbm_set_chain(); below.  */
8039 #include <assert.h>
8040 /* Override any gcc2 internal prototype to avoid an error.  */
8041 /* We use char because int might match the return type of a gcc2
8042     builtin and then its argument prototype would still apply.  */
8043 char mdbm_set_chain();
8044
8045 int main() {
8046
8047 /* The GNU C library defines this for functions which it implements
8048     to always fail with ENOSYS.  Some functions are actually named
8049     something starting with __ and the normal name is an alias.  */
8050 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
8051 choke me
8052 #else
8053 mdbm_set_chain();
8054 #endif
8055
8056 ; return 0; }
8057 EOF
8058 if { (eval echo configure:8059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8059   rm -rf conftest*
8060   eval "ac_cv_func_mdbm_set_chain=yes"
8061 else
8062   echo "configure: failed program was:" >&5
8063   cat conftest.$ac_ext >&5
8064   rm -rf conftest*
8065   eval "ac_cv_func_mdbm_set_chain=no"
8066 fi
8067 rm -f conftest*
8068 fi
8069
8070 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
8071   echo "$ac_t""yes" 1>&6
8072   ol_cv_lib_mdbm=yes
8073 else
8074   echo "$ac_t""no" 1>&6
8075
8076                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
8077 echo "configure:8078: checking for mdbm_set_chain in -lmdbm" >&5
8078 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
8079 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8080   echo $ac_n "(cached) $ac_c" 1>&6
8081 else
8082   ac_save_LIBS="$LIBS"
8083 LIBS="-lmdbm  $LIBS"
8084 cat > conftest.$ac_ext <<EOF
8085 #line 8086 "configure"
8086 #include "confdefs.h"
8087 /* Override any gcc2 internal prototype to avoid an error.  */
8088 /* We use char because int might match the return type of a gcc2
8089     builtin and then its argument prototype would still apply.  */
8090 char mdbm_set_chain();
8091
8092 int main() {
8093 mdbm_set_chain()
8094 ; return 0; }
8095 EOF
8096 if { (eval echo configure:8097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8097   rm -rf conftest*
8098   eval "ac_cv_lib_$ac_lib_var=yes"
8099 else
8100   echo "configure: failed program was:" >&5
8101   cat conftest.$ac_ext >&5
8102   rm -rf conftest*
8103   eval "ac_cv_lib_$ac_lib_var=no"
8104 fi
8105 rm -f conftest*
8106 LIBS="$ac_save_LIBS"
8107
8108 fi
8109 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8110   echo "$ac_t""yes" 1>&6
8111   ol_cv_lib_mdbm=-lmdbm
8112 else
8113   echo "$ac_t""no" 1>&6
8114 ol_cv_lib_mdbm=no
8115 fi
8116
8117         
8118 fi
8119
8120         LIBS="$ol_LIBS"
8121
8122 fi
8123
8124 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
8125
8126
8127  for ac_hdr in mdbm.h
8128 do
8129 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8130 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8131 echo "configure:8132: checking for $ac_hdr" >&5
8132 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8133   echo $ac_n "(cached) $ac_c" 1>&6
8134 else
8135   cat > conftest.$ac_ext <<EOF
8136 #line 8137 "configure"
8137 #include "confdefs.h"
8138 #include <$ac_hdr>
8139 EOF
8140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8141 { (eval echo configure:8142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8142 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8143 if test -z "$ac_err"; then
8144   rm -rf conftest*
8145   eval "ac_cv_header_$ac_safe=yes"
8146 else
8147   echo "$ac_err" >&5
8148   echo "configure: failed program was:" >&5
8149   cat conftest.$ac_ext >&5
8150   rm -rf conftest*
8151   eval "ac_cv_header_$ac_safe=no"
8152 fi
8153 rm -f conftest*
8154 fi
8155 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8156   echo "$ac_t""yes" 1>&6
8157     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8158   cat >> confdefs.h <<EOF
8159 #define $ac_tr_hdr 1
8160 EOF
8161  
8162 else
8163   echo "$ac_t""no" 1>&6
8164 fi
8165 done
8166
8167  echo $ac_n "checking for db""... $ac_c" 1>&6
8168 echo "configure:8169: checking for db" >&5
8169 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
8170   echo $ac_n "(cached) $ac_c" 1>&6
8171 else
8172   
8173         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
8174                 ol_cv_mdbm=no
8175         else
8176                 ol_cv_mdbm=yes
8177         fi
8178
8179 fi
8180
8181 echo "$ac_t""$ol_cv_mdbm" 1>&6
8182  if test $ol_cv_mdbm = yes ; then
8183         cat >> confdefs.h <<\EOF
8184 #define HAVE_MDBM 1
8185 EOF
8186
8187  fi
8188
8189
8190         if test $ol_cv_mdbm = yes ; then
8191                 ol_link_ldbm=mdbm
8192                 ol_with_ldbm_api=mdbm
8193                 if test $ol_cv_lib_mdbm != yes ; then
8194                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
8195                 fi
8196         fi
8197 fi
8198
8199 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
8200         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
8201 echo "configure:8202: checking for GDBM library" >&5
8202 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
8203   echo $ac_n "(cached) $ac_c" 1>&6
8204 else
8205         ol_LIBS="$LIBS"
8206         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
8207 echo "configure:8208: checking for gdbm_open" >&5
8208 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
8209   echo $ac_n "(cached) $ac_c" 1>&6
8210 else
8211   cat > conftest.$ac_ext <<EOF
8212 #line 8213 "configure"
8213 #include "confdefs.h"
8214 /* System header to define __stub macros and hopefully few prototypes,
8215     which can conflict with char gdbm_open(); below.  */
8216 #include <assert.h>
8217 /* Override any gcc2 internal prototype to avoid an error.  */
8218 /* We use char because int might match the return type of a gcc2
8219     builtin and then its argument prototype would still apply.  */
8220 char gdbm_open();
8221
8222 int main() {
8223
8224 /* The GNU C library defines this for functions which it implements
8225     to always fail with ENOSYS.  Some functions are actually named
8226     something starting with __ and the normal name is an alias.  */
8227 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
8228 choke me
8229 #else
8230 gdbm_open();
8231 #endif
8232
8233 ; return 0; }
8234 EOF
8235 if { (eval echo configure:8236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8236   rm -rf conftest*
8237   eval "ac_cv_func_gdbm_open=yes"
8238 else
8239   echo "configure: failed program was:" >&5
8240   cat conftest.$ac_ext >&5
8241   rm -rf conftest*
8242   eval "ac_cv_func_gdbm_open=no"
8243 fi
8244 rm -f conftest*
8245 fi
8246
8247 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
8248   echo "$ac_t""yes" 1>&6
8249   ol_cv_lib_gdbm=yes
8250 else
8251   echo "$ac_t""no" 1>&6
8252
8253                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
8254 echo "configure:8255: checking for gdbm_open in -lgdbm" >&5
8255 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
8256 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8257   echo $ac_n "(cached) $ac_c" 1>&6
8258 else
8259   ac_save_LIBS="$LIBS"
8260 LIBS="-lgdbm  $LIBS"
8261 cat > conftest.$ac_ext <<EOF
8262 #line 8263 "configure"
8263 #include "confdefs.h"
8264 /* Override any gcc2 internal prototype to avoid an error.  */
8265 /* We use char because int might match the return type of a gcc2
8266     builtin and then its argument prototype would still apply.  */
8267 char gdbm_open();
8268
8269 int main() {
8270 gdbm_open()
8271 ; return 0; }
8272 EOF
8273 if { (eval echo configure:8274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8274   rm -rf conftest*
8275   eval "ac_cv_lib_$ac_lib_var=yes"
8276 else
8277   echo "configure: failed program was:" >&5
8278   cat conftest.$ac_ext >&5
8279   rm -rf conftest*
8280   eval "ac_cv_lib_$ac_lib_var=no"
8281 fi
8282 rm -f conftest*
8283 LIBS="$ac_save_LIBS"
8284
8285 fi
8286 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8287   echo "$ac_t""yes" 1>&6
8288   ol_cv_lib_gdbm=-lgdbm
8289 else
8290   echo "$ac_t""no" 1>&6
8291 ol_cv_lib_gdbm=no
8292 fi
8293
8294         
8295 fi
8296
8297         LIBS="$ol_LIBS"
8298
8299 fi
8300
8301 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8302
8303
8304  for ac_hdr in gdbm.h
8305 do
8306 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8307 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8308 echo "configure:8309: checking for $ac_hdr" >&5
8309 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8310   echo $ac_n "(cached) $ac_c" 1>&6
8311 else
8312   cat > conftest.$ac_ext <<EOF
8313 #line 8314 "configure"
8314 #include "confdefs.h"
8315 #include <$ac_hdr>
8316 EOF
8317 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8318 { (eval echo configure:8319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8319 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8320 if test -z "$ac_err"; then
8321   rm -rf conftest*
8322   eval "ac_cv_header_$ac_safe=yes"
8323 else
8324   echo "$ac_err" >&5
8325   echo "configure: failed program was:" >&5
8326   cat conftest.$ac_ext >&5
8327   rm -rf conftest*
8328   eval "ac_cv_header_$ac_safe=no"
8329 fi
8330 rm -f conftest*
8331 fi
8332 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8333   echo "$ac_t""yes" 1>&6
8334     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8335   cat >> confdefs.h <<EOF
8336 #define $ac_tr_hdr 1
8337 EOF
8338  
8339 else
8340   echo "$ac_t""no" 1>&6
8341 fi
8342 done
8343
8344  echo $ac_n "checking for db""... $ac_c" 1>&6
8345 echo "configure:8346: checking for db" >&5
8346 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8347   echo $ac_n "(cached) $ac_c" 1>&6
8348 else
8349   
8350         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8351                 ol_cv_gdbm=no
8352         else
8353                 ol_cv_gdbm=yes
8354         fi
8355
8356 fi
8357
8358 echo "$ac_t""$ol_cv_gdbm" 1>&6
8359  if test $ol_cv_gdbm = yes ; then
8360         cat >> confdefs.h <<\EOF
8361 #define HAVE_GDBM 1
8362 EOF
8363
8364  fi
8365
8366
8367         if test $ol_cv_gdbm = yes ; then
8368                 ol_link_ldbm=gdbm
8369                 ol_with_ldbm_api=gdbm
8370
8371                 if test $ol_cv_lib_gdbm != yes ; then
8372                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8373                 fi
8374         fi
8375 fi
8376
8377 if test $ol_with_ldbm_api = auto ; then
8378         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8379 elif test $ol_with_ldbm_api = ndbm ; then
8380         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8381 echo "configure:8382: checking for NDBM library" >&5
8382 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8383   echo $ac_n "(cached) $ac_c" 1>&6
8384 else
8385         ol_LIBS="$LIBS"
8386         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8387 echo "configure:8388: checking for dbm_open" >&5
8388 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8389   echo $ac_n "(cached) $ac_c" 1>&6
8390 else
8391   cat > conftest.$ac_ext <<EOF
8392 #line 8393 "configure"
8393 #include "confdefs.h"
8394 /* System header to define __stub macros and hopefully few prototypes,
8395     which can conflict with char dbm_open(); below.  */
8396 #include <assert.h>
8397 /* Override any gcc2 internal prototype to avoid an error.  */
8398 /* We use char because int might match the return type of a gcc2
8399     builtin and then its argument prototype would still apply.  */
8400 char dbm_open();
8401
8402 int main() {
8403
8404 /* The GNU C library defines this for functions which it implements
8405     to always fail with ENOSYS.  Some functions are actually named
8406     something starting with __ and the normal name is an alias.  */
8407 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8408 choke me
8409 #else
8410 dbm_open();
8411 #endif
8412
8413 ; return 0; }
8414 EOF
8415 if { (eval echo configure:8416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8416   rm -rf conftest*
8417   eval "ac_cv_func_dbm_open=yes"
8418 else
8419   echo "configure: failed program was:" >&5
8420   cat conftest.$ac_ext >&5
8421   rm -rf conftest*
8422   eval "ac_cv_func_dbm_open=no"
8423 fi
8424 rm -f conftest*
8425 fi
8426
8427 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8428   echo "$ac_t""yes" 1>&6
8429   ol_cv_lib_ndbm=yes
8430 else
8431   echo "$ac_t""no" 1>&6
8432
8433                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8434 echo "configure:8435: checking for dbm_open in -lndbm" >&5
8435 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8436 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8437   echo $ac_n "(cached) $ac_c" 1>&6
8438 else
8439   ac_save_LIBS="$LIBS"
8440 LIBS="-lndbm  $LIBS"
8441 cat > conftest.$ac_ext <<EOF
8442 #line 8443 "configure"
8443 #include "confdefs.h"
8444 /* Override any gcc2 internal prototype to avoid an error.  */
8445 /* We use char because int might match the return type of a gcc2
8446     builtin and then its argument prototype would still apply.  */
8447 char dbm_open();
8448
8449 int main() {
8450 dbm_open()
8451 ; return 0; }
8452 EOF
8453 if { (eval echo configure:8454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8454   rm -rf conftest*
8455   eval "ac_cv_lib_$ac_lib_var=yes"
8456 else
8457   echo "configure: failed program was:" >&5
8458   cat conftest.$ac_ext >&5
8459   rm -rf conftest*
8460   eval "ac_cv_lib_$ac_lib_var=no"
8461 fi
8462 rm -f conftest*
8463 LIBS="$ac_save_LIBS"
8464
8465 fi
8466 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8467   echo "$ac_t""yes" 1>&6
8468   ol_cv_lib_ndbm=-lndbm
8469 else
8470   echo "$ac_t""no" 1>&6
8471
8472                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8473 echo "configure:8474: checking for dbm_open in -ldbm" >&5
8474 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8475 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8476   echo $ac_n "(cached) $ac_c" 1>&6
8477 else
8478   ac_save_LIBS="$LIBS"
8479 LIBS="-ldbm  $LIBS"
8480 cat > conftest.$ac_ext <<EOF
8481 #line 8482 "configure"
8482 #include "confdefs.h"
8483 /* Override any gcc2 internal prototype to avoid an error.  */
8484 /* We use char because int might match the return type of a gcc2
8485     builtin and then its argument prototype would still apply.  */
8486 char dbm_open();
8487
8488 int main() {
8489 dbm_open()
8490 ; return 0; }
8491 EOF
8492 if { (eval echo configure:8493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8493   rm -rf conftest*
8494   eval "ac_cv_lib_$ac_lib_var=yes"
8495 else
8496   echo "configure: failed program was:" >&5
8497   cat conftest.$ac_ext >&5
8498   rm -rf conftest*
8499   eval "ac_cv_lib_$ac_lib_var=no"
8500 fi
8501 rm -f conftest*
8502 LIBS="$ac_save_LIBS"
8503
8504 fi
8505 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8506   echo "$ac_t""yes" 1>&6
8507   ol_cv_lib_ndbm=-ldbm
8508 else
8509   echo "$ac_t""no" 1>&6
8510 ol_cv_lib_ndbm=no
8511 fi
8512                 
8513 fi
8514
8515         
8516 fi
8517
8518         LIBS="$ol_LIBS"
8519
8520 fi
8521
8522 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8523
8524
8525  for ac_hdr in ndbm.h
8526 do
8527 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8528 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8529 echo "configure:8530: checking for $ac_hdr" >&5
8530 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8531   echo $ac_n "(cached) $ac_c" 1>&6
8532 else
8533   cat > conftest.$ac_ext <<EOF
8534 #line 8535 "configure"
8535 #include "confdefs.h"
8536 #include <$ac_hdr>
8537 EOF
8538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8539 { (eval echo configure:8540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8540 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8541 if test -z "$ac_err"; then
8542   rm -rf conftest*
8543   eval "ac_cv_header_$ac_safe=yes"
8544 else
8545   echo "$ac_err" >&5
8546   echo "configure: failed program was:" >&5
8547   cat conftest.$ac_ext >&5
8548   rm -rf conftest*
8549   eval "ac_cv_header_$ac_safe=no"
8550 fi
8551 rm -f conftest*
8552 fi
8553 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8554   echo "$ac_t""yes" 1>&6
8555     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8556   cat >> confdefs.h <<EOF
8557 #define $ac_tr_hdr 1
8558 EOF
8559  
8560 else
8561   echo "$ac_t""no" 1>&6
8562 fi
8563 done
8564
8565  echo $ac_n "checking for db""... $ac_c" 1>&6
8566 echo "configure:8567: checking for db" >&5
8567 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8568   echo $ac_n "(cached) $ac_c" 1>&6
8569 else
8570   
8571         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8572                 ol_cv_ndbm=no
8573         else
8574                 ol_cv_ndbm=yes
8575         fi
8576
8577 fi
8578
8579 echo "$ac_t""$ol_cv_ndbm" 1>&6
8580  if test $ol_cv_ndbm = yes ; then
8581         cat >> confdefs.h <<\EOF
8582 #define HAVE_NDBM 1
8583 EOF
8584
8585  fi
8586
8587
8588         if test $ol_cv_ndbm = yes ; then
8589                 ol_link_ldbm=ndbm
8590                 ol_with_ldbm_api=ndbm
8591
8592                 if test $ol_cv_lib_ndbm != yes ; then
8593                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8594                 fi
8595         fi
8596 fi
8597
8598 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8599         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8600         if test $ol_enable_ldbm = yes ; then
8601                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8602         fi
8603
8604         echo "configure: warning: disabling LDBM" 1>&2
8605         ol_enable_ldbm=no
8606 fi
8607
8608 if test $ol_enable_wrappers != no ; then
8609         for ac_hdr in tcpd.h
8610 do
8611 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8612 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8613 echo "configure:8614: checking for $ac_hdr" >&5
8614 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8615   echo $ac_n "(cached) $ac_c" 1>&6
8616 else
8617   cat > conftest.$ac_ext <<EOF
8618 #line 8619 "configure"
8619 #include "confdefs.h"
8620 #include <$ac_hdr>
8621 EOF
8622 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8623 { (eval echo configure:8624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8624 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8625 if test -z "$ac_err"; then
8626   rm -rf conftest*
8627   eval "ac_cv_header_$ac_safe=yes"
8628 else
8629   echo "$ac_err" >&5
8630   echo "configure: failed program was:" >&5
8631   cat conftest.$ac_ext >&5
8632   rm -rf conftest*
8633   eval "ac_cv_header_$ac_safe=no"
8634 fi
8635 rm -f conftest*
8636 fi
8637 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8638   echo "$ac_t""yes" 1>&6
8639     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8640   cat >> confdefs.h <<EOF
8641 #define $ac_tr_hdr 1
8642 EOF
8643  
8644 else
8645   echo "$ac_t""no" 1>&6
8646 fi
8647 done
8648
8649
8650         if test $ac_cv_header_tcpd_h != yes ; then
8651                 have_wrappers=no
8652         else
8653                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8654 echo "configure:8655: checking for main in -lwrap" >&5
8655 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8656 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8657   echo $ac_n "(cached) $ac_c" 1>&6
8658 else
8659   ac_save_LIBS="$LIBS"
8660 LIBS="-lwrap  $LIBS"
8661 cat > conftest.$ac_ext <<EOF
8662 #line 8663 "configure"
8663 #include "confdefs.h"
8664
8665 int main() {
8666 main()
8667 ; return 0; }
8668 EOF
8669 if { (eval echo configure:8670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8670   rm -rf conftest*
8671   eval "ac_cv_lib_$ac_lib_var=yes"
8672 else
8673   echo "configure: failed program was:" >&5
8674   cat conftest.$ac_ext >&5
8675   rm -rf conftest*
8676   eval "ac_cv_lib_$ac_lib_var=no"
8677 fi
8678 rm -f conftest*
8679 LIBS="$ac_save_LIBS"
8680
8681 fi
8682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8683   echo "$ac_t""yes" 1>&6
8684   have_wrappers=yes
8685 else
8686   echo "$ac_t""no" 1>&6
8687 have_wrappers=no
8688 fi
8689
8690         fi
8691
8692         if test $have_wrappers = yes ; then
8693                 cat >> confdefs.h <<\EOF
8694 #define HAVE_TCPD 1
8695 EOF
8696
8697                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8698
8699                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8700 echo "configure:8701: checking for main in -lnsl" >&5
8701 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8702 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8703   echo $ac_n "(cached) $ac_c" 1>&6
8704 else
8705   ac_save_LIBS="$LIBS"
8706 LIBS="-lnsl  $LIBS"
8707 cat > conftest.$ac_ext <<EOF
8708 #line 8709 "configure"
8709 #include "confdefs.h"
8710
8711 int main() {
8712 main()
8713 ; return 0; }
8714 EOF
8715 if { (eval echo configure:8716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8716   rm -rf conftest*
8717   eval "ac_cv_lib_$ac_lib_var=yes"
8718 else
8719   echo "configure: failed program was:" >&5
8720   cat conftest.$ac_ext >&5
8721   rm -rf conftest*
8722   eval "ac_cv_lib_$ac_lib_var=no"
8723 fi
8724 rm -f conftest*
8725 LIBS="$ac_save_LIBS"
8726
8727 fi
8728 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8729   echo "$ac_t""yes" 1>&6
8730     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8731     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8732   cat >> confdefs.h <<EOF
8733 #define $ac_tr_lib 1
8734 EOF
8735
8736   LIBS="-lnsl $LIBS"
8737
8738 else
8739   echo "$ac_t""no" 1>&6
8740 fi
8741
8742         else
8743                 echo "configure: warning: could not find -lwrap" 1>&2
8744                 if test $ol_enable_wrappers = yes ; then
8745                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8746                 fi
8747
8748                 echo "configure: warning: disabling wrappers support" 1>&2
8749                 ol_enable_wrappers=no
8750         fi
8751 fi
8752
8753 if test $ol_enable_syslog != no ; then
8754         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8755 echo "configure:8756: checking for openlog" >&5
8756 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8757   echo $ac_n "(cached) $ac_c" 1>&6
8758 else
8759   cat > conftest.$ac_ext <<EOF
8760 #line 8761 "configure"
8761 #include "confdefs.h"
8762 /* System header to define __stub macros and hopefully few prototypes,
8763     which can conflict with char openlog(); below.  */
8764 #include <assert.h>
8765 /* Override any gcc2 internal prototype to avoid an error.  */
8766 /* We use char because int might match the return type of a gcc2
8767     builtin and then its argument prototype would still apply.  */
8768 char openlog();
8769
8770 int main() {
8771
8772 /* The GNU C library defines this for functions which it implements
8773     to always fail with ENOSYS.  Some functions are actually named
8774     something starting with __ and the normal name is an alias.  */
8775 #if defined (__stub_openlog) || defined (__stub___openlog)
8776 choke me
8777 #else
8778 openlog();
8779 #endif
8780
8781 ; return 0; }
8782 EOF
8783 if { (eval echo configure:8784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8784   rm -rf conftest*
8785   eval "ac_cv_func_openlog=yes"
8786 else
8787   echo "configure: failed program was:" >&5
8788   cat conftest.$ac_ext >&5
8789   rm -rf conftest*
8790   eval "ac_cv_func_openlog=no"
8791 fi
8792 rm -f conftest*
8793 fi
8794
8795 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8796   echo "$ac_t""yes" 1>&6
8797   :
8798 else
8799   echo "$ac_t""no" 1>&6
8800 fi
8801
8802         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8803                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8804         fi
8805         ol_enable_syslog=$ac_cv_func_openlog
8806 fi
8807
8808 if test $ol_enable_dmalloc != no ; then
8809         for ac_hdr in dmalloc.h
8810 do
8811 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8812 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8813 echo "configure:8814: checking for $ac_hdr" >&5
8814 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8815   echo $ac_n "(cached) $ac_c" 1>&6
8816 else
8817   cat > conftest.$ac_ext <<EOF
8818 #line 8819 "configure"
8819 #include "confdefs.h"
8820 #include <$ac_hdr>
8821 EOF
8822 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8823 { (eval echo configure:8824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8824 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8825 if test -z "$ac_err"; then
8826   rm -rf conftest*
8827   eval "ac_cv_header_$ac_safe=yes"
8828 else
8829   echo "$ac_err" >&5
8830   echo "configure: failed program was:" >&5
8831   cat conftest.$ac_ext >&5
8832   rm -rf conftest*
8833   eval "ac_cv_header_$ac_safe=no"
8834 fi
8835 rm -f conftest*
8836 fi
8837 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8838   echo "$ac_t""yes" 1>&6
8839     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8840   cat >> confdefs.h <<EOF
8841 #define $ac_tr_hdr 1
8842 EOF
8843  
8844 else
8845   echo "$ac_t""no" 1>&6
8846 fi
8847 done
8848
8849         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8850 echo "configure:8851: checking for dmalloc_shutdown in -ldmalloc" >&5
8851 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8852 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8853   echo $ac_n "(cached) $ac_c" 1>&6
8854 else
8855   ac_save_LIBS="$LIBS"
8856 LIBS="-ldmalloc  $LIBS"
8857 cat > conftest.$ac_ext <<EOF
8858 #line 8859 "configure"
8859 #include "confdefs.h"
8860 /* Override any gcc2 internal prototype to avoid an error.  */
8861 /* We use char because int might match the return type of a gcc2
8862     builtin and then its argument prototype would still apply.  */
8863 char dmalloc_shutdown();
8864
8865 int main() {
8866 dmalloc_shutdown()
8867 ; return 0; }
8868 EOF
8869 if { (eval echo configure:8870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8870   rm -rf conftest*
8871   eval "ac_cv_lib_$ac_lib_var=yes"
8872 else
8873   echo "configure: failed program was:" >&5
8874   cat conftest.$ac_ext >&5
8875   rm -rf conftest*
8876   eval "ac_cv_lib_$ac_lib_var=no"
8877 fi
8878 rm -f conftest*
8879 LIBS="$ac_save_LIBS"
8880
8881 fi
8882 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8883   echo "$ac_t""yes" 1>&6
8884     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8885     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8886   cat >> confdefs.h <<EOF
8887 #define $ac_tr_lib 1
8888 EOF
8889
8890   LIBS="-ldmalloc $LIBS"
8891
8892 else
8893   echo "$ac_t""no" 1>&6
8894 fi
8895
8896 fi
8897
8898 if test $ol_enable_tcl != no ; then
8899         for ac_hdr in tcl.h
8900 do
8901 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8902 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8903 echo "configure:8904: checking for $ac_hdr" >&5
8904 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8905   echo $ac_n "(cached) $ac_c" 1>&6
8906 else
8907   cat > conftest.$ac_ext <<EOF
8908 #line 8909 "configure"
8909 #include "confdefs.h"
8910 #include <$ac_hdr>
8911 EOF
8912 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8913 { (eval echo configure:8914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8914 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8915 if test -z "$ac_err"; then
8916   rm -rf conftest*
8917   eval "ac_cv_header_$ac_safe=yes"
8918 else
8919   echo "$ac_err" >&5
8920   echo "configure: failed program was:" >&5
8921   cat conftest.$ac_ext >&5
8922   rm -rf conftest*
8923   eval "ac_cv_header_$ac_safe=no"
8924 fi
8925 rm -f conftest*
8926 fi
8927 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8928   echo "$ac_t""yes" 1>&6
8929     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8930   cat >> confdefs.h <<EOF
8931 #define $ac_tr_hdr 1
8932 EOF
8933  
8934 else
8935   echo "$ac_t""no" 1>&6
8936 fi
8937 done
8938
8939
8940         if test $ac_cv_header_tcl_h != yes ; then
8941                 have_tcl=no
8942         else
8943                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8944 echo "configure:8945: checking for main in -ltcl" >&5
8945 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8946 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8947   echo $ac_n "(cached) $ac_c" 1>&6
8948 else
8949   ac_save_LIBS="$LIBS"
8950 LIBS="-ltcl  $LIBS"
8951 cat > conftest.$ac_ext <<EOF
8952 #line 8953 "configure"
8953 #include "confdefs.h"
8954
8955 int main() {
8956 main()
8957 ; return 0; }
8958 EOF
8959 if { (eval echo configure:8960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8960   rm -rf conftest*
8961   eval "ac_cv_lib_$ac_lib_var=yes"
8962 else
8963   echo "configure: failed program was:" >&5
8964   cat conftest.$ac_ext >&5
8965   rm -rf conftest*
8966   eval "ac_cv_lib_$ac_lib_var=no"
8967 fi
8968 rm -f conftest*
8969 LIBS="$ac_save_LIBS"
8970
8971 fi
8972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8973   echo "$ac_t""yes" 1>&6
8974   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8975 else
8976   echo "$ac_t""no" 1>&6
8977 have_tcl=no
8978 fi
8979
8980
8981                 if test $have_tcl != yes; then
8982                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8983 echo "configure:8984: checking for main in -ltcl7.6" >&5
8984 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8985 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8986   echo $ac_n "(cached) $ac_c" 1>&6
8987 else
8988   ac_save_LIBS="$LIBS"
8989 LIBS="-ltcl7.6  $LIBS"
8990 cat > conftest.$ac_ext <<EOF
8991 #line 8992 "configure"
8992 #include "confdefs.h"
8993
8994 int main() {
8995 main()
8996 ; return 0; }
8997 EOF
8998 if { (eval echo configure:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8999   rm -rf conftest*
9000   eval "ac_cv_lib_$ac_lib_var=yes"
9001 else
9002   echo "configure: failed program was:" >&5
9003   cat conftest.$ac_ext >&5
9004   rm -rf conftest*
9005   eval "ac_cv_lib_$ac_lib_var=no"
9006 fi
9007 rm -f conftest*
9008 LIBS="$ac_save_LIBS"
9009
9010 fi
9011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9012   echo "$ac_t""yes" 1>&6
9013   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
9014 else
9015   echo "$ac_t""no" 1>&6
9016 have_tcl=no
9017 fi
9018
9019                 fi
9020
9021                 if test $have_tcl != yes; then
9022                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
9023 echo "configure:9024: checking for main in -ltcl8.0" >&5
9024 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
9025 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9026   echo $ac_n "(cached) $ac_c" 1>&6
9027 else
9028   ac_save_LIBS="$LIBS"
9029 LIBS="-ltcl8.0  $LIBS"
9030 cat > conftest.$ac_ext <<EOF
9031 #line 9032 "configure"
9032 #include "confdefs.h"
9033
9034 int main() {
9035 main()
9036 ; return 0; }
9037 EOF
9038 if { (eval echo configure:9039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9039   rm -rf conftest*
9040   eval "ac_cv_lib_$ac_lib_var=yes"
9041 else
9042   echo "configure: failed program was:" >&5
9043   cat conftest.$ac_ext >&5
9044   rm -rf conftest*
9045   eval "ac_cv_lib_$ac_lib_var=no"
9046 fi
9047 rm -f conftest*
9048 LIBS="$ac_save_LIBS"
9049
9050 fi
9051 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9052   echo "$ac_t""yes" 1>&6
9053   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
9054 else
9055   echo "$ac_t""no" 1>&6
9056 have_tcl=no
9057 fi
9058
9059                 fi
9060         fi
9061
9062         if test $have_tcl != yes ; then
9063                 echo "configure: warning: could not find -ltcl" 1>&2
9064                 if test $ol_enable_tcl = yes ; then
9065                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
9066                 fi
9067
9068                 ol_enable_tcl=no
9069         fi
9070 fi
9071
9072 # ud needs termcap (should insert check here)
9073 ol_link_termcap=no
9074 for ac_hdr in termcap.h ncurses.h
9075 do
9076 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9077 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9078 echo "configure:9079: checking for $ac_hdr" >&5
9079 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9080   echo $ac_n "(cached) $ac_c" 1>&6
9081 else
9082   cat > conftest.$ac_ext <<EOF
9083 #line 9084 "configure"
9084 #include "confdefs.h"
9085 #include <$ac_hdr>
9086 EOF
9087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9088 { (eval echo configure:9089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9089 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9090 if test -z "$ac_err"; then
9091   rm -rf conftest*
9092   eval "ac_cv_header_$ac_safe=yes"
9093 else
9094   echo "$ac_err" >&5
9095   echo "configure: failed program was:" >&5
9096   cat conftest.$ac_ext >&5
9097   rm -rf conftest*
9098   eval "ac_cv_header_$ac_safe=no"
9099 fi
9100 rm -f conftest*
9101 fi
9102 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9103   echo "$ac_t""yes" 1>&6
9104     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9105   cat >> confdefs.h <<EOF
9106 #define $ac_tr_hdr 1
9107 EOF
9108  
9109 else
9110   echo "$ac_t""no" 1>&6
9111 fi
9112 done
9113
9114
9115 if test $ol_link_termcap = no ; then
9116         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
9117 echo "configure:9118: checking for tputs in -ltermcap" >&5
9118 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
9119 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9120   echo $ac_n "(cached) $ac_c" 1>&6
9121 else
9122   ac_save_LIBS="$LIBS"
9123 LIBS="-ltermcap  $LIBS"
9124 cat > conftest.$ac_ext <<EOF
9125 #line 9126 "configure"
9126 #include "confdefs.h"
9127 /* Override any gcc2 internal prototype to avoid an error.  */
9128 /* We use char because int might match the return type of a gcc2
9129     builtin and then its argument prototype would still apply.  */
9130 char tputs();
9131
9132 int main() {
9133 tputs()
9134 ; return 0; }
9135 EOF
9136 if { (eval echo configure:9137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9137   rm -rf conftest*
9138   eval "ac_cv_lib_$ac_lib_var=yes"
9139 else
9140   echo "configure: failed program was:" >&5
9141   cat conftest.$ac_ext >&5
9142   rm -rf conftest*
9143   eval "ac_cv_lib_$ac_lib_var=no"
9144 fi
9145 rm -f conftest*
9146 LIBS="$ac_save_LIBS"
9147
9148 fi
9149 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9150   echo "$ac_t""yes" 1>&6
9151   have_termcap=yes
9152 else
9153   echo "$ac_t""no" 1>&6
9154 have_termcap=no
9155 fi
9156
9157         if test $have_termcap = yes ; then
9158                 cat >> confdefs.h <<\EOF
9159 #define HAVE_TERMCAP 1
9160 EOF
9161
9162                 ol_link_termcap=yes
9163                 TERMCAP_LIBS=-ltermcap
9164         fi
9165 fi
9166
9167 if test $ol_link_termcap = no ; then
9168         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
9169 echo "configure:9170: checking for initscr in -lncurses" >&5
9170 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
9171 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9172   echo $ac_n "(cached) $ac_c" 1>&6
9173 else
9174   ac_save_LIBS="$LIBS"
9175 LIBS="-lncurses  $LIBS"
9176 cat > conftest.$ac_ext <<EOF
9177 #line 9178 "configure"
9178 #include "confdefs.h"
9179 /* Override any gcc2 internal prototype to avoid an error.  */
9180 /* We use char because int might match the return type of a gcc2
9181     builtin and then its argument prototype would still apply.  */
9182 char initscr();
9183
9184 int main() {
9185 initscr()
9186 ; return 0; }
9187 EOF
9188 if { (eval echo configure:9189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9189   rm -rf conftest*
9190   eval "ac_cv_lib_$ac_lib_var=yes"
9191 else
9192   echo "configure: failed program was:" >&5
9193   cat conftest.$ac_ext >&5
9194   rm -rf conftest*
9195   eval "ac_cv_lib_$ac_lib_var=no"
9196 fi
9197 rm -f conftest*
9198 LIBS="$ac_save_LIBS"
9199
9200 fi
9201 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9202   echo "$ac_t""yes" 1>&6
9203   have_ncurses=yes
9204 else
9205   echo "$ac_t""no" 1>&6
9206 have_ncurses=no
9207 fi
9208
9209         if test $have_ncurses = yes ; then
9210                 cat >> confdefs.h <<\EOF
9211 #define HAVE_NCURSES 1
9212 EOF
9213
9214                 ol_link_termcap=yes
9215                 TERMCAP_LIBS=-lncurses
9216         fi
9217 fi
9218
9219 if test $ol_link_termcap = no ; then
9220         cat >> confdefs.h <<\EOF
9221 #define NO_TERMCAP 1
9222 EOF
9223
9224         TERMCAP_LIBS=
9225 fi
9226
9227 ol_link_readline=no
9228 if test $ol_with_readline != no ; then
9229         for ac_hdr in readline/readline.h readline/history.h
9230 do
9231 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9232 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9233 echo "configure:9234: checking for $ac_hdr" >&5
9234 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9235   echo $ac_n "(cached) $ac_c" 1>&6
9236 else
9237   cat > conftest.$ac_ext <<EOF
9238 #line 9239 "configure"
9239 #include "confdefs.h"
9240 #include <$ac_hdr>
9241 EOF
9242 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9243 { (eval echo configure:9244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9244 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9245 if test -z "$ac_err"; then
9246   rm -rf conftest*
9247   eval "ac_cv_header_$ac_safe=yes"
9248 else
9249   echo "$ac_err" >&5
9250   echo "configure: failed program was:" >&5
9251   cat conftest.$ac_ext >&5
9252   rm -rf conftest*
9253   eval "ac_cv_header_$ac_safe=no"
9254 fi
9255 rm -f conftest*
9256 fi
9257 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9258   echo "$ac_t""yes" 1>&6
9259     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9260   cat >> confdefs.h <<EOF
9261 #define $ac_tr_hdr 1
9262 EOF
9263  
9264 else
9265   echo "$ac_t""no" 1>&6
9266 fi
9267 done
9268
9269
9270         if test $ac_cv_header_readline_readline_h = yes ; then
9271                 save_LIBS="$LIBS"
9272                 LIBS="$TERMCAP_LIBS $LIBS"
9273                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
9274 echo "configure:9275: checking for readline in -lreadline" >&5
9275 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
9276 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9277   echo $ac_n "(cached) $ac_c" 1>&6
9278 else
9279   ac_save_LIBS="$LIBS"
9280 LIBS="-lreadline  $LIBS"
9281 cat > conftest.$ac_ext <<EOF
9282 #line 9283 "configure"
9283 #include "confdefs.h"
9284 /* Override any gcc2 internal prototype to avoid an error.  */
9285 /* We use char because int might match the return type of a gcc2
9286     builtin and then its argument prototype would still apply.  */
9287 char readline();
9288
9289 int main() {
9290 readline()
9291 ; return 0; }
9292 EOF
9293 if { (eval echo configure:9294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9294   rm -rf conftest*
9295   eval "ac_cv_lib_$ac_lib_var=yes"
9296 else
9297   echo "configure: failed program was:" >&5
9298   cat conftest.$ac_ext >&5
9299   rm -rf conftest*
9300   eval "ac_cv_lib_$ac_lib_var=no"
9301 fi
9302 rm -f conftest*
9303 LIBS="$ac_save_LIBS"
9304
9305 fi
9306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9307   echo "$ac_t""yes" 1>&6
9308   have_readline=yes
9309 else
9310   echo "$ac_t""no" 1>&6
9311 have_readline=no
9312 fi
9313
9314                 LIBS="$save_LIBS"
9315                         
9316                 if test $have_readline = yes ; then
9317                         ol_with_readline=found
9318                         ol_link_readline=yes
9319
9320                         READLINE_LIBS="-lreadline"
9321                 fi
9322         fi
9323 fi
9324
9325 if test $ol_link_readline = yes ; then
9326         cat >> confdefs.h <<\EOF
9327 #define HAVE_READLINE 1
9328 EOF
9329
9330 fi
9331
9332
9333 # FreeBSD (and others) have crypt(3) in -lcrypt
9334 if test $ol_enable_crypt != no ; then
9335         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9336 echo "configure:9337: checking for crypt" >&5
9337 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9338   echo $ac_n "(cached) $ac_c" 1>&6
9339 else
9340   cat > conftest.$ac_ext <<EOF
9341 #line 9342 "configure"
9342 #include "confdefs.h"
9343 /* System header to define __stub macros and hopefully few prototypes,
9344     which can conflict with char crypt(); below.  */
9345 #include <assert.h>
9346 /* Override any gcc2 internal prototype to avoid an error.  */
9347 /* We use char because int might match the return type of a gcc2
9348     builtin and then its argument prototype would still apply.  */
9349 char crypt();
9350
9351 int main() {
9352
9353 /* The GNU C library defines this for functions which it implements
9354     to always fail with ENOSYS.  Some functions are actually named
9355     something starting with __ and the normal name is an alias.  */
9356 #if defined (__stub_crypt) || defined (__stub___crypt)
9357 choke me
9358 #else
9359 crypt();
9360 #endif
9361
9362 ; return 0; }
9363 EOF
9364 if { (eval echo configure:9365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9365   rm -rf conftest*
9366   eval "ac_cv_func_crypt=yes"
9367 else
9368   echo "configure: failed program was:" >&5
9369   cat conftest.$ac_ext >&5
9370   rm -rf conftest*
9371   eval "ac_cv_func_crypt=no"
9372 fi
9373 rm -f conftest*
9374 fi
9375
9376 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9377   echo "$ac_t""yes" 1>&6
9378   have_crypt=yes
9379 else
9380   echo "$ac_t""no" 1>&6
9381
9382                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9383 echo "configure:9384: checking for crypt in -lcrypt" >&5
9384 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9385 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9386   echo $ac_n "(cached) $ac_c" 1>&6
9387 else
9388   ac_save_LIBS="$LIBS"
9389 LIBS="-lcrypt  $LIBS"
9390 cat > conftest.$ac_ext <<EOF
9391 #line 9392 "configure"
9392 #include "confdefs.h"
9393 /* Override any gcc2 internal prototype to avoid an error.  */
9394 /* We use char because int might match the return type of a gcc2
9395     builtin and then its argument prototype would still apply.  */
9396 char crypt();
9397
9398 int main() {
9399 crypt()
9400 ; return 0; }
9401 EOF
9402 if { (eval echo configure:9403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9403   rm -rf conftest*
9404   eval "ac_cv_lib_$ac_lib_var=yes"
9405 else
9406   echo "configure: failed program was:" >&5
9407   cat conftest.$ac_ext >&5
9408   rm -rf conftest*
9409   eval "ac_cv_lib_$ac_lib_var=no"
9410 fi
9411 rm -f conftest*
9412 LIBS="$ac_save_LIBS"
9413
9414 fi
9415 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9416   echo "$ac_t""yes" 1>&6
9417   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9418                         have_crypt=yes
9419 else
9420   echo "$ac_t""no" 1>&6
9421 have_crypt=no
9422 fi
9423
9424 fi
9425
9426
9427         if test $have_crypt = yes ; then
9428                 cat >> confdefs.h <<\EOF
9429 #define HAVE_CRYPT 1
9430 EOF
9431
9432         else
9433                 echo "configure: warning: could not find crypt" 1>&2
9434                 if test $ol_enable_crypt = yes ; then
9435                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9436                 fi
9437
9438                 echo "configure: warning: disabling crypt support" 1>&2
9439                 ol_enable_crypt=no
9440         fi
9441 fi
9442
9443 # FreeBSD (and others) have setproctitle(3) in -lutil
9444 if test $ol_enable_proctitle != no ; then
9445         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9446 echo "configure:9447: checking for setproctitle" >&5
9447 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9448   echo $ac_n "(cached) $ac_c" 1>&6
9449 else
9450   cat > conftest.$ac_ext <<EOF
9451 #line 9452 "configure"
9452 #include "confdefs.h"
9453 /* System header to define __stub macros and hopefully few prototypes,
9454     which can conflict with char setproctitle(); below.  */
9455 #include <assert.h>
9456 /* Override any gcc2 internal prototype to avoid an error.  */
9457 /* We use char because int might match the return type of a gcc2
9458     builtin and then its argument prototype would still apply.  */
9459 char setproctitle();
9460
9461 int main() {
9462
9463 /* The GNU C library defines this for functions which it implements
9464     to always fail with ENOSYS.  Some functions are actually named
9465     something starting with __ and the normal name is an alias.  */
9466 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9467 choke me
9468 #else
9469 setproctitle();
9470 #endif
9471
9472 ; return 0; }
9473 EOF
9474 if { (eval echo configure:9475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9475   rm -rf conftest*
9476   eval "ac_cv_func_setproctitle=yes"
9477 else
9478   echo "configure: failed program was:" >&5
9479   cat conftest.$ac_ext >&5
9480   rm -rf conftest*
9481   eval "ac_cv_func_setproctitle=no"
9482 fi
9483 rm -f conftest*
9484 fi
9485
9486 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9487   echo "$ac_t""yes" 1>&6
9488   have_setproctitle=yes
9489 else
9490   echo "$ac_t""no" 1>&6
9491
9492                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9493 echo "configure:9494: checking for setproctitle in -lutil" >&5
9494 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9495 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9496   echo $ac_n "(cached) $ac_c" 1>&6
9497 else
9498   ac_save_LIBS="$LIBS"
9499 LIBS="-lutil  $LIBS"
9500 cat > conftest.$ac_ext <<EOF
9501 #line 9502 "configure"
9502 #include "confdefs.h"
9503 /* Override any gcc2 internal prototype to avoid an error.  */
9504 /* We use char because int might match the return type of a gcc2
9505     builtin and then its argument prototype would still apply.  */
9506 char setproctitle();
9507
9508 int main() {
9509 setproctitle()
9510 ; return 0; }
9511 EOF
9512 if { (eval echo configure:9513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9513   rm -rf conftest*
9514   eval "ac_cv_lib_$ac_lib_var=yes"
9515 else
9516   echo "configure: failed program was:" >&5
9517   cat conftest.$ac_ext >&5
9518   rm -rf conftest*
9519   eval "ac_cv_lib_$ac_lib_var=no"
9520 fi
9521 rm -f conftest*
9522 LIBS="$ac_save_LIBS"
9523
9524 fi
9525 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9526   echo "$ac_t""yes" 1>&6
9527   have_setproctitle=yes
9528                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9529 else
9530   echo "$ac_t""no" 1>&6
9531 have_setproctitle=no
9532                         LIBOBJS="$LIBOBJS setproctitle.o"
9533 fi
9534
9535 fi
9536
9537
9538         if test $have_setproctitle = yes ; then
9539                 cat >> confdefs.h <<\EOF
9540 #define HAVE_SETPROCTITLE 1
9541 EOF
9542
9543         fi
9544 fi
9545
9546 # test for EBCDIC
9547 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9548 echo "configure:9549: checking for EBCDIC" >&5
9549 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9550   echo $ac_n "(cached) $ac_c" 1>&6
9551 else
9552   
9553         cat > conftest.$ac_ext <<EOF
9554 #line 9555 "configure"
9555 #include "confdefs.h"
9556
9557 #if !('M' == 0xd4)
9558 #include <__ASCII__/generate_error.h>
9559 #endif
9560
9561 EOF
9562 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9563 { (eval echo configure:9564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9564 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9565 if test -z "$ac_err"; then
9566   rm -rf conftest*
9567   ol_cv_cpp_ebcdic=yes
9568 else
9569   echo "$ac_err" >&5
9570   echo "configure: failed program was:" >&5
9571   cat conftest.$ac_ext >&5
9572   rm -rf conftest*
9573   ol_cv_cpp_ebcdic=no
9574 fi
9575 rm -f conftest*
9576 fi
9577
9578 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9579 if test $ol_cv_cpp_ebcdic = yes ; then
9580         cat >> confdefs.h <<\EOF
9581 #define HAVE_EBCDIC 1
9582 EOF
9583
9584 fi
9585
9586 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9587 echo "configure:9588: checking for ANSI C header files" >&5
9588 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9589   echo $ac_n "(cached) $ac_c" 1>&6
9590 else
9591   cat > conftest.$ac_ext <<EOF
9592 #line 9593 "configure"
9593 #include "confdefs.h"
9594 #include <stdlib.h>
9595 #include <stdarg.h>
9596 #include <string.h>
9597 #include <float.h>
9598 EOF
9599 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9600 { (eval echo configure:9601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9601 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9602 if test -z "$ac_err"; then
9603   rm -rf conftest*
9604   ol_cv_header_stdc=yes
9605 else
9606   echo "$ac_err" >&5
9607   echo "configure: failed program was:" >&5
9608   cat conftest.$ac_ext >&5
9609   rm -rf conftest*
9610   ol_cv_header_stdc=no
9611 fi
9612 rm -f conftest*
9613
9614 if test $ol_cv_header_stdc = yes; then
9615   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9616 cat > conftest.$ac_ext <<EOF
9617 #line 9618 "configure"
9618 #include "confdefs.h"
9619 #include <string.h>
9620 EOF
9621 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9622   egrep "memchr" >/dev/null 2>&1; then
9623   :
9624 else
9625   rm -rf conftest*
9626   ol_cv_header_stdc=no
9627 fi
9628 rm -f conftest*
9629
9630 fi
9631
9632 if test $ol_cv_header_stdc = yes; then
9633   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9634 cat > conftest.$ac_ext <<EOF
9635 #line 9636 "configure"
9636 #include "confdefs.h"
9637 #include <stdlib.h>
9638 EOF
9639 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9640   egrep "free" >/dev/null 2>&1; then
9641   :
9642 else
9643   rm -rf conftest*
9644   ol_cv_header_stdc=no
9645 fi
9646 rm -f conftest*
9647
9648 fi
9649
9650 if test $ol_cv_header_stdc = yes; then
9651   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9652 if test "$cross_compiling" = yes; then
9653   :
9654 else
9655   cat > conftest.$ac_ext <<EOF
9656 #line 9657 "configure"
9657 #include "confdefs.h"
9658 #include <ctype.h>
9659 #ifndef HAVE_EBCDIC
9660 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9661 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9662 #else
9663 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9664                 || ('j' <= (c) && (c) <= 'r') \
9665                 || ('s' <= (c) && (c) <= 'z'))
9666 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9667 #endif
9668 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9669 int main () { int i; for (i = 0; i < 256; i++)
9670 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9671 exit (0); }
9672
9673 EOF
9674 if { (eval echo configure:9675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9675 then
9676   :
9677 else
9678   echo "configure: failed program was:" >&5
9679   cat conftest.$ac_ext >&5
9680   rm -fr conftest*
9681   ol_cv_header_stdc=no
9682 fi
9683 rm -fr conftest*
9684 fi
9685
9686 fi
9687 fi
9688
9689 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9690 if test $ol_cv_header_stdc = yes; then
9691   cat >> confdefs.h <<\EOF
9692 #define STDC_HEADERS 1
9693 EOF
9694
9695 fi
9696 ac_cv_header_stdc=disable
9697
9698
9699 if test $ol_cv_header_stdc != yes; then
9700         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9701 fi
9702
9703 ac_header_dirent=no
9704 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9705 do
9706 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9707 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9708 echo "configure:9709: checking for $ac_hdr that defines DIR" >&5
9709 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9710   echo $ac_n "(cached) $ac_c" 1>&6
9711 else
9712   cat > conftest.$ac_ext <<EOF
9713 #line 9714 "configure"
9714 #include "confdefs.h"
9715 #include <sys/types.h>
9716 #include <$ac_hdr>
9717 int main() {
9718 DIR *dirp = 0;
9719 ; return 0; }
9720 EOF
9721 if { (eval echo configure:9722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9722   rm -rf conftest*
9723   eval "ac_cv_header_dirent_$ac_safe=yes"
9724 else
9725   echo "configure: failed program was:" >&5
9726   cat conftest.$ac_ext >&5
9727   rm -rf conftest*
9728   eval "ac_cv_header_dirent_$ac_safe=no"
9729 fi
9730 rm -f conftest*
9731 fi
9732 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9733   echo "$ac_t""yes" 1>&6
9734     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9735   cat >> confdefs.h <<EOF
9736 #define $ac_tr_hdr 1
9737 EOF
9738  ac_header_dirent=$ac_hdr; break
9739 else
9740   echo "$ac_t""no" 1>&6
9741 fi
9742 done
9743 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9744 if test $ac_header_dirent = dirent.h; then
9745 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9746 echo "configure:9747: checking for opendir in -ldir" >&5
9747 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9748 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9749   echo $ac_n "(cached) $ac_c" 1>&6
9750 else
9751   ac_save_LIBS="$LIBS"
9752 LIBS="-ldir  $LIBS"
9753 cat > conftest.$ac_ext <<EOF
9754 #line 9755 "configure"
9755 #include "confdefs.h"
9756 /* Override any gcc2 internal prototype to avoid an error.  */
9757 /* We use char because int might match the return type of a gcc2
9758     builtin and then its argument prototype would still apply.  */
9759 char opendir();
9760
9761 int main() {
9762 opendir()
9763 ; return 0; }
9764 EOF
9765 if { (eval echo configure:9766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9766   rm -rf conftest*
9767   eval "ac_cv_lib_$ac_lib_var=yes"
9768 else
9769   echo "configure: failed program was:" >&5
9770   cat conftest.$ac_ext >&5
9771   rm -rf conftest*
9772   eval "ac_cv_lib_$ac_lib_var=no"
9773 fi
9774 rm -f conftest*
9775 LIBS="$ac_save_LIBS"
9776
9777 fi
9778 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9779   echo "$ac_t""yes" 1>&6
9780   LIBS="$LIBS -ldir"
9781 else
9782   echo "$ac_t""no" 1>&6
9783 fi
9784
9785 else
9786 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9787 echo "configure:9788: checking for opendir in -lx" >&5
9788 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9789 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9790   echo $ac_n "(cached) $ac_c" 1>&6
9791 else
9792   ac_save_LIBS="$LIBS"
9793 LIBS="-lx  $LIBS"
9794 cat > conftest.$ac_ext <<EOF
9795 #line 9796 "configure"
9796 #include "confdefs.h"
9797 /* Override any gcc2 internal prototype to avoid an error.  */
9798 /* We use char because int might match the return type of a gcc2
9799     builtin and then its argument prototype would still apply.  */
9800 char opendir();
9801
9802 int main() {
9803 opendir()
9804 ; return 0; }
9805 EOF
9806 if { (eval echo configure:9807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9807   rm -rf conftest*
9808   eval "ac_cv_lib_$ac_lib_var=yes"
9809 else
9810   echo "configure: failed program was:" >&5
9811   cat conftest.$ac_ext >&5
9812   rm -rf conftest*
9813   eval "ac_cv_lib_$ac_lib_var=no"
9814 fi
9815 rm -f conftest*
9816 LIBS="$ac_save_LIBS"
9817
9818 fi
9819 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9820   echo "$ac_t""yes" 1>&6
9821   LIBS="$LIBS -lx"
9822 else
9823   echo "$ac_t""no" 1>&6
9824 fi
9825
9826 fi
9827
9828 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9829 echo "configure:9830: checking for sys/wait.h that is POSIX.1 compatible" >&5
9830 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9831   echo $ac_n "(cached) $ac_c" 1>&6
9832 else
9833   cat > conftest.$ac_ext <<EOF
9834 #line 9835 "configure"
9835 #include "confdefs.h"
9836 #include <sys/types.h>
9837 #include <sys/wait.h>
9838 #ifndef WEXITSTATUS
9839 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9840 #endif
9841 #ifndef WIFEXITED
9842 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9843 #endif
9844 int main() {
9845 int s;
9846 wait (&s);
9847 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9848 ; return 0; }
9849 EOF
9850 if { (eval echo configure:9851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9851   rm -rf conftest*
9852   ac_cv_header_sys_wait_h=yes
9853 else
9854   echo "configure: failed program was:" >&5
9855   cat conftest.$ac_ext >&5
9856   rm -rf conftest*
9857   ac_cv_header_sys_wait_h=no
9858 fi
9859 rm -f conftest*
9860 fi
9861
9862 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9863 if test $ac_cv_header_sys_wait_h = yes; then
9864   cat >> confdefs.h <<\EOF
9865 #define HAVE_SYS_WAIT_H 1
9866 EOF
9867
9868 fi
9869
9870 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9871 echo "configure:9872: checking POSIX termios" >&5
9872 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9873   echo $ac_n "(cached) $ac_c" 1>&6
9874 else
9875   cat > conftest.$ac_ext <<EOF
9876 #line 9877 "configure"
9877 #include "confdefs.h"
9878 #include <sys/types.h>
9879 #include <unistd.h>
9880 #include <termios.h>
9881 int main() {
9882 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9883    tcgetattr(0, 0);
9884 ; return 0; }
9885 EOF
9886 if { (eval echo configure:9887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9887   rm -rf conftest*
9888   am_cv_sys_posix_termios=yes
9889 else
9890   echo "configure: failed program was:" >&5
9891   cat conftest.$ac_ext >&5
9892   rm -rf conftest*
9893   am_cv_sys_posix_termios=no
9894 fi
9895 rm -f conftest*
9896 fi
9897
9898 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9899
9900
9901  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9902 echo "configure:9903: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9903 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9904   echo $ac_n "(cached) $ac_c" 1>&6
9905 else
9906   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9907
9908   gwinsz_in_termios_h=no
9909   if test $am_cv_sys_posix_termios = yes; then
9910     cat > conftest.$ac_ext <<EOF
9911 #line 9912 "configure"
9912 #include "confdefs.h"
9913 #include <sys/types.h>
9914 #     include <termios.h>
9915 #     ifdef TIOCGWINSZ
9916         yes
9917 #     endif
9918     
9919 EOF
9920 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9921   egrep "yes" >/dev/null 2>&1; then
9922   rm -rf conftest*
9923   gwinsz_in_termios_h=yes
9924 fi
9925 rm -f conftest*
9926
9927   fi
9928
9929   if test $gwinsz_in_termios_h = no; then
9930     cat > conftest.$ac_ext <<EOF
9931 #line 9932 "configure"
9932 #include "confdefs.h"
9933 #include <sys/types.h>
9934 #     include <sys/ioctl.h>
9935 #     ifdef TIOCGWINSZ
9936         yes
9937 #     endif
9938     
9939 EOF
9940 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9941   egrep "yes" >/dev/null 2>&1; then
9942   rm -rf conftest*
9943   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9944 fi
9945 rm -f conftest*
9946
9947   fi
9948   
9949 fi
9950
9951 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9952   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9953     cat >> confdefs.h <<\EOF
9954 #define GWINSZ_IN_SYS_IOCTL 1
9955 EOF
9956
9957   fi
9958
9959 if test $am_cv_sys_posix_termios = yes ; then
9960         cat >> confdefs.h <<\EOF
9961 #define HAVE_POSIX_TERMIOS 1
9962 EOF
9963
9964 fi
9965
9966 for ac_hdr in \
9967         arpa/inet.h             \
9968         arpa/nameser.h  \
9969         assert.h                \
9970         crypt.h                 \
9971         errno.h                 \
9972         fcntl.h                 \
9973         filio.h                 \
9974         getopt.h                \
9975         grp.h                   \
9976         libutil.h               \
9977         limits.h                \
9978         locale.h                \
9979         malloc.h                \
9980         memory.h                \
9981         psap.h                  \
9982         pwd.h                   \
9983         resolv.h                \
9984         sgtty.h                 \
9985         stdarg.h                \
9986         stddef.h                \
9987         string.h                \
9988         strings.h               \
9989         sysexits.h              \
9990         sys/file.h              \
9991         sys/filio.h             \
9992         sys/errno.h             \
9993         sys/ioctl.h             \
9994         sys/param.h             \
9995         sys/resource.h  \
9996         sys/select.h    \
9997         sys/socket.h    \
9998         sys/syslog.h    \
9999         sys/time.h              \
10000         sys/types.h             \
10001         syslog.h                \
10002         termios.h               \
10003         unistd.h                \
10004
10005 do
10006 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10007 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10008 echo "configure:10009: checking for $ac_hdr" >&5
10009 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10010   echo $ac_n "(cached) $ac_c" 1>&6
10011 else
10012   cat > conftest.$ac_ext <<EOF
10013 #line 10014 "configure"
10014 #include "confdefs.h"
10015 #include <$ac_hdr>
10016 EOF
10017 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10018 { (eval echo configure:10019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10019 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10020 if test -z "$ac_err"; then
10021   rm -rf conftest*
10022   eval "ac_cv_header_$ac_safe=yes"
10023 else
10024   echo "$ac_err" >&5
10025   echo "configure: failed program was:" >&5
10026   cat conftest.$ac_ext >&5
10027   rm -rf conftest*
10028   eval "ac_cv_header_$ac_safe=no"
10029 fi
10030 rm -f conftest*
10031 fi
10032 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10033   echo "$ac_t""yes" 1>&6
10034     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10035   cat >> confdefs.h <<EOF
10036 #define $ac_tr_hdr 1
10037 EOF
10038  
10039 else
10040   echo "$ac_t""no" 1>&6
10041 fi
10042 done
10043
10044
10045 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
10046 echo "configure:10047: checking for uid_t in sys/types.h" >&5
10047 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
10048   echo $ac_n "(cached) $ac_c" 1>&6
10049 else
10050   cat > conftest.$ac_ext <<EOF
10051 #line 10052 "configure"
10052 #include "confdefs.h"
10053 #include <sys/types.h>
10054 EOF
10055 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10056   egrep "uid_t" >/dev/null 2>&1; then
10057   rm -rf conftest*
10058   ac_cv_type_uid_t=yes
10059 else
10060   rm -rf conftest*
10061   ac_cv_type_uid_t=no
10062 fi
10063 rm -f conftest*
10064
10065 fi
10066
10067 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10068 if test $ac_cv_type_uid_t = no; then
10069   cat >> confdefs.h <<\EOF
10070 #define uid_t int
10071 EOF
10072
10073   cat >> confdefs.h <<\EOF
10074 #define gid_t int
10075 EOF
10076
10077 fi
10078
10079 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10080 echo "configure:10081: checking type of array argument to getgroups" >&5
10081 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
10082   echo $ac_n "(cached) $ac_c" 1>&6
10083 else
10084   if test "$cross_compiling" = yes; then
10085   ac_cv_type_getgroups=cross
10086 else
10087   cat > conftest.$ac_ext <<EOF
10088 #line 10089 "configure"
10089 #include "confdefs.h"
10090
10091 /* Thanks to Mike Rendell for this test.  */
10092 #include <sys/types.h>
10093 #define NGID 256
10094 #undef MAX
10095 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10096 main()
10097 {
10098   gid_t gidset[NGID];
10099   int i, n;
10100   union { gid_t gval; long lval; }  val;
10101
10102   val.lval = -1;
10103   for (i = 0; i < NGID; i++)
10104     gidset[i] = val.gval;
10105   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10106                  gidset);
10107   /* Exit non-zero if getgroups seems to require an array of ints.  This
10108      happens when gid_t is short but getgroups modifies an array of ints.  */
10109   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10110 }
10111
10112 EOF
10113 if { (eval echo configure:10114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10114 then
10115     ac_cv_type_getgroups=gid_t
10116 else
10117   echo "configure: failed program was:" >&5
10118   cat conftest.$ac_ext >&5
10119   rm -fr conftest*
10120   ac_cv_type_getgroups=int
10121 fi
10122 rm -fr conftest*
10123 fi
10124
10125 if test $ac_cv_type_getgroups = cross; then
10126         cat > conftest.$ac_ext <<EOF
10127 #line 10128 "configure"
10128 #include "confdefs.h"
10129 #include <unistd.h>
10130 EOF
10131 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10132   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10133   rm -rf conftest*
10134   ac_cv_type_getgroups=gid_t
10135 else
10136   rm -rf conftest*
10137   ac_cv_type_getgroups=int
10138 fi
10139 rm -f conftest*
10140
10141 fi
10142 fi
10143
10144 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10145 cat >> confdefs.h <<EOF
10146 #define GETGROUPS_T $ac_cv_type_getgroups
10147 EOF
10148
10149  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10150 echo "configure:10151: checking for ANSI C header files" >&5
10151 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
10152   echo $ac_n "(cached) $ac_c" 1>&6
10153 else
10154   cat > conftest.$ac_ext <<EOF
10155 #line 10156 "configure"
10156 #include "confdefs.h"
10157 #include <stdlib.h>
10158 #include <stdarg.h>
10159 #include <string.h>
10160 #include <float.h>
10161 EOF
10162 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10163 { (eval echo configure:10164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10164 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10165 if test -z "$ac_err"; then
10166   rm -rf conftest*
10167   ac_cv_header_stdc=yes
10168 else
10169   echo "$ac_err" >&5
10170   echo "configure: failed program was:" >&5
10171   cat conftest.$ac_ext >&5
10172   rm -rf conftest*
10173   ac_cv_header_stdc=no
10174 fi
10175 rm -f conftest*
10176
10177 if test $ac_cv_header_stdc = yes; then
10178   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10179 cat > conftest.$ac_ext <<EOF
10180 #line 10181 "configure"
10181 #include "confdefs.h"
10182 #include <string.h>
10183 EOF
10184 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10185   egrep "memchr" >/dev/null 2>&1; then
10186   :
10187 else
10188   rm -rf conftest*
10189   ac_cv_header_stdc=no
10190 fi
10191 rm -f conftest*
10192
10193 fi
10194
10195 if test $ac_cv_header_stdc = yes; then
10196   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10197 cat > conftest.$ac_ext <<EOF
10198 #line 10199 "configure"
10199 #include "confdefs.h"
10200 #include <stdlib.h>
10201 EOF
10202 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10203   egrep "free" >/dev/null 2>&1; then
10204   :
10205 else
10206   rm -rf conftest*
10207   ac_cv_header_stdc=no
10208 fi
10209 rm -f conftest*
10210
10211 fi
10212
10213 if test $ac_cv_header_stdc = yes; then
10214   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10215 if test "$cross_compiling" = yes; then
10216   :
10217 else
10218   cat > conftest.$ac_ext <<EOF
10219 #line 10220 "configure"
10220 #include "confdefs.h"
10221 #include <ctype.h>
10222 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10223 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10224 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10225 int main () { int i; for (i = 0; i < 256; i++)
10226 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10227 exit (0); }
10228
10229 EOF
10230 if { (eval echo configure:10231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10231 then
10232   :
10233 else
10234   echo "configure: failed program was:" >&5
10235   cat conftest.$ac_ext >&5
10236   rm -fr conftest*
10237   ac_cv_header_stdc=no
10238 fi
10239 rm -fr conftest*
10240 fi
10241
10242 fi
10243 fi
10244
10245 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10246 if test $ac_cv_header_stdc = yes; then
10247   cat >> confdefs.h <<\EOF
10248 #define STDC_HEADERS 1
10249 EOF
10250
10251 fi
10252
10253 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10254 echo "configure:10255: checking for mode_t" >&5
10255 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
10256   echo $ac_n "(cached) $ac_c" 1>&6
10257 else
10258   cat > conftest.$ac_ext <<EOF
10259 #line 10260 "configure"
10260 #include "confdefs.h"
10261 #include <sys/types.h>
10262 #if STDC_HEADERS
10263 #include <stdlib.h>
10264 #include <stddef.h>
10265 #endif
10266 EOF
10267 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10268   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10269   rm -rf conftest*
10270   ac_cv_type_mode_t=yes
10271 else
10272   rm -rf conftest*
10273   ac_cv_type_mode_t=no
10274 fi
10275 rm -f conftest*
10276
10277 fi
10278 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
10279 if test $ac_cv_type_mode_t = no; then
10280   cat >> confdefs.h <<\EOF
10281 #define mode_t int
10282 EOF
10283
10284 fi
10285
10286 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10287 echo "configure:10288: checking for off_t" >&5
10288 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10289   echo $ac_n "(cached) $ac_c" 1>&6
10290 else
10291   cat > conftest.$ac_ext <<EOF
10292 #line 10293 "configure"
10293 #include "confdefs.h"
10294 #include <sys/types.h>
10295 #if STDC_HEADERS
10296 #include <stdlib.h>
10297 #include <stddef.h>
10298 #endif
10299 EOF
10300 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10301   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10302   rm -rf conftest*
10303   ac_cv_type_off_t=yes
10304 else
10305   rm -rf conftest*
10306   ac_cv_type_off_t=no
10307 fi
10308 rm -f conftest*
10309
10310 fi
10311 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10312 if test $ac_cv_type_off_t = no; then
10313   cat >> confdefs.h <<\EOF
10314 #define off_t long
10315 EOF
10316
10317 fi
10318
10319 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10320 echo "configure:10321: checking for pid_t" >&5
10321 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10322   echo $ac_n "(cached) $ac_c" 1>&6
10323 else
10324   cat > conftest.$ac_ext <<EOF
10325 #line 10326 "configure"
10326 #include "confdefs.h"
10327 #include <sys/types.h>
10328 #if STDC_HEADERS
10329 #include <stdlib.h>
10330 #include <stddef.h>
10331 #endif
10332 EOF
10333 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10334   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10335   rm -rf conftest*
10336   ac_cv_type_pid_t=yes
10337 else
10338   rm -rf conftest*
10339   ac_cv_type_pid_t=no
10340 fi
10341 rm -f conftest*
10342
10343 fi
10344 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10345 if test $ac_cv_type_pid_t = no; then
10346   cat >> confdefs.h <<\EOF
10347 #define pid_t int
10348 EOF
10349
10350 fi
10351
10352 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10353 echo "configure:10354: checking for ptrdiff_t" >&5
10354 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10355   echo $ac_n "(cached) $ac_c" 1>&6
10356 else
10357   cat > conftest.$ac_ext <<EOF
10358 #line 10359 "configure"
10359 #include "confdefs.h"
10360 #include <stddef.h>
10361 int main() {
10362 ptrdiff_t p
10363 ; return 0; }
10364 EOF
10365 if { (eval echo configure:10366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10366   rm -rf conftest*
10367   am_cv_type_ptrdiff_t=yes
10368 else
10369   echo "configure: failed program was:" >&5
10370   cat conftest.$ac_ext >&5
10371   rm -rf conftest*
10372   am_cv_type_ptrdiff_t=no
10373 fi
10374 rm -f conftest*
10375 fi
10376
10377 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10378    if test $am_cv_type_ptrdiff_t = yes; then
10379      cat >> confdefs.h <<\EOF
10380 #define HAVE_PTRDIFF_T 1
10381 EOF
10382
10383    fi
10384
10385 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10386 echo "configure:10387: checking return type of signal handlers" >&5
10387 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10388   echo $ac_n "(cached) $ac_c" 1>&6
10389 else
10390   cat > conftest.$ac_ext <<EOF
10391 #line 10392 "configure"
10392 #include "confdefs.h"
10393 #include <sys/types.h>
10394 #include <signal.h>
10395 #ifdef signal
10396 #undef signal
10397 #endif
10398 #ifdef __cplusplus
10399 extern "C" void (*signal (int, void (*)(int)))(int);
10400 #else
10401 void (*signal ()) ();
10402 #endif
10403
10404 int main() {
10405 int i;
10406 ; return 0; }
10407 EOF
10408 if { (eval echo configure:10409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10409   rm -rf conftest*
10410   ac_cv_type_signal=void
10411 else
10412   echo "configure: failed program was:" >&5
10413   cat conftest.$ac_ext >&5
10414   rm -rf conftest*
10415   ac_cv_type_signal=int
10416 fi
10417 rm -f conftest*
10418 fi
10419
10420 echo "$ac_t""$ac_cv_type_signal" 1>&6
10421 cat >> confdefs.h <<EOF
10422 #define RETSIGTYPE $ac_cv_type_signal
10423 EOF
10424
10425
10426 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10427 echo "configure:10428: checking for sig_atomic_t" >&5
10428 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10429   echo $ac_n "(cached) $ac_c" 1>&6
10430 else
10431   cat > conftest.$ac_ext <<EOF
10432 #line 10433 "configure"
10433 #include "confdefs.h"
10434 #include <signal.h>
10435 int main() {
10436 sig_atomic_t atomic;
10437 ; return 0; }
10438 EOF
10439 if { (eval echo configure:10440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10440   rm -rf conftest*
10441   ol_cv_type_sig_atomic_t=yes
10442 else
10443   echo "configure: failed program was:" >&5
10444   cat conftest.$ac_ext >&5
10445   rm -rf conftest*
10446   ol_cv_type_sig_atomic_t=no
10447 fi
10448 rm -f conftest*
10449 fi
10450
10451 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10452   if test $ol_cv_type_sig_atomic_t = no; then
10453     cat >> confdefs.h <<\EOF
10454 #define sig_atomic_t int
10455 EOF
10456
10457   fi
10458  
10459 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10460 echo "configure:10461: checking for size_t" >&5
10461 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10462   echo $ac_n "(cached) $ac_c" 1>&6
10463 else
10464   cat > conftest.$ac_ext <<EOF
10465 #line 10466 "configure"
10466 #include "confdefs.h"
10467 #include <sys/types.h>
10468 #if STDC_HEADERS
10469 #include <stdlib.h>
10470 #include <stddef.h>
10471 #endif
10472 EOF
10473 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10474   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10475   rm -rf conftest*
10476   ac_cv_type_size_t=yes
10477 else
10478   rm -rf conftest*
10479   ac_cv_type_size_t=no
10480 fi
10481 rm -f conftest*
10482
10483 fi
10484 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10485 if test $ac_cv_type_size_t = no; then
10486   cat >> confdefs.h <<\EOF
10487 #define size_t unsigned
10488 EOF
10489
10490 fi
10491
10492 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10493 echo "configure:10494: checking for st_blksize in struct stat" >&5
10494 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10495   echo $ac_n "(cached) $ac_c" 1>&6
10496 else
10497   cat > conftest.$ac_ext <<EOF
10498 #line 10499 "configure"
10499 #include "confdefs.h"
10500 #include <sys/types.h>
10501 #include <sys/stat.h>
10502 int main() {
10503 struct stat s; s.st_blksize;
10504 ; return 0; }
10505 EOF
10506 if { (eval echo configure:10507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10507   rm -rf conftest*
10508   ac_cv_struct_st_blksize=yes
10509 else
10510   echo "configure: failed program was:" >&5
10511   cat conftest.$ac_ext >&5
10512   rm -rf conftest*
10513   ac_cv_struct_st_blksize=no
10514 fi
10515 rm -f conftest*
10516 fi
10517
10518 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10519 if test $ac_cv_struct_st_blksize = yes; then
10520   cat >> confdefs.h <<\EOF
10521 #define HAVE_ST_BLKSIZE 1
10522 EOF
10523
10524 fi
10525
10526 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10527 echo "configure:10528: checking whether time.h and sys/time.h may both be included" >&5
10528 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10529   echo $ac_n "(cached) $ac_c" 1>&6
10530 else
10531   cat > conftest.$ac_ext <<EOF
10532 #line 10533 "configure"
10533 #include "confdefs.h"
10534 #include <sys/types.h>
10535 #include <sys/time.h>
10536 #include <time.h>
10537 int main() {
10538 struct tm *tp;
10539 ; return 0; }
10540 EOF
10541 if { (eval echo configure:10542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10542   rm -rf conftest*
10543   ac_cv_header_time=yes
10544 else
10545   echo "configure: failed program was:" >&5
10546   cat conftest.$ac_ext >&5
10547   rm -rf conftest*
10548   ac_cv_header_time=no
10549 fi
10550 rm -f conftest*
10551 fi
10552
10553 echo "$ac_t""$ac_cv_header_time" 1>&6
10554 if test $ac_cv_header_time = yes; then
10555   cat >> confdefs.h <<\EOF
10556 #define TIME_WITH_SYS_TIME 1
10557 EOF
10558
10559 fi
10560
10561 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10562 echo "configure:10563: checking whether struct tm is in sys/time.h or time.h" >&5
10563 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10564   echo $ac_n "(cached) $ac_c" 1>&6
10565 else
10566   cat > conftest.$ac_ext <<EOF
10567 #line 10568 "configure"
10568 #include "confdefs.h"
10569 #include <sys/types.h>
10570 #include <time.h>
10571 int main() {
10572 struct tm *tp; tp->tm_sec;
10573 ; return 0; }
10574 EOF
10575 if { (eval echo configure:10576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10576   rm -rf conftest*
10577   ac_cv_struct_tm=time.h
10578 else
10579   echo "configure: failed program was:" >&5
10580   cat conftest.$ac_ext >&5
10581   rm -rf conftest*
10582   ac_cv_struct_tm=sys/time.h
10583 fi
10584 rm -f conftest*
10585 fi
10586
10587 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10588 if test $ac_cv_struct_tm = sys/time.h; then
10589   cat >> confdefs.h <<\EOF
10590 #define TM_IN_SYS_TIME 1
10591 EOF
10592
10593 fi
10594
10595 # test for pw_gecos in struct passwd
10596 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10597 echo "configure:10598: checking struct passwd for pw_gecos" >&5
10598 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10599   echo $ac_n "(cached) $ac_c" 1>&6
10600 else
10601   
10602         cat > conftest.$ac_ext <<EOF
10603 #line 10604 "configure"
10604 #include "confdefs.h"
10605 #include <pwd.h>
10606 int main() {
10607
10608         struct passwd pwd;
10609         pwd.pw_gecos = pwd.pw_name;
10610
10611 ; return 0; }
10612 EOF
10613 if { (eval echo configure:10614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10614   rm -rf conftest*
10615   ol_cv_struct_passwd_pw_gecos=yes
10616 else
10617   echo "configure: failed program was:" >&5
10618   cat conftest.$ac_ext >&5
10619   rm -rf conftest*
10620   ol_cv_struct_passwd_pw_gecos=no
10621 fi
10622 rm -f conftest*
10623 fi
10624
10625 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10626 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10627         cat >> confdefs.h <<\EOF
10628 #define HAVE_PW_GECOS 1
10629 EOF
10630
10631 fi
10632
10633
10634
10635 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10636 echo "configure:10637: checking if toupper() requires islower()" >&5
10637 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10638   echo $ac_n "(cached) $ac_c" 1>&6
10639 else
10640   
10641         if test "$cross_compiling" = yes; then
10642   ol_cv_c_upper_lower=safe
10643 else
10644   cat > conftest.$ac_ext <<EOF
10645 #line 10646 "configure"
10646 #include "confdefs.h"
10647
10648 #include <ctype.h>
10649 main()
10650 {
10651         if ('C' == toupper('C'))
10652                 exit(0);
10653         else
10654                 exit(1);
10655 }
10656 EOF
10657 if { (eval echo configure:10658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10658 then
10659   ol_cv_c_upper_lower=no
10660 else
10661   echo "configure: failed program was:" >&5
10662   cat conftest.$ac_ext >&5
10663   rm -fr conftest*
10664   ol_cv_c_upper_lower=yes
10665 fi
10666 rm -fr conftest*
10667 fi
10668
10669 fi
10670
10671 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10672 if test $ol_cv_c_upper_lower != no ; then
10673         cat >> confdefs.h <<\EOF
10674 #define C_UPPER_LOWER 1
10675 EOF
10676
10677 fi
10678
10679 echo $ac_n "checking for working const""... $ac_c" 1>&6
10680 echo "configure:10681: checking for working const" >&5
10681 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10682   echo $ac_n "(cached) $ac_c" 1>&6
10683 else
10684   cat > conftest.$ac_ext <<EOF
10685 #line 10686 "configure"
10686 #include "confdefs.h"
10687
10688 int main() {
10689
10690 /* Ultrix mips cc rejects this.  */
10691 typedef int charset[2]; const charset x;
10692 /* SunOS 4.1.1 cc rejects this.  */
10693 char const *const *ccp;
10694 char **p;
10695 /* NEC SVR4.0.2 mips cc rejects this.  */
10696 struct point {int x, y;};
10697 static struct point const zero = {0,0};
10698 /* AIX XL C 1.02.0.0 rejects this.
10699    It does not let you subtract one const X* pointer from another in an arm
10700    of an if-expression whose if-part is not a constant expression */
10701 const char *g = "string";
10702 ccp = &g + (g ? g-g : 0);
10703 /* HPUX 7.0 cc rejects these. */
10704 ++ccp;
10705 p = (char**) ccp;
10706 ccp = (char const *const *) p;
10707 { /* SCO 3.2v4 cc rejects this.  */
10708   char *t;
10709   char const *s = 0 ? (char *) 0 : (char const *) 0;
10710
10711   *t++ = 0;
10712 }
10713 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10714   int x[] = {25, 17};
10715   const int *foo = &x[0];
10716   ++foo;
10717 }
10718 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10719   typedef const int *iptr;
10720   iptr p = 0;
10721   ++p;
10722 }
10723 { /* AIX XL C 1.02.0.0 rejects this saying
10724      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10725   struct s { int j; const int *ap[3]; };
10726   struct s *b; b->j = 5;
10727 }
10728 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10729   const int foo = 10;
10730 }
10731
10732 ; return 0; }
10733 EOF
10734 if { (eval echo configure:10735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10735   rm -rf conftest*
10736   ac_cv_c_const=yes
10737 else
10738   echo "configure: failed program was:" >&5
10739   cat conftest.$ac_ext >&5
10740   rm -rf conftest*
10741   ac_cv_c_const=no
10742 fi
10743 rm -f conftest*
10744 fi
10745
10746 echo "$ac_t""$ac_cv_c_const" 1>&6
10747 if test $ac_cv_c_const = no; then
10748   cat >> confdefs.h <<\EOF
10749 #define const 
10750 EOF
10751
10752 fi
10753
10754 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10755 echo "configure:10756: checking if compiler understands volatile" >&5
10756 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10757   echo $ac_n "(cached) $ac_c" 1>&6
10758 else
10759   cat > conftest.$ac_ext <<EOF
10760 #line 10761 "configure"
10761 #include "confdefs.h"
10762 int x, y, z;
10763 int main() {
10764 volatile int a; int * volatile b = x ? &y : &z;
10765       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10766       *b = 0;
10767 ; return 0; }
10768 EOF
10769 if { (eval echo configure:10770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10770   rm -rf conftest*
10771   ol_cv_c_volatile=yes
10772 else
10773   echo "configure: failed program was:" >&5
10774   cat conftest.$ac_ext >&5
10775   rm -rf conftest*
10776   ol_cv_c_volatile=no
10777 fi
10778 rm -f conftest*
10779 fi
10780
10781 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10782   if test $ol_cv_c_volatile = yes; then
10783     : 
10784   else
10785     cat >> confdefs.h <<\EOF
10786 #define volatile 
10787 EOF
10788
10789   fi
10790  
10791
10792 if test $cross_compiling = yes ; then
10793         cat >> confdefs.h <<\EOF
10794 #define CROSS_COMPILING 1
10795 EOF
10796
10797 else
10798         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10799 echo "configure:10800: checking whether byte ordering is bigendian" >&5
10800 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10801   echo $ac_n "(cached) $ac_c" 1>&6
10802 else
10803   ac_cv_c_bigendian=unknown
10804 # See if sys/param.h defines the BYTE_ORDER macro.
10805 cat > conftest.$ac_ext <<EOF
10806 #line 10807 "configure"
10807 #include "confdefs.h"
10808 #include <sys/types.h>
10809 #include <sys/param.h>
10810 int main() {
10811
10812 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10813  bogus endian macros
10814 #endif
10815 ; return 0; }
10816 EOF
10817 if { (eval echo configure:10818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10818   rm -rf conftest*
10819   # It does; now see whether it defined to BIG_ENDIAN or not.
10820 cat > conftest.$ac_ext <<EOF
10821 #line 10822 "configure"
10822 #include "confdefs.h"
10823 #include <sys/types.h>
10824 #include <sys/param.h>
10825 int main() {
10826
10827 #if BYTE_ORDER != BIG_ENDIAN
10828  not big endian
10829 #endif
10830 ; return 0; }
10831 EOF
10832 if { (eval echo configure:10833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10833   rm -rf conftest*
10834   ac_cv_c_bigendian=yes
10835 else
10836   echo "configure: failed program was:" >&5
10837   cat conftest.$ac_ext >&5
10838   rm -rf conftest*
10839   ac_cv_c_bigendian=no
10840 fi
10841 rm -f conftest*
10842 else
10843   echo "configure: failed program was:" >&5
10844   cat conftest.$ac_ext >&5
10845 fi
10846 rm -f conftest*
10847 if test $ac_cv_c_bigendian = unknown; then
10848 if test "$cross_compiling" = yes; then
10849     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10850 else
10851   cat > conftest.$ac_ext <<EOF
10852 #line 10853 "configure"
10853 #include "confdefs.h"
10854 main () {
10855   /* Are we little or big endian?  From Harbison&Steele.  */
10856   union
10857   {
10858     long l;
10859     char c[sizeof (long)];
10860   } u;
10861   u.l = 1;
10862   exit (u.c[sizeof (long) - 1] == 1);
10863 }
10864 EOF
10865 if { (eval echo configure:10866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10866 then
10867   ac_cv_c_bigendian=no
10868 else
10869   echo "configure: failed program was:" >&5
10870   cat conftest.$ac_ext >&5
10871   rm -fr conftest*
10872   ac_cv_c_bigendian=yes
10873 fi
10874 rm -fr conftest*
10875 fi
10876
10877 fi
10878 fi
10879
10880 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10881 if test $ac_cv_c_bigendian = yes; then
10882   cat >> confdefs.h <<\EOF
10883 #define WORDS_BIGENDIAN 1
10884 EOF
10885
10886 fi
10887
10888         echo $ac_n "checking size of short""... $ac_c" 1>&6
10889 echo "configure:10890: checking size of short" >&5
10890 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10891   echo $ac_n "(cached) $ac_c" 1>&6
10892 else
10893   if test "$cross_compiling" = yes; then
10894     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10895 else
10896   cat > conftest.$ac_ext <<EOF
10897 #line 10898 "configure"
10898 #include "confdefs.h"
10899 #include <stdio.h>
10900 main()
10901 {
10902   FILE *f=fopen("conftestval", "w");
10903   if (!f) exit(1);
10904   fprintf(f, "%d\n", sizeof(short));
10905   exit(0);
10906 }
10907 EOF
10908 if { (eval echo configure:10909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10909 then
10910   ac_cv_sizeof_short=`cat conftestval`
10911 else
10912   echo "configure: failed program was:" >&5
10913   cat conftest.$ac_ext >&5
10914   rm -fr conftest*
10915   ac_cv_sizeof_short=0
10916 fi
10917 rm -fr conftest*
10918 fi
10919
10920 fi
10921 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10922 cat >> confdefs.h <<EOF
10923 #define SIZEOF_SHORT $ac_cv_sizeof_short
10924 EOF
10925
10926  
10927         echo $ac_n "checking size of int""... $ac_c" 1>&6
10928 echo "configure:10929: checking size of int" >&5
10929 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10930   echo $ac_n "(cached) $ac_c" 1>&6
10931 else
10932   if test "$cross_compiling" = yes; then
10933     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10934 else
10935   cat > conftest.$ac_ext <<EOF
10936 #line 10937 "configure"
10937 #include "confdefs.h"
10938 #include <stdio.h>
10939 main()
10940 {
10941   FILE *f=fopen("conftestval", "w");
10942   if (!f) exit(1);
10943   fprintf(f, "%d\n", sizeof(int));
10944   exit(0);
10945 }
10946 EOF
10947 if { (eval echo configure:10948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10948 then
10949   ac_cv_sizeof_int=`cat conftestval`
10950 else
10951   echo "configure: failed program was:" >&5
10952   cat conftest.$ac_ext >&5
10953   rm -fr conftest*
10954   ac_cv_sizeof_int=0
10955 fi
10956 rm -fr conftest*
10957 fi
10958
10959 fi
10960 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10961 cat >> confdefs.h <<EOF
10962 #define SIZEOF_INT $ac_cv_sizeof_int
10963 EOF
10964
10965  
10966         echo $ac_n "checking size of long""... $ac_c" 1>&6
10967 echo "configure:10968: checking size of long" >&5
10968 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10969   echo $ac_n "(cached) $ac_c" 1>&6
10970 else
10971   if test "$cross_compiling" = yes; then
10972     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10973 else
10974   cat > conftest.$ac_ext <<EOF
10975 #line 10976 "configure"
10976 #include "confdefs.h"
10977 #include <stdio.h>
10978 main()
10979 {
10980   FILE *f=fopen("conftestval", "w");
10981   if (!f) exit(1);
10982   fprintf(f, "%d\n", sizeof(long));
10983   exit(0);
10984 }
10985 EOF
10986 if { (eval echo configure:10987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10987 then
10988   ac_cv_sizeof_long=`cat conftestval`
10989 else
10990   echo "configure: failed program was:" >&5
10991   cat conftest.$ac_ext >&5
10992   rm -fr conftest*
10993   ac_cv_sizeof_long=0
10994 fi
10995 rm -fr conftest*
10996 fi
10997
10998 fi
10999 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
11000 cat >> confdefs.h <<EOF
11001 #define SIZEOF_LONG $ac_cv_sizeof_long
11002 EOF
11003
11004
11005
11006         if test "$ac_cv_sizeof_int" -lt 4 ; then
11007                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
11008         fi
11009 fi
11010
11011 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
11012 echo "configure:11013: checking for 8-bit clean memcmp" >&5
11013 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
11014   echo $ac_n "(cached) $ac_c" 1>&6
11015 else
11016   if test "$cross_compiling" = yes; then
11017   ac_cv_func_memcmp_clean=no
11018 else
11019   cat > conftest.$ac_ext <<EOF
11020 #line 11021 "configure"
11021 #include "confdefs.h"
11022
11023 main()
11024 {
11025   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
11026   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
11027 }
11028
11029 EOF
11030 if { (eval echo configure:11031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11031 then
11032   ac_cv_func_memcmp_clean=yes
11033 else
11034   echo "configure: failed program was:" >&5
11035   cat conftest.$ac_ext >&5
11036   rm -fr conftest*
11037   ac_cv_func_memcmp_clean=no
11038 fi
11039 rm -fr conftest*
11040 fi
11041
11042 fi
11043
11044 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
11045 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
11046
11047 echo $ac_n "checking for strftime""... $ac_c" 1>&6
11048 echo "configure:11049: checking for strftime" >&5
11049 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
11050   echo $ac_n "(cached) $ac_c" 1>&6
11051 else
11052   cat > conftest.$ac_ext <<EOF
11053 #line 11054 "configure"
11054 #include "confdefs.h"
11055 /* System header to define __stub macros and hopefully few prototypes,
11056     which can conflict with char strftime(); below.  */
11057 #include <assert.h>
11058 /* Override any gcc2 internal prototype to avoid an error.  */
11059 /* We use char because int might match the return type of a gcc2
11060     builtin and then its argument prototype would still apply.  */
11061 char strftime();
11062
11063 int main() {
11064
11065 /* The GNU C library defines this for functions which it implements
11066     to always fail with ENOSYS.  Some functions are actually named
11067     something starting with __ and the normal name is an alias.  */
11068 #if defined (__stub_strftime) || defined (__stub___strftime)
11069 choke me
11070 #else
11071 strftime();
11072 #endif
11073
11074 ; return 0; }
11075 EOF
11076 if { (eval echo configure:11077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11077   rm -rf conftest*
11078   eval "ac_cv_func_strftime=yes"
11079 else
11080   echo "configure: failed program was:" >&5
11081   cat conftest.$ac_ext >&5
11082   rm -rf conftest*
11083   eval "ac_cv_func_strftime=no"
11084 fi
11085 rm -f conftest*
11086 fi
11087
11088 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11089   echo "$ac_t""yes" 1>&6
11090   cat >> confdefs.h <<\EOF
11091 #define HAVE_STRFTIME 1
11092 EOF
11093
11094 else
11095   echo "$ac_t""no" 1>&6
11096 # strftime is in -lintl on SCO UNIX.
11097 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11098 echo "configure:11099: checking for strftime in -lintl" >&5
11099 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
11100 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11101   echo $ac_n "(cached) $ac_c" 1>&6
11102 else
11103   ac_save_LIBS="$LIBS"
11104 LIBS="-lintl  $LIBS"
11105 cat > conftest.$ac_ext <<EOF
11106 #line 11107 "configure"
11107 #include "confdefs.h"
11108 /* Override any gcc2 internal prototype to avoid an error.  */
11109 /* We use char because int might match the return type of a gcc2
11110     builtin and then its argument prototype would still apply.  */
11111 char strftime();
11112
11113 int main() {
11114 strftime()
11115 ; return 0; }
11116 EOF
11117 if { (eval echo configure:11118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11118   rm -rf conftest*
11119   eval "ac_cv_lib_$ac_lib_var=yes"
11120 else
11121   echo "configure: failed program was:" >&5
11122   cat conftest.$ac_ext >&5
11123   rm -rf conftest*
11124   eval "ac_cv_lib_$ac_lib_var=no"
11125 fi
11126 rm -f conftest*
11127 LIBS="$ac_save_LIBS"
11128
11129 fi
11130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11131   echo "$ac_t""yes" 1>&6
11132   cat >> confdefs.h <<\EOF
11133 #define HAVE_STRFTIME 1
11134 EOF
11135
11136 LIBS="-lintl $LIBS"
11137 else
11138   echo "$ac_t""no" 1>&6
11139 fi
11140
11141 fi
11142
11143
11144 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11145 echo "configure:11146: checking for vprintf" >&5
11146 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
11147   echo $ac_n "(cached) $ac_c" 1>&6
11148 else
11149   cat > conftest.$ac_ext <<EOF
11150 #line 11151 "configure"
11151 #include "confdefs.h"
11152 /* System header to define __stub macros and hopefully few prototypes,
11153     which can conflict with char vprintf(); below.  */
11154 #include <assert.h>
11155 /* Override any gcc2 internal prototype to avoid an error.  */
11156 /* We use char because int might match the return type of a gcc2
11157     builtin and then its argument prototype would still apply.  */
11158 char vprintf();
11159
11160 int main() {
11161
11162 /* The GNU C library defines this for functions which it implements
11163     to always fail with ENOSYS.  Some functions are actually named
11164     something starting with __ and the normal name is an alias.  */
11165 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11166 choke me
11167 #else
11168 vprintf();
11169 #endif
11170
11171 ; return 0; }
11172 EOF
11173 if { (eval echo configure:11174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11174   rm -rf conftest*
11175   eval "ac_cv_func_vprintf=yes"
11176 else
11177   echo "configure: failed program was:" >&5
11178   cat conftest.$ac_ext >&5
11179   rm -rf conftest*
11180   eval "ac_cv_func_vprintf=no"
11181 fi
11182 rm -f conftest*
11183 fi
11184
11185 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11186   echo "$ac_t""yes" 1>&6
11187   cat >> confdefs.h <<\EOF
11188 #define HAVE_VPRINTF 1
11189 EOF
11190
11191 else
11192   echo "$ac_t""no" 1>&6
11193 fi
11194
11195 if test "$ac_cv_func_vprintf" != yes; then
11196 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11197 echo "configure:11198: checking for _doprnt" >&5
11198 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
11199   echo $ac_n "(cached) $ac_c" 1>&6
11200 else
11201   cat > conftest.$ac_ext <<EOF
11202 #line 11203 "configure"
11203 #include "confdefs.h"
11204 /* System header to define __stub macros and hopefully few prototypes,
11205     which can conflict with char _doprnt(); below.  */
11206 #include <assert.h>
11207 /* Override any gcc2 internal prototype to avoid an error.  */
11208 /* We use char because int might match the return type of a gcc2
11209     builtin and then its argument prototype would still apply.  */
11210 char _doprnt();
11211
11212 int main() {
11213
11214 /* The GNU C library defines this for functions which it implements
11215     to always fail with ENOSYS.  Some functions are actually named
11216     something starting with __ and the normal name is an alias.  */
11217 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11218 choke me
11219 #else
11220 _doprnt();
11221 #endif
11222
11223 ; return 0; }
11224 EOF
11225 if { (eval echo configure:11226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11226   rm -rf conftest*
11227   eval "ac_cv_func__doprnt=yes"
11228 else
11229   echo "configure: failed program was:" >&5
11230   cat conftest.$ac_ext >&5
11231   rm -rf conftest*
11232   eval "ac_cv_func__doprnt=no"
11233 fi
11234 rm -f conftest*
11235 fi
11236
11237 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
11238   echo "$ac_t""yes" 1>&6
11239   cat >> confdefs.h <<\EOF
11240 #define HAVE_DOPRNT 1
11241 EOF
11242
11243 else
11244   echo "$ac_t""no" 1>&6
11245 fi
11246
11247 fi
11248
11249
11250 if test $ac_cv_func_vprintf = yes ; then
11251                 for ac_func in vsnprintf vsprintf
11252 do
11253 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11254 echo "configure:11255: checking for $ac_func" >&5
11255 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11256   echo $ac_n "(cached) $ac_c" 1>&6
11257 else
11258   cat > conftest.$ac_ext <<EOF
11259 #line 11260 "configure"
11260 #include "confdefs.h"
11261 /* System header to define __stub macros and hopefully few prototypes,
11262     which can conflict with char $ac_func(); below.  */
11263 #include <assert.h>
11264 /* Override any gcc2 internal prototype to avoid an error.  */
11265 /* We use char because int might match the return type of a gcc2
11266     builtin and then its argument prototype would still apply.  */
11267 char $ac_func();
11268
11269 int main() {
11270
11271 /* The GNU C library defines this for functions which it implements
11272     to always fail with ENOSYS.  Some functions are actually named
11273     something starting with __ and the normal name is an alias.  */
11274 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11275 choke me
11276 #else
11277 $ac_func();
11278 #endif
11279
11280 ; return 0; }
11281 EOF
11282 if { (eval echo configure:11283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11283   rm -rf conftest*
11284   eval "ac_cv_func_$ac_func=yes"
11285 else
11286   echo "configure: failed program was:" >&5
11287   cat conftest.$ac_ext >&5
11288   rm -rf conftest*
11289   eval "ac_cv_func_$ac_func=no"
11290 fi
11291 rm -f conftest*
11292 fi
11293
11294 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11295   echo "$ac_t""yes" 1>&6
11296     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11297   cat >> confdefs.h <<EOF
11298 #define $ac_tr_func 1
11299 EOF
11300  
11301 else
11302   echo "$ac_t""no" 1>&6
11303 fi
11304 done
11305
11306 fi
11307
11308 for ac_func in \
11309         bcopy                   \
11310         closesocket             \
11311         endgrent                \
11312         endpwent                \
11313         flock                   \
11314         getdtablesize   \
11315         getgrgid                \
11316         gethostname             \
11317         getpass                 \
11318         getpwuid                \
11319         gettimeofday    \
11320         initgroups              \
11321         lockf                   \
11322         memcpy                  \
11323         memmove                 \
11324         mkstemp                 \
11325         recv                    \
11326         recvfrom                \
11327         setpwfile               \
11328         setgid                  \
11329         setegid                 \
11330         setsid                  \
11331         setuid                  \
11332         seteuid                 \
11333         signal                  \
11334         sigset                  \
11335         snprintf                \
11336         strdup                  \
11337         strerror                \
11338         strpbrk                 \
11339         strrchr                 \
11340         strsep                  \
11341         strstr                  \
11342         strtol                  \
11343         strtoul                 \
11344         strspn                  \
11345         sysconf                 \
11346         waitpid                 \
11347         wait4                   \
11348
11349 do
11350 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11351 echo "configure:11352: checking for $ac_func" >&5
11352 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11353   echo $ac_n "(cached) $ac_c" 1>&6
11354 else
11355   cat > conftest.$ac_ext <<EOF
11356 #line 11357 "configure"
11357 #include "confdefs.h"
11358 /* System header to define __stub macros and hopefully few prototypes,
11359     which can conflict with char $ac_func(); below.  */
11360 #include <assert.h>
11361 /* Override any gcc2 internal prototype to avoid an error.  */
11362 /* We use char because int might match the return type of a gcc2
11363     builtin and then its argument prototype would still apply.  */
11364 char $ac_func();
11365
11366 int main() {
11367
11368 /* The GNU C library defines this for functions which it implements
11369     to always fail with ENOSYS.  Some functions are actually named
11370     something starting with __ and the normal name is an alias.  */
11371 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11372 choke me
11373 #else
11374 $ac_func();
11375 #endif
11376
11377 ; return 0; }
11378 EOF
11379 if { (eval echo configure:11380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11380   rm -rf conftest*
11381   eval "ac_cv_func_$ac_func=yes"
11382 else
11383   echo "configure: failed program was:" >&5
11384   cat conftest.$ac_ext >&5
11385   rm -rf conftest*
11386   eval "ac_cv_func_$ac_func=no"
11387 fi
11388 rm -f conftest*
11389 fi
11390
11391 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11392   echo "$ac_t""yes" 1>&6
11393     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11394   cat >> confdefs.h <<EOF
11395 #define $ac_tr_func 1
11396 EOF
11397  
11398 else
11399   echo "$ac_t""no" 1>&6
11400 fi
11401 done
11402
11403
11404 for ac_func in getopt tempnam
11405 do
11406 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11407 echo "configure:11408: checking for $ac_func" >&5
11408 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11409   echo $ac_n "(cached) $ac_c" 1>&6
11410 else
11411   cat > conftest.$ac_ext <<EOF
11412 #line 11413 "configure"
11413 #include "confdefs.h"
11414 /* System header to define __stub macros and hopefully few prototypes,
11415     which can conflict with char $ac_func(); below.  */
11416 #include <assert.h>
11417 /* Override any gcc2 internal prototype to avoid an error.  */
11418 /* We use char because int might match the return type of a gcc2
11419     builtin and then its argument prototype would still apply.  */
11420 char $ac_func();
11421
11422 int main() {
11423
11424 /* The GNU C library defines this for functions which it implements
11425     to always fail with ENOSYS.  Some functions are actually named
11426     something starting with __ and the normal name is an alias.  */
11427 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11428 choke me
11429 #else
11430 $ac_func();
11431 #endif
11432
11433 ; return 0; }
11434 EOF
11435 if { (eval echo configure:11436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11436   rm -rf conftest*
11437   eval "ac_cv_func_$ac_func=yes"
11438 else
11439   echo "configure: failed program was:" >&5
11440   cat conftest.$ac_ext >&5
11441   rm -rf conftest*
11442   eval "ac_cv_func_$ac_func=no"
11443 fi
11444 rm -f conftest*
11445 fi
11446
11447 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11448   echo "$ac_t""yes" 1>&6
11449     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11450   cat >> confdefs.h <<EOF
11451 #define $ac_tr_func 1
11452 EOF
11453  
11454 else
11455   echo "$ac_t""no" 1>&6
11456 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11457 fi
11458 done
11459
11460
11461
11462 # Check Configuration
11463
11464 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11465 echo "configure:11466: checking declaration of sys_errlist" >&5
11466 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11467   echo $ac_n "(cached) $ac_c" 1>&6
11468 else
11469   
11470         cat > conftest.$ac_ext <<EOF
11471 #line 11472 "configure"
11472 #include "confdefs.h"
11473
11474 #include <stdio.h>
11475 #include <sys/types.h>
11476 #include <errno.h> 
11477 int main() {
11478 char *c = (char *) *sys_errlist
11479 ; return 0; }
11480 EOF
11481 if { (eval echo configure:11482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11482   rm -rf conftest*
11483   ol_cv_dcl_sys_errlist=yes
11484 else
11485   echo "configure: failed program was:" >&5
11486   cat conftest.$ac_ext >&5
11487   rm -rf conftest*
11488   ol_cv_dcl_sys_errlist=no
11489 fi
11490 rm -f conftest*
11491 fi
11492
11493 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11494 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11495 if test $ol_cv_dcl_sys_errlist = no ; then
11496         cat >> confdefs.h <<\EOF
11497 #define DECL_SYS_ERRLIST 1
11498 EOF
11499
11500         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11501 echo "configure:11502: checking existence of sys_errlist" >&5
11502         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11503   echo $ac_n "(cached) $ac_c" 1>&6
11504 else
11505   
11506                 cat > conftest.$ac_ext <<EOF
11507 #line 11508 "configure"
11508 #include "confdefs.h"
11509 #include <errno.h>
11510 int main() {
11511 char *c = (char *) *sys_errlist
11512 ; return 0; }
11513 EOF
11514 if { (eval echo configure:11515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11515   rm -rf conftest*
11516   ol_cv_have_sys_errlist=yes
11517 else
11518   echo "configure: failed program was:" >&5
11519   cat conftest.$ac_ext >&5
11520   rm -rf conftest*
11521   ol_cv_have_sys_errlist=no
11522 fi
11523 rm -f conftest*
11524 fi
11525
11526         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11527         if test $ol_cv_have_sys_errlist = yes ; then
11528                 cat >> confdefs.h <<\EOF
11529 #define HAVE_SYS_ERRLIST 1
11530 EOF
11531
11532         fi
11533 fi
11534
11535
11536
11537 if test "$ol_enable_debug" != no ; then
11538         cat >> confdefs.h <<\EOF
11539 #define LDAP_DEBUG 1
11540 EOF
11541
11542 fi
11543 if test "$ol_enable_syslog" = yes ; then
11544         cat >> confdefs.h <<\EOF
11545 #define LDAP_SYSLOG 1
11546 EOF
11547
11548 fi
11549 if test "$ol_enable_libui" = yes ; then
11550         cat >> confdefs.h <<\EOF
11551 #define LDAP_LIBUI 1
11552 EOF
11553
11554 fi
11555 if test "$ol_enable_cache" = no ; then
11556         cat >> confdefs.h <<\EOF
11557 #define LDAP_NOCACHE 1
11558 EOF
11559
11560 fi
11561 if test "$ol_enable_dns" != no ; then
11562         cat >> confdefs.h <<\EOF
11563 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11564 EOF
11565
11566 fi
11567 if test "$ol_enable_proctitle" != no ; then
11568         cat >> confdefs.h <<\EOF
11569 #define LDAP_PROCTITLE 1
11570 EOF
11571
11572 fi
11573 if test "$ol_enable_referrals" != no ; then
11574         cat >> confdefs.h <<\EOF
11575 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11576 EOF
11577
11578 fi
11579 if test "$ol_enable_cldap" != no ; then
11580         cat >> confdefs.h <<\EOF
11581 #define LDAP_CONNECTIONLESS 1
11582 EOF
11583
11584 fi
11585
11586 if test "$ol_enable_aclgroups" != no ; then
11587         cat >> confdefs.h <<\EOF
11588 #define SLAPD_ACLGROUPS 1
11589 EOF
11590
11591 fi
11592 if test "$ol_enable_crypt" != no ; then
11593         cat >> confdefs.h <<\EOF
11594 #define SLAPD_CRYPT 1
11595 EOF
11596
11597 fi
11598 if test "$ol_enable_cleartext" != no ; then
11599         cat >> confdefs.h <<\EOF
11600 #define SLAPD_CLEARTEXT 1
11601 EOF
11602
11603 fi
11604 if test "$ol_enable_phonetic" != no ; then
11605         cat >> confdefs.h <<\EOF
11606 #define SLAPD_PHONETIC 1
11607 EOF
11608
11609 fi
11610 if test "$ol_enable_rlookups" != no ; then
11611         cat >> confdefs.h <<\EOF
11612 #define SLAPD_RLOOKUPS 1
11613 EOF
11614
11615 fi
11616
11617 if test "$ol_link_modules" != no ; then
11618         cat >> confdefs.h <<\EOF
11619 #define SLAPD_MODULES 1
11620 EOF
11621
11622         BUILD_SLAPD=yes
11623 fi
11624
11625 if test "$ol_link_bdb2" != no ; then
11626         cat >> confdefs.h <<\EOF
11627 #define SLAPD_BDB2 1
11628 EOF
11629
11630         BUILD_SLAPD=yes
11631         BUILD_BDB2=yes
11632 fi
11633
11634 if test "$ol_enable_ldap" != no ; then
11635         cat >> confdefs.h <<\EOF
11636 #define SLAPD_LDAP 1
11637 EOF
11638
11639         BUILD_SLAPD=yes
11640         BUILD_LDAP=yes
11641 fi
11642
11643 if test "$ol_link_ldbm" != no ; then
11644         cat >> confdefs.h <<\EOF
11645 #define SLAPD_LDBM 1
11646 EOF
11647
11648         BUILD_SLAPD=yes
11649         BUILD_LDBM=yes
11650 fi
11651
11652 if test "$ol_enable_passwd" != no ; then
11653         cat >> confdefs.h <<\EOF
11654 #define SLAPD_PASSWD 1
11655 EOF
11656
11657         BUILD_SLAPD=yes
11658         BUILD_PASSWD=yes
11659 fi
11660
11661 if test "$ol_link_perl" != no ; then
11662         cat >> confdefs.h <<\EOF
11663 #define SLAPD_PERL 1
11664 EOF
11665
11666         BUILD_SLAPD=yes
11667         BUILD_PERL=yes
11668 fi
11669
11670 if test "$ol_enable_shell" != no ; then
11671         cat >> confdefs.h <<\EOF
11672 #define SLAPD_SHELL 1
11673 EOF
11674
11675         BUILD_SLAPD=yes
11676         BUILD_SHELL=yes
11677 fi
11678
11679 if test "$ol_enable_tcl" != no ; then
11680         cat >> confdefs.h <<\EOF
11681 #define SLAPD_TCL 1
11682 EOF
11683
11684         BUILD_SLAPD=yes
11685         BUILD_TCL=yes
11686 fi
11687
11688 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11689         $BUILD_SLAPD = yes ; then
11690         BUILD_SLURPD=yes
11691 fi
11692
11693 if test "$ol_link_isode" != no ; then
11694         BUILD_LDAPD=yes
11695 fi
11696
11697
11698
11699
11700   
11701   
11702   
11703   
11704   
11705   
11706   
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729 trap '' 1 2 15
11730
11731 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11732
11733 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11734 # Let make expand exec_prefix.
11735 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11736
11737 # Any assignment to VPATH causes Sun make to only execute
11738 # the first set of double-colon rules, so remove it if not needed.
11739 # If there is a colon in the path, we need to keep it.
11740 if test "x$srcdir" = x.; then
11741   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11742 fi
11743
11744 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11745
11746 DEFS=-DHAVE_CONFIG_H
11747
11748 # Without the "./", some shells look in PATH for config.status.
11749 : ${CONFIG_STATUS=./config.status}
11750
11751 echo creating $CONFIG_STATUS
11752 rm -f $CONFIG_STATUS
11753 cat > $CONFIG_STATUS <<EOF
11754 #! /bin/sh
11755 # Generated automatically by configure.
11756 # Run this file to recreate the current configuration.
11757 # This directory was configured as follows,
11758 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11759 #
11760 # $0 $ac_configure_args
11761 #
11762 # Compiler output produced by configure, useful for debugging
11763 # configure, is in ./config.log if it exists.
11764
11765 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11766 for ac_option
11767 do
11768   case "\$ac_option" in
11769   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11770     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11771     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11772   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11773     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11774     exit 0 ;;
11775   -help | --help | --hel | --he | --h)
11776     echo "\$ac_cs_usage"; exit 0 ;;
11777   *) echo "\$ac_cs_usage"; exit 1 ;;
11778   esac
11779 done
11780
11781 ac_given_srcdir=$srcdir
11782 ac_given_INSTALL="$INSTALL"
11783
11784 trap 'rm -fr `echo "\
11785 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11786 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11787 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11788 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11789 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11790 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11791 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11792 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11793 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11794 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11795 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11796 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11797 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11798 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11799 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11800 include/Makefile:build/top.mk:include/Makefile.in \
11801 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11802 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11803 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11804 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11805 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11806 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11807 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11808 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11809 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11810 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11811 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11812 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11813 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11814 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11815 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11816 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11817 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11818 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11819 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11820 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11821 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11822 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11823 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11824 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11825 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11826 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11827  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11828 EOF
11829 cat >> $CONFIG_STATUS <<EOF
11830
11831 # Protect against being on the right side of a sed subst in config.status.
11832 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11833  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11834 $ac_vpsub
11835 $extrasub
11836 s%@SHELL@%$SHELL%g
11837 s%@CFLAGS@%$CFLAGS%g
11838 s%@CPPFLAGS@%$CPPFLAGS%g
11839 s%@CXXFLAGS@%$CXXFLAGS%g
11840 s%@FFLAGS@%$FFLAGS%g
11841 s%@DEFS@%$DEFS%g
11842 s%@LDFLAGS@%$LDFLAGS%g
11843 s%@LIBS@%$LIBS%g
11844 s%@exec_prefix@%$exec_prefix%g
11845 s%@prefix@%$prefix%g
11846 s%@program_transform_name@%$program_transform_name%g
11847 s%@bindir@%$bindir%g
11848 s%@sbindir@%$sbindir%g
11849 s%@libexecdir@%$libexecdir%g
11850 s%@datadir@%$datadir%g
11851 s%@sysconfdir@%$sysconfdir%g
11852 s%@sharedstatedir@%$sharedstatedir%g
11853 s%@localstatedir@%$localstatedir%g
11854 s%@libdir@%$libdir%g
11855 s%@includedir@%$includedir%g
11856 s%@oldincludedir@%$oldincludedir%g
11857 s%@infodir@%$infodir%g
11858 s%@mandir@%$mandir%g
11859 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11860 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11861 s%@INSTALL_DATA@%$INSTALL_DATA%g
11862 s%@PACKAGE@%$PACKAGE%g
11863 s%@VERSION@%$VERSION%g
11864 s%@ACLOCAL@%$ACLOCAL%g
11865 s%@AUTOCONF@%$AUTOCONF%g
11866 s%@AUTOMAKE@%$AUTOMAKE%g
11867 s%@AUTOHEADER@%$AUTOHEADER%g
11868 s%@MAKEINFO@%$MAKEINFO%g
11869 s%@SET_MAKE@%$SET_MAKE%g
11870 s%@top_builddir@%$top_builddir%g
11871 s%@ldap_subdir@%$ldap_subdir%g
11872 s%@host@%$host%g
11873 s%@host_alias@%$host_alias%g
11874 s%@host_cpu@%$host_cpu%g
11875 s%@host_vendor@%$host_vendor%g
11876 s%@host_os@%$host_os%g
11877 s%@CC@%$CC%g
11878 s%@RANLIB@%$RANLIB%g
11879 s%@LD@%$LD%g
11880 s%@NM@%$NM%g
11881 s%@LN_S@%$LN_S%g
11882 s%@LIBTOOL@%$LIBTOOL%g
11883 s%@AWK@%$AWK%g
11884 s%@LN_H@%$LN_H%g
11885 s%@SENDMAIL@%$SENDMAIL%g
11886 s%@EDITOR@%$EDITOR%g
11887 s%@FINGER@%$FINGER%g
11888 s%@GLIBCONFIG@%$GLIBCONFIG%g
11889 s%@PERLBIN@%$PERLBIN%g
11890 s%@CPP@%$CPP%g
11891 s%@EXEEXT@%$EXEEXT%g
11892 s%@OBJEXT@%$OBJEXT%g
11893 s%@OL_MKDEP@%$OL_MKDEP%g
11894 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
11895 s%@PEPSY@%$PEPSY%g
11896 s%@LIBOBJS@%$LIBOBJS%g
11897 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11898 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11899 s%@BUILD_BDB2@%$BUILD_BDB2%g
11900 s%@BUILD_LDAP@%$BUILD_LDAP%g
11901 s%@BUILD_LDBM@%$BUILD_LDBM%g
11902 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11903 s%@BUILD_PERL@%$BUILD_PERL%g
11904 s%@BUILD_SHELL@%$BUILD_SHELL%g
11905 s%@BUILD_TCL@%$BUILD_TCL%g
11906 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11907 s%@LDAP_LIBS@%$LDAP_LIBS%g
11908 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11909 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11910 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11911 s%@LDBM_LIBS@%$LDBM_LIBS%g
11912 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11913 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11914 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11915 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11916 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11917 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11918 s%@KRB_LIBS@%$KRB_LIBS%g
11919 s%@READLINE_LIBS@%$READLINE_LIBS%g
11920 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11921 s%@TLS_LIBS@%$TLS_LIBS%g
11922
11923 CEOF
11924 EOF
11925
11926 cat >> $CONFIG_STATUS <<\EOF
11927
11928 # Split the substitutions into bite-sized pieces for seds with
11929 # small command number limits, like on Digital OSF/1 and HP-UX.
11930 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11931 ac_file=1 # Number of current file.
11932 ac_beg=1 # First line for current file.
11933 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11934 ac_more_lines=:
11935 ac_sed_cmds=""
11936 while $ac_more_lines; do
11937   if test $ac_beg -gt 1; then
11938     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11939   else
11940     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11941   fi
11942   if test ! -s conftest.s$ac_file; then
11943     ac_more_lines=false
11944     rm -f conftest.s$ac_file
11945   else
11946     if test -z "$ac_sed_cmds"; then
11947       ac_sed_cmds="sed -f conftest.s$ac_file"
11948     else
11949       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11950     fi
11951     ac_file=`expr $ac_file + 1`
11952     ac_beg=$ac_end
11953     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11954   fi
11955 done
11956 if test -z "$ac_sed_cmds"; then
11957   ac_sed_cmds=cat
11958 fi
11959 EOF
11960
11961 cat >> $CONFIG_STATUS <<EOF
11962
11963 CONFIG_FILES=\${CONFIG_FILES-"\
11964 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11965 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11966 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11967 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11968 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11969 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11970 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11971 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11972 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11973 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11974 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11975 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11976 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11977 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11978 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11979 include/Makefile:build/top.mk:include/Makefile.in \
11980 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11981 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11982 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11983 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11984 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11985 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11986 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11987 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11988 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11989 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11990 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11991 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11992 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11993 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11994 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11995 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11996 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11997 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11998 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11999 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
12000 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
12001 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
12002 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12003 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12004 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12005 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12006 "}
12007 EOF
12008 cat >> $CONFIG_STATUS <<\EOF
12009 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12010   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12011   case "$ac_file" in
12012   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12013        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12014   *) ac_file_in="${ac_file}.in" ;;
12015   esac
12016
12017   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12018
12019   # Remove last slash and all that follows it.  Not all systems have dirname.
12020   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12021   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12022     # The file is in a subdirectory.
12023     test ! -d "$ac_dir" && mkdir "$ac_dir"
12024     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12025     # A "../" for each directory in $ac_dir_suffix.
12026     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12027   else
12028     ac_dir_suffix= ac_dots=
12029   fi
12030
12031   case "$ac_given_srcdir" in
12032   .)  srcdir=.
12033       if test -z "$ac_dots"; then top_srcdir=.
12034       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12035   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12036   *) # Relative path.
12037     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12038     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12039   esac
12040
12041   case "$ac_given_INSTALL" in
12042   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12043   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12044   esac
12045
12046   echo creating "$ac_file"
12047   rm -f "$ac_file"
12048   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12049   case "$ac_file" in
12050   *Makefile*) ac_comsub="1i\\
12051 # $configure_input" ;;
12052   *) ac_comsub= ;;
12053   esac
12054
12055   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12056   sed -e "$ac_comsub
12057 s%@configure_input@%$configure_input%g
12058 s%@srcdir@%$srcdir%g
12059 s%@top_srcdir@%$top_srcdir%g
12060 s%@INSTALL@%$INSTALL%g
12061 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12062 fi; done
12063 rm -f conftest.s*
12064
12065 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12066 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12067 #
12068 # ac_d sets the value in "#define NAME VALUE" lines.
12069 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12070 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12071 ac_dC='\3'
12072 ac_dD='%g'
12073 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12074 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12075 ac_uB='\([      ]\)%\1#\2define\3'
12076 ac_uC=' '
12077 ac_uD='\4%g'
12078 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12079 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12080 ac_eB='$%\1#\2define\3'
12081 ac_eC=' '
12082 ac_eD='%g'
12083
12084 if test "${CONFIG_HEADERS+set}" != set; then
12085 EOF
12086 cat >> $CONFIG_STATUS <<EOF
12087   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
12088 EOF
12089 cat >> $CONFIG_STATUS <<\EOF
12090 fi
12091 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12092   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12093   case "$ac_file" in
12094   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12095        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12096   *) ac_file_in="${ac_file}.in" ;;
12097   esac
12098
12099   echo creating $ac_file
12100
12101   rm -f conftest.frag conftest.in conftest.out
12102   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12103   cat $ac_file_inputs > conftest.in
12104
12105 EOF
12106
12107 # Transform confdefs.h into a sed script conftest.vals that substitutes
12108 # the proper values into config.h.in to produce config.h.  And first:
12109 # Protect against being on the right side of a sed subst in config.status.
12110 # Protect against being in an unquoted here document in config.status.
12111 rm -f conftest.vals
12112 cat > conftest.hdr <<\EOF
12113 s/[\\&%]/\\&/g
12114 s%[\\$`]%\\&%g
12115 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12116 s%ac_d%ac_u%gp
12117 s%ac_u%ac_e%gp
12118 EOF
12119 sed -n -f conftest.hdr confdefs.h > conftest.vals
12120 rm -f conftest.hdr
12121
12122 # This sed command replaces #undef with comments.  This is necessary, for
12123 # example, in the case of _POSIX_SOURCE, which is predefined and required
12124 # on some systems where configure will not decide to define it.
12125 cat >> conftest.vals <<\EOF
12126 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12127 EOF
12128
12129 # Break up conftest.vals because some shells have a limit on
12130 # the size of here documents, and old seds have small limits too.
12131
12132 rm -f conftest.tail
12133 while :
12134 do
12135   ac_lines=`grep -c . conftest.vals`
12136   # grep -c gives empty output for an empty file on some AIX systems.
12137   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12138   # Write a limited-size here document to conftest.frag.
12139   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12140   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12141   echo 'CEOF
12142   sed -f conftest.frag conftest.in > conftest.out
12143   rm -f conftest.in
12144   mv conftest.out conftest.in
12145 ' >> $CONFIG_STATUS
12146   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12147   rm -f conftest.vals
12148   mv conftest.tail conftest.vals
12149 done
12150 rm -f conftest.vals
12151
12152 cat >> $CONFIG_STATUS <<\EOF
12153   rm -f conftest.frag conftest.h
12154   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12155   cat conftest.in >> conftest.h
12156   rm -f conftest.in
12157   if cmp -s $ac_file conftest.h 2>/dev/null; then
12158     echo "$ac_file is unchanged"
12159     rm -f conftest.h
12160   else
12161     # Remove last slash and all that follows it.  Not all systems have dirname.
12162       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12163       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12164       # The file is in a subdirectory.
12165       test ! -d "$ac_dir" && mkdir "$ac_dir"
12166     fi
12167     rm -f $ac_file
12168     mv conftest.h $ac_file
12169   fi
12170 fi; done
12171
12172 EOF
12173 cat >> $CONFIG_STATUS <<EOF
12174
12175 EOF
12176 cat >> $CONFIG_STATUS <<\EOF
12177
12178 date > stamp-h
12179 echo Please \"make depend\" to build dependencies
12180
12181 exit 0
12182 EOF
12183 chmod +x $CONFIG_STATUS
12184 rm -fr confdefs* $ac_clean_files
12185 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12186