]> git.sur5r.net Git - openldap/blob - configure
c5da2bfbedaf83998eb3376fe64fff97805c3248
[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*)
1851         if test -z "CC" -a "$ol_host_os" = aix ; then
1852                 case "$ol_with_threads" in
1853                 auto | yes |  posix) ol_aix_threads=yes ;;
1854                 esac
1855         fi
1856 ;;
1857 esac
1858
1859 if test -z "${CC}" -a $ol_aix_threads = yes ; then
1860         for ac_prog in cc_r xlc_r cc
1861 do
1862 # Extract the first word of "$ac_prog", so it can be a program name with args.
1863 set dummy $ac_prog; ac_word=$2
1864 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1865 echo "configure:1866: checking for $ac_word" >&5
1866 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1867   echo $ac_n "(cached) $ac_c" 1>&6
1868 else
1869   if test -n "$CC"; then
1870   ac_cv_prog_CC="$CC" # Let the user override the test.
1871 else
1872   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1873   ac_dummy="$PATH"
1874   for ac_dir in $ac_dummy; do
1875     test -z "$ac_dir" && ac_dir=.
1876     if test -f $ac_dir/$ac_word; then
1877       ac_cv_prog_CC="$ac_prog"
1878       break
1879     fi
1880   done
1881   IFS="$ac_save_ifs"
1882 fi
1883 fi
1884 CC="$ac_cv_prog_CC"
1885 if test -n "$CC"; then
1886   echo "$ac_t""$CC" 1>&6
1887 else
1888   echo "$ac_t""no" 1>&6
1889 fi
1890
1891 test -n "$CC" && break
1892 done
1893
1894
1895         if test "$CC" = cc ; then
1896                                 if test $ol_with_threads != auto ; then
1897                         { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
1898                 else
1899                         echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
1900                 fi
1901                 ol_with_threads=no
1902
1903         elif test "$CC" ; then
1904                 ol_with_threads=posix
1905                 ol_cv_pthread_create=yes
1906         fi
1907 fi
1908
1909 if test -z "${CC}"; then
1910         for ac_prog in cc
1911 do
1912 # Extract the first word of "$ac_prog", so it can be a program name with args.
1913 set dummy $ac_prog; ac_word=$2
1914 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1915 echo "configure:1916: checking for $ac_word" >&5
1916 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1917   echo $ac_n "(cached) $ac_c" 1>&6
1918 else
1919   if test -n "$CC"; then
1920   ac_cv_prog_CC="$CC" # Let the user override the test.
1921 else
1922   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1923   ac_dummy="$PATH"
1924   for ac_dir in $ac_dummy; do
1925     test -z "$ac_dir" && ac_dir=.
1926     if test -f $ac_dir/$ac_word; then
1927       ac_cv_prog_CC="$ac_prog"
1928       break
1929     fi
1930   done
1931   IFS="$ac_save_ifs"
1932 fi
1933 fi
1934 CC="$ac_cv_prog_CC"
1935 if test -n "$CC"; then
1936   echo "$ac_t""$CC" 1>&6
1937 else
1938   echo "$ac_t""no" 1>&6
1939 fi
1940
1941 test -n "$CC" && break
1942 done
1943
1944 fi
1945
1946
1947 # Extract the first word of "ranlib", so it can be a program name with args.
1948 set dummy ranlib; ac_word=$2
1949 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1950 echo "configure:1951: checking for $ac_word" >&5
1951 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1952   echo $ac_n "(cached) $ac_c" 1>&6
1953 else
1954   if test -n "$RANLIB"; then
1955   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1956 else
1957   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1958   ac_dummy="$PATH"
1959   for ac_dir in $ac_dummy; do
1960     test -z "$ac_dir" && ac_dir=.
1961     if test -f $ac_dir/$ac_word; then
1962       ac_cv_prog_RANLIB="ranlib"
1963       break
1964     fi
1965   done
1966   IFS="$ac_save_ifs"
1967   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1968 fi
1969 fi
1970 RANLIB="$ac_cv_prog_RANLIB"
1971 if test -n "$RANLIB"; then
1972   echo "$ac_t""$RANLIB" 1>&6
1973 else
1974   echo "$ac_t""no" 1>&6
1975 fi
1976
1977 # Extract the first word of "gcc", so it can be a program name with args.
1978 set dummy gcc; ac_word=$2
1979 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1980 echo "configure:1981: checking for $ac_word" >&5
1981 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1982   echo $ac_n "(cached) $ac_c" 1>&6
1983 else
1984   if test -n "$CC"; then
1985   ac_cv_prog_CC="$CC" # Let the user override the test.
1986 else
1987   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1988   ac_dummy="$PATH"
1989   for ac_dir in $ac_dummy; do
1990     test -z "$ac_dir" && ac_dir=.
1991     if test -f $ac_dir/$ac_word; then
1992       ac_cv_prog_CC="gcc"
1993       break
1994     fi
1995   done
1996   IFS="$ac_save_ifs"
1997 fi
1998 fi
1999 CC="$ac_cv_prog_CC"
2000 if test -n "$CC"; then
2001   echo "$ac_t""$CC" 1>&6
2002 else
2003   echo "$ac_t""no" 1>&6
2004 fi
2005
2006 if test -z "$CC"; then
2007   # Extract the first word of "cc", so it can be a program name with args.
2008 set dummy cc; ac_word=$2
2009 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2010 echo "configure:2011: checking for $ac_word" >&5
2011 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2012   echo $ac_n "(cached) $ac_c" 1>&6
2013 else
2014   if test -n "$CC"; then
2015   ac_cv_prog_CC="$CC" # Let the user override the test.
2016 else
2017   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2018   ac_prog_rejected=no
2019   ac_dummy="$PATH"
2020   for ac_dir in $ac_dummy; do
2021     test -z "$ac_dir" && ac_dir=.
2022     if test -f $ac_dir/$ac_word; then
2023       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2024         ac_prog_rejected=yes
2025         continue
2026       fi
2027       ac_cv_prog_CC="cc"
2028       break
2029     fi
2030   done
2031   IFS="$ac_save_ifs"
2032 if test $ac_prog_rejected = yes; then
2033   # We found a bogon in the path, so make sure we never use it.
2034   set dummy $ac_cv_prog_CC
2035   shift
2036   if test $# -gt 0; then
2037     # We chose a different compiler from the bogus one.
2038     # However, it has the same basename, so the bogon will be chosen
2039     # first if we set CC to just the basename; use the full file name.
2040     shift
2041     set dummy "$ac_dir/$ac_word" "$@"
2042     shift
2043     ac_cv_prog_CC="$@"
2044   fi
2045 fi
2046 fi
2047 fi
2048 CC="$ac_cv_prog_CC"
2049 if test -n "$CC"; then
2050   echo "$ac_t""$CC" 1>&6
2051 else
2052   echo "$ac_t""no" 1>&6
2053 fi
2054
2055   if test -z "$CC"; then
2056     case "`uname -s`" in
2057     *win32* | *WIN32*)
2058       # Extract the first word of "cl", so it can be a program name with args.
2059 set dummy cl; ac_word=$2
2060 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2061 echo "configure:2062: checking for $ac_word" >&5
2062 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2063   echo $ac_n "(cached) $ac_c" 1>&6
2064 else
2065   if test -n "$CC"; then
2066   ac_cv_prog_CC="$CC" # Let the user override the test.
2067 else
2068   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2069   ac_dummy="$PATH"
2070   for ac_dir in $ac_dummy; do
2071     test -z "$ac_dir" && ac_dir=.
2072     if test -f $ac_dir/$ac_word; then
2073       ac_cv_prog_CC="cl"
2074       break
2075     fi
2076   done
2077   IFS="$ac_save_ifs"
2078 fi
2079 fi
2080 CC="$ac_cv_prog_CC"
2081 if test -n "$CC"; then
2082   echo "$ac_t""$CC" 1>&6
2083 else
2084   echo "$ac_t""no" 1>&6
2085 fi
2086  ;;
2087     esac
2088   fi
2089   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2090 fi
2091
2092 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2093 echo "configure:2094: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2094
2095 ac_ext=c
2096 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2097 ac_cpp='$CPP $CPPFLAGS'
2098 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2099 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2100 cross_compiling=$ac_cv_prog_cc_cross
2101
2102 cat > conftest.$ac_ext << EOF
2103
2104 #line 2105 "configure"
2105 #include "confdefs.h"
2106
2107 main(){return(0);}
2108 EOF
2109 if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2110   ac_cv_prog_cc_works=yes
2111   # If we can't run a trivial program, we are probably using a cross compiler.
2112   if (./conftest; exit) 2>/dev/null; then
2113     ac_cv_prog_cc_cross=no
2114   else
2115     ac_cv_prog_cc_cross=yes
2116   fi
2117 else
2118   echo "configure: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   ac_cv_prog_cc_works=no
2121 fi
2122 rm -fr conftest*
2123 ac_ext=c
2124 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2125 ac_cpp='$CPP $CPPFLAGS'
2126 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2127 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2128 cross_compiling=$ac_cv_prog_cc_cross
2129
2130 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2131 if test $ac_cv_prog_cc_works = no; then
2132   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2133 fi
2134 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2135 echo "configure:2136: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2136 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2137 cross_compiling=$ac_cv_prog_cc_cross
2138
2139 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2140 echo "configure:2141: checking whether we are using GNU C" >&5
2141 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2142   echo $ac_n "(cached) $ac_c" 1>&6
2143 else
2144   cat > conftest.c <<EOF
2145 #ifdef __GNUC__
2146   yes;
2147 #endif
2148 EOF
2149 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2150   ac_cv_prog_gcc=yes
2151 else
2152   ac_cv_prog_gcc=no
2153 fi
2154 fi
2155
2156 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2157
2158 if test $ac_cv_prog_gcc = yes; then
2159   GCC=yes
2160 else
2161   GCC=
2162 fi
2163
2164 ac_test_CFLAGS="${CFLAGS+set}"
2165 ac_save_CFLAGS="$CFLAGS"
2166 CFLAGS=
2167 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2168 echo "configure:2169: checking whether ${CC-cc} accepts -g" >&5
2169 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2170   echo $ac_n "(cached) $ac_c" 1>&6
2171 else
2172   echo 'void f(){}' > conftest.c
2173 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2174   ac_cv_prog_cc_g=yes
2175 else
2176   ac_cv_prog_cc_g=no
2177 fi
2178 rm -f conftest*
2179
2180 fi
2181
2182 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2183 if test "$ac_test_CFLAGS" = set; then
2184   CFLAGS="$ac_save_CFLAGS"
2185 elif test $ac_cv_prog_cc_g = yes; then
2186   if test "$GCC" = yes; then
2187     CFLAGS="-g -O2"
2188   else
2189     CFLAGS="-g"
2190   fi
2191 else
2192   if test "$GCC" = yes; then
2193     CFLAGS="-O2"
2194   else
2195     CFLAGS=
2196   fi
2197 fi
2198
2199 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2200 if test "${with_gnu_ld+set}" = set; then
2201   withval="$with_gnu_ld"
2202   test "$withval" = no || with_gnu_ld=yes
2203 else
2204   with_gnu_ld=no
2205 fi
2206
2207
2208 ac_prog=ld
2209 if test "$ac_cv_prog_gcc" = yes; then
2210   # Check if gcc -print-prog-name=ld gives a path.
2211   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2212 echo "configure:2213: checking for ld used by GCC" >&5
2213   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2214   case "$ac_prog" in
2215   # Accept absolute paths.
2216   /* | A-Za-z:\\*)
2217     test -z "$LD" && LD="$ac_prog"
2218     ;;
2219   "")
2220     # If it fails, then pretend we aren't using GCC.
2221     ac_prog=ld
2222     ;;
2223   *)
2224     # If it is relative, then search for the first ld in PATH.
2225     with_gnu_ld=unknown
2226     ;;
2227   esac
2228 elif test "$with_gnu_ld" = yes; then
2229   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2230 echo "configure:2231: checking for GNU ld" >&5
2231 else
2232   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2233 echo "configure:2234: checking for non-GNU ld" >&5
2234 fi
2235 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2236   echo $ac_n "(cached) $ac_c" 1>&6
2237 else
2238   if test -z "$LD"; then
2239   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2240   for ac_dir in $PATH; do
2241     test -z "$ac_dir" && ac_dir=.
2242     if test -f "$ac_dir/$ac_prog"; then
2243       ac_cv_path_LD="$ac_dir/$ac_prog"
2244       # Check to see if the program is GNU ld.  I'd rather use --version,
2245       # but apparently some GNU ld's only accept -v.
2246       # Break only if it was the GNU/non-GNU ld that we prefer.
2247       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2248         test "$with_gnu_ld" != no && break
2249       else
2250         test "$with_gnu_ld" != yes && break
2251       fi
2252     fi
2253   done
2254   IFS="$ac_save_ifs"
2255 else
2256   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2257 fi
2258 fi
2259
2260 LD="$ac_cv_path_LD"
2261 if test -n "$LD"; then
2262   echo "$ac_t""$LD" 1>&6
2263 else
2264   echo "$ac_t""no" 1>&6
2265 fi
2266 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2267
2268 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2269 echo "configure:2270: checking if the linker ($LD) is GNU ld" >&5
2270 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2271   echo $ac_n "(cached) $ac_c" 1>&6
2272 else
2273   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2274 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2275   ac_cv_prog_gnu_ld=yes
2276 else
2277   ac_cv_prog_gnu_ld=no
2278 fi
2279 fi
2280
2281 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2282
2283
2284 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2285 echo "configure:2286: checking for BSD-compatible nm" >&5
2286 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2287   echo $ac_n "(cached) $ac_c" 1>&6
2288 else
2289   case "$NM" in
2290 /* | A-Za-z:\\*)
2291   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2292   ;;
2293 *)
2294   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2295   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2296     test -z "$ac_dir" && ac_dir=.
2297     if test -f $ac_dir/nm; then
2298       # Check to see if the nm accepts a BSD-compat flag.
2299       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2300       #   nm: unknown option "B" ignored
2301       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2302         ac_cv_path_NM="$ac_dir/nm -B"
2303       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2304         ac_cv_path_NM="$ac_dir/nm -p"
2305       else
2306         ac_cv_path_NM="$ac_dir/nm"
2307       fi
2308       break
2309     fi
2310   done
2311   IFS="$ac_save_ifs"
2312   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2313   ;;
2314 esac
2315 fi
2316
2317 NM="$ac_cv_path_NM"
2318 echo "$ac_t""$NM" 1>&6
2319
2320
2321 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2322 echo "configure:2323: checking whether ln -s works" >&5
2323 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2324   echo $ac_n "(cached) $ac_c" 1>&6
2325 else
2326   rm -f conftestdata
2327 if ln -s X conftestdata 2>/dev/null
2328 then
2329   rm -f conftestdata
2330   ac_cv_prog_LN_S="ln -s"
2331 else
2332   ac_cv_prog_LN_S=ln
2333 fi
2334 fi
2335 LN_S="$ac_cv_prog_LN_S"
2336 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2337   echo "$ac_t""yes" 1>&6
2338 else
2339   echo "$ac_t""no" 1>&6
2340 fi
2341
2342 # Always use our own libtool.
2343 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2344
2345 # Check for any special flags to pass to ltconfig.
2346 libtool_flags=
2347 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2348 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2349 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2350 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2351 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2352
2353 # Some flags need to be propagated to the compiler or linker for good
2354 # libtool support.
2355 case "$host" in
2356 *-*-irix6*)
2357   # Find out which ABI we are using.
2358   echo '#line 2359 "configure"' > conftest.$ac_ext
2359   if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2360     case "`/usr/bin/file conftest.o`" in
2361     *32-bit*)
2362       LD="${LD-ld} -32"
2363       ;;
2364     *N32*)
2365       LD="${LD-ld} -n32"
2366       ;;
2367     *64-bit*)
2368       LD="${LD-ld} -64"
2369       ;;
2370     esac
2371   fi
2372   rm -rf conftest*
2373   ;;
2374
2375 *-*-sco3.2v5*)
2376   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2377   CFLAGS="$CFLAGS -belf"
2378   ;;
2379 esac
2380
2381 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2382 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2383 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2384 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2385 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2386 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2387
2388
2389 for ac_prog in mawk gawk nawk awk
2390 do
2391 # Extract the first word of "$ac_prog", so it can be a program name with args.
2392 set dummy $ac_prog; ac_word=$2
2393 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2394 echo "configure:2395: checking for $ac_word" >&5
2395 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2396   echo $ac_n "(cached) $ac_c" 1>&6
2397 else
2398   if test -n "$AWK"; then
2399   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2400 else
2401   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2402   ac_dummy="$PATH"
2403   for ac_dir in $ac_dummy; do
2404     test -z "$ac_dir" && ac_dir=.
2405     if test -f $ac_dir/$ac_word; then
2406       ac_cv_prog_AWK="$ac_prog"
2407       break
2408     fi
2409   done
2410   IFS="$ac_save_ifs"
2411 fi
2412 fi
2413 AWK="$ac_cv_prog_AWK"
2414 if test -n "$AWK"; then
2415   echo "$ac_t""$AWK" 1>&6
2416 else
2417   echo "$ac_t""no" 1>&6
2418 fi
2419
2420 test -n "$AWK" && break
2421 done
2422
2423 # test for ln hardlink support
2424 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2425 echo "configure:2426: checking whether ln works" >&5
2426 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2427   echo $ac_n "(cached) $ac_c" 1>&6
2428 else
2429   rm -f conftest.src conftest.dst
2430 echo "conftest" > conftest.src
2431 if ln conftest.src conftest.dst 2>/dev/null
2432 then
2433   ol_cv_prog_LN_H="ln"
2434 else
2435   ol_cv_prog_LN_H="cp"
2436 fi
2437 rm -f conftest.src conftest.dst
2438
2439 fi
2440 LN_H="$ol_cv_prog_LN_H"
2441 if test "$ol_cv_prog_LN_H" = "ln"; then
2442         echo "$ac_t""yes" 1>&6
2443 else
2444         echo "$ac_t""no" 1>&6
2445 fi
2446
2447 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2448 echo "configure:2449: checking whether ln -s works" >&5
2449 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2450   echo $ac_n "(cached) $ac_c" 1>&6
2451 else
2452   rm -f conftestdata
2453 if ln -s X conftestdata 2>/dev/null
2454 then
2455   rm -f conftestdata
2456   ac_cv_prog_LN_S="ln -s"
2457 else
2458   ac_cv_prog_LN_S=ln
2459 fi
2460 fi
2461 LN_S="$ac_cv_prog_LN_S"
2462 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2463   echo "$ac_t""yes" 1>&6
2464 else
2465   echo "$ac_t""no" 1>&6
2466 fi
2467
2468
2469 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2470         LN_S="$LN_H"
2471 fi
2472
2473 # Extract the first word of "sendmail", so it can be a program name with args.
2474 set dummy sendmail; ac_word=$2
2475 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2476 echo "configure:2477: checking for $ac_word" >&5
2477 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   case "$SENDMAIL" in
2481   /*)
2482   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2483   ;;
2484   ?:/*)                  
2485   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2486   ;;
2487   *)
2488   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2489   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2490   for ac_dir in $ac_dummy; do 
2491     test -z "$ac_dir" && ac_dir=.
2492     if test -f $ac_dir/$ac_word; then
2493       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2494       break
2495     fi
2496   done
2497   IFS="$ac_save_ifs"
2498   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2499   ;;
2500 esac
2501 fi
2502 SENDMAIL="$ac_cv_path_SENDMAIL"
2503 if test -n "$SENDMAIL"; then
2504   echo "$ac_t""$SENDMAIL" 1>&6
2505 else
2506   echo "$ac_t""no" 1>&6
2507 fi
2508
2509 # Extract the first word of "vi", so it can be a program name with args.
2510 set dummy vi; ac_word=$2
2511 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2512 echo "configure:2513: checking for $ac_word" >&5
2513 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2514   echo $ac_n "(cached) $ac_c" 1>&6
2515 else
2516   case "$EDITOR" in
2517   /*)
2518   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2519   ;;
2520   ?:/*)                  
2521   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2522   ;;
2523   *)
2524   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2525   ac_dummy="$PATH:/usr/ucb"
2526   for ac_dir in $ac_dummy; do 
2527     test -z "$ac_dir" && ac_dir=.
2528     if test -f $ac_dir/$ac_word; then
2529       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2530       break
2531     fi
2532   done
2533   IFS="$ac_save_ifs"
2534   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2535   ;;
2536 esac
2537 fi
2538 EDITOR="$ac_cv_path_EDITOR"
2539 if test -n "$EDITOR"; then
2540   echo "$ac_t""$EDITOR" 1>&6
2541 else
2542   echo "$ac_t""no" 1>&6
2543 fi
2544
2545 # Extract the first word of "finger", so it can be a program name with args.
2546 set dummy finger; ac_word=$2
2547 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2548 echo "configure:2549: checking for $ac_word" >&5
2549 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2550   echo $ac_n "(cached) $ac_c" 1>&6
2551 else
2552   case "$FINGER" in
2553   /*)
2554   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2555   ;;
2556   ?:/*)                  
2557   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2558   ;;
2559   *)
2560   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2561   ac_dummy="$PATH:/usr/ucb"
2562   for ac_dir in $ac_dummy; do 
2563     test -z "$ac_dir" && ac_dir=.
2564     if test -f $ac_dir/$ac_word; then
2565       ac_cv_path_FINGER="$ac_dir/$ac_word"
2566       break
2567     fi
2568   done
2569   IFS="$ac_save_ifs"
2570   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2571   ;;
2572 esac
2573 fi
2574 FINGER="$ac_cv_path_FINGER"
2575 if test -n "$FINGER"; then
2576   echo "$ac_t""$FINGER" 1>&6
2577 else
2578   echo "$ac_t""no" 1>&6
2579 fi
2580
2581
2582 ol_link_modules=no
2583 if test $ol_enable_modules != no ; then
2584         # Extract the first word of "glib-config", so it can be a program name with args.
2585 set dummy glib-config; ac_word=$2
2586 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2587 echo "configure:2588: checking for $ac_word" >&5
2588 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2589   echo $ac_n "(cached) $ac_c" 1>&6
2590 else
2591   case "$GLIBCONFIG" in
2592   /*)
2593   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2594   ;;
2595   ?:/*)                  
2596   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2597   ;;
2598   *)
2599   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2600   ac_dummy="$PATH"
2601   for ac_dir in $ac_dummy; do 
2602     test -z "$ac_dir" && ac_dir=.
2603     if test -f $ac_dir/$ac_word; then
2604       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2605       break
2606     fi
2607   done
2608   IFS="$ac_save_ifs"
2609   ;;
2610 esac
2611 fi
2612 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2613 if test -n "$GLIBCONFIG"; then
2614   echo "$ac_t""$GLIBCONFIG" 1>&6
2615 else
2616   echo "$ac_t""no" 1>&6
2617 fi
2618
2619
2620         if test "no$GLIBCONFIG" = "no" ; then
2621                 if test $ol_enable_modules = yes ; then
2622                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2623                 fi
2624
2625         else
2626                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2627                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2628                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2629
2630                                 ol_link_modules=yes
2631         fi
2632 fi
2633
2634 ol_link_perl=no
2635 if test $ol_enable_perl != no ; then
2636         # Extract the first word of "perl", so it can be a program name with args.
2637 set dummy perl; ac_word=$2
2638 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2639 echo "configure:2640: checking for $ac_word" >&5
2640 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2641   echo $ac_n "(cached) $ac_c" 1>&6
2642 else
2643   case "$PERLBIN" in
2644   /*)
2645   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2646   ;;
2647   ?:/*)                  
2648   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2649   ;;
2650   *)
2651   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2652   ac_dummy="$PATH"
2653   for ac_dir in $ac_dummy; do 
2654     test -z "$ac_dir" && ac_dir=.
2655     if test -f $ac_dir/$ac_word; then
2656       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2657       break
2658     fi
2659   done
2660   IFS="$ac_save_ifs"
2661   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2662   ;;
2663 esac
2664 fi
2665 PERLBIN="$ac_cv_path_PERLBIN"
2666 if test -n "$PERLBIN"; then
2667   echo "$ac_t""$PERLBIN" 1>&6
2668 else
2669   echo "$ac_t""no" 1>&6
2670 fi
2671
2672
2673         if test "no$PERLBIN" = "no" ; then
2674                 if test $ol_enable_perl = yes ; then
2675                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2676                 fi
2677
2678         else
2679                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2680                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2681
2682                                 ol_link_perl=yes
2683         fi
2684 fi
2685
2686 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2687 echo "configure:2688: checking how to run the C preprocessor" >&5
2688 # On Suns, sometimes $CPP names a directory.
2689 if test -n "$CPP" && test -d "$CPP"; then
2690   CPP=
2691 fi
2692 if test -z "$CPP"; then
2693 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2694   echo $ac_n "(cached) $ac_c" 1>&6
2695 else
2696     # This must be in double quotes, not single quotes, because CPP may get
2697   # substituted into the Makefile and "${CC-cc}" will confuse make.
2698   CPP="${CC-cc} -E"
2699   # On the NeXT, cc -E runs the code through the compiler's parser,
2700   # not just through cpp.
2701   cat > conftest.$ac_ext <<EOF
2702 #line 2703 "configure"
2703 #include "confdefs.h"
2704 #include <assert.h>
2705 Syntax Error
2706 EOF
2707 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2708 { (eval echo configure:2709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2709 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2710 if test -z "$ac_err"; then
2711   :
2712 else
2713   echo "$ac_err" >&5
2714   echo "configure: failed program was:" >&5
2715   cat conftest.$ac_ext >&5
2716   rm -rf conftest*
2717   CPP="${CC-cc} -E -traditional-cpp"
2718   cat > conftest.$ac_ext <<EOF
2719 #line 2720 "configure"
2720 #include "confdefs.h"
2721 #include <assert.h>
2722 Syntax Error
2723 EOF
2724 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2725 { (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2726 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2727 if test -z "$ac_err"; then
2728   :
2729 else
2730   echo "$ac_err" >&5
2731   echo "configure: failed program was:" >&5
2732   cat conftest.$ac_ext >&5
2733   rm -rf conftest*
2734   CPP="${CC-cc} -nologo -E"
2735   cat > conftest.$ac_ext <<EOF
2736 #line 2737 "configure"
2737 #include "confdefs.h"
2738 #include <assert.h>
2739 Syntax Error
2740 EOF
2741 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2742 { (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2743 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2744 if test -z "$ac_err"; then
2745   :
2746 else
2747   echo "$ac_err" >&5
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   CPP=/lib/cpp
2752 fi
2753 rm -f conftest*
2754 fi
2755 rm -f conftest*
2756 fi
2757 rm -f conftest*
2758   ac_cv_prog_CPP="$CPP"
2759 fi
2760   CPP="$ac_cv_prog_CPP"
2761 else
2762   ac_cv_prog_CPP="$CPP"
2763 fi
2764 echo "$ac_t""$CPP" 1>&6
2765
2766
2767 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2768         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2769
2770 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2771         echo "configure: warning: programs compiled here do run here..." 1>&2
2772         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2773
2774 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2775         echo "configure: warning: programs compiled here do not run here..." 1>&2
2776         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2777 fi
2778
2779 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2780 echo "configure:2781: checking for AIX" >&5
2781 cat > conftest.$ac_ext <<EOF
2782 #line 2783 "configure"
2783 #include "confdefs.h"
2784 #ifdef _AIX
2785   yes
2786 #endif
2787
2788 EOF
2789 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2790   egrep "yes" >/dev/null 2>&1; then
2791   rm -rf conftest*
2792   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2793 #define _ALL_SOURCE 1
2794 EOF
2795
2796 else
2797   rm -rf conftest*
2798   echo "$ac_t""no" 1>&6
2799 fi
2800 rm -f conftest*
2801
2802
2803 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2804 echo "configure:2805: checking for POSIXized ISC" >&5
2805 if test -d /etc/conf/kconfig.d &&
2806   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2807 then
2808   echo "$ac_t""yes" 1>&6
2809   ISC=yes # If later tests want to check for ISC.
2810   cat >> confdefs.h <<\EOF
2811 #define _POSIX_SOURCE 1
2812 EOF
2813
2814   if test "$GCC" = yes; then
2815     CC="$CC -posix"
2816   else
2817     CC="$CC -Xp"
2818   fi
2819 else
2820   echo "$ac_t""no" 1>&6
2821   ISC=
2822 fi
2823
2824 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2825 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2826 echo "configure:2827: checking for minix/config.h" >&5
2827 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2828   echo $ac_n "(cached) $ac_c" 1>&6
2829 else
2830   cat > conftest.$ac_ext <<EOF
2831 #line 2832 "configure"
2832 #include "confdefs.h"
2833 #include <minix/config.h>
2834 EOF
2835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2836 { (eval echo configure:2837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2837 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2838 if test -z "$ac_err"; then
2839   rm -rf conftest*
2840   eval "ac_cv_header_$ac_safe=yes"
2841 else
2842   echo "$ac_err" >&5
2843   echo "configure: failed program was:" >&5
2844   cat conftest.$ac_ext >&5
2845   rm -rf conftest*
2846   eval "ac_cv_header_$ac_safe=no"
2847 fi
2848 rm -f conftest*
2849 fi
2850 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2851   echo "$ac_t""yes" 1>&6
2852   MINIX=yes
2853 else
2854   echo "$ac_t""no" 1>&6
2855 MINIX=
2856 fi
2857
2858 if test "$MINIX" = yes; then
2859   cat >> confdefs.h <<\EOF
2860 #define _POSIX_SOURCE 1
2861 EOF
2862
2863   cat >> confdefs.h <<\EOF
2864 #define _POSIX_1_SOURCE 2
2865 EOF
2866
2867   cat >> confdefs.h <<\EOF
2868 #define _MINIX 1
2869 EOF
2870
2871 fi
2872
2873
2874 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2875 echo "configure:2876: checking for be_app in -lbe" >&5
2876 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2877 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2878   echo $ac_n "(cached) $ac_c" 1>&6
2879 else
2880   ac_save_LIBS="$LIBS"
2881 LIBS="-lbe -lroot -lnet $LIBS"
2882 cat > conftest.$ac_ext <<EOF
2883 #line 2884 "configure"
2884 #include "confdefs.h"
2885 /* Override any gcc2 internal prototype to avoid an error.  */
2886 /* We use char because int might match the return type of a gcc2
2887     builtin and then its argument prototype would still apply.  */
2888 char be_app();
2889
2890 int main() {
2891 be_app()
2892 ; return 0; }
2893 EOF
2894 if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2895   rm -rf conftest*
2896   eval "ac_cv_lib_$ac_lib_var=yes"
2897 else
2898   echo "configure: failed program was:" >&5
2899   cat conftest.$ac_ext >&5
2900   rm -rf conftest*
2901   eval "ac_cv_lib_$ac_lib_var=no"
2902 fi
2903 rm -f conftest*
2904 LIBS="$ac_save_LIBS"
2905
2906 fi
2907 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2908   echo "$ac_t""yes" 1>&6
2909   LIBS="$LIBS -lbe -lroot -lnet"
2910 else
2911   echo "$ac_t""no" 1>&6
2912 :
2913 fi
2914
2915
2916 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2917 echo "configure:2918: checking for Cygwin environment" >&5
2918 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2919   echo $ac_n "(cached) $ac_c" 1>&6
2920 else
2921   cat > conftest.$ac_ext <<EOF
2922 #line 2923 "configure"
2923 #include "confdefs.h"
2924
2925 int main() {
2926
2927 #ifndef __CYGWIN__
2928 #define __CYGWIN__ __CYGWIN32__
2929 #endif
2930 return __CYGWIN__;
2931 ; return 0; }
2932 EOF
2933 if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2934   rm -rf conftest*
2935   ac_cv_cygwin=yes
2936 else
2937   echo "configure: failed program was:" >&5
2938   cat conftest.$ac_ext >&5
2939   rm -rf conftest*
2940   ac_cv_cygwin=no
2941 fi
2942 rm -f conftest*
2943 rm -f conftest*
2944 fi
2945
2946 echo "$ac_t""$ac_cv_cygwin" 1>&6
2947 CYGWIN=
2948 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2949 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2950 echo "configure:2951: checking for mingw32 environment" >&5
2951 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2952   echo $ac_n "(cached) $ac_c" 1>&6
2953 else
2954   cat > conftest.$ac_ext <<EOF
2955 #line 2956 "configure"
2956 #include "confdefs.h"
2957
2958 int main() {
2959 return __MINGW32__;
2960 ; return 0; }
2961 EOF
2962 if { (eval echo configure:2963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2963   rm -rf conftest*
2964   ac_cv_mingw32=yes
2965 else
2966   echo "configure: failed program was:" >&5
2967   cat conftest.$ac_ext >&5
2968   rm -rf conftest*
2969   ac_cv_mingw32=no
2970 fi
2971 rm -f conftest*
2972 rm -f conftest*
2973 fi
2974
2975 echo "$ac_t""$ac_cv_mingw32" 1>&6
2976 MINGW32=
2977 test "$ac_cv_mingw32" = yes && MINGW32=yes
2978
2979
2980 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2981 echo "configure:2982: checking for executable suffix" >&5
2982 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2983   echo $ac_n "(cached) $ac_c" 1>&6
2984 else
2985   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2986   ac_cv_exeext=.exe
2987 else
2988   rm -f conftest*
2989   echo 'int main () { return 0; }' > conftest.$ac_ext
2990   ac_cv_exeext=
2991   if { (eval echo configure:2992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2992     for file in conftest.*; do
2993       case $file in
2994       *.c | *.o | *.obj) ;;
2995       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2996       esac
2997     done
2998   else
2999     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3000   fi
3001   rm -f conftest*
3002   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3003 fi
3004 fi
3005
3006 EXEEXT=""
3007 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3008 echo "$ac_t""${ac_cv_exeext}" 1>&6
3009 ac_exeext=$EXEEXT
3010
3011 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3012 echo "configure:3013: checking for object suffix" >&5
3013 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
3014   echo $ac_n "(cached) $ac_c" 1>&6
3015 else
3016   rm -f conftest*
3017 echo 'int i = 1;' > conftest.$ac_ext
3018 if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3019   for ac_file in conftest.*; do
3020     case $ac_file in
3021     *.c) ;;
3022     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3023     esac
3024   done
3025 else
3026   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3027 fi
3028 rm -f conftest*
3029 fi
3030
3031 echo "$ac_t""$ac_cv_objext" 1>&6
3032 OBJEXT=$ac_cv_objext
3033 ac_objext=$ac_cv_objext
3034
3035
3036 cat >> confdefs.h <<EOF
3037 #define EXEEXT "${EXEEXT}"
3038 EOF
3039
3040
3041
3042
3043
3044 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3045 echo "configure:3046: checking for ${CC-cc} option to accept ANSI C" >&5
3046 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
3047   echo $ac_n "(cached) $ac_c" 1>&6
3048 else
3049   am_cv_prog_cc_stdc=no
3050 ac_save_CC="$CC"
3051 # Don't try gcc -ansi; that turns off useful extensions and
3052 # breaks some systems' header files.
3053 # AIX                   -qlanglvl=ansi
3054 # Ultrix and OSF/1      -std1
3055 # HP-UX                 -Aa -D_HPUX_SOURCE
3056 # SVR4                  -Xc -D__EXTENSIONS__
3057 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3058 do
3059   CC="$ac_save_CC $ac_arg"
3060   cat > conftest.$ac_ext <<EOF
3061 #line 3062 "configure"
3062 #include "confdefs.h"
3063 #include <stdarg.h>
3064 #include <stdio.h>
3065 #include <sys/types.h>
3066 #include <sys/stat.h>
3067 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3068 struct buf { int x; };
3069 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3070 static char *e (p, i)
3071      char **p;
3072      int i;
3073 {
3074   return p[i];
3075 }
3076 static char *f (char * (*g) (char **, int), char **p, ...)
3077 {
3078   char *s;
3079   va_list v;
3080   va_start (v,p);
3081   s = g (p, va_arg (v,int));
3082   va_end (v);
3083   return s;
3084 }
3085 int test (int i, double x);
3086 struct s1 {int (*f) (int a);};
3087 struct s2 {int (*f) (double a);};
3088 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3089 int argc;
3090 char **argv;
3091
3092 int main() {
3093
3094 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3095
3096 ; return 0; }
3097 EOF
3098 if { (eval echo configure:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3099   rm -rf conftest*
3100   am_cv_prog_cc_stdc="$ac_arg"; break
3101 else
3102   echo "configure: failed program was:" >&5
3103   cat conftest.$ac_ext >&5
3104 fi
3105 rm -f conftest*
3106 done
3107 CC="$ac_save_CC"
3108
3109 fi
3110
3111 if test -z "$am_cv_prog_cc_stdc"; then
3112   echo "$ac_t""none needed" 1>&6
3113 else
3114   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3115 fi
3116 case "x$am_cv_prog_cc_stdc" in
3117   x|xno) ;;
3118   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3119 esac
3120
3121 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3122         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3123 fi
3124
3125
3126 # test for make depend flag
3127 OL_MKDEP=
3128 OL_MKDEP_FLAGS=
3129 if test -z "${MKDEP}"; then
3130         OL_MKDEP="${CC-cc}"
3131         if test -z "${MKDEP_FLAGS}"; then
3132                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3133 echo "configure:3134: checking for ${OL_MKDEP} depend flag" >&5
3134 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
3135   echo $ac_n "(cached) $ac_c" 1>&6
3136 else
3137   
3138                         ol_cv_mkdep=no
3139                         for flag in "-M" "-xM"; do
3140                                 cat > conftest.c <<EOF
3141  noCode;
3142 EOF
3143                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3144                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3145                                 then
3146                                         if test ! -f conftest."${ac_object}" ; then
3147                                                 ol_cv_mkdep=$flag
3148                                                 OL_MKDEP_FLAGS="$flag"
3149                                                 break
3150                                         fi
3151                                 fi
3152                         done
3153                         rm -f conftest*
3154                 
3155 fi
3156
3157 echo "$ac_t""$ol_cv_mkdep" 1>&6
3158         else
3159                 cc_cv_mkdep=yes
3160                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3161         fi
3162 else
3163         cc_cv_mkdep=yes
3164         OL_MKDEP="${MKDEP}"
3165         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3166 fi
3167
3168
3169
3170 if test "${ol_cv_mkdep}" = no ; then
3171         # this will soon become an error
3172         echo "configure: warning: do not know how to generate dependencies" 1>&2
3173 fi
3174
3175
3176
3177 echo $ac_n "checking for socket""... $ac_c" 1>&6
3178 echo "configure:3179: checking for socket" >&5
3179 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3180   echo $ac_n "(cached) $ac_c" 1>&6
3181 else
3182   cat > conftest.$ac_ext <<EOF
3183 #line 3184 "configure"
3184 #include "confdefs.h"
3185 /* System header to define __stub macros and hopefully few prototypes,
3186     which can conflict with char socket(); below.  */
3187 #include <assert.h>
3188 /* Override any gcc2 internal prototype to avoid an error.  */
3189 /* We use char because int might match the return type of a gcc2
3190     builtin and then its argument prototype would still apply.  */
3191 char socket();
3192
3193 int main() {
3194
3195 /* The GNU C library defines this for functions which it implements
3196     to always fail with ENOSYS.  Some functions are actually named
3197     something starting with __ and the normal name is an alias.  */
3198 #if defined (__stub_socket) || defined (__stub___socket)
3199 choke me
3200 #else
3201 socket();
3202 #endif
3203
3204 ; return 0; }
3205 EOF
3206 if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3207   rm -rf conftest*
3208   eval "ac_cv_func_socket=yes"
3209 else
3210   echo "configure: failed program was:" >&5
3211   cat conftest.$ac_ext >&5
3212   rm -rf conftest*
3213   eval "ac_cv_func_socket=no"
3214 fi
3215 rm -f conftest*
3216 fi
3217
3218 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3219   echo "$ac_t""yes" 1>&6
3220   :
3221 else
3222   echo "$ac_t""no" 1>&6
3223         
3224         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3225 echo "configure:3226: checking for main in -lsocket" >&5
3226 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3227 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3228   echo $ac_n "(cached) $ac_c" 1>&6
3229 else
3230   ac_save_LIBS="$LIBS"
3231 LIBS="-lsocket  $LIBS"
3232 cat > conftest.$ac_ext <<EOF
3233 #line 3234 "configure"
3234 #include "confdefs.h"
3235
3236 int main() {
3237 main()
3238 ; return 0; }
3239 EOF
3240 if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3241   rm -rf conftest*
3242   eval "ac_cv_lib_$ac_lib_var=yes"
3243 else
3244   echo "configure: failed program was:" >&5
3245   cat conftest.$ac_ext >&5
3246   rm -rf conftest*
3247   eval "ac_cv_lib_$ac_lib_var=no"
3248 fi
3249 rm -f conftest*
3250 LIBS="$ac_save_LIBS"
3251
3252 fi
3253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3254   echo "$ac_t""yes" 1>&6
3255     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3256     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3257   cat >> confdefs.h <<EOF
3258 #define $ac_tr_lib 1
3259 EOF
3260
3261   LIBS="-lsocket $LIBS"
3262
3263 else
3264   echo "$ac_t""no" 1>&6
3265 fi
3266
3267         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3268 echo "configure:3269: checking for main in -lnet" >&5
3269 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3270 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3271   echo $ac_n "(cached) $ac_c" 1>&6
3272 else
3273   ac_save_LIBS="$LIBS"
3274 LIBS="-lnet  $LIBS"
3275 cat > conftest.$ac_ext <<EOF
3276 #line 3277 "configure"
3277 #include "confdefs.h"
3278
3279 int main() {
3280 main()
3281 ; return 0; }
3282 EOF
3283 if { (eval echo configure:3284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3284   rm -rf conftest*
3285   eval "ac_cv_lib_$ac_lib_var=yes"
3286 else
3287   echo "configure: failed program was:" >&5
3288   cat conftest.$ac_ext >&5
3289   rm -rf conftest*
3290   eval "ac_cv_lib_$ac_lib_var=no"
3291 fi
3292 rm -f conftest*
3293 LIBS="$ac_save_LIBS"
3294
3295 fi
3296 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3297   echo "$ac_t""yes" 1>&6
3298     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3299     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3300   cat >> confdefs.h <<EOF
3301 #define $ac_tr_lib 1
3302 EOF
3303
3304   LIBS="-lnet $LIBS"
3305
3306 else
3307   echo "$ac_t""no" 1>&6
3308 fi
3309
3310         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3311 echo "configure:3312: checking for socket in -lnet" >&5
3312 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3313 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3314   echo $ac_n "(cached) $ac_c" 1>&6
3315 else
3316   ac_save_LIBS="$LIBS"
3317 LIBS="-lnet  $LIBS"
3318 cat > conftest.$ac_ext <<EOF
3319 #line 3320 "configure"
3320 #include "confdefs.h"
3321 /* Override any gcc2 internal prototype to avoid an error.  */
3322 /* We use char because int might match the return type of a gcc2
3323     builtin and then its argument prototype would still apply.  */
3324 char socket();
3325
3326 int main() {
3327 socket()
3328 ; return 0; }
3329 EOF
3330 if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3331   rm -rf conftest*
3332   eval "ac_cv_lib_$ac_lib_var=yes"
3333 else
3334   echo "configure: failed program was:" >&5
3335   cat conftest.$ac_ext >&5
3336   rm -rf conftest*
3337   eval "ac_cv_lib_$ac_lib_var=no"
3338 fi
3339 rm -f conftest*
3340 LIBS="$ac_save_LIBS"
3341
3342 fi
3343 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3344   echo "$ac_t""yes" 1>&6
3345     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3346     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3347   cat >> confdefs.h <<EOF
3348 #define $ac_tr_lib 1
3349 EOF
3350
3351   LIBS="-lnet $LIBS"
3352
3353 else
3354   echo "$ac_t""no" 1>&6
3355 fi
3356
3357         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3358 echo "configure:3359: checking for main in -lnsl_s" >&5
3359 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3360 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3361   echo $ac_n "(cached) $ac_c" 1>&6
3362 else
3363   ac_save_LIBS="$LIBS"
3364 LIBS="-lnsl_s  $LIBS"
3365 cat > conftest.$ac_ext <<EOF
3366 #line 3367 "configure"
3367 #include "confdefs.h"
3368
3369 int main() {
3370 main()
3371 ; return 0; }
3372 EOF
3373 if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3374   rm -rf conftest*
3375   eval "ac_cv_lib_$ac_lib_var=yes"
3376 else
3377   echo "configure: failed program was:" >&5
3378   cat conftest.$ac_ext >&5
3379   rm -rf conftest*
3380   eval "ac_cv_lib_$ac_lib_var=no"
3381 fi
3382 rm -f conftest*
3383 LIBS="$ac_save_LIBS"
3384
3385 fi
3386 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3387   echo "$ac_t""yes" 1>&6
3388     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3389     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3390   cat >> confdefs.h <<EOF
3391 #define $ac_tr_lib 1
3392 EOF
3393
3394   LIBS="-lnsl_s $LIBS"
3395
3396 else
3397   echo "$ac_t""no" 1>&6
3398 fi
3399
3400         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3401 echo "configure:3402: checking for main in -lnsl" >&5
3402 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3403 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3404   echo $ac_n "(cached) $ac_c" 1>&6
3405 else
3406   ac_save_LIBS="$LIBS"
3407 LIBS="-lnsl  $LIBS"
3408 cat > conftest.$ac_ext <<EOF
3409 #line 3410 "configure"
3410 #include "confdefs.h"
3411
3412 int main() {
3413 main()
3414 ; return 0; }
3415 EOF
3416 if { (eval echo configure:3417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3417   rm -rf conftest*
3418   eval "ac_cv_lib_$ac_lib_var=yes"
3419 else
3420   echo "configure: failed program was:" >&5
3421   cat conftest.$ac_ext >&5
3422   rm -rf conftest*
3423   eval "ac_cv_lib_$ac_lib_var=no"
3424 fi
3425 rm -f conftest*
3426 LIBS="$ac_save_LIBS"
3427
3428 fi
3429 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3430   echo "$ac_t""yes" 1>&6
3431     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3432     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3433   cat >> confdefs.h <<EOF
3434 #define $ac_tr_lib 1
3435 EOF
3436
3437   LIBS="-lnsl $LIBS"
3438
3439 else
3440   echo "$ac_t""no" 1>&6
3441 fi
3442
3443         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3444 echo "configure:3445: checking for socket in -linet" >&5
3445 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3446 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3447   echo $ac_n "(cached) $ac_c" 1>&6
3448 else
3449   ac_save_LIBS="$LIBS"
3450 LIBS="-linet  $LIBS"
3451 cat > conftest.$ac_ext <<EOF
3452 #line 3453 "configure"
3453 #include "confdefs.h"
3454 /* Override any gcc2 internal prototype to avoid an error.  */
3455 /* We use char because int might match the return type of a gcc2
3456     builtin and then its argument prototype would still apply.  */
3457 char socket();
3458
3459 int main() {
3460 socket()
3461 ; return 0; }
3462 EOF
3463 if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3464   rm -rf conftest*
3465   eval "ac_cv_lib_$ac_lib_var=yes"
3466 else
3467   echo "configure: failed program was:" >&5
3468   cat conftest.$ac_ext >&5
3469   rm -rf conftest*
3470   eval "ac_cv_lib_$ac_lib_var=no"
3471 fi
3472 rm -f conftest*
3473 LIBS="$ac_save_LIBS"
3474
3475 fi
3476 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3477   echo "$ac_t""yes" 1>&6
3478     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3479     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3480   cat >> confdefs.h <<EOF
3481 #define $ac_tr_lib 1
3482 EOF
3483
3484   LIBS="-linet $LIBS"
3485
3486 else
3487   echo "$ac_t""no" 1>&6
3488 fi
3489
3490         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3491 echo "configure:3492: checking for main in -lgen" >&5
3492 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3493 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3494   echo $ac_n "(cached) $ac_c" 1>&6
3495 else
3496   ac_save_LIBS="$LIBS"
3497 LIBS="-lgen  $LIBS"
3498 cat > conftest.$ac_ext <<EOF
3499 #line 3500 "configure"
3500 #include "confdefs.h"
3501
3502 int main() {
3503 main()
3504 ; return 0; }
3505 EOF
3506 if { (eval echo configure:3507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3507   rm -rf conftest*
3508   eval "ac_cv_lib_$ac_lib_var=yes"
3509 else
3510   echo "configure: failed program was:" >&5
3511   cat conftest.$ac_ext >&5
3512   rm -rf conftest*
3513   eval "ac_cv_lib_$ac_lib_var=no"
3514 fi
3515 rm -f conftest*
3516 LIBS="$ac_save_LIBS"
3517
3518 fi
3519 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3520   echo "$ac_t""yes" 1>&6
3521     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3522     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3523   cat >> confdefs.h <<EOF
3524 #define $ac_tr_lib 1
3525 EOF
3526
3527   LIBS="-lgen $LIBS"
3528
3529 else
3530   echo "$ac_t""no" 1>&6
3531 fi
3532
3533
3534 fi
3535
3536
3537 for ac_func in res_search
3538 do
3539 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3540 echo "configure:3541: checking for $ac_func" >&5
3541 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3542   echo $ac_n "(cached) $ac_c" 1>&6
3543 else
3544   cat > conftest.$ac_ext <<EOF
3545 #line 3546 "configure"
3546 #include "confdefs.h"
3547 /* System header to define __stub macros and hopefully few prototypes,
3548     which can conflict with char $ac_func(); below.  */
3549 #include <assert.h>
3550 /* Override any gcc2 internal prototype to avoid an error.  */
3551 /* We use char because int might match the return type of a gcc2
3552     builtin and then its argument prototype would still apply.  */
3553 char $ac_func();
3554
3555 int main() {
3556
3557 /* The GNU C library defines this for functions which it implements
3558     to always fail with ENOSYS.  Some functions are actually named
3559     something starting with __ and the normal name is an alias.  */
3560 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3561 choke me
3562 #else
3563 $ac_func();
3564 #endif
3565
3566 ; return 0; }
3567 EOF
3568 if { (eval echo configure:3569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3569   rm -rf conftest*
3570   eval "ac_cv_func_$ac_func=yes"
3571 else
3572   echo "configure: failed program was:" >&5
3573   cat conftest.$ac_ext >&5
3574   rm -rf conftest*
3575   eval "ac_cv_func_$ac_func=no"
3576 fi
3577 rm -f conftest*
3578 fi
3579
3580 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3581   echo "$ac_t""yes" 1>&6
3582     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3583   cat >> confdefs.h <<EOF
3584 #define $ac_tr_func 1
3585 EOF
3586  
3587 else
3588   echo "$ac_t""no" 1>&6
3589 fi
3590 done
3591
3592 if test $ac_cv_func_res_search = "no" ; then 
3593         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3594 echo "configure:3595: checking for res_search in -lbind" >&5
3595 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3596 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3597   echo $ac_n "(cached) $ac_c" 1>&6
3598 else
3599   ac_save_LIBS="$LIBS"
3600 LIBS="-lbind  $LIBS"
3601 cat > conftest.$ac_ext <<EOF
3602 #line 3603 "configure"
3603 #include "confdefs.h"
3604 /* Override any gcc2 internal prototype to avoid an error.  */
3605 /* We use char because int might match the return type of a gcc2
3606     builtin and then its argument prototype would still apply.  */
3607 char res_search();
3608
3609 int main() {
3610 res_search()
3611 ; return 0; }
3612 EOF
3613 if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3614   rm -rf conftest*
3615   eval "ac_cv_lib_$ac_lib_var=yes"
3616 else
3617   echo "configure: failed program was:" >&5
3618   cat conftest.$ac_ext >&5
3619   rm -rf conftest*
3620   eval "ac_cv_lib_$ac_lib_var=no"
3621 fi
3622 rm -f conftest*
3623 LIBS="$ac_save_LIBS"
3624
3625 fi
3626 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3627   echo "$ac_t""yes" 1>&6
3628     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3629     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3630   cat >> confdefs.h <<EOF
3631 #define $ac_tr_lib 1
3632 EOF
3633
3634   LIBS="-lbind $LIBS"
3635
3636 else
3637   echo "$ac_t""no" 1>&6
3638 fi
3639
3640         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3641                 cat >> confdefs.h <<\EOF
3642 #define HAVE_RES_SEARCH 1
3643 EOF
3644
3645         else
3646                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3647 echo "configure:3648: checking for res_search in -lresolv" >&5
3648 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3649 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3650   echo $ac_n "(cached) $ac_c" 1>&6
3651 else
3652   ac_save_LIBS="$LIBS"
3653 LIBS="-lresolv  $LIBS"
3654 cat > conftest.$ac_ext <<EOF
3655 #line 3656 "configure"
3656 #include "confdefs.h"
3657 /* Override any gcc2 internal prototype to avoid an error.  */
3658 /* We use char because int might match the return type of a gcc2
3659     builtin and then its argument prototype would still apply.  */
3660 char res_search();
3661
3662 int main() {
3663 res_search()
3664 ; return 0; }
3665 EOF
3666 if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3667   rm -rf conftest*
3668   eval "ac_cv_lib_$ac_lib_var=yes"
3669 else
3670   echo "configure: failed program was:" >&5
3671   cat conftest.$ac_ext >&5
3672   rm -rf conftest*
3673   eval "ac_cv_lib_$ac_lib_var=no"
3674 fi
3675 rm -f conftest*
3676 LIBS="$ac_save_LIBS"
3677
3678 fi
3679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3680   echo "$ac_t""yes" 1>&6
3681     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3682     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3683   cat >> confdefs.h <<EOF
3684 #define $ac_tr_lib 1
3685 EOF
3686
3687   LIBS="-lresolv $LIBS"
3688
3689 else
3690   echo "$ac_t""no" 1>&6
3691 fi
3692
3693                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3694                         cat >> confdefs.h <<\EOF
3695 #define HAVE_RES_SEARCH 1
3696 EOF
3697
3698                 fi
3699         fi
3700 fi
3701
3702 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3703 echo "configure:3704: checking for sigset in -lV3" >&5
3704 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3705 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3706   echo $ac_n "(cached) $ac_c" 1>&6
3707 else
3708   ac_save_LIBS="$LIBS"
3709 LIBS="-lV3  $LIBS"
3710 cat > conftest.$ac_ext <<EOF
3711 #line 3712 "configure"
3712 #include "confdefs.h"
3713 /* Override any gcc2 internal prototype to avoid an error.  */
3714 /* We use char because int might match the return type of a gcc2
3715     builtin and then its argument prototype would still apply.  */
3716 char sigset();
3717
3718 int main() {
3719 sigset()
3720 ; return 0; }
3721 EOF
3722 if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3723   rm -rf conftest*
3724   eval "ac_cv_lib_$ac_lib_var=yes"
3725 else
3726   echo "configure: failed program was:" >&5
3727   cat conftest.$ac_ext >&5
3728   rm -rf conftest*
3729   eval "ac_cv_lib_$ac_lib_var=no"
3730 fi
3731 rm -f conftest*
3732 LIBS="$ac_save_LIBS"
3733
3734 fi
3735 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3736   echo "$ac_t""yes" 1>&6
3737     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3738     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3739   cat >> confdefs.h <<EOF
3740 #define $ac_tr_lib 1
3741 EOF
3742
3743   LIBS="-lV3 $LIBS"
3744
3745 else
3746   echo "$ac_t""no" 1>&6
3747 fi
3748
3749
3750 for ac_hdr in regex.h 
3751 do
3752 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3753 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3754 echo "configure:3755: checking for $ac_hdr" >&5
3755 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3756   echo $ac_n "(cached) $ac_c" 1>&6
3757 else
3758   cat > conftest.$ac_ext <<EOF
3759 #line 3760 "configure"
3760 #include "confdefs.h"
3761 #include <$ac_hdr>
3762 EOF
3763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3764 { (eval echo configure:3765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3766 if test -z "$ac_err"; then
3767   rm -rf conftest*
3768   eval "ac_cv_header_$ac_safe=yes"
3769 else
3770   echo "$ac_err" >&5
3771   echo "configure: failed program was:" >&5
3772   cat conftest.$ac_ext >&5
3773   rm -rf conftest*
3774   eval "ac_cv_header_$ac_safe=no"
3775 fi
3776 rm -f conftest*
3777 fi
3778 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3779   echo "$ac_t""yes" 1>&6
3780     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3781   cat >> confdefs.h <<EOF
3782 #define $ac_tr_hdr 1
3783 EOF
3784  
3785 else
3786   echo "$ac_t""no" 1>&6
3787 fi
3788 done
3789
3790 if test "$ac_cv_header_regex_h" != yes ; then
3791         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
3792 fi
3793 echo $ac_n "checking for regfree""... $ac_c" 1>&6
3794 echo "configure:3795: checking for regfree" >&5
3795 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
3796   echo $ac_n "(cached) $ac_c" 1>&6
3797 else
3798   cat > conftest.$ac_ext <<EOF
3799 #line 3800 "configure"
3800 #include "confdefs.h"
3801 /* System header to define __stub macros and hopefully few prototypes,
3802     which can conflict with char regfree(); below.  */
3803 #include <assert.h>
3804 /* Override any gcc2 internal prototype to avoid an error.  */
3805 /* We use char because int might match the return type of a gcc2
3806     builtin and then its argument prototype would still apply.  */
3807 char regfree();
3808
3809 int main() {
3810
3811 /* The GNU C library defines this for functions which it implements
3812     to always fail with ENOSYS.  Some functions are actually named
3813     something starting with __ and the normal name is an alias.  */
3814 #if defined (__stub_regfree) || defined (__stub___regfree)
3815 choke me
3816 #else
3817 regfree();
3818 #endif
3819
3820 ; return 0; }
3821 EOF
3822 if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3823   rm -rf conftest*
3824   eval "ac_cv_func_regfree=yes"
3825 else
3826   echo "configure: failed program was:" >&5
3827   cat conftest.$ac_ext >&5
3828   rm -rf conftest*
3829   eval "ac_cv_func_regfree=no"
3830 fi
3831 rm -f conftest*
3832 fi
3833
3834 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
3835   echo "$ac_t""yes" 1>&6
3836   :
3837 else
3838   echo "$ac_t""no" 1>&6
3839 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
3840 fi
3841
3842
3843
3844 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
3845 echo "configure:3846: checking for compatible POSIX regex" >&5
3846 if eval "test \"`echo '$''{'ol_cv_c_posix_regex'+set}'`\" = set"; then
3847   echo $ac_n "(cached) $ac_c" 1>&6
3848 else
3849   
3850         if test "$cross_compiling" = yes; then
3851   ol_cv_c_posix_regex=cross
3852 else
3853   cat > conftest.$ac_ext <<EOF
3854 #line 3855 "configure"
3855 #include "confdefs.h"
3856
3857 #include <sys/types.h>
3858 #include <regex.h>
3859 static char *pattern, *string;
3860 main()
3861 {
3862         int rc;
3863         regex_t re;
3864
3865         pattern = "^A";
3866
3867         if(regcomp(&re, pattern, 0)) {
3868                 return -1;
3869         }
3870         
3871         string = "ALL MATCH";
3872         
3873         rc = regexec(&re, string, 0, (void*)0, 0);
3874
3875         regfree(&re);
3876
3877         return rc;
3878 }
3879 EOF
3880 if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3881 then
3882   ol_cv_c_posix_regex=yes
3883 else
3884   echo "configure: failed program was:" >&5
3885   cat conftest.$ac_ext >&5
3886   rm -fr conftest*
3887   ol_cv_c_posix_regex=no
3888 fi
3889 rm -fr conftest*
3890 fi
3891
3892 fi
3893
3894 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
3895
3896 if test "$ol_cv_c_posix_regex" = no ; then
3897         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
3898 fi
3899
3900 echo $ac_n "checking for select""... $ac_c" 1>&6
3901 echo "configure:3902: checking for select" >&5
3902 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3903   echo $ac_n "(cached) $ac_c" 1>&6
3904 else
3905   cat > conftest.$ac_ext <<EOF
3906 #line 3907 "configure"
3907 #include "confdefs.h"
3908 /* System header to define __stub macros and hopefully few prototypes,
3909     which can conflict with char select(); below.  */
3910 #include <assert.h>
3911 /* Override any gcc2 internal prototype to avoid an error.  */
3912 /* We use char because int might match the return type of a gcc2
3913     builtin and then its argument prototype would still apply.  */
3914 char select();
3915
3916 int main() {
3917
3918 /* The GNU C library defines this for functions which it implements
3919     to always fail with ENOSYS.  Some functions are actually named
3920     something starting with __ and the normal name is an alias.  */
3921 #if defined (__stub_select) || defined (__stub___select)
3922 choke me
3923 #else
3924 select();
3925 #endif
3926
3927 ; return 0; }
3928 EOF
3929 if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3930   rm -rf conftest*
3931   eval "ac_cv_func_select=yes"
3932 else
3933   echo "configure: failed program was:" >&5
3934   cat conftest.$ac_ext >&5
3935   rm -rf conftest*
3936   eval "ac_cv_func_select=no"
3937 fi
3938 rm -f conftest*
3939 fi
3940
3941 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3942   echo "$ac_t""yes" 1>&6
3943   :
3944 else
3945   echo "$ac_t""no" 1>&6
3946 { echo "configure: error: select() required." 1>&2; exit 1; }
3947 fi
3948
3949
3950 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3951 echo "configure:3952: checking types of arguments for select()" >&5
3952  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3953   echo $ac_n "(cached) $ac_c" 1>&6
3954 else
3955    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3956   echo $ac_n "(cached) $ac_c" 1>&6
3957 else
3958     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3959   echo $ac_n "(cached) $ac_c" 1>&6
3960 else
3961      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3962      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3963       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3964        cat > conftest.$ac_ext <<EOF
3965 #line 3966 "configure"
3966 #include "confdefs.h"
3967 #ifdef HAVE_SYS_TYPES_H
3968 #include <sys/types.h>
3969 #endif
3970 #ifdef HAVE_SYS_TIME_H
3971 #include <sys/time.h>
3972 #endif
3973 #ifdef HAVE_SYS_SELECT_H
3974 #include <sys/select.h>
3975 #endif
3976 #ifdef HAVE_SYS_SOCKET_H
3977 #include <sys/socket.h>
3978 #endif
3979 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);
3980 int main() {
3981
3982 ; return 0; }
3983 EOF
3984 if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3985   rm -rf conftest*
3986           ac_not_found=no ; break 3
3987 else
3988   echo "configure: failed program was:" >&5
3989   cat conftest.$ac_ext >&5
3990   rm -rf conftest*
3991   ac_not_found=yes
3992 fi
3993 rm -f conftest*
3994       done
3995      done
3996     done
3997    
3998 fi
3999   
4000 fi
4001  
4002 fi
4003  if test "$ac_not_found" = yes; then
4004   ac_cv_func_select_arg1=int 
4005   ac_cv_func_select_arg234='int *' 
4006   ac_cv_func_select_arg5='struct timeval *'
4007  fi
4008  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4009  cat >> confdefs.h <<EOF
4010 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4011 EOF
4012
4013  cat >> confdefs.h <<EOF
4014 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4015 EOF
4016
4017  cat >> confdefs.h <<EOF
4018 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4019 EOF
4020
4021
4022
4023 # ISODE tests
4024 ol_link_isode=no
4025 if test $ol_enable_ldapd != no ; then
4026         echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
4027
4028                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
4029 echo "configure:4030: checking for main in -lxtpp" >&5
4030 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
4031 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4032   echo $ac_n "(cached) $ac_c" 1>&6
4033 else
4034   ac_save_LIBS="$LIBS"
4035 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
4036 cat > conftest.$ac_ext <<EOF
4037 #line 4038 "configure"
4038 #include "confdefs.h"
4039
4040 int main() {
4041 main()
4042 ; return 0; }
4043 EOF
4044 if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4045   rm -rf conftest*
4046   eval "ac_cv_lib_$ac_lib_var=yes"
4047 else
4048   echo "configure: failed program was:" >&5
4049   cat conftest.$ac_ext >&5
4050   rm -rf conftest*
4051   eval "ac_cv_lib_$ac_lib_var=no"
4052 fi
4053 rm -f conftest*
4054 LIBS="$ac_save_LIBS"
4055
4056 fi
4057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4058   echo "$ac_t""yes" 1>&6
4059   
4060                 ol_link_isode=yes
4061                 cat >> confdefs.h <<\EOF
4062 #define HAVE_XTPP 1
4063 EOF
4064
4065                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
4066                 
4067 else
4068   echo "$ac_t""no" 1>&6
4069 :
4070 fi
4071
4072         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
4073 echo "configure:4074: checking for main in -ldsap" >&5
4074 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
4075 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4076   echo $ac_n "(cached) $ac_c" 1>&6
4077 else
4078   ac_save_LIBS="$LIBS"
4079 LIBS="-ldsap -lisode $LIBS"
4080 cat > conftest.$ac_ext <<EOF
4081 #line 4082 "configure"
4082 #include "confdefs.h"
4083
4084 int main() {
4085 main()
4086 ; return 0; }
4087 EOF
4088 if { (eval echo configure:4089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4089   rm -rf conftest*
4090   eval "ac_cv_lib_$ac_lib_var=yes"
4091 else
4092   echo "configure: failed program was:" >&5
4093   cat conftest.$ac_ext >&5
4094   rm -rf conftest*
4095   eval "ac_cv_lib_$ac_lib_var=no"
4096 fi
4097 rm -f conftest*
4098 LIBS="$ac_save_LIBS"
4099
4100 fi
4101 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4102   echo "$ac_t""yes" 1>&6
4103   
4104                 ol_link_isode=yes
4105                 cat >> confdefs.h <<\EOF
4106 #define HAVE_DSAP 1
4107 EOF
4108
4109                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
4110                 
4111 else
4112   echo "$ac_t""no" 1>&6
4113 :
4114 fi
4115
4116         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
4117 echo "configure:4118: checking for main in -lisode" >&5
4118 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
4119 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4120   echo $ac_n "(cached) $ac_c" 1>&6
4121 else
4122   ac_save_LIBS="$LIBS"
4123 LIBS="-lisode  $LIBS"
4124 cat > conftest.$ac_ext <<EOF
4125 #line 4126 "configure"
4126 #include "confdefs.h"
4127
4128 int main() {
4129 main()
4130 ; return 0; }
4131 EOF
4132 if { (eval echo configure:4133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4133   rm -rf conftest*
4134   eval "ac_cv_lib_$ac_lib_var=yes"
4135 else
4136   echo "configure: failed program was:" >&5
4137   cat conftest.$ac_ext >&5
4138   rm -rf conftest*
4139   eval "ac_cv_lib_$ac_lib_var=no"
4140 fi
4141 rm -f conftest*
4142 LIBS="$ac_save_LIBS"
4143
4144 fi
4145 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4146   echo "$ac_t""yes" 1>&6
4147   
4148                 ol_link_isode=yes
4149                 cat >> confdefs.h <<\EOF
4150 #define HAVE_ISODE 1
4151 EOF
4152
4153                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
4154                 
4155 else
4156   echo "$ac_t""no" 1>&6
4157 :
4158 fi
4159
4160 fi
4161
4162 if test $ol_link_isode != no; then
4163         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
4164 echo "configure:4165: checking for main in -lpp" >&5
4165 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
4166 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4167   echo $ac_n "(cached) $ac_c" 1>&6
4168 else
4169   ac_save_LIBS="$LIBS"
4170 LIBS="-lpp  $LIBS"
4171 cat > conftest.$ac_ext <<EOF
4172 #line 4173 "configure"
4173 #include "confdefs.h"
4174
4175 int main() {
4176 main()
4177 ; return 0; }
4178 EOF
4179 if { (eval echo configure:4180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4180   rm -rf conftest*
4181   eval "ac_cv_lib_$ac_lib_var=yes"
4182 else
4183   echo "configure: failed program was:" >&5
4184   cat conftest.$ac_ext >&5
4185   rm -rf conftest*
4186   eval "ac_cv_lib_$ac_lib_var=no"
4187 fi
4188 rm -f conftest*
4189 LIBS="$ac_save_LIBS"
4190
4191 fi
4192 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4193   echo "$ac_t""yes" 1>&6
4194   
4195                 cat >> confdefs.h <<\EOF
4196 #define HAVE_PP 1
4197 EOF
4198
4199                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
4200                 
4201 else
4202   echo "$ac_t""no" 1>&6
4203 :
4204 fi
4205
4206
4207         # Extract the first word of "pepsy", so it can be a program name with args.
4208 set dummy pepsy; ac_word=$2
4209 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4210 echo "configure:4211: checking for $ac_word" >&5
4211 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
4212   echo $ac_n "(cached) $ac_c" 1>&6
4213 else
4214   case "$PEPSY" in
4215   /*)
4216   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
4217   ;;
4218   ?:/*)                  
4219   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
4220   ;;
4221   *)
4222   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4223   ac_dummy="$PATH"
4224   for ac_dir in $ac_dummy; do 
4225     test -z "$ac_dir" && ac_dir=.
4226     if test -f $ac_dir/$ac_word; then
4227       ac_cv_path_PEPSY="$ac_dir/$ac_word"
4228       break
4229     fi
4230   done
4231   IFS="$ac_save_ifs"
4232   ;;
4233 esac
4234 fi
4235 PEPSY="$ac_cv_path_PEPSY"
4236 if test -n "$PEPSY"; then
4237   echo "$ac_t""$PEPSY" 1>&6
4238 else
4239   echo "$ac_t""no" 1>&6
4240 fi
4241
4242 fi
4243
4244 ol_link_kerberos=no
4245
4246 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
4247         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
4248 do
4249 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4250 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4251 echo "configure:4252: checking for $ac_hdr" >&5
4252 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4253   echo $ac_n "(cached) $ac_c" 1>&6
4254 else
4255   cat > conftest.$ac_ext <<EOF
4256 #line 4257 "configure"
4257 #include "confdefs.h"
4258 #include <$ac_hdr>
4259 EOF
4260 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4261 { (eval echo configure:4262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4262 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4263 if test -z "$ac_err"; then
4264   rm -rf conftest*
4265   eval "ac_cv_header_$ac_safe=yes"
4266 else
4267   echo "$ac_err" >&5
4268   echo "configure: failed program was:" >&5
4269   cat conftest.$ac_ext >&5
4270   rm -rf conftest*
4271   eval "ac_cv_header_$ac_safe=no"
4272 fi
4273 rm -f conftest*
4274 fi
4275 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4276   echo "$ac_t""yes" 1>&6
4277     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4278   cat >> confdefs.h <<EOF
4279 #define $ac_tr_hdr 1
4280 EOF
4281  
4282 else
4283   echo "$ac_t""no" 1>&6
4284 fi
4285 done
4286
4287
4288         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4289                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4290 echo "configure:4291: checking for main in -lkrb4" >&5
4291 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4292 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4293   echo $ac_n "(cached) $ac_c" 1>&6
4294 else
4295   ac_save_LIBS="$LIBS"
4296 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4297 cat > conftest.$ac_ext <<EOF
4298 #line 4299 "configure"
4299 #include "confdefs.h"
4300
4301 int main() {
4302 main()
4303 ; return 0; }
4304 EOF
4305 if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4306   rm -rf conftest*
4307   eval "ac_cv_lib_$ac_lib_var=yes"
4308 else
4309   echo "configure: failed program was:" >&5
4310   cat conftest.$ac_ext >&5
4311   rm -rf conftest*
4312   eval "ac_cv_lib_$ac_lib_var=no"
4313 fi
4314 rm -f conftest*
4315 LIBS="$ac_save_LIBS"
4316
4317 fi
4318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4319   echo "$ac_t""yes" 1>&6
4320   have_k5=yes
4321 else
4322   echo "$ac_t""no" 1>&6
4323 have_k5=no
4324 fi
4325
4326
4327                 if test $have_k5 = yes ; then
4328                         ol_with_kerberos=found
4329                         ol_link_kerberos=yes
4330
4331                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4332
4333                         LIBS="$KRB_LIBS $LIBS"
4334
4335                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4336 echo "configure:4337: checking for des_debug in Kerberos libraries" >&5
4337 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4338   echo $ac_n "(cached) $ac_c" 1>&6
4339 else
4340   
4341                                                                 save_LIBS="$LIBS"
4342                                 LIBS="$KRB_LIBS $LIBS"
4343                                 cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346
4347 #include <kerberosIV/krb.h>
4348 #include <kerberosIV/des.h>
4349 extern int des_debug;
4350
4351 int main() {
4352
4353 des_debug = 1;
4354
4355 ; return 0; }
4356 EOF
4357 if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4358   rm -rf conftest*
4359   ol_cv_var_des_debug=yes
4360 else
4361   echo "configure: failed program was:" >&5
4362   cat conftest.$ac_ext >&5
4363   rm -rf conftest*
4364   ol_cv_var_des_debug=no
4365 fi
4366 rm -f conftest*
4367                                                                 LIBS="$save_LIBS"
4368                         
4369 fi
4370
4371 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4372
4373                         if test $ol_cv_var_des_debug = yes ; then
4374                                 cat >> confdefs.h <<\EOF
4375 #define HAVE_DES_DEBUG 1
4376 EOF
4377
4378                         fi
4379
4380                         LIBS="$save_LIBS"
4381                 fi
4382         fi
4383 fi
4384
4385 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4386         for ac_hdr in krb.h des.h
4387 do
4388 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4389 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4390 echo "configure:4391: checking for $ac_hdr" >&5
4391 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4392   echo $ac_n "(cached) $ac_c" 1>&6
4393 else
4394   cat > conftest.$ac_ext <<EOF
4395 #line 4396 "configure"
4396 #include "confdefs.h"
4397 #include <$ac_hdr>
4398 EOF
4399 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4400 { (eval echo configure:4401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4401 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4402 if test -z "$ac_err"; then
4403   rm -rf conftest*
4404   eval "ac_cv_header_$ac_safe=yes"
4405 else
4406   echo "$ac_err" >&5
4407   echo "configure: failed program was:" >&5
4408   cat conftest.$ac_ext >&5
4409   rm -rf conftest*
4410   eval "ac_cv_header_$ac_safe=no"
4411 fi
4412 rm -f conftest*
4413 fi
4414 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4415   echo "$ac_t""yes" 1>&6
4416     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4417   cat >> confdefs.h <<EOF
4418 #define $ac_tr_hdr 1
4419 EOF
4420  
4421 else
4422   echo "$ac_t""no" 1>&6
4423 fi
4424 done
4425
4426
4427         if test $ac_cv_header_krb_h = yes ; then
4428                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4429 echo "configure:4430: checking for main in -lkrb" >&5
4430 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4431 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4432   echo $ac_n "(cached) $ac_c" 1>&6
4433 else
4434   ac_save_LIBS="$LIBS"
4435 LIBS="-lkrb -ldes $LIBS"
4436 cat > conftest.$ac_ext <<EOF
4437 #line 4438 "configure"
4438 #include "confdefs.h"
4439
4440 int main() {
4441 main()
4442 ; return 0; }
4443 EOF
4444 if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4445   rm -rf conftest*
4446   eval "ac_cv_lib_$ac_lib_var=yes"
4447 else
4448   echo "configure: failed program was:" >&5
4449   cat conftest.$ac_ext >&5
4450   rm -rf conftest*
4451   eval "ac_cv_lib_$ac_lib_var=no"
4452 fi
4453 rm -f conftest*
4454 LIBS="$ac_save_LIBS"
4455
4456 fi
4457 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4458   echo "$ac_t""yes" 1>&6
4459   have_k4=yes
4460 else
4461   echo "$ac_t""no" 1>&6
4462 have_k4=no
4463 fi
4464
4465
4466                 if test $have_k4 = yes ; then
4467                         ol_with_kerberos=found
4468                         ol_link_kerberos=yes
4469
4470                         KRB_LIBS="-lkrb -ldes"
4471                 fi
4472         fi
4473 fi
4474
4475 if test $ol_link_kerberos = yes ; then
4476         cat >> confdefs.h <<\EOF
4477 #define HAVE_KERBEROS 1
4478 EOF
4479
4480 fi
4481
4482 ol_link_tls=no
4483 if test $ol_with_tls != no ; then
4484         
4485         for ac_hdr in ssl.h
4486 do
4487 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4488 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4489 echo "configure:4490: checking for $ac_hdr" >&5
4490 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4491   echo $ac_n "(cached) $ac_c" 1>&6
4492 else
4493   cat > conftest.$ac_ext <<EOF
4494 #line 4495 "configure"
4495 #include "confdefs.h"
4496 #include <$ac_hdr>
4497 EOF
4498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4499 { (eval echo configure:4500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4501 if test -z "$ac_err"; then
4502   rm -rf conftest*
4503   eval "ac_cv_header_$ac_safe=yes"
4504 else
4505   echo "$ac_err" >&5
4506   echo "configure: failed program was:" >&5
4507   cat conftest.$ac_ext >&5
4508   rm -rf conftest*
4509   eval "ac_cv_header_$ac_safe=no"
4510 fi
4511 rm -f conftest*
4512 fi
4513 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4514   echo "$ac_t""yes" 1>&6
4515     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4516   cat >> confdefs.h <<EOF
4517 #define $ac_tr_hdr 1
4518 EOF
4519  
4520 else
4521   echo "$ac_t""no" 1>&6
4522 fi
4523 done
4524
4525         
4526         if test $ac_cv_header_ssl_h = yes ; then
4527                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4528 echo "configure:4529: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4529 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4530 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4531   echo $ac_n "(cached) $ac_c" 1>&6
4532 else
4533   ac_save_LIBS="$LIBS"
4534 LIBS="-lssl -lcrypto $LIBS"
4535 cat > conftest.$ac_ext <<EOF
4536 #line 4537 "configure"
4537 #include "confdefs.h"
4538 /* Override any gcc2 internal prototype to avoid an error.  */
4539 /* We use char because int might match the return type of a gcc2
4540     builtin and then its argument prototype would still apply.  */
4541 char SSLeay_add_ssl_algorithms();
4542
4543 int main() {
4544 SSLeay_add_ssl_algorithms()
4545 ; return 0; }
4546 EOF
4547 if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4548   rm -rf conftest*
4549   eval "ac_cv_lib_$ac_lib_var=yes"
4550 else
4551   echo "configure: failed program was:" >&5
4552   cat conftest.$ac_ext >&5
4553   rm -rf conftest*
4554   eval "ac_cv_lib_$ac_lib_var=no"
4555 fi
4556 rm -f conftest*
4557 LIBS="$ac_save_LIBS"
4558
4559 fi
4560 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4561   echo "$ac_t""yes" 1>&6
4562   have_ssleay=yes
4563                         need_rsaref=no
4564 else
4565   echo "$ac_t""no" 1>&6
4566 have_ssleay=no
4567 fi
4568
4569                         
4570                 if test $have_ssleay = no ; then
4571                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4572 echo "configure:4573: checking for ssl3_accept in -lssl" >&5
4573 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4574 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4575   echo $ac_n "(cached) $ac_c" 1>&6
4576 else
4577   ac_save_LIBS="$LIBS"
4578 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4579 cat > conftest.$ac_ext <<EOF
4580 #line 4581 "configure"
4581 #include "confdefs.h"
4582 /* Override any gcc2 internal prototype to avoid an error.  */
4583 /* We use char because int might match the return type of a gcc2
4584     builtin and then its argument prototype would still apply.  */
4585 char ssl3_accept();
4586
4587 int main() {
4588 ssl3_accept()
4589 ; return 0; }
4590 EOF
4591 if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4592   rm -rf conftest*
4593   eval "ac_cv_lib_$ac_lib_var=yes"
4594 else
4595   echo "configure: failed program was:" >&5
4596   cat conftest.$ac_ext >&5
4597   rm -rf conftest*
4598   eval "ac_cv_lib_$ac_lib_var=no"
4599 fi
4600 rm -f conftest*
4601 LIBS="$ac_save_LIBS"
4602
4603 fi
4604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4605   echo "$ac_t""yes" 1>&6
4606   have_ssleay=yes
4607                                 need_rsaref=yes
4608 else
4609   echo "$ac_t""no" 1>&6
4610 have_ssleay=no
4611 fi
4612
4613                 fi
4614
4615                 if test $have_ssleay = yes ; then
4616                         ol_with_tls=found
4617                         ol_link_tls=yes
4618
4619                         cat >> confdefs.h <<\EOF
4620 #define HAVE_SSLEAY 1
4621 EOF
4622
4623
4624                         if test $need_rsaref = yes; then
4625                                 cat >> confdefs.h <<\EOF
4626 #define HAVE_RSAREF 1
4627 EOF
4628
4629
4630                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4631                         else
4632                                 TLS_LIBS="-lssl -lcrypto"
4633                         fi
4634                 fi
4635         fi
4636 fi
4637
4638 if test $ol_link_tls = yes ; then
4639         cat >> confdefs.h <<\EOF
4640 #define HAVE_TLS 1
4641 EOF
4642
4643 fi      
4644
4645 for ac_func in \
4646         ctime_r                 \
4647         gethostbyname_r gethostbyaddr_r \
4648
4649 do
4650 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4651 echo "configure:4652: checking for $ac_func" >&5
4652 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4653   echo $ac_n "(cached) $ac_c" 1>&6
4654 else
4655   cat > conftest.$ac_ext <<EOF
4656 #line 4657 "configure"
4657 #include "confdefs.h"
4658 /* System header to define __stub macros and hopefully few prototypes,
4659     which can conflict with char $ac_func(); below.  */
4660 #include <assert.h>
4661 /* Override any gcc2 internal prototype to avoid an error.  */
4662 /* We use char because int might match the return type of a gcc2
4663     builtin and then its argument prototype would still apply.  */
4664 char $ac_func();
4665
4666 int main() {
4667
4668 /* The GNU C library defines this for functions which it implements
4669     to always fail with ENOSYS.  Some functions are actually named
4670     something starting with __ and the normal name is an alias.  */
4671 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4672 choke me
4673 #else
4674 $ac_func();
4675 #endif
4676
4677 ; return 0; }
4678 EOF
4679 if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4680   rm -rf conftest*
4681   eval "ac_cv_func_$ac_func=yes"
4682 else
4683   echo "configure: failed program was:" >&5
4684   cat conftest.$ac_ext >&5
4685   rm -rf conftest*
4686   eval "ac_cv_func_$ac_func=no"
4687 fi
4688 rm -f conftest*
4689 fi
4690
4691 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4692   echo "$ac_t""yes" 1>&6
4693     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4694   cat >> confdefs.h <<EOF
4695 #define $ac_tr_func 1
4696 EOF
4697  
4698 else
4699   echo "$ac_t""no" 1>&6
4700 fi
4701 done
4702
4703
4704 if test "$ac_cv_func_ctime_r" = no ; then
4705         ol_cv_func_ctime_r_nargs=0
4706 else
4707         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4708 echo "configure:4709: checking number of arguments of ctime_r" >&5
4709 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4710   echo $ac_n "(cached) $ac_c" 1>&6
4711 else
4712   cat > conftest.$ac_ext <<EOF
4713 #line 4714 "configure"
4714 #include "confdefs.h"
4715 #include <time.h>
4716 int main() {
4717 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4718 ; return 0; }
4719 EOF
4720 if { (eval echo configure:4721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4721   rm -rf conftest*
4722   ol_cv_func_ctime_r_nargs=3
4723 else
4724   echo "configure: failed program was:" >&5
4725   cat conftest.$ac_ext >&5
4726   rm -rf conftest*
4727   cat > conftest.$ac_ext <<EOF
4728 #line 4729 "configure"
4729 #include "confdefs.h"
4730 #include <time.h>
4731 int main() {
4732 time_t ti; char *buffer; ctime_r(&ti,buffer);
4733 ; return 0; }
4734 EOF
4735 if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4736   rm -rf conftest*
4737   ol_cv_func_ctime_r_nargs=2
4738 else
4739   echo "configure: failed program was:" >&5
4740   cat conftest.$ac_ext >&5
4741   rm -rf conftest*
4742   ol_cv_func_ctime_r_nargs=0
4743 fi
4744 rm -f conftest*
4745 fi
4746 rm -f conftest*
4747 fi
4748
4749 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4750   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4751     cat >> confdefs.h <<EOF
4752 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4753 EOF
4754
4755   fi
4756
4757 fi
4758
4759 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4760         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4761 echo "configure:4762: checking number of arguments of gethostbyname_r" >&5
4762 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4763   echo $ac_n "(cached) $ac_c" 1>&6
4764 else
4765   cat > conftest.$ac_ext <<EOF
4766 #line 4767 "configure"
4767 #include "confdefs.h"
4768 #include <sys/types.h>
4769 #include <sys/socket.h>
4770 #include <netinet/in.h>
4771 #include <netdb.h>
4772 #define BUFSIZE (sizeof(struct hostent)+10)
4773 int main() {
4774 struct hostent hent; char buffer[BUFSIZE];
4775                 int bufsize=BUFSIZE;int h_errno;
4776                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4777                         buffer, bufsize, &h_errno);
4778 ; return 0; }
4779 EOF
4780 if { (eval echo configure:4781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4781   rm -rf conftest*
4782   ol_cv_func_gethostbyname_r_nargs=5
4783 else
4784   echo "configure: failed program was:" >&5
4785   cat conftest.$ac_ext >&5
4786   rm -rf conftest*
4787   cat > conftest.$ac_ext <<EOF
4788 #line 4789 "configure"
4789 #include "confdefs.h"
4790 #include <sys/types.h>
4791 #include <sys/socket.h>
4792 #include <netinet/in.h>
4793 #include <netdb.h>
4794 #define BUFSIZE (sizeof(struct hostent)+10)
4795 int main() {
4796 struct hostent hent;struct hostent *rhent;
4797                         char buffer[BUFSIZE];
4798                         int bufsize=BUFSIZE;int h_errno;
4799                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4800                                 &rhent, &h_errno);
4801 ; return 0; }
4802 EOF
4803 if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4804   rm -rf conftest*
4805   ol_cv_func_gethostbyname_r_nargs=6
4806 else
4807   echo "configure: failed program was:" >&5
4808   cat conftest.$ac_ext >&5
4809   rm -rf conftest*
4810   ol_cv_func_gethostbyname_r_nargs=0
4811 fi
4812 rm -f conftest*
4813 fi
4814 rm -f conftest*
4815 fi
4816
4817 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4818   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4819         cat >> confdefs.h <<EOF
4820 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4821 EOF
4822
4823   fi
4824
4825 else
4826         ol_cv_func_gethostbyname_r_nargs=0
4827 fi
4828  
4829 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4830         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4831 echo "configure:4832: checking number of arguments of gethostbyaddr_r" >&5
4832 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4833   echo $ac_n "(cached) $ac_c" 1>&6
4834 else
4835   cat > conftest.$ac_ext <<EOF
4836 #line 4837 "configure"
4837 #include "confdefs.h"
4838 #include <sys/types.h>
4839 #include <sys/socket.h>
4840 #include <netinet/in.h>
4841 #include <netdb.h>
4842 #define BUFSIZE (sizeof(struct hostent)+10)
4843 int main() {
4844 struct hostent hent; char buffer[BUFSIZE]; 
4845             struct in_addr add;
4846             size_t alen=sizeof(struct in_addr);
4847             int bufsize=BUFSIZE;int h_errno;
4848                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4849                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4850 ; return 0; }
4851 EOF
4852 if { (eval echo configure:4853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4853   rm -rf conftest*
4854   ol_cv_func_gethostbyaddr_r_nargs=7
4855 else
4856   echo "configure: failed program was:" >&5
4857   cat conftest.$ac_ext >&5
4858   rm -rf conftest*
4859   cat > conftest.$ac_ext <<EOF
4860 #line 4861 "configure"
4861 #include "confdefs.h"
4862 #include <sys/types.h>
4863 #include <sys/socket.h>
4864 #include <netinet/in.h>
4865 #include <netdb.h>
4866 #define BUFSIZE (sizeof(struct hostent)+10)
4867 int main() {
4868 struct hostent hent;
4869                         struct hostent *rhent; char buffer[BUFSIZE]; 
4870                         struct in_addr add;
4871                         size_t alen=sizeof(struct in_addr);
4872                         int bufsize=BUFSIZE;int h_errno;
4873                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4874                                 alen, AF_INET, &hent, buffer, bufsize, 
4875                                 &rhent, &h_errno);
4876 ; return 0; }
4877 EOF
4878 if { (eval echo configure:4879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4879   rm -rf conftest*
4880   ol_cv_func_gethostbyaddr_r_nargs=8
4881 else
4882   echo "configure: failed program was:" >&5
4883   cat conftest.$ac_ext >&5
4884   rm -rf conftest*
4885   ol_cv_func_gethostbyaddr_r_nargs=0
4886 fi
4887 rm -f conftest*
4888 fi
4889 rm -f conftest*
4890 fi
4891
4892 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4893   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4894     cat >> confdefs.h <<EOF
4895 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4896 EOF
4897
4898   fi
4899
4900 else
4901         ol_cv_func_gethostbyaddr_r_nargs=0
4902 fi
4903
4904 if test "$ac_cv_func_ctime_r" = yes \
4905         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4906         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4907         -a "$ac_cv_func_gethostbyname_r" = yes \
4908         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4909         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4910         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4911         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4912         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4913         ; then
4914  
4915         cat >> confdefs.h <<\EOF
4916 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4917 EOF
4918
4919 fi
4920
4921 ol_link_threads=no
4922 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4923         -o $ol_with_threads = posix ; then
4924
4925         for ac_hdr in pthread.h sched.h
4926 do
4927 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4928 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4929 echo "configure:4930: checking for $ac_hdr" >&5
4930 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4931   echo $ac_n "(cached) $ac_c" 1>&6
4932 else
4933   cat > conftest.$ac_ext <<EOF
4934 #line 4935 "configure"
4935 #include "confdefs.h"
4936 #include <$ac_hdr>
4937 EOF
4938 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4939 { (eval echo configure:4940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4940 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4941 if test -z "$ac_err"; then
4942   rm -rf conftest*
4943   eval "ac_cv_header_$ac_safe=yes"
4944 else
4945   echo "$ac_err" >&5
4946   echo "configure: failed program was:" >&5
4947   cat conftest.$ac_ext >&5
4948   rm -rf conftest*
4949   eval "ac_cv_header_$ac_safe=no"
4950 fi
4951 rm -f conftest*
4952 fi
4953 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4954   echo "$ac_t""yes" 1>&6
4955     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4956   cat >> confdefs.h <<EOF
4957 #define $ac_tr_hdr 1
4958 EOF
4959  
4960 else
4961   echo "$ac_t""no" 1>&6
4962 fi
4963 done
4964
4965
4966         if test $ac_cv_header_pthread_h = yes ; then
4967                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4968 echo "configure:4969: checking POSIX thread version" >&5
4969 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4970   echo $ac_n "(cached) $ac_c" 1>&6
4971 else
4972   
4973         cat > conftest.$ac_ext <<EOF
4974 #line 4975 "configure"
4975 #include "confdefs.h"
4976
4977 #               include <pthread.h>
4978                 /* this check could be improved */
4979 #               ifdef PTHREAD_ONCE_INIT
4980                         pthread_version_final
4981 #               endif
4982         
4983 EOF
4984 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4985   egrep "pthread_version_final" >/dev/null 2>&1; then
4986   rm -rf conftest*
4987   ol_pthread_final=yes
4988 else
4989   rm -rf conftest*
4990   ol_pthread_final=no
4991 fi
4992 rm -f conftest*
4993
4994
4995         cat > conftest.$ac_ext <<EOF
4996 #line 4997 "configure"
4997 #include "confdefs.h"
4998
4999 #               include <pthread.h>
5000                 /* this check could be improved */
5001 #               ifdef pthread_once_init
5002                         pthread_version_draft4
5003 #               endif
5004         
5005 EOF
5006 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5007   egrep "pthread_version_draft4" >/dev/null 2>&1; then
5008   rm -rf conftest*
5009   ol_pthread_draft4=yes
5010 else
5011   rm -rf conftest*
5012   ol_pthread_draft4=no
5013 fi
5014 rm -f conftest*
5015
5016
5017         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
5018                 ol_cv_pthread_version=final
5019         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
5020                 ol_cv_pthread_version=draft4
5021         else
5022                 ol_cv_pthread_version=unknown
5023         fi
5024
5025 fi
5026
5027 echo "$ac_t""$ol_cv_pthread_version" 1>&6
5028
5029
5030                 if test $ol_cv_pthread_version = final ; then
5031                         cat >> confdefs.h <<\EOF
5032 #define HAVE_PTHREADS_FINAL 1
5033 EOF
5034
5035                 elif test $ol_cv_pthread_version = draft4 ; then
5036                         cat >> confdefs.h <<\EOF
5037 #define HAVE_PTHREADS_D4 1
5038 EOF
5039
5040                 else
5041                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
5042                 fi
5043
5044                 # consider threads found
5045                 ol_with_threads=found
5046
5047                 
5048         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
5049 echo "configure:5050: checking for LinuxThreads pthread.h" >&5
5050 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
5051   echo $ac_n "(cached) $ac_c" 1>&6
5052 else
5053   cat > conftest.$ac_ext <<EOF
5054 #line 5055 "configure"
5055 #include "confdefs.h"
5056 #include <pthread.h>
5057 EOF
5058 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5059   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
5060   rm -rf conftest*
5061   ol_cv_header_linux_threads=yes
5062 else
5063   rm -rf conftest*
5064   ol_cv_header_linux_threads=no
5065 fi
5066 rm -f conftest*
5067
5068                 
5069 fi
5070
5071 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
5072         if test $ol_cv_header_linux_threads = yes; then
5073                 cat >> confdefs.h <<\EOF
5074 #define HAVE_LINUX_THREADS 1
5075 EOF
5076
5077         fi
5078
5079
5080                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5081                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
5082 echo "configure:5083: checking for pthread_create in default libraries" >&5
5083                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   
5087                 if test "$cross_compiling" = yes; then
5088                         ol_cv_pthread_create=yes
5089 else
5090   cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093
5094 #include <pthread.h>
5095 #ifndef NULL
5096 #define NULL (void*)0
5097 #endif
5098
5099 static void *task(p)
5100         void *p;
5101 {
5102         return (void *) (p == NULL);
5103 }
5104
5105 int main(argc, argv)
5106         int argc;
5107         char **argv;
5108 {
5109         pthread_t t;
5110         int status;
5111
5112         /* make sure pthread_create() isn't just a stub */
5113 #if HAVE_PTHREADS_D4
5114         status = pthread_create(&t, pthread_attr_default, task, NULL);
5115 #else
5116         status = pthread_create(&t, NULL, task, NULL);
5117 #endif
5118
5119         if( status ) return status;
5120
5121         /* make sure pthread_detach() isn't just a stub */
5122 #if HAVE_PTHREADS_D4
5123         status = pthread_detach( &t );
5124 #else
5125         status = pthread_detach( t );
5126 #endif
5127
5128         if( status ) return status;
5129
5130         return status;
5131 }
5132
5133 EOF
5134 if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5135 then
5136   ol_cv_pthread_create=yes
5137 else
5138   echo "configure: failed program was:" >&5
5139   cat conftest.$ac_ext >&5
5140   rm -fr conftest*
5141   ol_cv_pthread_create=no
5142 fi
5143 rm -fr conftest*
5144 fi
5145
5146 fi
5147
5148                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
5149
5150                 if test $ol_cv_pthread_create != no ; then
5151                         ol_link_threads=posix
5152                         ol_link_pthreads=""
5153                 fi
5154                 
5155                 # Pthread try link: -mt (ol_cv_pthread_mt)
5156         if test "$ol_link_threads" = no ; then
5157                 # try -mt
5158                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
5159 echo "configure:5160: checking for pthread link with -mt" >&5
5160 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
5161   echo $ac_n "(cached) $ac_c" 1>&6
5162 else
5163   
5164                         # save the flags
5165                         ol_LIBS="$LIBS"
5166                         LIBS="-mt $LIBS"
5167
5168                         cat > conftest.$ac_ext <<EOF
5169 #line 5170 "configure"
5170 #include "confdefs.h"
5171
5172 #include <pthread.h>
5173 #ifndef NULL
5174 #define NULL (void*)0
5175 #endif
5176
5177 int main() {
5178
5179         pthread_t t;
5180
5181 #if HAVE_PTHREADS_D4
5182         pthread_create(&t, pthread_attr_default, NULL, NULL);
5183         pthread_detach( &t );
5184 #else
5185         pthread_create(&t, NULL, NULL, NULL);
5186         pthread_detach( t );
5187 #endif
5188 #ifdef HAVE_LINUX_THREADS
5189         pthread_kill_other_threads_np();
5190 #endif
5191
5192 ; return 0; }
5193 EOF
5194 if { (eval echo configure:5195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5195   rm -rf conftest*
5196   ol_cv_pthread_mt=yes
5197 else
5198   echo "configure: failed program was:" >&5
5199   cat conftest.$ac_ext >&5
5200   rm -rf conftest*
5201   ol_cv_pthread_mt=no
5202 fi
5203 rm -f conftest*
5204
5205                 # restore the LIBS
5206                 LIBS="$ol_LIBS"
5207                 
5208 fi
5209
5210 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
5211
5212                 if test $ol_cv_pthread_mt = yes ; then
5213                         ol_link_pthreads="-mt"
5214                         ol_link_threads=posix
5215                 fi
5216         fi
5217
5218                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
5219         if test "$ol_link_threads" = no ; then
5220                 # try -kthread
5221                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
5222 echo "configure:5223: checking for pthread link with -kthread" >&5
5223 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
5224   echo $ac_n "(cached) $ac_c" 1>&6
5225 else
5226   
5227                         # save the flags
5228                         ol_LIBS="$LIBS"
5229                         LIBS="-kthread $LIBS"
5230
5231                         cat > conftest.$ac_ext <<EOF
5232 #line 5233 "configure"
5233 #include "confdefs.h"
5234
5235 #include <pthread.h>
5236 #ifndef NULL
5237 #define NULL (void*)0
5238 #endif
5239
5240 int main() {
5241
5242         pthread_t t;
5243
5244 #if HAVE_PTHREADS_D4
5245         pthread_create(&t, pthread_attr_default, NULL, NULL);
5246         pthread_detach( &t );
5247 #else
5248         pthread_create(&t, NULL, NULL, NULL);
5249         pthread_detach( t );
5250 #endif
5251 #ifdef HAVE_LINUX_THREADS
5252         pthread_kill_other_threads_np();
5253 #endif
5254
5255 ; return 0; }
5256 EOF
5257 if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5258   rm -rf conftest*
5259   ol_cv_pthread_kthread=yes
5260 else
5261   echo "configure: failed program was:" >&5
5262   cat conftest.$ac_ext >&5
5263   rm -rf conftest*
5264   ol_cv_pthread_kthread=no
5265 fi
5266 rm -f conftest*
5267
5268                 # restore the LIBS
5269                 LIBS="$ol_LIBS"
5270                 
5271 fi
5272
5273 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5274
5275                 if test $ol_cv_pthread_kthread = yes ; then
5276                         ol_link_pthreads="-kthread"
5277                         ol_link_threads=posix
5278                 fi
5279         fi
5280
5281                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5282         if test "$ol_link_threads" = no ; then
5283                 # try -pthread
5284                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5285 echo "configure:5286: checking for pthread link with -pthread" >&5
5286 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5287   echo $ac_n "(cached) $ac_c" 1>&6
5288 else
5289   
5290                         # save the flags
5291                         ol_LIBS="$LIBS"
5292                         LIBS="-pthread $LIBS"
5293
5294                         cat > conftest.$ac_ext <<EOF
5295 #line 5296 "configure"
5296 #include "confdefs.h"
5297
5298 #include <pthread.h>
5299 #ifndef NULL
5300 #define NULL (void*)0
5301 #endif
5302
5303 int main() {
5304
5305         pthread_t t;
5306
5307 #if HAVE_PTHREADS_D4
5308         pthread_create(&t, pthread_attr_default, NULL, NULL);
5309         pthread_detach( &t );
5310 #else
5311         pthread_create(&t, NULL, NULL, NULL);
5312         pthread_detach( t );
5313 #endif
5314 #ifdef HAVE_LINUX_THREADS
5315         pthread_kill_other_threads_np();
5316 #endif
5317
5318 ; return 0; }
5319 EOF
5320 if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5321   rm -rf conftest*
5322   ol_cv_pthread_pthread=yes
5323 else
5324   echo "configure: failed program was:" >&5
5325   cat conftest.$ac_ext >&5
5326   rm -rf conftest*
5327   ol_cv_pthread_pthread=no
5328 fi
5329 rm -f conftest*
5330
5331                 # restore the LIBS
5332                 LIBS="$ol_LIBS"
5333                 
5334 fi
5335
5336 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5337
5338                 if test $ol_cv_pthread_pthread = yes ; then
5339                         ol_link_pthreads="-pthread"
5340                         ol_link_threads=posix
5341                 fi
5342         fi
5343
5344                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5345         if test "$ol_link_threads" = no ; then
5346                 # try -pthreads
5347                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5348 echo "configure:5349: checking for pthread link with -pthreads" >&5
5349 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5350   echo $ac_n "(cached) $ac_c" 1>&6
5351 else
5352   
5353                         # save the flags
5354                         ol_LIBS="$LIBS"
5355                         LIBS="-pthreads $LIBS"
5356
5357                         cat > conftest.$ac_ext <<EOF
5358 #line 5359 "configure"
5359 #include "confdefs.h"
5360
5361 #include <pthread.h>
5362 #ifndef NULL
5363 #define NULL (void*)0
5364 #endif
5365
5366 int main() {
5367
5368         pthread_t t;
5369
5370 #if HAVE_PTHREADS_D4
5371         pthread_create(&t, pthread_attr_default, NULL, NULL);
5372         pthread_detach( &t );
5373 #else
5374         pthread_create(&t, NULL, NULL, NULL);
5375         pthread_detach( t );
5376 #endif
5377 #ifdef HAVE_LINUX_THREADS
5378         pthread_kill_other_threads_np();
5379 #endif
5380
5381 ; return 0; }
5382 EOF
5383 if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5384   rm -rf conftest*
5385   ol_cv_pthread_pthreads=yes
5386 else
5387   echo "configure: failed program was:" >&5
5388   cat conftest.$ac_ext >&5
5389   rm -rf conftest*
5390   ol_cv_pthread_pthreads=no
5391 fi
5392 rm -f conftest*
5393
5394                 # restore the LIBS
5395                 LIBS="$ol_LIBS"
5396                 
5397 fi
5398
5399 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5400
5401                 if test $ol_cv_pthread_pthreads = yes ; then
5402                         ol_link_pthreads="-pthreads"
5403                         ol_link_threads=posix
5404                 fi
5405         fi
5406
5407                 # Pthread try link: -thread (ol_cv_pthread_thread)
5408         if test "$ol_link_threads" = no ; then
5409                 # try -thread
5410                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5411 echo "configure:5412: checking for pthread link with -thread" >&5
5412 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5413   echo $ac_n "(cached) $ac_c" 1>&6
5414 else
5415   
5416                         # save the flags
5417                         ol_LIBS="$LIBS"
5418                         LIBS="-thread $LIBS"
5419
5420                         cat > conftest.$ac_ext <<EOF
5421 #line 5422 "configure"
5422 #include "confdefs.h"
5423
5424 #include <pthread.h>
5425 #ifndef NULL
5426 #define NULL (void*)0
5427 #endif
5428
5429 int main() {
5430
5431         pthread_t t;
5432
5433 #if HAVE_PTHREADS_D4
5434         pthread_create(&t, pthread_attr_default, NULL, NULL);
5435         pthread_detach( &t );
5436 #else
5437         pthread_create(&t, NULL, NULL, NULL);
5438         pthread_detach( t );
5439 #endif
5440 #ifdef HAVE_LINUX_THREADS
5441         pthread_kill_other_threads_np();
5442 #endif
5443
5444 ; return 0; }
5445 EOF
5446 if { (eval echo configure:5447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5447   rm -rf conftest*
5448   ol_cv_pthread_thread=yes
5449 else
5450   echo "configure: failed program was:" >&5
5451   cat conftest.$ac_ext >&5
5452   rm -rf conftest*
5453   ol_cv_pthread_thread=no
5454 fi
5455 rm -f conftest*
5456
5457                 # restore the LIBS
5458                 LIBS="$ol_LIBS"
5459                 
5460 fi
5461
5462 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5463
5464                 if test $ol_cv_pthread_thread = yes ; then
5465                         ol_link_pthreads="-thread"
5466                         ol_link_threads=posix
5467                 fi
5468         fi
5469
5470
5471                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5472         if test "$ol_link_threads" = no ; then
5473                 # try -lpthread -lmach -lexc -lc_r
5474                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5475 echo "configure:5476: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5476 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5477   echo $ac_n "(cached) $ac_c" 1>&6
5478 else
5479   
5480                         # save the flags
5481                         ol_LIBS="$LIBS"
5482                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5483
5484                         cat > conftest.$ac_ext <<EOF
5485 #line 5486 "configure"
5486 #include "confdefs.h"
5487
5488 #include <pthread.h>
5489 #ifndef NULL
5490 #define NULL (void*)0
5491 #endif
5492
5493 int main() {
5494
5495         pthread_t t;
5496
5497 #if HAVE_PTHREADS_D4
5498         pthread_create(&t, pthread_attr_default, NULL, NULL);
5499         pthread_detach( &t );
5500 #else
5501         pthread_create(&t, NULL, NULL, NULL);
5502         pthread_detach( t );
5503 #endif
5504 #ifdef HAVE_LINUX_THREADS
5505         pthread_kill_other_threads_np();
5506 #endif
5507
5508 ; return 0; }
5509 EOF
5510 if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5511   rm -rf conftest*
5512   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5513 else
5514   echo "configure: failed program was:" >&5
5515   cat conftest.$ac_ext >&5
5516   rm -rf conftest*
5517   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5518 fi
5519 rm -f conftest*
5520
5521                 # restore the LIBS
5522                 LIBS="$ol_LIBS"
5523                 
5524 fi
5525
5526 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5527
5528                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5529                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5530                         ol_link_threads=posix
5531                 fi
5532         fi
5533
5534                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5535         if test "$ol_link_threads" = no ; then
5536                 # try -lpthread -lmach -lexc
5537                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5538 echo "configure:5539: checking for pthread link with -lpthread -lmach -lexc" >&5
5539 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5540   echo $ac_n "(cached) $ac_c" 1>&6
5541 else
5542   
5543                         # save the flags
5544                         ol_LIBS="$LIBS"
5545                         LIBS="-lpthread -lmach -lexc $LIBS"
5546
5547                         cat > conftest.$ac_ext <<EOF
5548 #line 5549 "configure"
5549 #include "confdefs.h"
5550
5551 #include <pthread.h>
5552 #ifndef NULL
5553 #define NULL (void*)0
5554 #endif
5555
5556 int main() {
5557
5558         pthread_t t;
5559
5560 #if HAVE_PTHREADS_D4
5561         pthread_create(&t, pthread_attr_default, NULL, NULL);
5562         pthread_detach( &t );
5563 #else
5564         pthread_create(&t, NULL, NULL, NULL);
5565         pthread_detach( t );
5566 #endif
5567 #ifdef HAVE_LINUX_THREADS
5568         pthread_kill_other_threads_np();
5569 #endif
5570
5571 ; return 0; }
5572 EOF
5573 if { (eval echo configure:5574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5574   rm -rf conftest*
5575   ol_cv_pthread_lpthread_lmach_lexc=yes
5576 else
5577   echo "configure: failed program was:" >&5
5578   cat conftest.$ac_ext >&5
5579   rm -rf conftest*
5580   ol_cv_pthread_lpthread_lmach_lexc=no
5581 fi
5582 rm -f conftest*
5583
5584                 # restore the LIBS
5585                 LIBS="$ol_LIBS"
5586                 
5587 fi
5588
5589 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5590
5591                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5592                         ol_link_pthreads="-lpthread -lmach -lexc"
5593                         ol_link_threads=posix
5594                 fi
5595         fi
5596
5597
5598                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5599         if test "$ol_link_threads" = no ; then
5600                 # try -lpthread -Wl,-woff,85
5601                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5602 echo "configure:5603: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5603 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5604   echo $ac_n "(cached) $ac_c" 1>&6
5605 else
5606   
5607                         # save the flags
5608                         ol_LIBS="$LIBS"
5609                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5610
5611                         cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614
5615 #include <pthread.h>
5616 #ifndef NULL
5617 #define NULL (void*)0
5618 #endif
5619
5620 int main() {
5621
5622         pthread_t t;
5623
5624 #if HAVE_PTHREADS_D4
5625         pthread_create(&t, pthread_attr_default, NULL, NULL);
5626         pthread_detach( &t );
5627 #else
5628         pthread_create(&t, NULL, NULL, NULL);
5629         pthread_detach( t );
5630 #endif
5631 #ifdef HAVE_LINUX_THREADS
5632         pthread_kill_other_threads_np();
5633 #endif
5634
5635 ; return 0; }
5636 EOF
5637 if { (eval echo configure:5638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5638   rm -rf conftest*
5639   ol_cv_pthread_lib_lpthread_woff=yes
5640 else
5641   echo "configure: failed program was:" >&5
5642   cat conftest.$ac_ext >&5
5643   rm -rf conftest*
5644   ol_cv_pthread_lib_lpthread_woff=no
5645 fi
5646 rm -f conftest*
5647
5648                 # restore the LIBS
5649                 LIBS="$ol_LIBS"
5650                 
5651 fi
5652
5653 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5654
5655                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5656                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5657                         ol_link_threads=posix
5658                 fi
5659         fi
5660
5661
5662                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5663         if test "$ol_link_threads" = no ; then
5664                 # try -lpthread
5665                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5666 echo "configure:5667: checking for pthread link with -lpthread" >&5
5667 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5668   echo $ac_n "(cached) $ac_c" 1>&6
5669 else
5670   
5671                         # save the flags
5672                         ol_LIBS="$LIBS"
5673                         LIBS="-lpthread $LIBS"
5674
5675                         cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678
5679 #include <pthread.h>
5680 #ifndef NULL
5681 #define NULL (void*)0
5682 #endif
5683
5684 int main() {
5685
5686         pthread_t t;
5687
5688 #if HAVE_PTHREADS_D4
5689         pthread_create(&t, pthread_attr_default, NULL, NULL);
5690         pthread_detach( &t );
5691 #else
5692         pthread_create(&t, NULL, NULL, NULL);
5693         pthread_detach( t );
5694 #endif
5695 #ifdef HAVE_LINUX_THREADS
5696         pthread_kill_other_threads_np();
5697 #endif
5698
5699 ; return 0; }
5700 EOF
5701 if { (eval echo configure:5702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5702   rm -rf conftest*
5703   ol_cv_pthread_lpthread=yes
5704 else
5705   echo "configure: failed program was:" >&5
5706   cat conftest.$ac_ext >&5
5707   rm -rf conftest*
5708   ol_cv_pthread_lpthread=no
5709 fi
5710 rm -f conftest*
5711
5712                 # restore the LIBS
5713                 LIBS="$ol_LIBS"
5714                 
5715 fi
5716
5717 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5718
5719                 if test $ol_cv_pthread_lpthread = yes ; then
5720                         ol_link_pthreads="-lpthread"
5721                         ol_link_threads=posix
5722                 fi
5723         fi
5724
5725                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5726         if test "$ol_link_threads" = no ; then
5727                 # try -lc_r
5728                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5729 echo "configure:5730: checking for pthread link with -lc_r" >&5
5730 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5731   echo $ac_n "(cached) $ac_c" 1>&6
5732 else
5733   
5734                         # save the flags
5735                         ol_LIBS="$LIBS"
5736                         LIBS="-lc_r $LIBS"
5737
5738                         cat > conftest.$ac_ext <<EOF
5739 #line 5740 "configure"
5740 #include "confdefs.h"
5741
5742 #include <pthread.h>
5743 #ifndef NULL
5744 #define NULL (void*)0
5745 #endif
5746
5747 int main() {
5748
5749         pthread_t t;
5750
5751 #if HAVE_PTHREADS_D4
5752         pthread_create(&t, pthread_attr_default, NULL, NULL);
5753         pthread_detach( &t );
5754 #else
5755         pthread_create(&t, NULL, NULL, NULL);
5756         pthread_detach( t );
5757 #endif
5758 #ifdef HAVE_LINUX_THREADS
5759         pthread_kill_other_threads_np();
5760 #endif
5761
5762 ; return 0; }
5763 EOF
5764 if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5765   rm -rf conftest*
5766   ol_cv_pthread_lc_r=yes
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770   rm -rf conftest*
5771   ol_cv_pthread_lc_r=no
5772 fi
5773 rm -f conftest*
5774
5775                 # restore the LIBS
5776                 LIBS="$ol_LIBS"
5777                 
5778 fi
5779
5780 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5781
5782                 if test $ol_cv_pthread_lc_r = yes ; then
5783                         ol_link_pthreads="-lc_r"
5784                         ol_link_threads=posix
5785                 fi
5786         fi
5787
5788
5789                 # Pthread try link: -threads (ol_cv_pthread_threads)
5790         if test "$ol_link_threads" = no ; then
5791                 # try -threads
5792                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5793 echo "configure:5794: checking for pthread link with -threads" >&5
5794 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5795   echo $ac_n "(cached) $ac_c" 1>&6
5796 else
5797   
5798                         # save the flags
5799                         ol_LIBS="$LIBS"
5800                         LIBS="-threads $LIBS"
5801
5802                         cat > conftest.$ac_ext <<EOF
5803 #line 5804 "configure"
5804 #include "confdefs.h"
5805
5806 #include <pthread.h>
5807 #ifndef NULL
5808 #define NULL (void*)0
5809 #endif
5810
5811 int main() {
5812
5813         pthread_t t;
5814
5815 #if HAVE_PTHREADS_D4
5816         pthread_create(&t, pthread_attr_default, NULL, NULL);
5817         pthread_detach( &t );
5818 #else
5819         pthread_create(&t, NULL, NULL, NULL);
5820         pthread_detach( t );
5821 #endif
5822 #ifdef HAVE_LINUX_THREADS
5823         pthread_kill_other_threads_np();
5824 #endif
5825
5826 ; return 0; }
5827 EOF
5828 if { (eval echo configure:5829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5829   rm -rf conftest*
5830   ol_cv_pthread_threads=yes
5831 else
5832   echo "configure: failed program was:" >&5
5833   cat conftest.$ac_ext >&5
5834   rm -rf conftest*
5835   ol_cv_pthread_threads=no
5836 fi
5837 rm -f conftest*
5838
5839                 # restore the LIBS
5840                 LIBS="$ol_LIBS"
5841                 
5842 fi
5843
5844 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5845
5846                 if test $ol_cv_pthread_threads = yes ; then
5847                         ol_link_pthreads="-threads"
5848                         ol_link_threads=posix
5849                 fi
5850         fi
5851
5852
5853                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5854         if test "$ol_link_threads" = no ; then
5855                 # try -lpthreads -lmach -lexc -lc_r
5856                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5857 echo "configure:5858: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5858 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5859   echo $ac_n "(cached) $ac_c" 1>&6
5860 else
5861   
5862                         # save the flags
5863                         ol_LIBS="$LIBS"
5864                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5865
5866                         cat > conftest.$ac_ext <<EOF
5867 #line 5868 "configure"
5868 #include "confdefs.h"
5869
5870 #include <pthread.h>
5871 #ifndef NULL
5872 #define NULL (void*)0
5873 #endif
5874
5875 int main() {
5876
5877         pthread_t t;
5878
5879 #if HAVE_PTHREADS_D4
5880         pthread_create(&t, pthread_attr_default, NULL, NULL);
5881         pthread_detach( &t );
5882 #else
5883         pthread_create(&t, NULL, NULL, NULL);
5884         pthread_detach( t );
5885 #endif
5886 #ifdef HAVE_LINUX_THREADS
5887         pthread_kill_other_threads_np();
5888 #endif
5889
5890 ; return 0; }
5891 EOF
5892 if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5893   rm -rf conftest*
5894   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5895 else
5896   echo "configure: failed program was:" >&5
5897   cat conftest.$ac_ext >&5
5898   rm -rf conftest*
5899   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5900 fi
5901 rm -f conftest*
5902
5903                 # restore the LIBS
5904                 LIBS="$ol_LIBS"
5905                 
5906 fi
5907
5908 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5909
5910                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5911                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5912                         ol_link_threads=posix
5913                 fi
5914         fi
5915
5916                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5917         if test "$ol_link_threads" = no ; then
5918                 # try -lpthreads -lmach -lexc
5919                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5920 echo "configure:5921: checking for pthread link with -lpthreads -lmach -lexc" >&5
5921 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5922   echo $ac_n "(cached) $ac_c" 1>&6
5923 else
5924   
5925                         # save the flags
5926                         ol_LIBS="$LIBS"
5927                         LIBS="-lpthreads -lmach -lexc $LIBS"
5928
5929                         cat > conftest.$ac_ext <<EOF
5930 #line 5931 "configure"
5931 #include "confdefs.h"
5932
5933 #include <pthread.h>
5934 #ifndef NULL
5935 #define NULL (void*)0
5936 #endif
5937
5938 int main() {
5939
5940         pthread_t t;
5941
5942 #if HAVE_PTHREADS_D4
5943         pthread_create(&t, pthread_attr_default, NULL, NULL);
5944         pthread_detach( &t );
5945 #else
5946         pthread_create(&t, NULL, NULL, NULL);
5947         pthread_detach( t );
5948 #endif
5949 #ifdef HAVE_LINUX_THREADS
5950         pthread_kill_other_threads_np();
5951 #endif
5952
5953 ; return 0; }
5954 EOF
5955 if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5956   rm -rf conftest*
5957   ol_cv_pthread_lpthreads_lmach_lexc=yes
5958 else
5959   echo "configure: failed program was:" >&5
5960   cat conftest.$ac_ext >&5
5961   rm -rf conftest*
5962   ol_cv_pthread_lpthreads_lmach_lexc=no
5963 fi
5964 rm -f conftest*
5965
5966                 # restore the LIBS
5967                 LIBS="$ol_LIBS"
5968                 
5969 fi
5970
5971 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5972
5973                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5974                         ol_link_pthreads="-lpthreads -lmach -lexc"
5975                         ol_link_threads=posix
5976                 fi
5977         fi
5978
5979                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5980         if test "$ol_link_threads" = no ; then
5981                 # try -lpthreads -lexc
5982                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5983 echo "configure:5984: checking for pthread link with -lpthreads -lexc" >&5
5984 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5985   echo $ac_n "(cached) $ac_c" 1>&6
5986 else
5987   
5988                         # save the flags
5989                         ol_LIBS="$LIBS"
5990                         LIBS="-lpthreads -lexc $LIBS"
5991
5992                         cat > conftest.$ac_ext <<EOF
5993 #line 5994 "configure"
5994 #include "confdefs.h"
5995
5996 #include <pthread.h>
5997 #ifndef NULL
5998 #define NULL (void*)0
5999 #endif
6000
6001 int main() {
6002
6003         pthread_t t;
6004
6005 #if HAVE_PTHREADS_D4
6006         pthread_create(&t, pthread_attr_default, NULL, NULL);
6007         pthread_detach( &t );
6008 #else
6009         pthread_create(&t, NULL, NULL, NULL);
6010         pthread_detach( t );
6011 #endif
6012 #ifdef HAVE_LINUX_THREADS
6013         pthread_kill_other_threads_np();
6014 #endif
6015
6016 ; return 0; }
6017 EOF
6018 if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6019   rm -rf conftest*
6020   ol_cv_pthread_lpthreads_lexc=yes
6021 else
6022   echo "configure: failed program was:" >&5
6023   cat conftest.$ac_ext >&5
6024   rm -rf conftest*
6025   ol_cv_pthread_lpthreads_lexc=no
6026 fi
6027 rm -f conftest*
6028
6029                 # restore the LIBS
6030                 LIBS="$ol_LIBS"
6031                 
6032 fi
6033
6034 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
6035
6036                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
6037                         ol_link_pthreads="-lpthreads -lexc"
6038                         ol_link_threads=posix
6039                 fi
6040         fi
6041
6042
6043                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
6044         if test "$ol_link_threads" = no ; then
6045                 # try -lpthreads
6046                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
6047 echo "configure:6048: checking for pthread link with -lpthreads" >&5
6048 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
6049   echo $ac_n "(cached) $ac_c" 1>&6
6050 else
6051   
6052                         # save the flags
6053                         ol_LIBS="$LIBS"
6054                         LIBS="-lpthreads $LIBS"
6055
6056                         cat > conftest.$ac_ext <<EOF
6057 #line 6058 "configure"
6058 #include "confdefs.h"
6059
6060 #include <pthread.h>
6061 #ifndef NULL
6062 #define NULL (void*)0
6063 #endif
6064
6065 int main() {
6066
6067         pthread_t t;
6068
6069 #if HAVE_PTHREADS_D4
6070         pthread_create(&t, pthread_attr_default, NULL, NULL);
6071         pthread_detach( &t );
6072 #else
6073         pthread_create(&t, NULL, NULL, NULL);
6074         pthread_detach( t );
6075 #endif
6076 #ifdef HAVE_LINUX_THREADS
6077         pthread_kill_other_threads_np();
6078 #endif
6079
6080 ; return 0; }
6081 EOF
6082 if { (eval echo configure:6083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6083   rm -rf conftest*
6084   ol_cv_pthread_lib_lpthreads=yes
6085 else
6086   echo "configure: failed program was:" >&5
6087   cat conftest.$ac_ext >&5
6088   rm -rf conftest*
6089   ol_cv_pthread_lib_lpthreads=no
6090 fi
6091 rm -f conftest*
6092
6093                 # restore the LIBS
6094                 LIBS="$ol_LIBS"
6095                 
6096 fi
6097
6098 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
6099
6100                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
6101                         ol_link_pthreads="-lpthreads"
6102                         ol_link_threads=posix
6103                 fi
6104         fi
6105
6106
6107                 if test $ol_link_threads != no ; then
6108                         cat >> confdefs.h <<\EOF
6109 #define HAVE_PTHREADS 1
6110 EOF
6111
6112
6113                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
6114
6115                                                 save_CPPFLAGS="$CPPFLAGS"
6116                         save_LIBS="$LIBS"
6117                         LIBS="$LTHREAD_LIBS $LIBS"
6118
6119                                                                                                 for ac_func in sched_yield pthread_yield
6120 do
6121 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6122 echo "configure:6123: checking for $ac_func" >&5
6123 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6124   echo $ac_n "(cached) $ac_c" 1>&6
6125 else
6126   cat > conftest.$ac_ext <<EOF
6127 #line 6128 "configure"
6128 #include "confdefs.h"
6129 /* System header to define __stub macros and hopefully few prototypes,
6130     which can conflict with char $ac_func(); below.  */
6131 #include <assert.h>
6132 /* Override any gcc2 internal prototype to avoid an error.  */
6133 /* We use char because int might match the return type of a gcc2
6134     builtin and then its argument prototype would still apply.  */
6135 char $ac_func();
6136
6137 int main() {
6138
6139 /* The GNU C library defines this for functions which it implements
6140     to always fail with ENOSYS.  Some functions are actually named
6141     something starting with __ and the normal name is an alias.  */
6142 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6143 choke me
6144 #else
6145 $ac_func();
6146 #endif
6147
6148 ; return 0; }
6149 EOF
6150 if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6151   rm -rf conftest*
6152   eval "ac_cv_func_$ac_func=yes"
6153 else
6154   echo "configure: failed program was:" >&5
6155   cat conftest.$ac_ext >&5
6156   rm -rf conftest*
6157   eval "ac_cv_func_$ac_func=no"
6158 fi
6159 rm -f conftest*
6160 fi
6161
6162 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6163   echo "$ac_t""yes" 1>&6
6164     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6165   cat >> confdefs.h <<EOF
6166 #define $ac_tr_func 1
6167 EOF
6168  
6169 else
6170   echo "$ac_t""no" 1>&6
6171 fi
6172 done
6173
6174
6175                         if test $ac_cv_func_sched_yield = no -a \
6176                                 $ac_cv_func_pthread_yield = no ; then
6177                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
6178 echo "configure:6179: checking for sched_yield in -lrt" >&5
6179 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
6180 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6181   echo $ac_n "(cached) $ac_c" 1>&6
6182 else
6183   ac_save_LIBS="$LIBS"
6184 LIBS="-lrt  $LIBS"
6185 cat > conftest.$ac_ext <<EOF
6186 #line 6187 "configure"
6187 #include "confdefs.h"
6188 /* Override any gcc2 internal prototype to avoid an error.  */
6189 /* We use char because int might match the return type of a gcc2
6190     builtin and then its argument prototype would still apply.  */
6191 char sched_yield();
6192
6193 int main() {
6194 sched_yield()
6195 ; return 0; }
6196 EOF
6197 if { (eval echo configure:6198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6198   rm -rf conftest*
6199   eval "ac_cv_lib_$ac_lib_var=yes"
6200 else
6201   echo "configure: failed program was:" >&5
6202   cat conftest.$ac_ext >&5
6203   rm -rf conftest*
6204   eval "ac_cv_lib_$ac_lib_var=no"
6205 fi
6206 rm -f conftest*
6207 LIBS="$ac_save_LIBS"
6208
6209 fi
6210 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6211   echo "$ac_t""yes" 1>&6
6212   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
6213                                         cat >> confdefs.h <<\EOF
6214 #define HAVE_SCHED_YIELD 1
6215 EOF
6216
6217                                         ac_cv_func_sched_yield=yes
6218 else
6219   echo "$ac_t""no" 1>&6
6220 ac_cv_func_sched_yield=no
6221 fi
6222
6223                         fi
6224                         if test $ac_cv_func_sched_yield = no -a \
6225                                 $ac_cv_func_pthread_yield = no ; then
6226                                                                                                 for ac_func in thr_yield
6227 do
6228 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6229 echo "configure:6230: checking for $ac_func" >&5
6230 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6231   echo $ac_n "(cached) $ac_c" 1>&6
6232 else
6233   cat > conftest.$ac_ext <<EOF
6234 #line 6235 "configure"
6235 #include "confdefs.h"
6236 /* System header to define __stub macros and hopefully few prototypes,
6237     which can conflict with char $ac_func(); below.  */
6238 #include <assert.h>
6239 /* Override any gcc2 internal prototype to avoid an error.  */
6240 /* We use char because int might match the return type of a gcc2
6241     builtin and then its argument prototype would still apply.  */
6242 char $ac_func();
6243
6244 int main() {
6245
6246 /* The GNU C library defines this for functions which it implements
6247     to always fail with ENOSYS.  Some functions are actually named
6248     something starting with __ and the normal name is an alias.  */
6249 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6250 choke me
6251 #else
6252 $ac_func();
6253 #endif
6254
6255 ; return 0; }
6256 EOF
6257 if { (eval echo configure:6258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6258   rm -rf conftest*
6259   eval "ac_cv_func_$ac_func=yes"
6260 else
6261   echo "configure: failed program was:" >&5
6262   cat conftest.$ac_ext >&5
6263   rm -rf conftest*
6264   eval "ac_cv_func_$ac_func=no"
6265 fi
6266 rm -f conftest*
6267 fi
6268
6269 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6270   echo "$ac_t""yes" 1>&6
6271     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6272   cat >> confdefs.h <<EOF
6273 #define $ac_tr_func 1
6274 EOF
6275  
6276 else
6277   echo "$ac_t""no" 1>&6
6278 fi
6279 done
6280
6281                         fi
6282                         if test $ac_cv_func_sched_yield = no -a \
6283                                 $ac_cv_func_pthread_yield = no -a \
6284                                 "$ac_cv_func_thr_yield" = no ; then
6285                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6286                         fi
6287
6288                                                 for ac_func in pthread_kill
6289 do
6290 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6291 echo "configure:6292: checking for $ac_func" >&5
6292 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6293   echo $ac_n "(cached) $ac_c" 1>&6
6294 else
6295   cat > conftest.$ac_ext <<EOF
6296 #line 6297 "configure"
6297 #include "confdefs.h"
6298 /* System header to define __stub macros and hopefully few prototypes,
6299     which can conflict with char $ac_func(); below.  */
6300 #include <assert.h>
6301 /* Override any gcc2 internal prototype to avoid an error.  */
6302 /* We use char because int might match the return type of a gcc2
6303     builtin and then its argument prototype would still apply.  */
6304 char $ac_func();
6305
6306 int main() {
6307
6308 /* The GNU C library defines this for functions which it implements
6309     to always fail with ENOSYS.  Some functions are actually named
6310     something starting with __ and the normal name is an alias.  */
6311 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6312 choke me
6313 #else
6314 $ac_func();
6315 #endif
6316
6317 ; return 0; }
6318 EOF
6319 if { (eval echo configure:6320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6320   rm -rf conftest*
6321   eval "ac_cv_func_$ac_func=yes"
6322 else
6323   echo "configure: failed program was:" >&5
6324   cat conftest.$ac_ext >&5
6325   rm -rf conftest*
6326   eval "ac_cv_func_$ac_func=no"
6327 fi
6328 rm -f conftest*
6329 fi
6330
6331 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6332   echo "$ac_t""yes" 1>&6
6333     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6334   cat >> confdefs.h <<EOF
6335 #define $ac_tr_func 1
6336 EOF
6337  
6338 else
6339   echo "$ac_t""no" 1>&6
6340 fi
6341 done
6342
6343
6344                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6345 echo "configure:6346: checking for pthread_detach with <pthread.h>" >&5
6346 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6347   echo $ac_n "(cached) $ac_c" 1>&6
6348 else
6349   
6350                                                                 cat > conftest.$ac_ext <<EOF
6351 #line 6352 "configure"
6352 #include "confdefs.h"
6353
6354 #include <pthread.h>
6355 #ifndef NULL
6356 #define NULL (void*)0
6357 #endif
6358
6359 int main() {
6360 pthread_detach(NULL);
6361 ; return 0; }
6362 EOF
6363 if { (eval echo configure:6364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6364   rm -rf conftest*
6365   ol_cv_func_pthread_detach=yes
6366 else
6367   echo "configure: failed program was:" >&5
6368   cat conftest.$ac_ext >&5
6369   rm -rf conftest*
6370   ol_cv_func_pthread_detach=no
6371 fi
6372 rm -f conftest*
6373                         
6374 fi
6375
6376 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6377
6378                         if test $ol_cv_func_pthread_detach = no ; then
6379                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6380                         fi
6381
6382                         cat >> confdefs.h <<\EOF
6383 #define HAVE_PTHREAD_DETACH 1
6384 EOF
6385
6386
6387                                                 for ac_func in \
6388                                 pthread_setconcurrency \
6389                                 pthread_getconcurrency \
6390                                 thr_setconcurrency \
6391                                 thr_getconcurrency \
6392                         
6393 do
6394 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6395 echo "configure:6396: checking for $ac_func" >&5
6396 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6397   echo $ac_n "(cached) $ac_c" 1>&6
6398 else
6399   cat > conftest.$ac_ext <<EOF
6400 #line 6401 "configure"
6401 #include "confdefs.h"
6402 /* System header to define __stub macros and hopefully few prototypes,
6403     which can conflict with char $ac_func(); below.  */
6404 #include <assert.h>
6405 /* Override any gcc2 internal prototype to avoid an error.  */
6406 /* We use char because int might match the return type of a gcc2
6407     builtin and then its argument prototype would still apply.  */
6408 char $ac_func();
6409
6410 int main() {
6411
6412 /* The GNU C library defines this for functions which it implements
6413     to always fail with ENOSYS.  Some functions are actually named
6414     something starting with __ and the normal name is an alias.  */
6415 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6416 choke me
6417 #else
6418 $ac_func();
6419 #endif
6420
6421 ; return 0; }
6422 EOF
6423 if { (eval echo configure:6424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6424   rm -rf conftest*
6425   eval "ac_cv_func_$ac_func=yes"
6426 else
6427   echo "configure: failed program was:" >&5
6428   cat conftest.$ac_ext >&5
6429   rm -rf conftest*
6430   eval "ac_cv_func_$ac_func=no"
6431 fi
6432 rm -f conftest*
6433 fi
6434
6435 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6436   echo "$ac_t""yes" 1>&6
6437     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6438   cat >> confdefs.h <<EOF
6439 #define $ac_tr_func 1
6440 EOF
6441  
6442 else
6443   echo "$ac_t""no" 1>&6
6444 fi
6445 done
6446
6447
6448                         
6449         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6450 echo "configure:6451: checking for pthread_kill_other_threads_np" >&5
6451 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6452   echo $ac_n "(cached) $ac_c" 1>&6
6453 else
6454   cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457 /* System header to define __stub macros and hopefully few prototypes,
6458     which can conflict with char pthread_kill_other_threads_np(); below.  */
6459 #include <assert.h>
6460 /* Override any gcc2 internal prototype to avoid an error.  */
6461 /* We use char because int might match the return type of a gcc2
6462     builtin and then its argument prototype would still apply.  */
6463 char pthread_kill_other_threads_np();
6464
6465 int main() {
6466
6467 /* The GNU C library defines this for functions which it implements
6468     to always fail with ENOSYS.  Some functions are actually named
6469     something starting with __ and the normal name is an alias.  */
6470 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6471 choke me
6472 #else
6473 pthread_kill_other_threads_np();
6474 #endif
6475
6476 ; return 0; }
6477 EOF
6478 if { (eval echo configure:6479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6479   rm -rf conftest*
6480   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6481 else
6482   echo "configure: failed program was:" >&5
6483   cat conftest.$ac_ext >&5
6484   rm -rf conftest*
6485   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6486 fi
6487 rm -f conftest*
6488 fi
6489
6490 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6491   echo "$ac_t""yes" 1>&6
6492   :
6493 else
6494   echo "$ac_t""no" 1>&6
6495 fi
6496
6497         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6498 echo "configure:6499: checking for LinuxThreads implementation" >&5
6499 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6500   echo $ac_n "(cached) $ac_c" 1>&6
6501 else
6502   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6503 fi
6504
6505 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6506
6507                         
6508         
6509         
6510         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6511 echo "configure:6512: checking for LinuxThreads consistency" >&5
6512 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6513   echo $ac_n "(cached) $ac_c" 1>&6
6514 else
6515   
6516                 if test $ol_cv_header_linux_threads = yes -a \
6517                         $ol_cv_sys_linux_threads = yes; then
6518                         ol_cv_linux_threads=yes
6519                 elif test $ol_cv_header_linux_threads = no -a \
6520                         $ol_cv_sys_linux_threads = no; then
6521                         ol_cv_linux_threads=no
6522                 else
6523                         ol_cv_linux_threads=error
6524                 fi
6525         
6526 fi
6527
6528 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6529
6530
6531                         if test $ol_cv_linux_threads = error; then
6532                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6533                         fi
6534
6535                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6536 echo "configure:6537: checking if pthread_create() works" >&5
6537                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6538   echo $ac_n "(cached) $ac_c" 1>&6
6539 else
6540   
6541                         if test "$cross_compiling" = yes; then
6542                                 ol_cv_pthread_create_works=yes
6543 else
6544   cat > conftest.$ac_ext <<EOF
6545 #line 6546 "configure"
6546 #include "confdefs.h"
6547
6548 #include <pthread.h>
6549 #ifndef NULL
6550 #define NULL (void*)0
6551 #endif
6552
6553 static void *task(p)
6554         void *p;
6555 {
6556         return (void *) (p == NULL);
6557 }
6558
6559 int main(argc, argv)
6560         int argc;
6561         char **argv;
6562 {
6563         pthread_t t;
6564 #if HAVE_PTHREADS_D4
6565         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6566 #else
6567         exit(pthread_create(&t, NULL, task, NULL));
6568 #endif
6569 }
6570
6571 EOF
6572 if { (eval echo configure:6573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6573 then
6574   ol_cv_pthread_create_works=yes
6575 else
6576   echo "configure: failed program was:" >&5
6577   cat conftest.$ac_ext >&5
6578   rm -fr conftest*
6579   ol_cv_pthread_create_works=no
6580 fi
6581 rm -fr conftest*
6582 fi
6583
6584 fi
6585
6586                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6587
6588                         if test $ol_cv_pthread_create_works = no ; then
6589                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6590                         fi
6591
6592                                                 if test $ol_with_yielding_select = auto ; then
6593                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6594 echo "configure:6595: checking if select yields when using pthreads" >&5
6595                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6596   echo $ac_n "(cached) $ac_c" 1>&6
6597 else
6598   
6599                                 if test "$cross_compiling" = yes; then
6600   
6601                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6602 else
6603   cat > conftest.$ac_ext <<EOF
6604 #line 6605 "configure"
6605 #include "confdefs.h"
6606
6607 #include <sys/types.h>
6608 #include <sys/time.h>
6609 #include <unistd.h>
6610 #include <pthread.h>
6611 #ifndef NULL
6612 #define NULL (void*) 0
6613 #endif
6614
6615 static int fildes[2];
6616
6617 static void *task(p)
6618         void *p;
6619 {
6620         int i;
6621         struct timeval tv;
6622
6623         fd_set rfds;
6624
6625         tv.tv_sec=10;
6626         tv.tv_usec=0;
6627
6628         FD_ZERO(&rfds);
6629         FD_SET(fildes[0], &rfds);
6630
6631         /* we're not interested in any fds */
6632         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6633
6634         if(i < 0) {
6635                 perror("select");
6636                 exit(10);
6637         }
6638
6639         exit(0); /* if we exit here, the select blocked the whole process */
6640 }
6641
6642 int main(argc, argv)
6643         int argc;
6644         char **argv;
6645 {
6646         pthread_t t;
6647
6648         /* create a pipe to select */
6649         if(pipe(&fildes[0])) {
6650                 perror("select");
6651                 exit(1);
6652         }
6653
6654 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6655         (void) pthread_setconcurrency(2);
6656 #else
6657 #ifdef HAVE_THR_SETCONCURRENCY
6658         /* Set Solaris LWP concurrency to 2 */
6659         thr_setconcurrency(2);
6660 #endif
6661 #endif
6662
6663 #if HAVE_PTHREADS_D4
6664         pthread_create(&t, pthread_attr_default, task, NULL);
6665 #else
6666         pthread_create(&t, NULL, task, NULL);
6667 #endif
6668
6669 #if HAVE_SCHED_YIELD
6670         sched_yield();  /* make sure task runs first */
6671 #else
6672 #ifdef HAVE_PTHREAD_YIELD
6673         pthread_yield();        /* make sure task runs first */
6674 #endif
6675 #endif
6676
6677         exit(2);
6678 }
6679 EOF
6680 if { (eval echo configure:6681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6681 then
6682   ol_cv_pthread_select_yields=no
6683 else
6684   echo "configure: failed program was:" >&5
6685   cat conftest.$ac_ext >&5
6686   rm -fr conftest*
6687   ol_cv_pthread_select_yields=yes
6688 fi
6689 rm -fr conftest*
6690 fi
6691
6692 fi
6693
6694                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6695
6696                                 if test $ol_cv_pthread_select_yields = yes ; then
6697                                         ol_with_yielding_select=yes
6698                                 fi
6699                         fi
6700
6701                                                 CPPFLAGS="$save_CPPFLAGS"
6702                         LIBS="$save_LIBS"
6703                 else
6704                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6705                 fi
6706         fi
6707
6708         if test $ol_with_threads = posix ; then
6709                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6710         fi
6711 fi
6712
6713 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6714         -o $ol_with_threads = mach ; then
6715
6716                 for ac_hdr in mach/cthreads.h
6717 do
6718 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6719 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6720 echo "configure:6721: checking for $ac_hdr" >&5
6721 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6722   echo $ac_n "(cached) $ac_c" 1>&6
6723 else
6724   cat > conftest.$ac_ext <<EOF
6725 #line 6726 "configure"
6726 #include "confdefs.h"
6727 #include <$ac_hdr>
6728 EOF
6729 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6730 { (eval echo configure:6731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6731 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6732 if test -z "$ac_err"; then
6733   rm -rf conftest*
6734   eval "ac_cv_header_$ac_safe=yes"
6735 else
6736   echo "$ac_err" >&5
6737   echo "configure: failed program was:" >&5
6738   cat conftest.$ac_ext >&5
6739   rm -rf conftest*
6740   eval "ac_cv_header_$ac_safe=no"
6741 fi
6742 rm -f conftest*
6743 fi
6744 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6745   echo "$ac_t""yes" 1>&6
6746     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6747   cat >> confdefs.h <<EOF
6748 #define $ac_tr_hdr 1
6749 EOF
6750  
6751 else
6752   echo "$ac_t""no" 1>&6
6753 fi
6754 done
6755
6756         if test $ac_cv_header_mach_cthreads_h = yes ; then
6757                 ol_with_threads=found
6758
6759                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6760 echo "configure:6761: checking for cthread_fork" >&5
6761 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6762   echo $ac_n "(cached) $ac_c" 1>&6
6763 else
6764   cat > conftest.$ac_ext <<EOF
6765 #line 6766 "configure"
6766 #include "confdefs.h"
6767 /* System header to define __stub macros and hopefully few prototypes,
6768     which can conflict with char cthread_fork(); below.  */
6769 #include <assert.h>
6770 /* Override any gcc2 internal prototype to avoid an error.  */
6771 /* We use char because int might match the return type of a gcc2
6772     builtin and then its argument prototype would still apply.  */
6773 char cthread_fork();
6774
6775 int main() {
6776
6777 /* The GNU C library defines this for functions which it implements
6778     to always fail with ENOSYS.  Some functions are actually named
6779     something starting with __ and the normal name is an alias.  */
6780 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6781 choke me
6782 #else
6783 cthread_fork();
6784 #endif
6785
6786 ; return 0; }
6787 EOF
6788 if { (eval echo configure:6789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6789   rm -rf conftest*
6790   eval "ac_cv_func_cthread_fork=yes"
6791 else
6792   echo "configure: failed program was:" >&5
6793   cat conftest.$ac_ext >&5
6794   rm -rf conftest*
6795   eval "ac_cv_func_cthread_fork=no"
6796 fi
6797 rm -f conftest*
6798 fi
6799
6800 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6801   echo "$ac_t""yes" 1>&6
6802   ol_link_threads=yes
6803 else
6804   echo "$ac_t""no" 1>&6
6805 fi
6806
6807
6808                 if test $ol_link_threads = no ; then
6809                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6810 echo "configure:6811: checking for cthread_fork with -all_load" >&5
6811 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6812   echo $ac_n "(cached) $ac_c" 1>&6
6813 else
6814   
6815                                                                 save_LIBS="$LIBS"
6816                                 LIBS="-all_load $LIBS"
6817                                 cat > conftest.$ac_ext <<EOF
6818 #line 6819 "configure"
6819 #include "confdefs.h"
6820 #include <mach/cthreads.h>
6821 int main() {
6822
6823                                         cthread_fork((void *)0, (void *)0);
6824                                         
6825 ; return 0; }
6826 EOF
6827 if { (eval echo configure:6828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6828   rm -rf conftest*
6829   ol_cv_cthread_all_load=yes
6830 else
6831   echo "configure: failed program was:" >&5
6832   cat conftest.$ac_ext >&5
6833   rm -rf conftest*
6834   ol_cv_cthread_all_load=no
6835 fi
6836 rm -f conftest*
6837                                                                 LIBS="$save_LIBS"
6838                         
6839 fi
6840
6841 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6842
6843                         if test $ol_cv_cthread_all_load = yes ; then
6844                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6845                                 ol_link_threads=mach
6846                         fi
6847                 fi
6848
6849                 if test $ol_link_threads != no ; then
6850                         : check for cthread specific functionality here
6851                         cat >> confdefs.h <<\EOF
6852 #define HAVE_MACH_CTHREADS 1
6853 EOF
6854
6855                 else
6856                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6857                 fi
6858         fi
6859
6860         if test $ol_with_threads = mach ; then
6861                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6862         fi
6863 fi
6864
6865 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6866         -o $ol_with_threads = lwp ; then
6867
6868                 for ac_hdr in thread.h synch.h
6869 do
6870 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6871 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6872 echo "configure:6873: checking for $ac_hdr" >&5
6873 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6874   echo $ac_n "(cached) $ac_c" 1>&6
6875 else
6876   cat > conftest.$ac_ext <<EOF
6877 #line 6878 "configure"
6878 #include "confdefs.h"
6879 #include <$ac_hdr>
6880 EOF
6881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6882 { (eval echo configure:6883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6884 if test -z "$ac_err"; then
6885   rm -rf conftest*
6886   eval "ac_cv_header_$ac_safe=yes"
6887 else
6888   echo "$ac_err" >&5
6889   echo "configure: failed program was:" >&5
6890   cat conftest.$ac_ext >&5
6891   rm -rf conftest*
6892   eval "ac_cv_header_$ac_safe=no"
6893 fi
6894 rm -f conftest*
6895 fi
6896 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6897   echo "$ac_t""yes" 1>&6
6898     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6899   cat >> confdefs.h <<EOF
6900 #define $ac_tr_hdr 1
6901 EOF
6902  
6903 else
6904   echo "$ac_t""no" 1>&6
6905 fi
6906 done
6907
6908         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6909                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6910 echo "configure:6911: checking for thr_create in -lthread" >&5
6911 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6912 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6913   echo $ac_n "(cached) $ac_c" 1>&6
6914 else
6915   ac_save_LIBS="$LIBS"
6916 LIBS="-lthread  $LIBS"
6917 cat > conftest.$ac_ext <<EOF
6918 #line 6919 "configure"
6919 #include "confdefs.h"
6920 /* Override any gcc2 internal prototype to avoid an error.  */
6921 /* We use char because int might match the return type of a gcc2
6922     builtin and then its argument prototype would still apply.  */
6923 char thr_create();
6924
6925 int main() {
6926 thr_create()
6927 ; return 0; }
6928 EOF
6929 if { (eval echo configure:6930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6930   rm -rf conftest*
6931   eval "ac_cv_lib_$ac_lib_var=yes"
6932 else
6933   echo "configure: failed program was:" >&5
6934   cat conftest.$ac_ext >&5
6935   rm -rf conftest*
6936   eval "ac_cv_lib_$ac_lib_var=no"
6937 fi
6938 rm -f conftest*
6939 LIBS="$ac_save_LIBS"
6940
6941 fi
6942 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6943   echo "$ac_t""yes" 1>&6
6944   have_thr=yes
6945 else
6946   echo "$ac_t""no" 1>&6
6947 have_thr=no
6948 fi
6949
6950
6951                 if test $have_thr = yes ; then
6952                         cat >> confdefs.h <<\EOF
6953 #define HAVE_THR 1
6954 EOF
6955
6956                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6957                         ol_link_threads=thr
6958
6959                         if test $ol_with_yielding_select = auto ; then
6960                                 ol_with_yielding_select=yes
6961                         fi
6962
6963                                                 for ac_func in \
6964                                 thr_setconcurrency \
6965                                 thr_getconcurrency \
6966                         
6967 do
6968 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6969 echo "configure:6970: checking for $ac_func" >&5
6970 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6971   echo $ac_n "(cached) $ac_c" 1>&6
6972 else
6973   cat > conftest.$ac_ext <<EOF
6974 #line 6975 "configure"
6975 #include "confdefs.h"
6976 /* System header to define __stub macros and hopefully few prototypes,
6977     which can conflict with char $ac_func(); below.  */
6978 #include <assert.h>
6979 /* Override any gcc2 internal prototype to avoid an error.  */
6980 /* We use char because int might match the return type of a gcc2
6981     builtin and then its argument prototype would still apply.  */
6982 char $ac_func();
6983
6984 int main() {
6985
6986 /* The GNU C library defines this for functions which it implements
6987     to always fail with ENOSYS.  Some functions are actually named
6988     something starting with __ and the normal name is an alias.  */
6989 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6990 choke me
6991 #else
6992 $ac_func();
6993 #endif
6994
6995 ; return 0; }
6996 EOF
6997 if { (eval echo configure:6998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6998   rm -rf conftest*
6999   eval "ac_cv_func_$ac_func=yes"
7000 else
7001   echo "configure: failed program was:" >&5
7002   cat conftest.$ac_ext >&5
7003   rm -rf conftest*
7004   eval "ac_cv_func_$ac_func=no"
7005 fi
7006 rm -f conftest*
7007 fi
7008
7009 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7010   echo "$ac_t""yes" 1>&6
7011     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7012   cat >> confdefs.h <<EOF
7013 #define $ac_tr_func 1
7014 EOF
7015  
7016 else
7017   echo "$ac_t""no" 1>&6
7018 fi
7019 done
7020
7021                 fi
7022         fi
7023
7024                 for ac_hdr in lwp/lwp.h
7025 do
7026 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7027 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7028 echo "configure:7029: checking for $ac_hdr" >&5
7029 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7030   echo $ac_n "(cached) $ac_c" 1>&6
7031 else
7032   cat > conftest.$ac_ext <<EOF
7033 #line 7034 "configure"
7034 #include "confdefs.h"
7035 #include <$ac_hdr>
7036 EOF
7037 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7038 { (eval echo configure:7039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7039 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7040 if test -z "$ac_err"; then
7041   rm -rf conftest*
7042   eval "ac_cv_header_$ac_safe=yes"
7043 else
7044   echo "$ac_err" >&5
7045   echo "configure: failed program was:" >&5
7046   cat conftest.$ac_ext >&5
7047   rm -rf conftest*
7048   eval "ac_cv_header_$ac_safe=no"
7049 fi
7050 rm -f conftest*
7051 fi
7052 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7053   echo "$ac_t""yes" 1>&6
7054     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7055   cat >> confdefs.h <<EOF
7056 #define $ac_tr_hdr 1
7057 EOF
7058  
7059 else
7060   echo "$ac_t""no" 1>&6
7061 fi
7062 done
7063
7064         if test $ac_cv_header_lwp_lwp_h = yes ; then
7065                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
7066 echo "configure:7067: checking for lwp_create in -llwp" >&5
7067 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
7068 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7069   echo $ac_n "(cached) $ac_c" 1>&6
7070 else
7071   ac_save_LIBS="$LIBS"
7072 LIBS="-llwp  $LIBS"
7073 cat > conftest.$ac_ext <<EOF
7074 #line 7075 "configure"
7075 #include "confdefs.h"
7076 /* Override any gcc2 internal prototype to avoid an error.  */
7077 /* We use char because int might match the return type of a gcc2
7078     builtin and then its argument prototype would still apply.  */
7079 char lwp_create();
7080
7081 int main() {
7082 lwp_create()
7083 ; return 0; }
7084 EOF
7085 if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7086   rm -rf conftest*
7087   eval "ac_cv_lib_$ac_lib_var=yes"
7088 else
7089   echo "configure: failed program was:" >&5
7090   cat conftest.$ac_ext >&5
7091   rm -rf conftest*
7092   eval "ac_cv_lib_$ac_lib_var=no"
7093 fi
7094 rm -f conftest*
7095 LIBS="$ac_save_LIBS"
7096
7097 fi
7098 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7099   echo "$ac_t""yes" 1>&6
7100   have_lwp=yes
7101 else
7102   echo "$ac_t""no" 1>&6
7103 have_lwp=no
7104 fi
7105
7106
7107                 if test $have_lwp = yes ; then
7108                         cat >> confdefs.h <<\EOF
7109 #define HAVE_LWP 1
7110 EOF
7111
7112                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
7113                         ol_link_threads=lwp
7114
7115                         if test $ol_with_yielding_select = auto ; then
7116                                 ol_with_yielding_select=no
7117                         fi
7118                 fi
7119         fi
7120 fi
7121
7122 if test $ol_with_yielding_select = yes ; then
7123         cat >> confdefs.h <<\EOF
7124 #define HAVE_YIELDING_SELECT 1
7125 EOF
7126
7127 fi
7128
7129 if test $ol_with_threads = manual ; then
7130                 ol_link_threads=yes
7131
7132         echo "configure: warning: thread defines and link options must be set manually" 1>&2
7133
7134         for ac_hdr in pthread.h sched.h
7135 do
7136 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7137 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7138 echo "configure:7139: checking for $ac_hdr" >&5
7139 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7140   echo $ac_n "(cached) $ac_c" 1>&6
7141 else
7142   cat > conftest.$ac_ext <<EOF
7143 #line 7144 "configure"
7144 #include "confdefs.h"
7145 #include <$ac_hdr>
7146 EOF
7147 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7148 { (eval echo configure:7149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7149 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7150 if test -z "$ac_err"; then
7151   rm -rf conftest*
7152   eval "ac_cv_header_$ac_safe=yes"
7153 else
7154   echo "$ac_err" >&5
7155   echo "configure: failed program was:" >&5
7156   cat conftest.$ac_ext >&5
7157   rm -rf conftest*
7158   eval "ac_cv_header_$ac_safe=no"
7159 fi
7160 rm -f conftest*
7161 fi
7162 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7163   echo "$ac_t""yes" 1>&6
7164     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7165   cat >> confdefs.h <<EOF
7166 #define $ac_tr_hdr 1
7167 EOF
7168  
7169 else
7170   echo "$ac_t""no" 1>&6
7171 fi
7172 done
7173
7174         for ac_func in sched_yield pthread_yield
7175 do
7176 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7177 echo "configure:7178: checking for $ac_func" >&5
7178 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7179   echo $ac_n "(cached) $ac_c" 1>&6
7180 else
7181   cat > conftest.$ac_ext <<EOF
7182 #line 7183 "configure"
7183 #include "confdefs.h"
7184 /* System header to define __stub macros and hopefully few prototypes,
7185     which can conflict with char $ac_func(); below.  */
7186 #include <assert.h>
7187 /* Override any gcc2 internal prototype to avoid an error.  */
7188 /* We use char because int might match the return type of a gcc2
7189     builtin and then its argument prototype would still apply.  */
7190 char $ac_func();
7191
7192 int main() {
7193
7194 /* The GNU C library defines this for functions which it implements
7195     to always fail with ENOSYS.  Some functions are actually named
7196     something starting with __ and the normal name is an alias.  */
7197 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7198 choke me
7199 #else
7200 $ac_func();
7201 #endif
7202
7203 ; return 0; }
7204 EOF
7205 if { (eval echo configure:7206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7206   rm -rf conftest*
7207   eval "ac_cv_func_$ac_func=yes"
7208 else
7209   echo "configure: failed program was:" >&5
7210   cat conftest.$ac_ext >&5
7211   rm -rf conftest*
7212   eval "ac_cv_func_$ac_func=no"
7213 fi
7214 rm -f conftest*
7215 fi
7216
7217 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7218   echo "$ac_t""yes" 1>&6
7219     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7220   cat >> confdefs.h <<EOF
7221 #define $ac_tr_func 1
7222 EOF
7223  
7224 else
7225   echo "$ac_t""no" 1>&6
7226 fi
7227 done
7228
7229         
7230         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7231 echo "configure:7232: checking for LinuxThreads pthread.h" >&5
7232 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7233   echo $ac_n "(cached) $ac_c" 1>&6
7234 else
7235   cat > conftest.$ac_ext <<EOF
7236 #line 7237 "configure"
7237 #include "confdefs.h"
7238 #include <pthread.h>
7239 EOF
7240 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7241   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7242   rm -rf conftest*
7243   ol_cv_header_linux_threads=yes
7244 else
7245   rm -rf conftest*
7246   ol_cv_header_linux_threads=no
7247 fi
7248 rm -f conftest*
7249
7250                 
7251 fi
7252
7253 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7254         if test $ol_cv_header_linux_threads = yes; then
7255                 cat >> confdefs.h <<\EOF
7256 #define HAVE_LINUX_THREADS 1
7257 EOF
7258
7259         fi
7260
7261
7262         for ac_hdr in mach/cthreads.h
7263 do
7264 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7265 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7266 echo "configure:7267: checking for $ac_hdr" >&5
7267 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7268   echo $ac_n "(cached) $ac_c" 1>&6
7269 else
7270   cat > conftest.$ac_ext <<EOF
7271 #line 7272 "configure"
7272 #include "confdefs.h"
7273 #include <$ac_hdr>
7274 EOF
7275 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7276 { (eval echo configure:7277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7277 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7278 if test -z "$ac_err"; then
7279   rm -rf conftest*
7280   eval "ac_cv_header_$ac_safe=yes"
7281 else
7282   echo "$ac_err" >&5
7283   echo "configure: failed program was:" >&5
7284   cat conftest.$ac_ext >&5
7285   rm -rf conftest*
7286   eval "ac_cv_header_$ac_safe=no"
7287 fi
7288 rm -f conftest*
7289 fi
7290 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7291   echo "$ac_t""yes" 1>&6
7292     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7293   cat >> confdefs.h <<EOF
7294 #define $ac_tr_hdr 1
7295 EOF
7296  
7297 else
7298   echo "$ac_t""no" 1>&6
7299 fi
7300 done
7301
7302         for ac_hdr in lwp/lwp.h
7303 do
7304 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7305 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7306 echo "configure:7307: checking for $ac_hdr" >&5
7307 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7308   echo $ac_n "(cached) $ac_c" 1>&6
7309 else
7310   cat > conftest.$ac_ext <<EOF
7311 #line 7312 "configure"
7312 #include "confdefs.h"
7313 #include <$ac_hdr>
7314 EOF
7315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7316 { (eval echo configure:7317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7318 if test -z "$ac_err"; then
7319   rm -rf conftest*
7320   eval "ac_cv_header_$ac_safe=yes"
7321 else
7322   echo "$ac_err" >&5
7323   echo "configure: failed program was:" >&5
7324   cat conftest.$ac_ext >&5
7325   rm -rf conftest*
7326   eval "ac_cv_header_$ac_safe=no"
7327 fi
7328 rm -f conftest*
7329 fi
7330 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7331   echo "$ac_t""yes" 1>&6
7332     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7333   cat >> confdefs.h <<EOF
7334 #define $ac_tr_hdr 1
7335 EOF
7336  
7337 else
7338   echo "$ac_t""no" 1>&6
7339 fi
7340 done
7341
7342         for ac_hdr in thread.h synch.h
7343 do
7344 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7345 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7346 echo "configure:7347: checking for $ac_hdr" >&5
7347 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7348   echo $ac_n "(cached) $ac_c" 1>&6
7349 else
7350   cat > conftest.$ac_ext <<EOF
7351 #line 7352 "configure"
7352 #include "confdefs.h"
7353 #include <$ac_hdr>
7354 EOF
7355 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7356 { (eval echo configure:7357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7357 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7358 if test -z "$ac_err"; then
7359   rm -rf conftest*
7360   eval "ac_cv_header_$ac_safe=yes"
7361 else
7362   echo "$ac_err" >&5
7363   echo "configure: failed program was:" >&5
7364   cat conftest.$ac_ext >&5
7365   rm -rf conftest*
7366   eval "ac_cv_header_$ac_safe=no"
7367 fi
7368 rm -f conftest*
7369 fi
7370 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7371   echo "$ac_t""yes" 1>&6
7372     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7373   cat >> confdefs.h <<EOF
7374 #define $ac_tr_hdr 1
7375 EOF
7376  
7377 else
7378   echo "$ac_t""no" 1>&6
7379 fi
7380 done
7381
7382 fi
7383
7384 if test $ol_link_threads != no ; then  
7385                         cat >> confdefs.h <<\EOF
7386 #define REENTRANT 1
7387 EOF
7388
7389         cat >> confdefs.h <<\EOF
7390 #define _REENTRANT 1
7391 EOF
7392
7393         cat >> confdefs.h <<\EOF
7394 #define THREAD_SAFE 1
7395 EOF
7396
7397         cat >> confdefs.h <<\EOF
7398 #define _THREAD_SAFE 1
7399 EOF
7400
7401         cat >> confdefs.h <<\EOF
7402 #define THREADSAFE 1
7403 EOF
7404
7405         cat >> confdefs.h <<\EOF
7406 #define _THREADSAFE 1
7407 EOF
7408
7409
7410                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7411 echo "configure:7412: checking for thread specific errno" >&5
7412 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7413   echo $ac_n "(cached) $ac_c" 1>&6
7414 else
7415   
7416                 cat > conftest.$ac_ext <<EOF
7417 #line 7418 "configure"
7418 #include "confdefs.h"
7419 #include <errno.h>
7420 int main() {
7421 errno = 0;
7422 ; return 0; }
7423 EOF
7424 if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7425   rm -rf conftest*
7426   ol_cv_errno_thread_specific=yes
7427 else
7428   echo "configure: failed program was:" >&5
7429   cat conftest.$ac_ext >&5
7430   rm -rf conftest*
7431   ol_cv_errno_thread_specific=no
7432 fi
7433 rm -f conftest*
7434         
7435 fi
7436
7437 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7438
7439                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
7440 echo "configure:7441: checking for thread specific h_errno" >&5
7441 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
7442   echo $ac_n "(cached) $ac_c" 1>&6
7443 else
7444   
7445                 cat > conftest.$ac_ext <<EOF
7446 #line 7447 "configure"
7447 #include "confdefs.h"
7448 #include <netdb.h>
7449 int main() {
7450 h_errno = 0;
7451 ; return 0; }
7452 EOF
7453 if { (eval echo configure:7454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7454   rm -rf conftest*
7455   ol_cv_h_errno_thread_specific=yes
7456 else
7457   echo "configure: failed program was:" >&5
7458   cat conftest.$ac_ext >&5
7459   rm -rf conftest*
7460   ol_cv_h_errno_thread_specific=no
7461 fi
7462 rm -f conftest*
7463         
7464 fi
7465
7466 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
7467
7468         if test $ol_cv_errno_thread_specific != yes \
7469                 -o $ol_cv_h_errno_thread_specific != yes ; then
7470                 LIBS="$LTHREAD_LIBS $LIBS"
7471                 LTHREAD_LIBS=""
7472         fi
7473
7474 fi  
7475
7476 if test $ol_link_threads = no ; then
7477         if test $ol_with_threads = yes ; then
7478                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7479         fi
7480
7481         if test $ol_with_threads = auto ; then
7482                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7483                 ol_with_threads=no
7484         fi
7485
7486         cat >> confdefs.h <<\EOF
7487 #define NO_THREADS 1
7488 EOF
7489
7490         LTHREAD_LIBS=""
7491 fi
7492
7493 if test $ol_link_threads != no ; then
7494         cat >> confdefs.h <<\EOF
7495 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7496 EOF
7497
7498 fi
7499
7500
7501 ol_link_ldbm=no 
7502 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7503         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7504 echo "configure:7505: checking for DB2 library" >&5
7505 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7506   echo $ac_n "(cached) $ac_c" 1>&6
7507 else
7508         ol_LIBS="$LIBS"
7509         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7510 echo "configure:7511: checking for db_open in -ldb" >&5
7511 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7512 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7513   echo $ac_n "(cached) $ac_c" 1>&6
7514 else
7515   ac_save_LIBS="$LIBS"
7516 LIBS="-ldb  $LIBS"
7517 cat > conftest.$ac_ext <<EOF
7518 #line 7519 "configure"
7519 #include "confdefs.h"
7520 /* Override any gcc2 internal prototype to avoid an error.  */
7521 /* We use char because int might match the return type of a gcc2
7522     builtin and then its argument prototype would still apply.  */
7523 char db_open();
7524
7525 int main() {
7526 db_open()
7527 ; return 0; }
7528 EOF
7529 if { (eval echo configure:7530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7530   rm -rf conftest*
7531   eval "ac_cv_lib_$ac_lib_var=yes"
7532 else
7533   echo "configure: failed program was:" >&5
7534   cat conftest.$ac_ext >&5
7535   rm -rf conftest*
7536   eval "ac_cv_lib_$ac_lib_var=no"
7537 fi
7538 rm -f conftest*
7539 LIBS="$ac_save_LIBS"
7540
7541 fi
7542 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7543   echo "$ac_t""yes" 1>&6
7544   ol_cv_lib_db2=-ldb
7545 else
7546   echo "$ac_t""no" 1>&6
7547 ol_cv_lib_db2=no
7548 fi
7549
7550         LIBS="$ol_LIBS"
7551
7552 fi
7553
7554 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7555
7556 for ac_hdr in db.h
7557 do
7558 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7559 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7560 echo "configure:7561: checking for $ac_hdr" >&5
7561 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7562   echo $ac_n "(cached) $ac_c" 1>&6
7563 else
7564   cat > conftest.$ac_ext <<EOF
7565 #line 7566 "configure"
7566 #include "confdefs.h"
7567 #include <$ac_hdr>
7568 EOF
7569 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7570 { (eval echo configure:7571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7571 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7572 if test -z "$ac_err"; then
7573   rm -rf conftest*
7574   eval "ac_cv_header_$ac_safe=yes"
7575 else
7576   echo "$ac_err" >&5
7577   echo "configure: failed program was:" >&5
7578   cat conftest.$ac_ext >&5
7579   rm -rf conftest*
7580   eval "ac_cv_header_$ac_safe=no"
7581 fi
7582 rm -f conftest*
7583 fi
7584 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7585   echo "$ac_t""yes" 1>&6
7586     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7587   cat >> confdefs.h <<EOF
7588 #define $ac_tr_hdr 1
7589 EOF
7590  
7591 else
7592   echo "$ac_t""no" 1>&6
7593 fi
7594 done
7595
7596 if test $ac_cv_header_db_h = yes ; then
7597         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7598 echo "configure:7599: checking if db.h is DB2" >&5
7599 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7600   echo $ac_n "(cached) $ac_c" 1>&6
7601 else
7602   
7603                 cat > conftest.$ac_ext <<EOF
7604 #line 7605 "configure"
7605 #include "confdefs.h"
7606
7607 #                       include <db.h>
7608                         /* this check could be improved */
7609 #                       ifdef DB_VERSION_MAJOR
7610 #                               if DB_VERSION_MAJOR == 2
7611                                         __db_version_2
7612 #                               endif
7613 #                       endif
7614                 
7615 EOF
7616 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7617   egrep "__db_version_2" >/dev/null 2>&1; then
7618   rm -rf conftest*
7619   ol_cv_header_db2=yes
7620 else
7621   rm -rf conftest*
7622   ol_cv_header_db2=no
7623 fi
7624 rm -f conftest*
7625
7626 fi
7627
7628 echo "$ac_t""$ol_cv_header_db2" 1>&6
7629 else
7630         ol_cv_header_db2=no
7631 fi
7632
7633
7634  
7635  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7636 echo "configure:7637: checking for Berkeley DB2" >&5
7637 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7638   echo $ac_n "(cached) $ac_c" 1>&6
7639 else
7640   
7641         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7642                 ol_cv_berkeley_db2=no
7643         else
7644                 ol_cv_berkeley_db2=yes
7645         fi
7646
7647 fi
7648
7649 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7650  if test $ol_cv_berkeley_db2 = yes ; then
7651         cat >> confdefs.h <<\EOF
7652 #define HAVE_BERKELEY_DB2 1
7653 EOF
7654
7655  fi
7656
7657
7658         if test $ol_cv_berkeley_db2 = yes ; then
7659                 ol_link_ldbm=db2
7660                 ol_with_ldbm_api=db2
7661
7662                 if test $ol_with_ldbm_type = hash ; then
7663                         cat >> confdefs.h <<\EOF
7664 #define LDBM_USE_DBHASH 1
7665 EOF
7666
7667                 else
7668                         cat >> confdefs.h <<\EOF
7669 #define LDBM_USE_DBBTREE 1
7670 EOF
7671
7672                 fi
7673
7674                                                 if test $ol_cv_lib_db2 != yes ; then
7675                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7676                 fi
7677         fi
7678 fi
7679
7680 ol_link_bdb2=no
7681 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7682         ol_link_bdb2=yes
7683 fi
7684
7685 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7686         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7687 echo "configure:7688: checking for Berkeley DB library" >&5
7688 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7689   echo $ac_n "(cached) $ac_c" 1>&6
7690 else
7691   
7692         for ac_hdr in db1/db.h
7693 do
7694 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7695 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7696 echo "configure:7697: checking for $ac_hdr" >&5
7697 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7698   echo $ac_n "(cached) $ac_c" 1>&6
7699 else
7700   cat > conftest.$ac_ext <<EOF
7701 #line 7702 "configure"
7702 #include "confdefs.h"
7703 #include <$ac_hdr>
7704 EOF
7705 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7706 { (eval echo configure:7707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7707 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7708 if test -z "$ac_err"; then
7709   rm -rf conftest*
7710   eval "ac_cv_header_$ac_safe=yes"
7711 else
7712   echo "$ac_err" >&5
7713   echo "configure: failed program was:" >&5
7714   cat conftest.$ac_ext >&5
7715   rm -rf conftest*
7716   eval "ac_cv_header_$ac_safe=no"
7717 fi
7718 rm -f conftest*
7719 fi
7720 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7721   echo "$ac_t""yes" 1>&6
7722     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7723   cat >> confdefs.h <<EOF
7724 #define $ac_tr_hdr 1
7725 EOF
7726  
7727 else
7728   echo "$ac_t""no" 1>&6
7729 fi
7730 done
7731
7732         ol_LIBS="$LIBS"
7733         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7734 echo "configure:7735: checking for dbopen" >&5
7735 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7736   echo $ac_n "(cached) $ac_c" 1>&6
7737 else
7738   cat > conftest.$ac_ext <<EOF
7739 #line 7740 "configure"
7740 #include "confdefs.h"
7741 /* System header to define __stub macros and hopefully few prototypes,
7742     which can conflict with char dbopen(); below.  */
7743 #include <assert.h>
7744 /* Override any gcc2 internal prototype to avoid an error.  */
7745 /* We use char because int might match the return type of a gcc2
7746     builtin and then its argument prototype would still apply.  */
7747 char dbopen();
7748
7749 int main() {
7750
7751 /* The GNU C library defines this for functions which it implements
7752     to always fail with ENOSYS.  Some functions are actually named
7753     something starting with __ and the normal name is an alias.  */
7754 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7755 choke me
7756 #else
7757 dbopen();
7758 #endif
7759
7760 ; return 0; }
7761 EOF
7762 if { (eval echo configure:7763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7763   rm -rf conftest*
7764   eval "ac_cv_func_dbopen=yes"
7765 else
7766   echo "configure: failed program was:" >&5
7767   cat conftest.$ac_ext >&5
7768   rm -rf conftest*
7769   eval "ac_cv_func_dbopen=no"
7770 fi
7771 rm -f conftest*
7772 fi
7773
7774 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7775   echo "$ac_t""yes" 1>&6
7776   ol_cv_lib_db=yes
7777 else
7778   echo "$ac_t""no" 1>&6
7779
7780                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7781 echo "configure:7782: checking for dbopen in -ldb1" >&5
7782 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7783 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7784   echo $ac_n "(cached) $ac_c" 1>&6
7785 else
7786   ac_save_LIBS="$LIBS"
7787 LIBS="-ldb1  $LIBS"
7788 cat > conftest.$ac_ext <<EOF
7789 #line 7790 "configure"
7790 #include "confdefs.h"
7791 /* Override any gcc2 internal prototype to avoid an error.  */
7792 /* We use char because int might match the return type of a gcc2
7793     builtin and then its argument prototype would still apply.  */
7794 char dbopen();
7795
7796 int main() {
7797 dbopen()
7798 ; return 0; }
7799 EOF
7800 if { (eval echo configure:7801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7801   rm -rf conftest*
7802   eval "ac_cv_lib_$ac_lib_var=yes"
7803 else
7804   echo "configure: failed program was:" >&5
7805   cat conftest.$ac_ext >&5
7806   rm -rf conftest*
7807   eval "ac_cv_lib_$ac_lib_var=no"
7808 fi
7809 rm -f conftest*
7810 LIBS="$ac_save_LIBS"
7811
7812 fi
7813 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7814   echo "$ac_t""yes" 1>&6
7815   ol_cv_lib_db=-ldb1
7816 else
7817   echo "$ac_t""no" 1>&6
7818
7819                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7820 echo "configure:7821: checking for dbopen in -ldb" >&5
7821 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7822 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7823   echo $ac_n "(cached) $ac_c" 1>&6
7824 else
7825   ac_save_LIBS="$LIBS"
7826 LIBS="-ldb  $LIBS"
7827 cat > conftest.$ac_ext <<EOF
7828 #line 7829 "configure"
7829 #include "confdefs.h"
7830 /* Override any gcc2 internal prototype to avoid an error.  */
7831 /* We use char because int might match the return type of a gcc2
7832     builtin and then its argument prototype would still apply.  */
7833 char dbopen();
7834
7835 int main() {
7836 dbopen()
7837 ; return 0; }
7838 EOF
7839 if { (eval echo configure:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7840   rm -rf conftest*
7841   eval "ac_cv_lib_$ac_lib_var=yes"
7842 else
7843   echo "configure: failed program was:" >&5
7844   cat conftest.$ac_ext >&5
7845   rm -rf conftest*
7846   eval "ac_cv_lib_$ac_lib_var=no"
7847 fi
7848 rm -f conftest*
7849 LIBS="$ac_save_LIBS"
7850
7851 fi
7852 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7853   echo "$ac_t""yes" 1>&6
7854   ol_cv_lib_db=-ldb
7855 else
7856   echo "$ac_t""no" 1>&6
7857 ol_cv_lib_db=no
7858 fi
7859
7860                 
7861 fi
7862
7863         
7864 fi
7865
7866         LIBS="$ol_LIBS"
7867
7868 fi
7869
7870 echo "$ac_t""$ol_cv_lib_db" 1>&6
7871
7872
7873 for ac_hdr in db_185.h
7874 do
7875 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7876 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7877 echo "configure:7878: checking for $ac_hdr" >&5
7878 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7879   echo $ac_n "(cached) $ac_c" 1>&6
7880 else
7881   cat > conftest.$ac_ext <<EOF
7882 #line 7883 "configure"
7883 #include "confdefs.h"
7884 #include <$ac_hdr>
7885 EOF
7886 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7887 { (eval echo configure:7888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7888 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7889 if test -z "$ac_err"; then
7890   rm -rf conftest*
7891   eval "ac_cv_header_$ac_safe=yes"
7892 else
7893   echo "$ac_err" >&5
7894   echo "configure: failed program was:" >&5
7895   cat conftest.$ac_ext >&5
7896   rm -rf conftest*
7897   eval "ac_cv_header_$ac_safe=no"
7898 fi
7899 rm -f conftest*
7900 fi
7901 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7902   echo "$ac_t""yes" 1>&6
7903     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7904   cat >> confdefs.h <<EOF
7905 #define $ac_tr_hdr 1
7906 EOF
7907  
7908 else
7909   echo "$ac_t""no" 1>&6
7910 fi
7911 done
7912
7913 if test "$ol_cv_header_db2" = yes ; then
7914         
7915         ol_cv_header_db=$ac_cv_header_db_185_h
7916 else
7917         ol_cv_header_db=$ac_cv_header_db_h
7918 fi
7919
7920
7921  
7922  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7923 echo "configure:7924: checking for Berkeley DB" >&5
7924 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7925   echo $ac_n "(cached) $ac_c" 1>&6
7926 else
7927   
7928         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7929                 ol_cv_berkeley_db=no
7930         else
7931                 ol_cv_berkeley_db=yes
7932         fi
7933
7934 fi
7935
7936 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7937  if test $ol_cv_berkeley_db = yes ; then
7938         cat >> confdefs.h <<\EOF
7939 #define HAVE_BERKELEY_DB 1
7940 EOF
7941
7942  fi
7943
7944
7945         if test $ol_cv_berkeley_db = yes ; then
7946                 ol_link_ldbm=db
7947                 ol_with_ldbm_api=db
7948
7949                 if test $ol_with_ldbm_type = hash ; then
7950                         cat >> confdefs.h <<\EOF
7951 #define LDBM_USE_DBHASH 1
7952 EOF
7953
7954                 else
7955                         cat >> confdefs.h <<\EOF
7956 #define LDBM_USE_DBBTREE 1
7957 EOF
7958
7959                 fi
7960
7961                                                 if test $ol_cv_lib_db != yes ; then
7962                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7963                 fi
7964         fi
7965 fi
7966
7967 if test $ol_with_ldbm_api = manual ; then
7968                 ol_link_ldbm=yes
7969
7970         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7971
7972         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7973 do
7974 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7975 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7976 echo "configure:7977: checking for $ac_hdr" >&5
7977 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7978   echo $ac_n "(cached) $ac_c" 1>&6
7979 else
7980   cat > conftest.$ac_ext <<EOF
7981 #line 7982 "configure"
7982 #include "confdefs.h"
7983 #include <$ac_hdr>
7984 EOF
7985 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7986 { (eval echo configure:7987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7987 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7988 if test -z "$ac_err"; then
7989   rm -rf conftest*
7990   eval "ac_cv_header_$ac_safe=yes"
7991 else
7992   echo "$ac_err" >&5
7993   echo "configure: failed program was:" >&5
7994   cat conftest.$ac_ext >&5
7995   rm -rf conftest*
7996   eval "ac_cv_header_$ac_safe=no"
7997 fi
7998 rm -f conftest*
7999 fi
8000 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8001   echo "$ac_t""yes" 1>&6
8002     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8003   cat >> confdefs.h <<EOF
8004 #define $ac_tr_hdr 1
8005 EOF
8006  
8007 else
8008   echo "$ac_t""no" 1>&6
8009 fi
8010 done
8011
8012 fi
8013
8014 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
8015         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
8016         ol_with_ldbm_api=none
8017 fi
8018
8019 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
8020         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
8021 echo "configure:8022: checking for MDBM library" >&5
8022 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
8023   echo $ac_n "(cached) $ac_c" 1>&6
8024 else
8025         ol_LIBS="$LIBS"
8026         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
8027 echo "configure:8028: checking for mdbm_set_chain" >&5
8028 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
8029   echo $ac_n "(cached) $ac_c" 1>&6
8030 else
8031   cat > conftest.$ac_ext <<EOF
8032 #line 8033 "configure"
8033 #include "confdefs.h"
8034 /* System header to define __stub macros and hopefully few prototypes,
8035     which can conflict with char mdbm_set_chain(); below.  */
8036 #include <assert.h>
8037 /* Override any gcc2 internal prototype to avoid an error.  */
8038 /* We use char because int might match the return type of a gcc2
8039     builtin and then its argument prototype would still apply.  */
8040 char mdbm_set_chain();
8041
8042 int main() {
8043
8044 /* The GNU C library defines this for functions which it implements
8045     to always fail with ENOSYS.  Some functions are actually named
8046     something starting with __ and the normal name is an alias.  */
8047 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
8048 choke me
8049 #else
8050 mdbm_set_chain();
8051 #endif
8052
8053 ; return 0; }
8054 EOF
8055 if { (eval echo configure:8056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8056   rm -rf conftest*
8057   eval "ac_cv_func_mdbm_set_chain=yes"
8058 else
8059   echo "configure: failed program was:" >&5
8060   cat conftest.$ac_ext >&5
8061   rm -rf conftest*
8062   eval "ac_cv_func_mdbm_set_chain=no"
8063 fi
8064 rm -f conftest*
8065 fi
8066
8067 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
8068   echo "$ac_t""yes" 1>&6
8069   ol_cv_lib_mdbm=yes
8070 else
8071   echo "$ac_t""no" 1>&6
8072
8073                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
8074 echo "configure:8075: checking for mdbm_set_chain in -lmdbm" >&5
8075 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
8076 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8077   echo $ac_n "(cached) $ac_c" 1>&6
8078 else
8079   ac_save_LIBS="$LIBS"
8080 LIBS="-lmdbm  $LIBS"
8081 cat > conftest.$ac_ext <<EOF
8082 #line 8083 "configure"
8083 #include "confdefs.h"
8084 /* Override any gcc2 internal prototype to avoid an error.  */
8085 /* We use char because int might match the return type of a gcc2
8086     builtin and then its argument prototype would still apply.  */
8087 char mdbm_set_chain();
8088
8089 int main() {
8090 mdbm_set_chain()
8091 ; return 0; }
8092 EOF
8093 if { (eval echo configure:8094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8094   rm -rf conftest*
8095   eval "ac_cv_lib_$ac_lib_var=yes"
8096 else
8097   echo "configure: failed program was:" >&5
8098   cat conftest.$ac_ext >&5
8099   rm -rf conftest*
8100   eval "ac_cv_lib_$ac_lib_var=no"
8101 fi
8102 rm -f conftest*
8103 LIBS="$ac_save_LIBS"
8104
8105 fi
8106 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8107   echo "$ac_t""yes" 1>&6
8108   ol_cv_lib_mdbm=-lmdbm
8109 else
8110   echo "$ac_t""no" 1>&6
8111 ol_cv_lib_mdbm=no
8112 fi
8113
8114         
8115 fi
8116
8117         LIBS="$ol_LIBS"
8118
8119 fi
8120
8121 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
8122
8123
8124  for ac_hdr in mdbm.h
8125 do
8126 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8127 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8128 echo "configure:8129: checking for $ac_hdr" >&5
8129 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8130   echo $ac_n "(cached) $ac_c" 1>&6
8131 else
8132   cat > conftest.$ac_ext <<EOF
8133 #line 8134 "configure"
8134 #include "confdefs.h"
8135 #include <$ac_hdr>
8136 EOF
8137 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8138 { (eval echo configure:8139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8139 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8140 if test -z "$ac_err"; then
8141   rm -rf conftest*
8142   eval "ac_cv_header_$ac_safe=yes"
8143 else
8144   echo "$ac_err" >&5
8145   echo "configure: failed program was:" >&5
8146   cat conftest.$ac_ext >&5
8147   rm -rf conftest*
8148   eval "ac_cv_header_$ac_safe=no"
8149 fi
8150 rm -f conftest*
8151 fi
8152 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8153   echo "$ac_t""yes" 1>&6
8154     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8155   cat >> confdefs.h <<EOF
8156 #define $ac_tr_hdr 1
8157 EOF
8158  
8159 else
8160   echo "$ac_t""no" 1>&6
8161 fi
8162 done
8163
8164  echo $ac_n "checking for db""... $ac_c" 1>&6
8165 echo "configure:8166: checking for db" >&5
8166 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
8167   echo $ac_n "(cached) $ac_c" 1>&6
8168 else
8169   
8170         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
8171                 ol_cv_mdbm=no
8172         else
8173                 ol_cv_mdbm=yes
8174         fi
8175
8176 fi
8177
8178 echo "$ac_t""$ol_cv_mdbm" 1>&6
8179  if test $ol_cv_mdbm = yes ; then
8180         cat >> confdefs.h <<\EOF
8181 #define HAVE_MDBM 1
8182 EOF
8183
8184  fi
8185
8186
8187         if test $ol_cv_mdbm = yes ; then
8188                 ol_link_ldbm=mdbm
8189                 ol_with_ldbm_api=mdbm
8190                 if test $ol_cv_lib_mdbm != yes ; then
8191                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
8192                 fi
8193         fi
8194 fi
8195
8196 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
8197         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
8198 echo "configure:8199: checking for GDBM library" >&5
8199 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
8200   echo $ac_n "(cached) $ac_c" 1>&6
8201 else
8202         ol_LIBS="$LIBS"
8203         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
8204 echo "configure:8205: checking for gdbm_open" >&5
8205 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
8206   echo $ac_n "(cached) $ac_c" 1>&6
8207 else
8208   cat > conftest.$ac_ext <<EOF
8209 #line 8210 "configure"
8210 #include "confdefs.h"
8211 /* System header to define __stub macros and hopefully few prototypes,
8212     which can conflict with char gdbm_open(); below.  */
8213 #include <assert.h>
8214 /* Override any gcc2 internal prototype to avoid an error.  */
8215 /* We use char because int might match the return type of a gcc2
8216     builtin and then its argument prototype would still apply.  */
8217 char gdbm_open();
8218
8219 int main() {
8220
8221 /* The GNU C library defines this for functions which it implements
8222     to always fail with ENOSYS.  Some functions are actually named
8223     something starting with __ and the normal name is an alias.  */
8224 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
8225 choke me
8226 #else
8227 gdbm_open();
8228 #endif
8229
8230 ; return 0; }
8231 EOF
8232 if { (eval echo configure:8233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8233   rm -rf conftest*
8234   eval "ac_cv_func_gdbm_open=yes"
8235 else
8236   echo "configure: failed program was:" >&5
8237   cat conftest.$ac_ext >&5
8238   rm -rf conftest*
8239   eval "ac_cv_func_gdbm_open=no"
8240 fi
8241 rm -f conftest*
8242 fi
8243
8244 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
8245   echo "$ac_t""yes" 1>&6
8246   ol_cv_lib_gdbm=yes
8247 else
8248   echo "$ac_t""no" 1>&6
8249
8250                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
8251 echo "configure:8252: checking for gdbm_open in -lgdbm" >&5
8252 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
8253 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8254   echo $ac_n "(cached) $ac_c" 1>&6
8255 else
8256   ac_save_LIBS="$LIBS"
8257 LIBS="-lgdbm  $LIBS"
8258 cat > conftest.$ac_ext <<EOF
8259 #line 8260 "configure"
8260 #include "confdefs.h"
8261 /* Override any gcc2 internal prototype to avoid an error.  */
8262 /* We use char because int might match the return type of a gcc2
8263     builtin and then its argument prototype would still apply.  */
8264 char gdbm_open();
8265
8266 int main() {
8267 gdbm_open()
8268 ; return 0; }
8269 EOF
8270 if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8271   rm -rf conftest*
8272   eval "ac_cv_lib_$ac_lib_var=yes"
8273 else
8274   echo "configure: failed program was:" >&5
8275   cat conftest.$ac_ext >&5
8276   rm -rf conftest*
8277   eval "ac_cv_lib_$ac_lib_var=no"
8278 fi
8279 rm -f conftest*
8280 LIBS="$ac_save_LIBS"
8281
8282 fi
8283 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8284   echo "$ac_t""yes" 1>&6
8285   ol_cv_lib_gdbm=-lgdbm
8286 else
8287   echo "$ac_t""no" 1>&6
8288 ol_cv_lib_gdbm=no
8289 fi
8290
8291         
8292 fi
8293
8294         LIBS="$ol_LIBS"
8295
8296 fi
8297
8298 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8299
8300
8301  for ac_hdr in gdbm.h
8302 do
8303 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8304 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8305 echo "configure:8306: checking for $ac_hdr" >&5
8306 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8307   echo $ac_n "(cached) $ac_c" 1>&6
8308 else
8309   cat > conftest.$ac_ext <<EOF
8310 #line 8311 "configure"
8311 #include "confdefs.h"
8312 #include <$ac_hdr>
8313 EOF
8314 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8315 { (eval echo configure:8316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8316 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8317 if test -z "$ac_err"; then
8318   rm -rf conftest*
8319   eval "ac_cv_header_$ac_safe=yes"
8320 else
8321   echo "$ac_err" >&5
8322   echo "configure: failed program was:" >&5
8323   cat conftest.$ac_ext >&5
8324   rm -rf conftest*
8325   eval "ac_cv_header_$ac_safe=no"
8326 fi
8327 rm -f conftest*
8328 fi
8329 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8330   echo "$ac_t""yes" 1>&6
8331     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8332   cat >> confdefs.h <<EOF
8333 #define $ac_tr_hdr 1
8334 EOF
8335  
8336 else
8337   echo "$ac_t""no" 1>&6
8338 fi
8339 done
8340
8341  echo $ac_n "checking for db""... $ac_c" 1>&6
8342 echo "configure:8343: checking for db" >&5
8343 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8344   echo $ac_n "(cached) $ac_c" 1>&6
8345 else
8346   
8347         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8348                 ol_cv_gdbm=no
8349         else
8350                 ol_cv_gdbm=yes
8351         fi
8352
8353 fi
8354
8355 echo "$ac_t""$ol_cv_gdbm" 1>&6
8356  if test $ol_cv_gdbm = yes ; then
8357         cat >> confdefs.h <<\EOF
8358 #define HAVE_GDBM 1
8359 EOF
8360
8361  fi
8362
8363
8364         if test $ol_cv_gdbm = yes ; then
8365                 ol_link_ldbm=gdbm
8366                 ol_with_ldbm_api=gdbm
8367
8368                 if test $ol_cv_lib_gdbm != yes ; then
8369                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8370                 fi
8371         fi
8372 fi
8373
8374 if test $ol_with_ldbm_api = auto ; then
8375         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8376 elif test $ol_with_ldbm_api = ndbm ; then
8377         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8378 echo "configure:8379: checking for NDBM library" >&5
8379 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8380   echo $ac_n "(cached) $ac_c" 1>&6
8381 else
8382         ol_LIBS="$LIBS"
8383         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8384 echo "configure:8385: checking for dbm_open" >&5
8385 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8386   echo $ac_n "(cached) $ac_c" 1>&6
8387 else
8388   cat > conftest.$ac_ext <<EOF
8389 #line 8390 "configure"
8390 #include "confdefs.h"
8391 /* System header to define __stub macros and hopefully few prototypes,
8392     which can conflict with char dbm_open(); below.  */
8393 #include <assert.h>
8394 /* Override any gcc2 internal prototype to avoid an error.  */
8395 /* We use char because int might match the return type of a gcc2
8396     builtin and then its argument prototype would still apply.  */
8397 char dbm_open();
8398
8399 int main() {
8400
8401 /* The GNU C library defines this for functions which it implements
8402     to always fail with ENOSYS.  Some functions are actually named
8403     something starting with __ and the normal name is an alias.  */
8404 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8405 choke me
8406 #else
8407 dbm_open();
8408 #endif
8409
8410 ; return 0; }
8411 EOF
8412 if { (eval echo configure:8413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8413   rm -rf conftest*
8414   eval "ac_cv_func_dbm_open=yes"
8415 else
8416   echo "configure: failed program was:" >&5
8417   cat conftest.$ac_ext >&5
8418   rm -rf conftest*
8419   eval "ac_cv_func_dbm_open=no"
8420 fi
8421 rm -f conftest*
8422 fi
8423
8424 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8425   echo "$ac_t""yes" 1>&6
8426   ol_cv_lib_ndbm=yes
8427 else
8428   echo "$ac_t""no" 1>&6
8429
8430                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8431 echo "configure:8432: checking for dbm_open in -lndbm" >&5
8432 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8433 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8434   echo $ac_n "(cached) $ac_c" 1>&6
8435 else
8436   ac_save_LIBS="$LIBS"
8437 LIBS="-lndbm  $LIBS"
8438 cat > conftest.$ac_ext <<EOF
8439 #line 8440 "configure"
8440 #include "confdefs.h"
8441 /* Override any gcc2 internal prototype to avoid an error.  */
8442 /* We use char because int might match the return type of a gcc2
8443     builtin and then its argument prototype would still apply.  */
8444 char dbm_open();
8445
8446 int main() {
8447 dbm_open()
8448 ; return 0; }
8449 EOF
8450 if { (eval echo configure:8451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8451   rm -rf conftest*
8452   eval "ac_cv_lib_$ac_lib_var=yes"
8453 else
8454   echo "configure: failed program was:" >&5
8455   cat conftest.$ac_ext >&5
8456   rm -rf conftest*
8457   eval "ac_cv_lib_$ac_lib_var=no"
8458 fi
8459 rm -f conftest*
8460 LIBS="$ac_save_LIBS"
8461
8462 fi
8463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8464   echo "$ac_t""yes" 1>&6
8465   ol_cv_lib_ndbm=-lndbm
8466 else
8467   echo "$ac_t""no" 1>&6
8468
8469                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8470 echo "configure:8471: checking for dbm_open in -ldbm" >&5
8471 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8472 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8473   echo $ac_n "(cached) $ac_c" 1>&6
8474 else
8475   ac_save_LIBS="$LIBS"
8476 LIBS="-ldbm  $LIBS"
8477 cat > conftest.$ac_ext <<EOF
8478 #line 8479 "configure"
8479 #include "confdefs.h"
8480 /* Override any gcc2 internal prototype to avoid an error.  */
8481 /* We use char because int might match the return type of a gcc2
8482     builtin and then its argument prototype would still apply.  */
8483 char dbm_open();
8484
8485 int main() {
8486 dbm_open()
8487 ; return 0; }
8488 EOF
8489 if { (eval echo configure:8490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8490   rm -rf conftest*
8491   eval "ac_cv_lib_$ac_lib_var=yes"
8492 else
8493   echo "configure: failed program was:" >&5
8494   cat conftest.$ac_ext >&5
8495   rm -rf conftest*
8496   eval "ac_cv_lib_$ac_lib_var=no"
8497 fi
8498 rm -f conftest*
8499 LIBS="$ac_save_LIBS"
8500
8501 fi
8502 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8503   echo "$ac_t""yes" 1>&6
8504   ol_cv_lib_ndbm=-ldbm
8505 else
8506   echo "$ac_t""no" 1>&6
8507 ol_cv_lib_ndbm=no
8508 fi
8509                 
8510 fi
8511
8512         
8513 fi
8514
8515         LIBS="$ol_LIBS"
8516
8517 fi
8518
8519 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8520
8521
8522  for ac_hdr in ndbm.h
8523 do
8524 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8525 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8526 echo "configure:8527: checking for $ac_hdr" >&5
8527 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8528   echo $ac_n "(cached) $ac_c" 1>&6
8529 else
8530   cat > conftest.$ac_ext <<EOF
8531 #line 8532 "configure"
8532 #include "confdefs.h"
8533 #include <$ac_hdr>
8534 EOF
8535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8536 { (eval echo configure:8537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8538 if test -z "$ac_err"; then
8539   rm -rf conftest*
8540   eval "ac_cv_header_$ac_safe=yes"
8541 else
8542   echo "$ac_err" >&5
8543   echo "configure: failed program was:" >&5
8544   cat conftest.$ac_ext >&5
8545   rm -rf conftest*
8546   eval "ac_cv_header_$ac_safe=no"
8547 fi
8548 rm -f conftest*
8549 fi
8550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8551   echo "$ac_t""yes" 1>&6
8552     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8553   cat >> confdefs.h <<EOF
8554 #define $ac_tr_hdr 1
8555 EOF
8556  
8557 else
8558   echo "$ac_t""no" 1>&6
8559 fi
8560 done
8561
8562  echo $ac_n "checking for db""... $ac_c" 1>&6
8563 echo "configure:8564: checking for db" >&5
8564 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8565   echo $ac_n "(cached) $ac_c" 1>&6
8566 else
8567   
8568         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8569                 ol_cv_ndbm=no
8570         else
8571                 ol_cv_ndbm=yes
8572         fi
8573
8574 fi
8575
8576 echo "$ac_t""$ol_cv_ndbm" 1>&6
8577  if test $ol_cv_ndbm = yes ; then
8578         cat >> confdefs.h <<\EOF
8579 #define HAVE_NDBM 1
8580 EOF
8581
8582  fi
8583
8584
8585         if test $ol_cv_ndbm = yes ; then
8586                 ol_link_ldbm=ndbm
8587                 ol_with_ldbm_api=ndbm
8588
8589                 if test $ol_cv_lib_ndbm != yes ; then
8590                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8591                 fi
8592         fi
8593 fi
8594
8595 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8596         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8597         if test $ol_enable_ldbm = yes ; then
8598                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8599         fi
8600
8601         echo "configure: warning: disabling LDBM" 1>&2
8602         ol_enable_ldbm=no
8603 fi
8604
8605 if test $ol_enable_wrappers != no ; then
8606         for ac_hdr in tcpd.h
8607 do
8608 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8609 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8610 echo "configure:8611: checking for $ac_hdr" >&5
8611 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8612   echo $ac_n "(cached) $ac_c" 1>&6
8613 else
8614   cat > conftest.$ac_ext <<EOF
8615 #line 8616 "configure"
8616 #include "confdefs.h"
8617 #include <$ac_hdr>
8618 EOF
8619 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8620 { (eval echo configure:8621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8621 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8622 if test -z "$ac_err"; then
8623   rm -rf conftest*
8624   eval "ac_cv_header_$ac_safe=yes"
8625 else
8626   echo "$ac_err" >&5
8627   echo "configure: failed program was:" >&5
8628   cat conftest.$ac_ext >&5
8629   rm -rf conftest*
8630   eval "ac_cv_header_$ac_safe=no"
8631 fi
8632 rm -f conftest*
8633 fi
8634 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8635   echo "$ac_t""yes" 1>&6
8636     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8637   cat >> confdefs.h <<EOF
8638 #define $ac_tr_hdr 1
8639 EOF
8640  
8641 else
8642   echo "$ac_t""no" 1>&6
8643 fi
8644 done
8645
8646
8647         if test $ac_cv_header_tcpd_h != yes ; then
8648                 have_wrappers=no
8649         else
8650                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8651 echo "configure:8652: checking for main in -lwrap" >&5
8652 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8653 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8654   echo $ac_n "(cached) $ac_c" 1>&6
8655 else
8656   ac_save_LIBS="$LIBS"
8657 LIBS="-lwrap  $LIBS"
8658 cat > conftest.$ac_ext <<EOF
8659 #line 8660 "configure"
8660 #include "confdefs.h"
8661
8662 int main() {
8663 main()
8664 ; return 0; }
8665 EOF
8666 if { (eval echo configure:8667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8667   rm -rf conftest*
8668   eval "ac_cv_lib_$ac_lib_var=yes"
8669 else
8670   echo "configure: failed program was:" >&5
8671   cat conftest.$ac_ext >&5
8672   rm -rf conftest*
8673   eval "ac_cv_lib_$ac_lib_var=no"
8674 fi
8675 rm -f conftest*
8676 LIBS="$ac_save_LIBS"
8677
8678 fi
8679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8680   echo "$ac_t""yes" 1>&6
8681   have_wrappers=yes
8682 else
8683   echo "$ac_t""no" 1>&6
8684 have_wrappers=no
8685 fi
8686
8687         fi
8688
8689         if test $have_wrappers = yes ; then
8690                 cat >> confdefs.h <<\EOF
8691 #define HAVE_TCPD 1
8692 EOF
8693
8694                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8695
8696                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8697 echo "configure:8698: checking for main in -lnsl" >&5
8698 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8699 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8700   echo $ac_n "(cached) $ac_c" 1>&6
8701 else
8702   ac_save_LIBS="$LIBS"
8703 LIBS="-lnsl  $LIBS"
8704 cat > conftest.$ac_ext <<EOF
8705 #line 8706 "configure"
8706 #include "confdefs.h"
8707
8708 int main() {
8709 main()
8710 ; return 0; }
8711 EOF
8712 if { (eval echo configure:8713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8713   rm -rf conftest*
8714   eval "ac_cv_lib_$ac_lib_var=yes"
8715 else
8716   echo "configure: failed program was:" >&5
8717   cat conftest.$ac_ext >&5
8718   rm -rf conftest*
8719   eval "ac_cv_lib_$ac_lib_var=no"
8720 fi
8721 rm -f conftest*
8722 LIBS="$ac_save_LIBS"
8723
8724 fi
8725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8726   echo "$ac_t""yes" 1>&6
8727     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8728     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8729   cat >> confdefs.h <<EOF
8730 #define $ac_tr_lib 1
8731 EOF
8732
8733   LIBS="-lnsl $LIBS"
8734
8735 else
8736   echo "$ac_t""no" 1>&6
8737 fi
8738
8739         else
8740                 echo "configure: warning: could not find -lwrap" 1>&2
8741                 if test $ol_enable_wrappers = yes ; then
8742                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8743                 fi
8744
8745                 echo "configure: warning: disabling wrappers support" 1>&2
8746                 ol_enable_wrappers=no
8747         fi
8748 fi
8749
8750 if test $ol_enable_syslog != no ; then
8751         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8752 echo "configure:8753: checking for openlog" >&5
8753 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8754   echo $ac_n "(cached) $ac_c" 1>&6
8755 else
8756   cat > conftest.$ac_ext <<EOF
8757 #line 8758 "configure"
8758 #include "confdefs.h"
8759 /* System header to define __stub macros and hopefully few prototypes,
8760     which can conflict with char openlog(); below.  */
8761 #include <assert.h>
8762 /* Override any gcc2 internal prototype to avoid an error.  */
8763 /* We use char because int might match the return type of a gcc2
8764     builtin and then its argument prototype would still apply.  */
8765 char openlog();
8766
8767 int main() {
8768
8769 /* The GNU C library defines this for functions which it implements
8770     to always fail with ENOSYS.  Some functions are actually named
8771     something starting with __ and the normal name is an alias.  */
8772 #if defined (__stub_openlog) || defined (__stub___openlog)
8773 choke me
8774 #else
8775 openlog();
8776 #endif
8777
8778 ; return 0; }
8779 EOF
8780 if { (eval echo configure:8781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8781   rm -rf conftest*
8782   eval "ac_cv_func_openlog=yes"
8783 else
8784   echo "configure: failed program was:" >&5
8785   cat conftest.$ac_ext >&5
8786   rm -rf conftest*
8787   eval "ac_cv_func_openlog=no"
8788 fi
8789 rm -f conftest*
8790 fi
8791
8792 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8793   echo "$ac_t""yes" 1>&6
8794   :
8795 else
8796   echo "$ac_t""no" 1>&6
8797 fi
8798
8799         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8800                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8801         fi
8802         ol_enable_syslog=$ac_cv_func_openlog
8803 fi
8804
8805 if test $ol_enable_dmalloc != no ; then
8806         for ac_hdr in dmalloc.h
8807 do
8808 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8809 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8810 echo "configure:8811: checking for $ac_hdr" >&5
8811 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8812   echo $ac_n "(cached) $ac_c" 1>&6
8813 else
8814   cat > conftest.$ac_ext <<EOF
8815 #line 8816 "configure"
8816 #include "confdefs.h"
8817 #include <$ac_hdr>
8818 EOF
8819 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8820 { (eval echo configure:8821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8821 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8822 if test -z "$ac_err"; then
8823   rm -rf conftest*
8824   eval "ac_cv_header_$ac_safe=yes"
8825 else
8826   echo "$ac_err" >&5
8827   echo "configure: failed program was:" >&5
8828   cat conftest.$ac_ext >&5
8829   rm -rf conftest*
8830   eval "ac_cv_header_$ac_safe=no"
8831 fi
8832 rm -f conftest*
8833 fi
8834 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8835   echo "$ac_t""yes" 1>&6
8836     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8837   cat >> confdefs.h <<EOF
8838 #define $ac_tr_hdr 1
8839 EOF
8840  
8841 else
8842   echo "$ac_t""no" 1>&6
8843 fi
8844 done
8845
8846         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8847 echo "configure:8848: checking for dmalloc_shutdown in -ldmalloc" >&5
8848 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8849 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8850   echo $ac_n "(cached) $ac_c" 1>&6
8851 else
8852   ac_save_LIBS="$LIBS"
8853 LIBS="-ldmalloc  $LIBS"
8854 cat > conftest.$ac_ext <<EOF
8855 #line 8856 "configure"
8856 #include "confdefs.h"
8857 /* Override any gcc2 internal prototype to avoid an error.  */
8858 /* We use char because int might match the return type of a gcc2
8859     builtin and then its argument prototype would still apply.  */
8860 char dmalloc_shutdown();
8861
8862 int main() {
8863 dmalloc_shutdown()
8864 ; return 0; }
8865 EOF
8866 if { (eval echo configure:8867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8867   rm -rf conftest*
8868   eval "ac_cv_lib_$ac_lib_var=yes"
8869 else
8870   echo "configure: failed program was:" >&5
8871   cat conftest.$ac_ext >&5
8872   rm -rf conftest*
8873   eval "ac_cv_lib_$ac_lib_var=no"
8874 fi
8875 rm -f conftest*
8876 LIBS="$ac_save_LIBS"
8877
8878 fi
8879 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8880   echo "$ac_t""yes" 1>&6
8881     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8882     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8883   cat >> confdefs.h <<EOF
8884 #define $ac_tr_lib 1
8885 EOF
8886
8887   LIBS="-ldmalloc $LIBS"
8888
8889 else
8890   echo "$ac_t""no" 1>&6
8891 fi
8892
8893 fi
8894
8895 if test $ol_enable_tcl != no ; then
8896         for ac_hdr in tcl.h
8897 do
8898 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8899 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8900 echo "configure:8901: checking for $ac_hdr" >&5
8901 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8902   echo $ac_n "(cached) $ac_c" 1>&6
8903 else
8904   cat > conftest.$ac_ext <<EOF
8905 #line 8906 "configure"
8906 #include "confdefs.h"
8907 #include <$ac_hdr>
8908 EOF
8909 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8910 { (eval echo configure:8911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8911 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8912 if test -z "$ac_err"; then
8913   rm -rf conftest*
8914   eval "ac_cv_header_$ac_safe=yes"
8915 else
8916   echo "$ac_err" >&5
8917   echo "configure: failed program was:" >&5
8918   cat conftest.$ac_ext >&5
8919   rm -rf conftest*
8920   eval "ac_cv_header_$ac_safe=no"
8921 fi
8922 rm -f conftest*
8923 fi
8924 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8925   echo "$ac_t""yes" 1>&6
8926     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8927   cat >> confdefs.h <<EOF
8928 #define $ac_tr_hdr 1
8929 EOF
8930  
8931 else
8932   echo "$ac_t""no" 1>&6
8933 fi
8934 done
8935
8936
8937         if test $ac_cv_header_tcl_h != yes ; then
8938                 have_tcl=no
8939         else
8940                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8941 echo "configure:8942: checking for main in -ltcl" >&5
8942 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8943 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8944   echo $ac_n "(cached) $ac_c" 1>&6
8945 else
8946   ac_save_LIBS="$LIBS"
8947 LIBS="-ltcl  $LIBS"
8948 cat > conftest.$ac_ext <<EOF
8949 #line 8950 "configure"
8950 #include "confdefs.h"
8951
8952 int main() {
8953 main()
8954 ; return 0; }
8955 EOF
8956 if { (eval echo configure:8957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8957   rm -rf conftest*
8958   eval "ac_cv_lib_$ac_lib_var=yes"
8959 else
8960   echo "configure: failed program was:" >&5
8961   cat conftest.$ac_ext >&5
8962   rm -rf conftest*
8963   eval "ac_cv_lib_$ac_lib_var=no"
8964 fi
8965 rm -f conftest*
8966 LIBS="$ac_save_LIBS"
8967
8968 fi
8969 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8970   echo "$ac_t""yes" 1>&6
8971   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8972 else
8973   echo "$ac_t""no" 1>&6
8974 have_tcl=no
8975 fi
8976
8977
8978                 if test $have_tcl != yes; then
8979                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8980 echo "configure:8981: checking for main in -ltcl7.6" >&5
8981 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8982 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8983   echo $ac_n "(cached) $ac_c" 1>&6
8984 else
8985   ac_save_LIBS="$LIBS"
8986 LIBS="-ltcl7.6  $LIBS"
8987 cat > conftest.$ac_ext <<EOF
8988 #line 8989 "configure"
8989 #include "confdefs.h"
8990
8991 int main() {
8992 main()
8993 ; return 0; }
8994 EOF
8995 if { (eval echo configure:8996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8996   rm -rf conftest*
8997   eval "ac_cv_lib_$ac_lib_var=yes"
8998 else
8999   echo "configure: failed program was:" >&5
9000   cat conftest.$ac_ext >&5
9001   rm -rf conftest*
9002   eval "ac_cv_lib_$ac_lib_var=no"
9003 fi
9004 rm -f conftest*
9005 LIBS="$ac_save_LIBS"
9006
9007 fi
9008 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9009   echo "$ac_t""yes" 1>&6
9010   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
9011 else
9012   echo "$ac_t""no" 1>&6
9013 have_tcl=no
9014 fi
9015
9016                 fi
9017
9018                 if test $have_tcl != yes; then
9019                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
9020 echo "configure:9021: checking for main in -ltcl8.0" >&5
9021 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
9022 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9023   echo $ac_n "(cached) $ac_c" 1>&6
9024 else
9025   ac_save_LIBS="$LIBS"
9026 LIBS="-ltcl8.0  $LIBS"
9027 cat > conftest.$ac_ext <<EOF
9028 #line 9029 "configure"
9029 #include "confdefs.h"
9030
9031 int main() {
9032 main()
9033 ; return 0; }
9034 EOF
9035 if { (eval echo configure:9036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9036   rm -rf conftest*
9037   eval "ac_cv_lib_$ac_lib_var=yes"
9038 else
9039   echo "configure: failed program was:" >&5
9040   cat conftest.$ac_ext >&5
9041   rm -rf conftest*
9042   eval "ac_cv_lib_$ac_lib_var=no"
9043 fi
9044 rm -f conftest*
9045 LIBS="$ac_save_LIBS"
9046
9047 fi
9048 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9049   echo "$ac_t""yes" 1>&6
9050   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
9051 else
9052   echo "$ac_t""no" 1>&6
9053 have_tcl=no
9054 fi
9055
9056                 fi
9057         fi
9058
9059         if test $have_tcl != yes ; then
9060                 echo "configure: warning: could not find -ltcl" 1>&2
9061                 if test $ol_enable_tcl = yes ; then
9062                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
9063                 fi
9064
9065                 ol_enable_tcl=no
9066         fi
9067 fi
9068
9069 # ud needs termcap (should insert check here)
9070 ol_link_termcap=no
9071 for ac_hdr in termcap.h ncurses.h
9072 do
9073 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9074 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9075 echo "configure:9076: checking for $ac_hdr" >&5
9076 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9077   echo $ac_n "(cached) $ac_c" 1>&6
9078 else
9079   cat > conftest.$ac_ext <<EOF
9080 #line 9081 "configure"
9081 #include "confdefs.h"
9082 #include <$ac_hdr>
9083 EOF
9084 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9085 { (eval echo configure:9086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9086 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9087 if test -z "$ac_err"; then
9088   rm -rf conftest*
9089   eval "ac_cv_header_$ac_safe=yes"
9090 else
9091   echo "$ac_err" >&5
9092   echo "configure: failed program was:" >&5
9093   cat conftest.$ac_ext >&5
9094   rm -rf conftest*
9095   eval "ac_cv_header_$ac_safe=no"
9096 fi
9097 rm -f conftest*
9098 fi
9099 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9100   echo "$ac_t""yes" 1>&6
9101     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9102   cat >> confdefs.h <<EOF
9103 #define $ac_tr_hdr 1
9104 EOF
9105  
9106 else
9107   echo "$ac_t""no" 1>&6
9108 fi
9109 done
9110
9111
9112 if test $ol_link_termcap = no ; then
9113         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
9114 echo "configure:9115: checking for tputs in -ltermcap" >&5
9115 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
9116 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9117   echo $ac_n "(cached) $ac_c" 1>&6
9118 else
9119   ac_save_LIBS="$LIBS"
9120 LIBS="-ltermcap  $LIBS"
9121 cat > conftest.$ac_ext <<EOF
9122 #line 9123 "configure"
9123 #include "confdefs.h"
9124 /* Override any gcc2 internal prototype to avoid an error.  */
9125 /* We use char because int might match the return type of a gcc2
9126     builtin and then its argument prototype would still apply.  */
9127 char tputs();
9128
9129 int main() {
9130 tputs()
9131 ; return 0; }
9132 EOF
9133 if { (eval echo configure:9134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9134   rm -rf conftest*
9135   eval "ac_cv_lib_$ac_lib_var=yes"
9136 else
9137   echo "configure: failed program was:" >&5
9138   cat conftest.$ac_ext >&5
9139   rm -rf conftest*
9140   eval "ac_cv_lib_$ac_lib_var=no"
9141 fi
9142 rm -f conftest*
9143 LIBS="$ac_save_LIBS"
9144
9145 fi
9146 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9147   echo "$ac_t""yes" 1>&6
9148   have_termcap=yes
9149 else
9150   echo "$ac_t""no" 1>&6
9151 have_termcap=no
9152 fi
9153
9154         if test $have_termcap = yes ; then
9155                 cat >> confdefs.h <<\EOF
9156 #define HAVE_TERMCAP 1
9157 EOF
9158
9159                 ol_link_termcap=yes
9160                 TERMCAP_LIBS=-ltermcap
9161         fi
9162 fi
9163
9164 if test $ol_link_termcap = no ; then
9165         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
9166 echo "configure:9167: checking for initscr in -lncurses" >&5
9167 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
9168 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9169   echo $ac_n "(cached) $ac_c" 1>&6
9170 else
9171   ac_save_LIBS="$LIBS"
9172 LIBS="-lncurses  $LIBS"
9173 cat > conftest.$ac_ext <<EOF
9174 #line 9175 "configure"
9175 #include "confdefs.h"
9176 /* Override any gcc2 internal prototype to avoid an error.  */
9177 /* We use char because int might match the return type of a gcc2
9178     builtin and then its argument prototype would still apply.  */
9179 char initscr();
9180
9181 int main() {
9182 initscr()
9183 ; return 0; }
9184 EOF
9185 if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9186   rm -rf conftest*
9187   eval "ac_cv_lib_$ac_lib_var=yes"
9188 else
9189   echo "configure: failed program was:" >&5
9190   cat conftest.$ac_ext >&5
9191   rm -rf conftest*
9192   eval "ac_cv_lib_$ac_lib_var=no"
9193 fi
9194 rm -f conftest*
9195 LIBS="$ac_save_LIBS"
9196
9197 fi
9198 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9199   echo "$ac_t""yes" 1>&6
9200   have_ncurses=yes
9201 else
9202   echo "$ac_t""no" 1>&6
9203 have_ncurses=no
9204 fi
9205
9206         if test $have_ncurses = yes ; then
9207                 cat >> confdefs.h <<\EOF
9208 #define HAVE_NCURSES 1
9209 EOF
9210
9211                 ol_link_termcap=yes
9212                 TERMCAP_LIBS=-lncurses
9213         fi
9214 fi
9215
9216 if test $ol_link_termcap = no ; then
9217         cat >> confdefs.h <<\EOF
9218 #define NO_TERMCAP 1
9219 EOF
9220
9221         TERMCAP_LIBS=
9222 fi
9223
9224 ol_link_readline=no
9225 if test $ol_with_readline != no ; then
9226         for ac_hdr in readline/readline.h readline/history.h
9227 do
9228 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9229 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9230 echo "configure:9231: checking for $ac_hdr" >&5
9231 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9232   echo $ac_n "(cached) $ac_c" 1>&6
9233 else
9234   cat > conftest.$ac_ext <<EOF
9235 #line 9236 "configure"
9236 #include "confdefs.h"
9237 #include <$ac_hdr>
9238 EOF
9239 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9240 { (eval echo configure:9241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9241 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9242 if test -z "$ac_err"; then
9243   rm -rf conftest*
9244   eval "ac_cv_header_$ac_safe=yes"
9245 else
9246   echo "$ac_err" >&5
9247   echo "configure: failed program was:" >&5
9248   cat conftest.$ac_ext >&5
9249   rm -rf conftest*
9250   eval "ac_cv_header_$ac_safe=no"
9251 fi
9252 rm -f conftest*
9253 fi
9254 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9255   echo "$ac_t""yes" 1>&6
9256     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9257   cat >> confdefs.h <<EOF
9258 #define $ac_tr_hdr 1
9259 EOF
9260  
9261 else
9262   echo "$ac_t""no" 1>&6
9263 fi
9264 done
9265
9266
9267         if test $ac_cv_header_readline_readline_h = yes ; then
9268                 save_LIBS="$LIBS"
9269                 LIBS="$TERMCAP_LIBS $LIBS"
9270                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
9271 echo "configure:9272: checking for readline in -lreadline" >&5
9272 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
9273 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9274   echo $ac_n "(cached) $ac_c" 1>&6
9275 else
9276   ac_save_LIBS="$LIBS"
9277 LIBS="-lreadline  $LIBS"
9278 cat > conftest.$ac_ext <<EOF
9279 #line 9280 "configure"
9280 #include "confdefs.h"
9281 /* Override any gcc2 internal prototype to avoid an error.  */
9282 /* We use char because int might match the return type of a gcc2
9283     builtin and then its argument prototype would still apply.  */
9284 char readline();
9285
9286 int main() {
9287 readline()
9288 ; return 0; }
9289 EOF
9290 if { (eval echo configure:9291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9291   rm -rf conftest*
9292   eval "ac_cv_lib_$ac_lib_var=yes"
9293 else
9294   echo "configure: failed program was:" >&5
9295   cat conftest.$ac_ext >&5
9296   rm -rf conftest*
9297   eval "ac_cv_lib_$ac_lib_var=no"
9298 fi
9299 rm -f conftest*
9300 LIBS="$ac_save_LIBS"
9301
9302 fi
9303 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9304   echo "$ac_t""yes" 1>&6
9305   have_readline=yes
9306 else
9307   echo "$ac_t""no" 1>&6
9308 have_readline=no
9309 fi
9310
9311                 LIBS="$save_LIBS"
9312                         
9313                 if test $have_readline = yes ; then
9314                         ol_with_readline=found
9315                         ol_link_readline=yes
9316
9317                         READLINE_LIBS="-lreadline"
9318                 fi
9319         fi
9320 fi
9321
9322 if test $ol_link_readline = yes ; then
9323         cat >> confdefs.h <<\EOF
9324 #define HAVE_READLINE 1
9325 EOF
9326
9327 fi
9328
9329
9330 # FreeBSD (and others) have crypt(3) in -lcrypt
9331 if test $ol_enable_crypt != no ; then
9332         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9333 echo "configure:9334: checking for crypt" >&5
9334 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9335   echo $ac_n "(cached) $ac_c" 1>&6
9336 else
9337   cat > conftest.$ac_ext <<EOF
9338 #line 9339 "configure"
9339 #include "confdefs.h"
9340 /* System header to define __stub macros and hopefully few prototypes,
9341     which can conflict with char crypt(); below.  */
9342 #include <assert.h>
9343 /* Override any gcc2 internal prototype to avoid an error.  */
9344 /* We use char because int might match the return type of a gcc2
9345     builtin and then its argument prototype would still apply.  */
9346 char crypt();
9347
9348 int main() {
9349
9350 /* The GNU C library defines this for functions which it implements
9351     to always fail with ENOSYS.  Some functions are actually named
9352     something starting with __ and the normal name is an alias.  */
9353 #if defined (__stub_crypt) || defined (__stub___crypt)
9354 choke me
9355 #else
9356 crypt();
9357 #endif
9358
9359 ; return 0; }
9360 EOF
9361 if { (eval echo configure:9362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9362   rm -rf conftest*
9363   eval "ac_cv_func_crypt=yes"
9364 else
9365   echo "configure: failed program was:" >&5
9366   cat conftest.$ac_ext >&5
9367   rm -rf conftest*
9368   eval "ac_cv_func_crypt=no"
9369 fi
9370 rm -f conftest*
9371 fi
9372
9373 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9374   echo "$ac_t""yes" 1>&6
9375   have_crypt=yes
9376 else
9377   echo "$ac_t""no" 1>&6
9378
9379                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9380 echo "configure:9381: checking for crypt in -lcrypt" >&5
9381 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9382 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9383   echo $ac_n "(cached) $ac_c" 1>&6
9384 else
9385   ac_save_LIBS="$LIBS"
9386 LIBS="-lcrypt  $LIBS"
9387 cat > conftest.$ac_ext <<EOF
9388 #line 9389 "configure"
9389 #include "confdefs.h"
9390 /* Override any gcc2 internal prototype to avoid an error.  */
9391 /* We use char because int might match the return type of a gcc2
9392     builtin and then its argument prototype would still apply.  */
9393 char crypt();
9394
9395 int main() {
9396 crypt()
9397 ; return 0; }
9398 EOF
9399 if { (eval echo configure:9400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9400   rm -rf conftest*
9401   eval "ac_cv_lib_$ac_lib_var=yes"
9402 else
9403   echo "configure: failed program was:" >&5
9404   cat conftest.$ac_ext >&5
9405   rm -rf conftest*
9406   eval "ac_cv_lib_$ac_lib_var=no"
9407 fi
9408 rm -f conftest*
9409 LIBS="$ac_save_LIBS"
9410
9411 fi
9412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9413   echo "$ac_t""yes" 1>&6
9414   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9415                         have_crypt=yes
9416 else
9417   echo "$ac_t""no" 1>&6
9418 have_crypt=no
9419 fi
9420
9421 fi
9422
9423
9424         if test $have_crypt = yes ; then
9425                 cat >> confdefs.h <<\EOF
9426 #define HAVE_CRYPT 1
9427 EOF
9428
9429         else
9430                 echo "configure: warning: could not find crypt" 1>&2
9431                 if test $ol_enable_crypt = yes ; then
9432                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9433                 fi
9434
9435                 echo "configure: warning: disabling crypt support" 1>&2
9436                 ol_enable_crypt=no
9437         fi
9438 fi
9439
9440 # FreeBSD (and others) have setproctitle(3) in -lutil
9441 if test $ol_enable_proctitle != no ; then
9442         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9443 echo "configure:9444: checking for setproctitle" >&5
9444 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9445   echo $ac_n "(cached) $ac_c" 1>&6
9446 else
9447   cat > conftest.$ac_ext <<EOF
9448 #line 9449 "configure"
9449 #include "confdefs.h"
9450 /* System header to define __stub macros and hopefully few prototypes,
9451     which can conflict with char setproctitle(); below.  */
9452 #include <assert.h>
9453 /* Override any gcc2 internal prototype to avoid an error.  */
9454 /* We use char because int might match the return type of a gcc2
9455     builtin and then its argument prototype would still apply.  */
9456 char setproctitle();
9457
9458 int main() {
9459
9460 /* The GNU C library defines this for functions which it implements
9461     to always fail with ENOSYS.  Some functions are actually named
9462     something starting with __ and the normal name is an alias.  */
9463 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9464 choke me
9465 #else
9466 setproctitle();
9467 #endif
9468
9469 ; return 0; }
9470 EOF
9471 if { (eval echo configure:9472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9472   rm -rf conftest*
9473   eval "ac_cv_func_setproctitle=yes"
9474 else
9475   echo "configure: failed program was:" >&5
9476   cat conftest.$ac_ext >&5
9477   rm -rf conftest*
9478   eval "ac_cv_func_setproctitle=no"
9479 fi
9480 rm -f conftest*
9481 fi
9482
9483 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9484   echo "$ac_t""yes" 1>&6
9485   have_setproctitle=yes
9486 else
9487   echo "$ac_t""no" 1>&6
9488
9489                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9490 echo "configure:9491: checking for setproctitle in -lutil" >&5
9491 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9492 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9493   echo $ac_n "(cached) $ac_c" 1>&6
9494 else
9495   ac_save_LIBS="$LIBS"
9496 LIBS="-lutil  $LIBS"
9497 cat > conftest.$ac_ext <<EOF
9498 #line 9499 "configure"
9499 #include "confdefs.h"
9500 /* Override any gcc2 internal prototype to avoid an error.  */
9501 /* We use char because int might match the return type of a gcc2
9502     builtin and then its argument prototype would still apply.  */
9503 char setproctitle();
9504
9505 int main() {
9506 setproctitle()
9507 ; return 0; }
9508 EOF
9509 if { (eval echo configure:9510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9510   rm -rf conftest*
9511   eval "ac_cv_lib_$ac_lib_var=yes"
9512 else
9513   echo "configure: failed program was:" >&5
9514   cat conftest.$ac_ext >&5
9515   rm -rf conftest*
9516   eval "ac_cv_lib_$ac_lib_var=no"
9517 fi
9518 rm -f conftest*
9519 LIBS="$ac_save_LIBS"
9520
9521 fi
9522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9523   echo "$ac_t""yes" 1>&6
9524   have_setproctitle=yes
9525                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9526 else
9527   echo "$ac_t""no" 1>&6
9528 have_setproctitle=no
9529                         LIBOBJS="$LIBOBJS setproctitle.o"
9530 fi
9531
9532 fi
9533
9534
9535         if test $have_setproctitle = yes ; then
9536                 cat >> confdefs.h <<\EOF
9537 #define HAVE_SETPROCTITLE 1
9538 EOF
9539
9540         fi
9541 fi
9542
9543 # test for EBCDIC
9544 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9545 echo "configure:9546: checking for EBCDIC" >&5
9546 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9547   echo $ac_n "(cached) $ac_c" 1>&6
9548 else
9549   
9550         cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553
9554 #if !('M' == 0xd4)
9555 #include <__ASCII__/generate_error.h>
9556 #endif
9557
9558 EOF
9559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9560 { (eval echo configure:9561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9562 if test -z "$ac_err"; then
9563   rm -rf conftest*
9564   ol_cv_cpp_ebcdic=yes
9565 else
9566   echo "$ac_err" >&5
9567   echo "configure: failed program was:" >&5
9568   cat conftest.$ac_ext >&5
9569   rm -rf conftest*
9570   ol_cv_cpp_ebcdic=no
9571 fi
9572 rm -f conftest*
9573 fi
9574
9575 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9576 if test $ol_cv_cpp_ebcdic = yes ; then
9577         cat >> confdefs.h <<\EOF
9578 #define HAVE_EBCDIC 1
9579 EOF
9580
9581 fi
9582
9583 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9584 echo "configure:9585: checking for ANSI C header files" >&5
9585 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9586   echo $ac_n "(cached) $ac_c" 1>&6
9587 else
9588   cat > conftest.$ac_ext <<EOF
9589 #line 9590 "configure"
9590 #include "confdefs.h"
9591 #include <stdlib.h>
9592 #include <stdarg.h>
9593 #include <string.h>
9594 #include <float.h>
9595 EOF
9596 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9597 { (eval echo configure:9598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9598 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9599 if test -z "$ac_err"; then
9600   rm -rf conftest*
9601   ol_cv_header_stdc=yes
9602 else
9603   echo "$ac_err" >&5
9604   echo "configure: failed program was:" >&5
9605   cat conftest.$ac_ext >&5
9606   rm -rf conftest*
9607   ol_cv_header_stdc=no
9608 fi
9609 rm -f conftest*
9610
9611 if test $ol_cv_header_stdc = yes; then
9612   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9613 cat > conftest.$ac_ext <<EOF
9614 #line 9615 "configure"
9615 #include "confdefs.h"
9616 #include <string.h>
9617 EOF
9618 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9619   egrep "memchr" >/dev/null 2>&1; then
9620   :
9621 else
9622   rm -rf conftest*
9623   ol_cv_header_stdc=no
9624 fi
9625 rm -f conftest*
9626
9627 fi
9628
9629 if test $ol_cv_header_stdc = yes; then
9630   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9631 cat > conftest.$ac_ext <<EOF
9632 #line 9633 "configure"
9633 #include "confdefs.h"
9634 #include <stdlib.h>
9635 EOF
9636 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9637   egrep "free" >/dev/null 2>&1; then
9638   :
9639 else
9640   rm -rf conftest*
9641   ol_cv_header_stdc=no
9642 fi
9643 rm -f conftest*
9644
9645 fi
9646
9647 if test $ol_cv_header_stdc = yes; then
9648   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9649 if test "$cross_compiling" = yes; then
9650   :
9651 else
9652   cat > conftest.$ac_ext <<EOF
9653 #line 9654 "configure"
9654 #include "confdefs.h"
9655 #include <ctype.h>
9656 #ifndef HAVE_EBCDIC
9657 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9658 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9659 #else
9660 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9661                 || ('j' <= (c) && (c) <= 'r') \
9662                 || ('s' <= (c) && (c) <= 'z'))
9663 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9664 #endif
9665 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9666 int main () { int i; for (i = 0; i < 256; i++)
9667 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9668 exit (0); }
9669
9670 EOF
9671 if { (eval echo configure:9672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9672 then
9673   :
9674 else
9675   echo "configure: failed program was:" >&5
9676   cat conftest.$ac_ext >&5
9677   rm -fr conftest*
9678   ol_cv_header_stdc=no
9679 fi
9680 rm -fr conftest*
9681 fi
9682
9683 fi
9684 fi
9685
9686 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9687 if test $ol_cv_header_stdc = yes; then
9688   cat >> confdefs.h <<\EOF
9689 #define STDC_HEADERS 1
9690 EOF
9691
9692 fi
9693 ac_cv_header_stdc=disable
9694
9695
9696 if test $ol_cv_header_stdc != yes; then
9697         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9698 fi
9699
9700 ac_header_dirent=no
9701 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9702 do
9703 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9704 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9705 echo "configure:9706: checking for $ac_hdr that defines DIR" >&5
9706 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9707   echo $ac_n "(cached) $ac_c" 1>&6
9708 else
9709   cat > conftest.$ac_ext <<EOF
9710 #line 9711 "configure"
9711 #include "confdefs.h"
9712 #include <sys/types.h>
9713 #include <$ac_hdr>
9714 int main() {
9715 DIR *dirp = 0;
9716 ; return 0; }
9717 EOF
9718 if { (eval echo configure:9719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9719   rm -rf conftest*
9720   eval "ac_cv_header_dirent_$ac_safe=yes"
9721 else
9722   echo "configure: failed program was:" >&5
9723   cat conftest.$ac_ext >&5
9724   rm -rf conftest*
9725   eval "ac_cv_header_dirent_$ac_safe=no"
9726 fi
9727 rm -f conftest*
9728 fi
9729 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9730   echo "$ac_t""yes" 1>&6
9731     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9732   cat >> confdefs.h <<EOF
9733 #define $ac_tr_hdr 1
9734 EOF
9735  ac_header_dirent=$ac_hdr; break
9736 else
9737   echo "$ac_t""no" 1>&6
9738 fi
9739 done
9740 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9741 if test $ac_header_dirent = dirent.h; then
9742 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9743 echo "configure:9744: checking for opendir in -ldir" >&5
9744 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9745 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9746   echo $ac_n "(cached) $ac_c" 1>&6
9747 else
9748   ac_save_LIBS="$LIBS"
9749 LIBS="-ldir  $LIBS"
9750 cat > conftest.$ac_ext <<EOF
9751 #line 9752 "configure"
9752 #include "confdefs.h"
9753 /* Override any gcc2 internal prototype to avoid an error.  */
9754 /* We use char because int might match the return type of a gcc2
9755     builtin and then its argument prototype would still apply.  */
9756 char opendir();
9757
9758 int main() {
9759 opendir()
9760 ; return 0; }
9761 EOF
9762 if { (eval echo configure:9763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9763   rm -rf conftest*
9764   eval "ac_cv_lib_$ac_lib_var=yes"
9765 else
9766   echo "configure: failed program was:" >&5
9767   cat conftest.$ac_ext >&5
9768   rm -rf conftest*
9769   eval "ac_cv_lib_$ac_lib_var=no"
9770 fi
9771 rm -f conftest*
9772 LIBS="$ac_save_LIBS"
9773
9774 fi
9775 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9776   echo "$ac_t""yes" 1>&6
9777   LIBS="$LIBS -ldir"
9778 else
9779   echo "$ac_t""no" 1>&6
9780 fi
9781
9782 else
9783 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9784 echo "configure:9785: checking for opendir in -lx" >&5
9785 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9786 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9787   echo $ac_n "(cached) $ac_c" 1>&6
9788 else
9789   ac_save_LIBS="$LIBS"
9790 LIBS="-lx  $LIBS"
9791 cat > conftest.$ac_ext <<EOF
9792 #line 9793 "configure"
9793 #include "confdefs.h"
9794 /* Override any gcc2 internal prototype to avoid an error.  */
9795 /* We use char because int might match the return type of a gcc2
9796     builtin and then its argument prototype would still apply.  */
9797 char opendir();
9798
9799 int main() {
9800 opendir()
9801 ; return 0; }
9802 EOF
9803 if { (eval echo configure:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9804   rm -rf conftest*
9805   eval "ac_cv_lib_$ac_lib_var=yes"
9806 else
9807   echo "configure: failed program was:" >&5
9808   cat conftest.$ac_ext >&5
9809   rm -rf conftest*
9810   eval "ac_cv_lib_$ac_lib_var=no"
9811 fi
9812 rm -f conftest*
9813 LIBS="$ac_save_LIBS"
9814
9815 fi
9816 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9817   echo "$ac_t""yes" 1>&6
9818   LIBS="$LIBS -lx"
9819 else
9820   echo "$ac_t""no" 1>&6
9821 fi
9822
9823 fi
9824
9825 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9826 echo "configure:9827: checking for sys/wait.h that is POSIX.1 compatible" >&5
9827 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9828   echo $ac_n "(cached) $ac_c" 1>&6
9829 else
9830   cat > conftest.$ac_ext <<EOF
9831 #line 9832 "configure"
9832 #include "confdefs.h"
9833 #include <sys/types.h>
9834 #include <sys/wait.h>
9835 #ifndef WEXITSTATUS
9836 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9837 #endif
9838 #ifndef WIFEXITED
9839 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9840 #endif
9841 int main() {
9842 int s;
9843 wait (&s);
9844 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9845 ; return 0; }
9846 EOF
9847 if { (eval echo configure:9848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9848   rm -rf conftest*
9849   ac_cv_header_sys_wait_h=yes
9850 else
9851   echo "configure: failed program was:" >&5
9852   cat conftest.$ac_ext >&5
9853   rm -rf conftest*
9854   ac_cv_header_sys_wait_h=no
9855 fi
9856 rm -f conftest*
9857 fi
9858
9859 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9860 if test $ac_cv_header_sys_wait_h = yes; then
9861   cat >> confdefs.h <<\EOF
9862 #define HAVE_SYS_WAIT_H 1
9863 EOF
9864
9865 fi
9866
9867 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9868 echo "configure:9869: checking POSIX termios" >&5
9869 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9870   echo $ac_n "(cached) $ac_c" 1>&6
9871 else
9872   cat > conftest.$ac_ext <<EOF
9873 #line 9874 "configure"
9874 #include "confdefs.h"
9875 #include <sys/types.h>
9876 #include <unistd.h>
9877 #include <termios.h>
9878 int main() {
9879 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9880    tcgetattr(0, 0);
9881 ; return 0; }
9882 EOF
9883 if { (eval echo configure:9884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9884   rm -rf conftest*
9885   am_cv_sys_posix_termios=yes
9886 else
9887   echo "configure: failed program was:" >&5
9888   cat conftest.$ac_ext >&5
9889   rm -rf conftest*
9890   am_cv_sys_posix_termios=no
9891 fi
9892 rm -f conftest*
9893 fi
9894
9895 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9896
9897
9898  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9899 echo "configure:9900: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9900 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9901   echo $ac_n "(cached) $ac_c" 1>&6
9902 else
9903   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9904
9905   gwinsz_in_termios_h=no
9906   if test $am_cv_sys_posix_termios = yes; then
9907     cat > conftest.$ac_ext <<EOF
9908 #line 9909 "configure"
9909 #include "confdefs.h"
9910 #include <sys/types.h>
9911 #     include <termios.h>
9912 #     ifdef TIOCGWINSZ
9913         yes
9914 #     endif
9915     
9916 EOF
9917 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9918   egrep "yes" >/dev/null 2>&1; then
9919   rm -rf conftest*
9920   gwinsz_in_termios_h=yes
9921 fi
9922 rm -f conftest*
9923
9924   fi
9925
9926   if test $gwinsz_in_termios_h = no; then
9927     cat > conftest.$ac_ext <<EOF
9928 #line 9929 "configure"
9929 #include "confdefs.h"
9930 #include <sys/types.h>
9931 #     include <sys/ioctl.h>
9932 #     ifdef TIOCGWINSZ
9933         yes
9934 #     endif
9935     
9936 EOF
9937 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9938   egrep "yes" >/dev/null 2>&1; then
9939   rm -rf conftest*
9940   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9941 fi
9942 rm -f conftest*
9943
9944   fi
9945   
9946 fi
9947
9948 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9949   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9950     cat >> confdefs.h <<\EOF
9951 #define GWINSZ_IN_SYS_IOCTL 1
9952 EOF
9953
9954   fi
9955
9956 if test $am_cv_sys_posix_termios = yes ; then
9957         cat >> confdefs.h <<\EOF
9958 #define HAVE_POSIX_TERMIOS 1
9959 EOF
9960
9961 fi
9962
9963 for ac_hdr in \
9964         arpa/inet.h             \
9965         arpa/nameser.h  \
9966         assert.h                \
9967         crypt.h                 \
9968         errno.h                 \
9969         fcntl.h                 \
9970         filio.h                 \
9971         getopt.h                \
9972         grp.h                   \
9973         libutil.h               \
9974         limits.h                \
9975         locale.h                \
9976         malloc.h                \
9977         memory.h                \
9978         psap.h                  \
9979         pwd.h                   \
9980         resolv.h                \
9981         sgtty.h                 \
9982         stdarg.h                \
9983         stddef.h                \
9984         string.h                \
9985         strings.h               \
9986         sysexits.h              \
9987         sys/file.h              \
9988         sys/filio.h             \
9989         sys/errno.h             \
9990         sys/ioctl.h             \
9991         sys/param.h             \
9992         sys/resource.h  \
9993         sys/select.h    \
9994         sys/socket.h    \
9995         sys/syslog.h    \
9996         sys/time.h              \
9997         sys/types.h             \
9998         syslog.h                \
9999         termios.h               \
10000         unistd.h                \
10001
10002 do
10003 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10004 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10005 echo "configure:10006: checking for $ac_hdr" >&5
10006 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10007   echo $ac_n "(cached) $ac_c" 1>&6
10008 else
10009   cat > conftest.$ac_ext <<EOF
10010 #line 10011 "configure"
10011 #include "confdefs.h"
10012 #include <$ac_hdr>
10013 EOF
10014 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10015 { (eval echo configure:10016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10016 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10017 if test -z "$ac_err"; then
10018   rm -rf conftest*
10019   eval "ac_cv_header_$ac_safe=yes"
10020 else
10021   echo "$ac_err" >&5
10022   echo "configure: failed program was:" >&5
10023   cat conftest.$ac_ext >&5
10024   rm -rf conftest*
10025   eval "ac_cv_header_$ac_safe=no"
10026 fi
10027 rm -f conftest*
10028 fi
10029 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10030   echo "$ac_t""yes" 1>&6
10031     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10032   cat >> confdefs.h <<EOF
10033 #define $ac_tr_hdr 1
10034 EOF
10035  
10036 else
10037   echo "$ac_t""no" 1>&6
10038 fi
10039 done
10040
10041
10042 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
10043 echo "configure:10044: checking for uid_t in sys/types.h" >&5
10044 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
10045   echo $ac_n "(cached) $ac_c" 1>&6
10046 else
10047   cat > conftest.$ac_ext <<EOF
10048 #line 10049 "configure"
10049 #include "confdefs.h"
10050 #include <sys/types.h>
10051 EOF
10052 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10053   egrep "uid_t" >/dev/null 2>&1; then
10054   rm -rf conftest*
10055   ac_cv_type_uid_t=yes
10056 else
10057   rm -rf conftest*
10058   ac_cv_type_uid_t=no
10059 fi
10060 rm -f conftest*
10061
10062 fi
10063
10064 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10065 if test $ac_cv_type_uid_t = no; then
10066   cat >> confdefs.h <<\EOF
10067 #define uid_t int
10068 EOF
10069
10070   cat >> confdefs.h <<\EOF
10071 #define gid_t int
10072 EOF
10073
10074 fi
10075
10076 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10077 echo "configure:10078: checking type of array argument to getgroups" >&5
10078 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
10079   echo $ac_n "(cached) $ac_c" 1>&6
10080 else
10081   if test "$cross_compiling" = yes; then
10082   ac_cv_type_getgroups=cross
10083 else
10084   cat > conftest.$ac_ext <<EOF
10085 #line 10086 "configure"
10086 #include "confdefs.h"
10087
10088 /* Thanks to Mike Rendell for this test.  */
10089 #include <sys/types.h>
10090 #define NGID 256
10091 #undef MAX
10092 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10093 main()
10094 {
10095   gid_t gidset[NGID];
10096   int i, n;
10097   union { gid_t gval; long lval; }  val;
10098
10099   val.lval = -1;
10100   for (i = 0; i < NGID; i++)
10101     gidset[i] = val.gval;
10102   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10103                  gidset);
10104   /* Exit non-zero if getgroups seems to require an array of ints.  This
10105      happens when gid_t is short but getgroups modifies an array of ints.  */
10106   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10107 }
10108
10109 EOF
10110 if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10111 then
10112     ac_cv_type_getgroups=gid_t
10113 else
10114   echo "configure: failed program was:" >&5
10115   cat conftest.$ac_ext >&5
10116   rm -fr conftest*
10117   ac_cv_type_getgroups=int
10118 fi
10119 rm -fr conftest*
10120 fi
10121
10122 if test $ac_cv_type_getgroups = cross; then
10123         cat > conftest.$ac_ext <<EOF
10124 #line 10125 "configure"
10125 #include "confdefs.h"
10126 #include <unistd.h>
10127 EOF
10128 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10129   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10130   rm -rf conftest*
10131   ac_cv_type_getgroups=gid_t
10132 else
10133   rm -rf conftest*
10134   ac_cv_type_getgroups=int
10135 fi
10136 rm -f conftest*
10137
10138 fi
10139 fi
10140
10141 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10142 cat >> confdefs.h <<EOF
10143 #define GETGROUPS_T $ac_cv_type_getgroups
10144 EOF
10145
10146  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10147 echo "configure:10148: checking for ANSI C header files" >&5
10148 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
10149   echo $ac_n "(cached) $ac_c" 1>&6
10150 else
10151   cat > conftest.$ac_ext <<EOF
10152 #line 10153 "configure"
10153 #include "confdefs.h"
10154 #include <stdlib.h>
10155 #include <stdarg.h>
10156 #include <string.h>
10157 #include <float.h>
10158 EOF
10159 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10160 { (eval echo configure:10161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10161 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10162 if test -z "$ac_err"; then
10163   rm -rf conftest*
10164   ac_cv_header_stdc=yes
10165 else
10166   echo "$ac_err" >&5
10167   echo "configure: failed program was:" >&5
10168   cat conftest.$ac_ext >&5
10169   rm -rf conftest*
10170   ac_cv_header_stdc=no
10171 fi
10172 rm -f conftest*
10173
10174 if test $ac_cv_header_stdc = yes; then
10175   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10176 cat > conftest.$ac_ext <<EOF
10177 #line 10178 "configure"
10178 #include "confdefs.h"
10179 #include <string.h>
10180 EOF
10181 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10182   egrep "memchr" >/dev/null 2>&1; then
10183   :
10184 else
10185   rm -rf conftest*
10186   ac_cv_header_stdc=no
10187 fi
10188 rm -f conftest*
10189
10190 fi
10191
10192 if test $ac_cv_header_stdc = yes; then
10193   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10194 cat > conftest.$ac_ext <<EOF
10195 #line 10196 "configure"
10196 #include "confdefs.h"
10197 #include <stdlib.h>
10198 EOF
10199 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10200   egrep "free" >/dev/null 2>&1; then
10201   :
10202 else
10203   rm -rf conftest*
10204   ac_cv_header_stdc=no
10205 fi
10206 rm -f conftest*
10207
10208 fi
10209
10210 if test $ac_cv_header_stdc = yes; then
10211   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10212 if test "$cross_compiling" = yes; then
10213   :
10214 else
10215   cat > conftest.$ac_ext <<EOF
10216 #line 10217 "configure"
10217 #include "confdefs.h"
10218 #include <ctype.h>
10219 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10220 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10221 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10222 int main () { int i; for (i = 0; i < 256; i++)
10223 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10224 exit (0); }
10225
10226 EOF
10227 if { (eval echo configure:10228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10228 then
10229   :
10230 else
10231   echo "configure: failed program was:" >&5
10232   cat conftest.$ac_ext >&5
10233   rm -fr conftest*
10234   ac_cv_header_stdc=no
10235 fi
10236 rm -fr conftest*
10237 fi
10238
10239 fi
10240 fi
10241
10242 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10243 if test $ac_cv_header_stdc = yes; then
10244   cat >> confdefs.h <<\EOF
10245 #define STDC_HEADERS 1
10246 EOF
10247
10248 fi
10249
10250 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10251 echo "configure:10252: checking for mode_t" >&5
10252 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
10253   echo $ac_n "(cached) $ac_c" 1>&6
10254 else
10255   cat > conftest.$ac_ext <<EOF
10256 #line 10257 "configure"
10257 #include "confdefs.h"
10258 #include <sys/types.h>
10259 #if STDC_HEADERS
10260 #include <stdlib.h>
10261 #include <stddef.h>
10262 #endif
10263 EOF
10264 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10265   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10266   rm -rf conftest*
10267   ac_cv_type_mode_t=yes
10268 else
10269   rm -rf conftest*
10270   ac_cv_type_mode_t=no
10271 fi
10272 rm -f conftest*
10273
10274 fi
10275 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
10276 if test $ac_cv_type_mode_t = no; then
10277   cat >> confdefs.h <<\EOF
10278 #define mode_t int
10279 EOF
10280
10281 fi
10282
10283 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10284 echo "configure:10285: checking for off_t" >&5
10285 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10286   echo $ac_n "(cached) $ac_c" 1>&6
10287 else
10288   cat > conftest.$ac_ext <<EOF
10289 #line 10290 "configure"
10290 #include "confdefs.h"
10291 #include <sys/types.h>
10292 #if STDC_HEADERS
10293 #include <stdlib.h>
10294 #include <stddef.h>
10295 #endif
10296 EOF
10297 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10298   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10299   rm -rf conftest*
10300   ac_cv_type_off_t=yes
10301 else
10302   rm -rf conftest*
10303   ac_cv_type_off_t=no
10304 fi
10305 rm -f conftest*
10306
10307 fi
10308 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10309 if test $ac_cv_type_off_t = no; then
10310   cat >> confdefs.h <<\EOF
10311 #define off_t long
10312 EOF
10313
10314 fi
10315
10316 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10317 echo "configure:10318: checking for pid_t" >&5
10318 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10319   echo $ac_n "(cached) $ac_c" 1>&6
10320 else
10321   cat > conftest.$ac_ext <<EOF
10322 #line 10323 "configure"
10323 #include "confdefs.h"
10324 #include <sys/types.h>
10325 #if STDC_HEADERS
10326 #include <stdlib.h>
10327 #include <stddef.h>
10328 #endif
10329 EOF
10330 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10331   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10332   rm -rf conftest*
10333   ac_cv_type_pid_t=yes
10334 else
10335   rm -rf conftest*
10336   ac_cv_type_pid_t=no
10337 fi
10338 rm -f conftest*
10339
10340 fi
10341 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10342 if test $ac_cv_type_pid_t = no; then
10343   cat >> confdefs.h <<\EOF
10344 #define pid_t int
10345 EOF
10346
10347 fi
10348
10349 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10350 echo "configure:10351: checking for ptrdiff_t" >&5
10351 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10352   echo $ac_n "(cached) $ac_c" 1>&6
10353 else
10354   cat > conftest.$ac_ext <<EOF
10355 #line 10356 "configure"
10356 #include "confdefs.h"
10357 #include <stddef.h>
10358 int main() {
10359 ptrdiff_t p
10360 ; return 0; }
10361 EOF
10362 if { (eval echo configure:10363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10363   rm -rf conftest*
10364   am_cv_type_ptrdiff_t=yes
10365 else
10366   echo "configure: failed program was:" >&5
10367   cat conftest.$ac_ext >&5
10368   rm -rf conftest*
10369   am_cv_type_ptrdiff_t=no
10370 fi
10371 rm -f conftest*
10372 fi
10373
10374 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10375    if test $am_cv_type_ptrdiff_t = yes; then
10376      cat >> confdefs.h <<\EOF
10377 #define HAVE_PTRDIFF_T 1
10378 EOF
10379
10380    fi
10381
10382 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10383 echo "configure:10384: checking return type of signal handlers" >&5
10384 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10385   echo $ac_n "(cached) $ac_c" 1>&6
10386 else
10387   cat > conftest.$ac_ext <<EOF
10388 #line 10389 "configure"
10389 #include "confdefs.h"
10390 #include <sys/types.h>
10391 #include <signal.h>
10392 #ifdef signal
10393 #undef signal
10394 #endif
10395 #ifdef __cplusplus
10396 extern "C" void (*signal (int, void (*)(int)))(int);
10397 #else
10398 void (*signal ()) ();
10399 #endif
10400
10401 int main() {
10402 int i;
10403 ; return 0; }
10404 EOF
10405 if { (eval echo configure:10406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10406   rm -rf conftest*
10407   ac_cv_type_signal=void
10408 else
10409   echo "configure: failed program was:" >&5
10410   cat conftest.$ac_ext >&5
10411   rm -rf conftest*
10412   ac_cv_type_signal=int
10413 fi
10414 rm -f conftest*
10415 fi
10416
10417 echo "$ac_t""$ac_cv_type_signal" 1>&6
10418 cat >> confdefs.h <<EOF
10419 #define RETSIGTYPE $ac_cv_type_signal
10420 EOF
10421
10422
10423 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10424 echo "configure:10425: checking for sig_atomic_t" >&5
10425 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10426   echo $ac_n "(cached) $ac_c" 1>&6
10427 else
10428   cat > conftest.$ac_ext <<EOF
10429 #line 10430 "configure"
10430 #include "confdefs.h"
10431 #include <signal.h>
10432 int main() {
10433 sig_atomic_t atomic;
10434 ; return 0; }
10435 EOF
10436 if { (eval echo configure:10437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10437   rm -rf conftest*
10438   ol_cv_type_sig_atomic_t=yes
10439 else
10440   echo "configure: failed program was:" >&5
10441   cat conftest.$ac_ext >&5
10442   rm -rf conftest*
10443   ol_cv_type_sig_atomic_t=no
10444 fi
10445 rm -f conftest*
10446 fi
10447
10448 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10449   if test $ol_cv_type_sig_atomic_t = no; then
10450     cat >> confdefs.h <<\EOF
10451 #define sig_atomic_t int
10452 EOF
10453
10454   fi
10455  
10456 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10457 echo "configure:10458: checking for size_t" >&5
10458 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10459   echo $ac_n "(cached) $ac_c" 1>&6
10460 else
10461   cat > conftest.$ac_ext <<EOF
10462 #line 10463 "configure"
10463 #include "confdefs.h"
10464 #include <sys/types.h>
10465 #if STDC_HEADERS
10466 #include <stdlib.h>
10467 #include <stddef.h>
10468 #endif
10469 EOF
10470 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10471   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10472   rm -rf conftest*
10473   ac_cv_type_size_t=yes
10474 else
10475   rm -rf conftest*
10476   ac_cv_type_size_t=no
10477 fi
10478 rm -f conftest*
10479
10480 fi
10481 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10482 if test $ac_cv_type_size_t = no; then
10483   cat >> confdefs.h <<\EOF
10484 #define size_t unsigned
10485 EOF
10486
10487 fi
10488
10489 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10490 echo "configure:10491: checking for st_blksize in struct stat" >&5
10491 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10492   echo $ac_n "(cached) $ac_c" 1>&6
10493 else
10494   cat > conftest.$ac_ext <<EOF
10495 #line 10496 "configure"
10496 #include "confdefs.h"
10497 #include <sys/types.h>
10498 #include <sys/stat.h>
10499 int main() {
10500 struct stat s; s.st_blksize;
10501 ; return 0; }
10502 EOF
10503 if { (eval echo configure:10504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10504   rm -rf conftest*
10505   ac_cv_struct_st_blksize=yes
10506 else
10507   echo "configure: failed program was:" >&5
10508   cat conftest.$ac_ext >&5
10509   rm -rf conftest*
10510   ac_cv_struct_st_blksize=no
10511 fi
10512 rm -f conftest*
10513 fi
10514
10515 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10516 if test $ac_cv_struct_st_blksize = yes; then
10517   cat >> confdefs.h <<\EOF
10518 #define HAVE_ST_BLKSIZE 1
10519 EOF
10520
10521 fi
10522
10523 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10524 echo "configure:10525: checking whether time.h and sys/time.h may both be included" >&5
10525 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10526   echo $ac_n "(cached) $ac_c" 1>&6
10527 else
10528   cat > conftest.$ac_ext <<EOF
10529 #line 10530 "configure"
10530 #include "confdefs.h"
10531 #include <sys/types.h>
10532 #include <sys/time.h>
10533 #include <time.h>
10534 int main() {
10535 struct tm *tp;
10536 ; return 0; }
10537 EOF
10538 if { (eval echo configure:10539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10539   rm -rf conftest*
10540   ac_cv_header_time=yes
10541 else
10542   echo "configure: failed program was:" >&5
10543   cat conftest.$ac_ext >&5
10544   rm -rf conftest*
10545   ac_cv_header_time=no
10546 fi
10547 rm -f conftest*
10548 fi
10549
10550 echo "$ac_t""$ac_cv_header_time" 1>&6
10551 if test $ac_cv_header_time = yes; then
10552   cat >> confdefs.h <<\EOF
10553 #define TIME_WITH_SYS_TIME 1
10554 EOF
10555
10556 fi
10557
10558 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10559 echo "configure:10560: checking whether struct tm is in sys/time.h or time.h" >&5
10560 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10561   echo $ac_n "(cached) $ac_c" 1>&6
10562 else
10563   cat > conftest.$ac_ext <<EOF
10564 #line 10565 "configure"
10565 #include "confdefs.h"
10566 #include <sys/types.h>
10567 #include <time.h>
10568 int main() {
10569 struct tm *tp; tp->tm_sec;
10570 ; return 0; }
10571 EOF
10572 if { (eval echo configure:10573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10573   rm -rf conftest*
10574   ac_cv_struct_tm=time.h
10575 else
10576   echo "configure: failed program was:" >&5
10577   cat conftest.$ac_ext >&5
10578   rm -rf conftest*
10579   ac_cv_struct_tm=sys/time.h
10580 fi
10581 rm -f conftest*
10582 fi
10583
10584 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10585 if test $ac_cv_struct_tm = sys/time.h; then
10586   cat >> confdefs.h <<\EOF
10587 #define TM_IN_SYS_TIME 1
10588 EOF
10589
10590 fi
10591
10592 # test for pw_gecos in struct passwd
10593 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10594 echo "configure:10595: checking struct passwd for pw_gecos" >&5
10595 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10596   echo $ac_n "(cached) $ac_c" 1>&6
10597 else
10598   
10599         cat > conftest.$ac_ext <<EOF
10600 #line 10601 "configure"
10601 #include "confdefs.h"
10602 #include <pwd.h>
10603 int main() {
10604
10605         struct passwd pwd;
10606         pwd.pw_gecos = pwd.pw_name;
10607
10608 ; return 0; }
10609 EOF
10610 if { (eval echo configure:10611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10611   rm -rf conftest*
10612   ol_cv_struct_passwd_pw_gecos=yes
10613 else
10614   echo "configure: failed program was:" >&5
10615   cat conftest.$ac_ext >&5
10616   rm -rf conftest*
10617   ol_cv_struct_passwd_pw_gecos=no
10618 fi
10619 rm -f conftest*
10620 fi
10621
10622 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10623 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10624         cat >> confdefs.h <<\EOF
10625 #define HAVE_PW_GECOS 1
10626 EOF
10627
10628 fi
10629
10630
10631
10632 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10633 echo "configure:10634: checking if toupper() requires islower()" >&5
10634 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10635   echo $ac_n "(cached) $ac_c" 1>&6
10636 else
10637   
10638         if test "$cross_compiling" = yes; then
10639   ol_cv_c_upper_lower=safe
10640 else
10641   cat > conftest.$ac_ext <<EOF
10642 #line 10643 "configure"
10643 #include "confdefs.h"
10644
10645 #include <ctype.h>
10646 main()
10647 {
10648         if ('C' == toupper('C'))
10649                 exit(0);
10650         else
10651                 exit(1);
10652 }
10653 EOF
10654 if { (eval echo configure:10655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10655 then
10656   ol_cv_c_upper_lower=no
10657 else
10658   echo "configure: failed program was:" >&5
10659   cat conftest.$ac_ext >&5
10660   rm -fr conftest*
10661   ol_cv_c_upper_lower=yes
10662 fi
10663 rm -fr conftest*
10664 fi
10665
10666 fi
10667
10668 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10669 if test $ol_cv_c_upper_lower != no ; then
10670         cat >> confdefs.h <<\EOF
10671 #define C_UPPER_LOWER 1
10672 EOF
10673
10674 fi
10675
10676 echo $ac_n "checking for working const""... $ac_c" 1>&6
10677 echo "configure:10678: checking for working const" >&5
10678 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10679   echo $ac_n "(cached) $ac_c" 1>&6
10680 else
10681   cat > conftest.$ac_ext <<EOF
10682 #line 10683 "configure"
10683 #include "confdefs.h"
10684
10685 int main() {
10686
10687 /* Ultrix mips cc rejects this.  */
10688 typedef int charset[2]; const charset x;
10689 /* SunOS 4.1.1 cc rejects this.  */
10690 char const *const *ccp;
10691 char **p;
10692 /* NEC SVR4.0.2 mips cc rejects this.  */
10693 struct point {int x, y;};
10694 static struct point const zero = {0,0};
10695 /* AIX XL C 1.02.0.0 rejects this.
10696    It does not let you subtract one const X* pointer from another in an arm
10697    of an if-expression whose if-part is not a constant expression */
10698 const char *g = "string";
10699 ccp = &g + (g ? g-g : 0);
10700 /* HPUX 7.0 cc rejects these. */
10701 ++ccp;
10702 p = (char**) ccp;
10703 ccp = (char const *const *) p;
10704 { /* SCO 3.2v4 cc rejects this.  */
10705   char *t;
10706   char const *s = 0 ? (char *) 0 : (char const *) 0;
10707
10708   *t++ = 0;
10709 }
10710 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10711   int x[] = {25, 17};
10712   const int *foo = &x[0];
10713   ++foo;
10714 }
10715 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10716   typedef const int *iptr;
10717   iptr p = 0;
10718   ++p;
10719 }
10720 { /* AIX XL C 1.02.0.0 rejects this saying
10721      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10722   struct s { int j; const int *ap[3]; };
10723   struct s *b; b->j = 5;
10724 }
10725 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10726   const int foo = 10;
10727 }
10728
10729 ; return 0; }
10730 EOF
10731 if { (eval echo configure:10732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10732   rm -rf conftest*
10733   ac_cv_c_const=yes
10734 else
10735   echo "configure: failed program was:" >&5
10736   cat conftest.$ac_ext >&5
10737   rm -rf conftest*
10738   ac_cv_c_const=no
10739 fi
10740 rm -f conftest*
10741 fi
10742
10743 echo "$ac_t""$ac_cv_c_const" 1>&6
10744 if test $ac_cv_c_const = no; then
10745   cat >> confdefs.h <<\EOF
10746 #define const 
10747 EOF
10748
10749 fi
10750
10751 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10752 echo "configure:10753: checking if compiler understands volatile" >&5
10753 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10754   echo $ac_n "(cached) $ac_c" 1>&6
10755 else
10756   cat > conftest.$ac_ext <<EOF
10757 #line 10758 "configure"
10758 #include "confdefs.h"
10759 int x, y, z;
10760 int main() {
10761 volatile int a; int * volatile b = x ? &y : &z;
10762       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10763       *b = 0;
10764 ; return 0; }
10765 EOF
10766 if { (eval echo configure:10767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10767   rm -rf conftest*
10768   ol_cv_c_volatile=yes
10769 else
10770   echo "configure: failed program was:" >&5
10771   cat conftest.$ac_ext >&5
10772   rm -rf conftest*
10773   ol_cv_c_volatile=no
10774 fi
10775 rm -f conftest*
10776 fi
10777
10778 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10779   if test $ol_cv_c_volatile = yes; then
10780     : 
10781   else
10782     cat >> confdefs.h <<\EOF
10783 #define volatile 
10784 EOF
10785
10786   fi
10787  
10788
10789 if test $cross_compiling = yes ; then
10790         cat >> confdefs.h <<\EOF
10791 #define CROSS_COMPILING 1
10792 EOF
10793
10794 else
10795         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10796 echo "configure:10797: checking whether byte ordering is bigendian" >&5
10797 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10798   echo $ac_n "(cached) $ac_c" 1>&6
10799 else
10800   ac_cv_c_bigendian=unknown
10801 # See if sys/param.h defines the BYTE_ORDER macro.
10802 cat > conftest.$ac_ext <<EOF
10803 #line 10804 "configure"
10804 #include "confdefs.h"
10805 #include <sys/types.h>
10806 #include <sys/param.h>
10807 int main() {
10808
10809 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10810  bogus endian macros
10811 #endif
10812 ; return 0; }
10813 EOF
10814 if { (eval echo configure:10815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10815   rm -rf conftest*
10816   # It does; now see whether it defined to BIG_ENDIAN or not.
10817 cat > conftest.$ac_ext <<EOF
10818 #line 10819 "configure"
10819 #include "confdefs.h"
10820 #include <sys/types.h>
10821 #include <sys/param.h>
10822 int main() {
10823
10824 #if BYTE_ORDER != BIG_ENDIAN
10825  not big endian
10826 #endif
10827 ; return 0; }
10828 EOF
10829 if { (eval echo configure:10830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10830   rm -rf conftest*
10831   ac_cv_c_bigendian=yes
10832 else
10833   echo "configure: failed program was:" >&5
10834   cat conftest.$ac_ext >&5
10835   rm -rf conftest*
10836   ac_cv_c_bigendian=no
10837 fi
10838 rm -f conftest*
10839 else
10840   echo "configure: failed program was:" >&5
10841   cat conftest.$ac_ext >&5
10842 fi
10843 rm -f conftest*
10844 if test $ac_cv_c_bigendian = unknown; then
10845 if test "$cross_compiling" = yes; then
10846     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10847 else
10848   cat > conftest.$ac_ext <<EOF
10849 #line 10850 "configure"
10850 #include "confdefs.h"
10851 main () {
10852   /* Are we little or big endian?  From Harbison&Steele.  */
10853   union
10854   {
10855     long l;
10856     char c[sizeof (long)];
10857   } u;
10858   u.l = 1;
10859   exit (u.c[sizeof (long) - 1] == 1);
10860 }
10861 EOF
10862 if { (eval echo configure:10863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10863 then
10864   ac_cv_c_bigendian=no
10865 else
10866   echo "configure: failed program was:" >&5
10867   cat conftest.$ac_ext >&5
10868   rm -fr conftest*
10869   ac_cv_c_bigendian=yes
10870 fi
10871 rm -fr conftest*
10872 fi
10873
10874 fi
10875 fi
10876
10877 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10878 if test $ac_cv_c_bigendian = yes; then
10879   cat >> confdefs.h <<\EOF
10880 #define WORDS_BIGENDIAN 1
10881 EOF
10882
10883 fi
10884
10885         echo $ac_n "checking size of short""... $ac_c" 1>&6
10886 echo "configure:10887: checking size of short" >&5
10887 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10888   echo $ac_n "(cached) $ac_c" 1>&6
10889 else
10890   if test "$cross_compiling" = yes; then
10891     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10892 else
10893   cat > conftest.$ac_ext <<EOF
10894 #line 10895 "configure"
10895 #include "confdefs.h"
10896 #include <stdio.h>
10897 main()
10898 {
10899   FILE *f=fopen("conftestval", "w");
10900   if (!f) exit(1);
10901   fprintf(f, "%d\n", sizeof(short));
10902   exit(0);
10903 }
10904 EOF
10905 if { (eval echo configure:10906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10906 then
10907   ac_cv_sizeof_short=`cat conftestval`
10908 else
10909   echo "configure: failed program was:" >&5
10910   cat conftest.$ac_ext >&5
10911   rm -fr conftest*
10912   ac_cv_sizeof_short=0
10913 fi
10914 rm -fr conftest*
10915 fi
10916
10917 fi
10918 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10919 cat >> confdefs.h <<EOF
10920 #define SIZEOF_SHORT $ac_cv_sizeof_short
10921 EOF
10922
10923  
10924         echo $ac_n "checking size of int""... $ac_c" 1>&6
10925 echo "configure:10926: checking size of int" >&5
10926 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10927   echo $ac_n "(cached) $ac_c" 1>&6
10928 else
10929   if test "$cross_compiling" = yes; then
10930     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10931 else
10932   cat > conftest.$ac_ext <<EOF
10933 #line 10934 "configure"
10934 #include "confdefs.h"
10935 #include <stdio.h>
10936 main()
10937 {
10938   FILE *f=fopen("conftestval", "w");
10939   if (!f) exit(1);
10940   fprintf(f, "%d\n", sizeof(int));
10941   exit(0);
10942 }
10943 EOF
10944 if { (eval echo configure:10945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10945 then
10946   ac_cv_sizeof_int=`cat conftestval`
10947 else
10948   echo "configure: failed program was:" >&5
10949   cat conftest.$ac_ext >&5
10950   rm -fr conftest*
10951   ac_cv_sizeof_int=0
10952 fi
10953 rm -fr conftest*
10954 fi
10955
10956 fi
10957 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10958 cat >> confdefs.h <<EOF
10959 #define SIZEOF_INT $ac_cv_sizeof_int
10960 EOF
10961
10962  
10963         echo $ac_n "checking size of long""... $ac_c" 1>&6
10964 echo "configure:10965: checking size of long" >&5
10965 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10966   echo $ac_n "(cached) $ac_c" 1>&6
10967 else
10968   if test "$cross_compiling" = yes; then
10969     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10970 else
10971   cat > conftest.$ac_ext <<EOF
10972 #line 10973 "configure"
10973 #include "confdefs.h"
10974 #include <stdio.h>
10975 main()
10976 {
10977   FILE *f=fopen("conftestval", "w");
10978   if (!f) exit(1);
10979   fprintf(f, "%d\n", sizeof(long));
10980   exit(0);
10981 }
10982 EOF
10983 if { (eval echo configure:10984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10984 then
10985   ac_cv_sizeof_long=`cat conftestval`
10986 else
10987   echo "configure: failed program was:" >&5
10988   cat conftest.$ac_ext >&5
10989   rm -fr conftest*
10990   ac_cv_sizeof_long=0
10991 fi
10992 rm -fr conftest*
10993 fi
10994
10995 fi
10996 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10997 cat >> confdefs.h <<EOF
10998 #define SIZEOF_LONG $ac_cv_sizeof_long
10999 EOF
11000
11001
11002
11003         if test "$ac_cv_sizeof_int" -lt 4 ; then
11004                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
11005         fi
11006 fi
11007
11008 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
11009 echo "configure:11010: checking for 8-bit clean memcmp" >&5
11010 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
11011   echo $ac_n "(cached) $ac_c" 1>&6
11012 else
11013   if test "$cross_compiling" = yes; then
11014   ac_cv_func_memcmp_clean=no
11015 else
11016   cat > conftest.$ac_ext <<EOF
11017 #line 11018 "configure"
11018 #include "confdefs.h"
11019
11020 main()
11021 {
11022   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
11023   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
11024 }
11025
11026 EOF
11027 if { (eval echo configure:11028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11028 then
11029   ac_cv_func_memcmp_clean=yes
11030 else
11031   echo "configure: failed program was:" >&5
11032   cat conftest.$ac_ext >&5
11033   rm -fr conftest*
11034   ac_cv_func_memcmp_clean=no
11035 fi
11036 rm -fr conftest*
11037 fi
11038
11039 fi
11040
11041 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
11042 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
11043
11044 echo $ac_n "checking for strftime""... $ac_c" 1>&6
11045 echo "configure:11046: checking for strftime" >&5
11046 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
11047   echo $ac_n "(cached) $ac_c" 1>&6
11048 else
11049   cat > conftest.$ac_ext <<EOF
11050 #line 11051 "configure"
11051 #include "confdefs.h"
11052 /* System header to define __stub macros and hopefully few prototypes,
11053     which can conflict with char strftime(); below.  */
11054 #include <assert.h>
11055 /* Override any gcc2 internal prototype to avoid an error.  */
11056 /* We use char because int might match the return type of a gcc2
11057     builtin and then its argument prototype would still apply.  */
11058 char strftime();
11059
11060 int main() {
11061
11062 /* The GNU C library defines this for functions which it implements
11063     to always fail with ENOSYS.  Some functions are actually named
11064     something starting with __ and the normal name is an alias.  */
11065 #if defined (__stub_strftime) || defined (__stub___strftime)
11066 choke me
11067 #else
11068 strftime();
11069 #endif
11070
11071 ; return 0; }
11072 EOF
11073 if { (eval echo configure:11074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11074   rm -rf conftest*
11075   eval "ac_cv_func_strftime=yes"
11076 else
11077   echo "configure: failed program was:" >&5
11078   cat conftest.$ac_ext >&5
11079   rm -rf conftest*
11080   eval "ac_cv_func_strftime=no"
11081 fi
11082 rm -f conftest*
11083 fi
11084
11085 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11086   echo "$ac_t""yes" 1>&6
11087   cat >> confdefs.h <<\EOF
11088 #define HAVE_STRFTIME 1
11089 EOF
11090
11091 else
11092   echo "$ac_t""no" 1>&6
11093 # strftime is in -lintl on SCO UNIX.
11094 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11095 echo "configure:11096: checking for strftime in -lintl" >&5
11096 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
11097 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11098   echo $ac_n "(cached) $ac_c" 1>&6
11099 else
11100   ac_save_LIBS="$LIBS"
11101 LIBS="-lintl  $LIBS"
11102 cat > conftest.$ac_ext <<EOF
11103 #line 11104 "configure"
11104 #include "confdefs.h"
11105 /* Override any gcc2 internal prototype to avoid an error.  */
11106 /* We use char because int might match the return type of a gcc2
11107     builtin and then its argument prototype would still apply.  */
11108 char strftime();
11109
11110 int main() {
11111 strftime()
11112 ; return 0; }
11113 EOF
11114 if { (eval echo configure:11115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11115   rm -rf conftest*
11116   eval "ac_cv_lib_$ac_lib_var=yes"
11117 else
11118   echo "configure: failed program was:" >&5
11119   cat conftest.$ac_ext >&5
11120   rm -rf conftest*
11121   eval "ac_cv_lib_$ac_lib_var=no"
11122 fi
11123 rm -f conftest*
11124 LIBS="$ac_save_LIBS"
11125
11126 fi
11127 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11128   echo "$ac_t""yes" 1>&6
11129   cat >> confdefs.h <<\EOF
11130 #define HAVE_STRFTIME 1
11131 EOF
11132
11133 LIBS="-lintl $LIBS"
11134 else
11135   echo "$ac_t""no" 1>&6
11136 fi
11137
11138 fi
11139
11140
11141 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11142 echo "configure:11143: checking for vprintf" >&5
11143 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
11144   echo $ac_n "(cached) $ac_c" 1>&6
11145 else
11146   cat > conftest.$ac_ext <<EOF
11147 #line 11148 "configure"
11148 #include "confdefs.h"
11149 /* System header to define __stub macros and hopefully few prototypes,
11150     which can conflict with char vprintf(); below.  */
11151 #include <assert.h>
11152 /* Override any gcc2 internal prototype to avoid an error.  */
11153 /* We use char because int might match the return type of a gcc2
11154     builtin and then its argument prototype would still apply.  */
11155 char vprintf();
11156
11157 int main() {
11158
11159 /* The GNU C library defines this for functions which it implements
11160     to always fail with ENOSYS.  Some functions are actually named
11161     something starting with __ and the normal name is an alias.  */
11162 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11163 choke me
11164 #else
11165 vprintf();
11166 #endif
11167
11168 ; return 0; }
11169 EOF
11170 if { (eval echo configure:11171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11171   rm -rf conftest*
11172   eval "ac_cv_func_vprintf=yes"
11173 else
11174   echo "configure: failed program was:" >&5
11175   cat conftest.$ac_ext >&5
11176   rm -rf conftest*
11177   eval "ac_cv_func_vprintf=no"
11178 fi
11179 rm -f conftest*
11180 fi
11181
11182 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11183   echo "$ac_t""yes" 1>&6
11184   cat >> confdefs.h <<\EOF
11185 #define HAVE_VPRINTF 1
11186 EOF
11187
11188 else
11189   echo "$ac_t""no" 1>&6
11190 fi
11191
11192 if test "$ac_cv_func_vprintf" != yes; then
11193 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11194 echo "configure:11195: checking for _doprnt" >&5
11195 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
11196   echo $ac_n "(cached) $ac_c" 1>&6
11197 else
11198   cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 /* System header to define __stub macros and hopefully few prototypes,
11202     which can conflict with char _doprnt(); below.  */
11203 #include <assert.h>
11204 /* Override any gcc2 internal prototype to avoid an error.  */
11205 /* We use char because int might match the return type of a gcc2
11206     builtin and then its argument prototype would still apply.  */
11207 char _doprnt();
11208
11209 int main() {
11210
11211 /* The GNU C library defines this for functions which it implements
11212     to always fail with ENOSYS.  Some functions are actually named
11213     something starting with __ and the normal name is an alias.  */
11214 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11215 choke me
11216 #else
11217 _doprnt();
11218 #endif
11219
11220 ; return 0; }
11221 EOF
11222 if { (eval echo configure:11223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11223   rm -rf conftest*
11224   eval "ac_cv_func__doprnt=yes"
11225 else
11226   echo "configure: failed program was:" >&5
11227   cat conftest.$ac_ext >&5
11228   rm -rf conftest*
11229   eval "ac_cv_func__doprnt=no"
11230 fi
11231 rm -f conftest*
11232 fi
11233
11234 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
11235   echo "$ac_t""yes" 1>&6
11236   cat >> confdefs.h <<\EOF
11237 #define HAVE_DOPRNT 1
11238 EOF
11239
11240 else
11241   echo "$ac_t""no" 1>&6
11242 fi
11243
11244 fi
11245
11246
11247 if test $ac_cv_func_vprintf = yes ; then
11248                 for ac_func in vsnprintf vsprintf
11249 do
11250 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11251 echo "configure:11252: checking for $ac_func" >&5
11252 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11253   echo $ac_n "(cached) $ac_c" 1>&6
11254 else
11255   cat > conftest.$ac_ext <<EOF
11256 #line 11257 "configure"
11257 #include "confdefs.h"
11258 /* System header to define __stub macros and hopefully few prototypes,
11259     which can conflict with char $ac_func(); below.  */
11260 #include <assert.h>
11261 /* Override any gcc2 internal prototype to avoid an error.  */
11262 /* We use char because int might match the return type of a gcc2
11263     builtin and then its argument prototype would still apply.  */
11264 char $ac_func();
11265
11266 int main() {
11267
11268 /* The GNU C library defines this for functions which it implements
11269     to always fail with ENOSYS.  Some functions are actually named
11270     something starting with __ and the normal name is an alias.  */
11271 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11272 choke me
11273 #else
11274 $ac_func();
11275 #endif
11276
11277 ; return 0; }
11278 EOF
11279 if { (eval echo configure:11280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11280   rm -rf conftest*
11281   eval "ac_cv_func_$ac_func=yes"
11282 else
11283   echo "configure: failed program was:" >&5
11284   cat conftest.$ac_ext >&5
11285   rm -rf conftest*
11286   eval "ac_cv_func_$ac_func=no"
11287 fi
11288 rm -f conftest*
11289 fi
11290
11291 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11292   echo "$ac_t""yes" 1>&6
11293     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11294   cat >> confdefs.h <<EOF
11295 #define $ac_tr_func 1
11296 EOF
11297  
11298 else
11299   echo "$ac_t""no" 1>&6
11300 fi
11301 done
11302
11303 fi
11304
11305 for ac_func in \
11306         bcopy                   \
11307         closesocket             \
11308         endgrent                \
11309         endpwent                \
11310         flock                   \
11311         getdtablesize   \
11312         getgrgid                \
11313         gethostname             \
11314         getpass                 \
11315         getpwuid                \
11316         gettimeofday    \
11317         initgroups              \
11318         lockf                   \
11319         memcpy                  \
11320         memmove                 \
11321         mkstemp                 \
11322         recv                    \
11323         recvfrom                \
11324         setpwfile               \
11325         setgid                  \
11326         setegid                 \
11327         setsid                  \
11328         setuid                  \
11329         seteuid                 \
11330         signal                  \
11331         sigset                  \
11332         snprintf                \
11333         strdup                  \
11334         strerror                \
11335         strpbrk                 \
11336         strrchr                 \
11337         strsep                  \
11338         strstr                  \
11339         strtol                  \
11340         strtoul                 \
11341         strspn                  \
11342         sysconf                 \
11343         waitpid                 \
11344         wait4                   \
11345
11346 do
11347 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11348 echo "configure:11349: checking for $ac_func" >&5
11349 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11350   echo $ac_n "(cached) $ac_c" 1>&6
11351 else
11352   cat > conftest.$ac_ext <<EOF
11353 #line 11354 "configure"
11354 #include "confdefs.h"
11355 /* System header to define __stub macros and hopefully few prototypes,
11356     which can conflict with char $ac_func(); below.  */
11357 #include <assert.h>
11358 /* Override any gcc2 internal prototype to avoid an error.  */
11359 /* We use char because int might match the return type of a gcc2
11360     builtin and then its argument prototype would still apply.  */
11361 char $ac_func();
11362
11363 int main() {
11364
11365 /* The GNU C library defines this for functions which it implements
11366     to always fail with ENOSYS.  Some functions are actually named
11367     something starting with __ and the normal name is an alias.  */
11368 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11369 choke me
11370 #else
11371 $ac_func();
11372 #endif
11373
11374 ; return 0; }
11375 EOF
11376 if { (eval echo configure:11377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11377   rm -rf conftest*
11378   eval "ac_cv_func_$ac_func=yes"
11379 else
11380   echo "configure: failed program was:" >&5
11381   cat conftest.$ac_ext >&5
11382   rm -rf conftest*
11383   eval "ac_cv_func_$ac_func=no"
11384 fi
11385 rm -f conftest*
11386 fi
11387
11388 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11389   echo "$ac_t""yes" 1>&6
11390     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11391   cat >> confdefs.h <<EOF
11392 #define $ac_tr_func 1
11393 EOF
11394  
11395 else
11396   echo "$ac_t""no" 1>&6
11397 fi
11398 done
11399
11400
11401 for ac_func in getopt tempnam
11402 do
11403 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11404 echo "configure:11405: checking for $ac_func" >&5
11405 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11406   echo $ac_n "(cached) $ac_c" 1>&6
11407 else
11408   cat > conftest.$ac_ext <<EOF
11409 #line 11410 "configure"
11410 #include "confdefs.h"
11411 /* System header to define __stub macros and hopefully few prototypes,
11412     which can conflict with char $ac_func(); below.  */
11413 #include <assert.h>
11414 /* Override any gcc2 internal prototype to avoid an error.  */
11415 /* We use char because int might match the return type of a gcc2
11416     builtin and then its argument prototype would still apply.  */
11417 char $ac_func();
11418
11419 int main() {
11420
11421 /* The GNU C library defines this for functions which it implements
11422     to always fail with ENOSYS.  Some functions are actually named
11423     something starting with __ and the normal name is an alias.  */
11424 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11425 choke me
11426 #else
11427 $ac_func();
11428 #endif
11429
11430 ; return 0; }
11431 EOF
11432 if { (eval echo configure:11433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11433   rm -rf conftest*
11434   eval "ac_cv_func_$ac_func=yes"
11435 else
11436   echo "configure: failed program was:" >&5
11437   cat conftest.$ac_ext >&5
11438   rm -rf conftest*
11439   eval "ac_cv_func_$ac_func=no"
11440 fi
11441 rm -f conftest*
11442 fi
11443
11444 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11445   echo "$ac_t""yes" 1>&6
11446     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11447   cat >> confdefs.h <<EOF
11448 #define $ac_tr_func 1
11449 EOF
11450  
11451 else
11452   echo "$ac_t""no" 1>&6
11453 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11454 fi
11455 done
11456
11457
11458
11459 # Check Configuration
11460
11461 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11462 echo "configure:11463: checking declaration of sys_errlist" >&5
11463 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11464   echo $ac_n "(cached) $ac_c" 1>&6
11465 else
11466   
11467         cat > conftest.$ac_ext <<EOF
11468 #line 11469 "configure"
11469 #include "confdefs.h"
11470
11471 #include <stdio.h>
11472 #include <sys/types.h>
11473 #include <errno.h> 
11474 int main() {
11475 char *c = (char *) *sys_errlist
11476 ; return 0; }
11477 EOF
11478 if { (eval echo configure:11479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11479   rm -rf conftest*
11480   ol_cv_dcl_sys_errlist=yes
11481 else
11482   echo "configure: failed program was:" >&5
11483   cat conftest.$ac_ext >&5
11484   rm -rf conftest*
11485   ol_cv_dcl_sys_errlist=no
11486 fi
11487 rm -f conftest*
11488 fi
11489
11490 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11491 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11492 if test $ol_cv_dcl_sys_errlist = no ; then
11493         cat >> confdefs.h <<\EOF
11494 #define DECL_SYS_ERRLIST 1
11495 EOF
11496
11497         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11498 echo "configure:11499: checking existence of sys_errlist" >&5
11499         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11500   echo $ac_n "(cached) $ac_c" 1>&6
11501 else
11502   
11503                 cat > conftest.$ac_ext <<EOF
11504 #line 11505 "configure"
11505 #include "confdefs.h"
11506 #include <errno.h>
11507 int main() {
11508 char *c = (char *) *sys_errlist
11509 ; return 0; }
11510 EOF
11511 if { (eval echo configure:11512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11512   rm -rf conftest*
11513   ol_cv_have_sys_errlist=yes
11514 else
11515   echo "configure: failed program was:" >&5
11516   cat conftest.$ac_ext >&5
11517   rm -rf conftest*
11518   ol_cv_have_sys_errlist=no
11519 fi
11520 rm -f conftest*
11521 fi
11522
11523         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11524         if test $ol_cv_have_sys_errlist = yes ; then
11525                 cat >> confdefs.h <<\EOF
11526 #define HAVE_SYS_ERRLIST 1
11527 EOF
11528
11529         fi
11530 fi
11531
11532
11533
11534 if test "$ol_enable_debug" != no ; then
11535         cat >> confdefs.h <<\EOF
11536 #define LDAP_DEBUG 1
11537 EOF
11538
11539 fi
11540 if test "$ol_enable_syslog" = yes ; then
11541         cat >> confdefs.h <<\EOF
11542 #define LDAP_SYSLOG 1
11543 EOF
11544
11545 fi
11546 if test "$ol_enable_libui" = yes ; then
11547         cat >> confdefs.h <<\EOF
11548 #define LDAP_LIBUI 1
11549 EOF
11550
11551 fi
11552 if test "$ol_enable_cache" = no ; then
11553         cat >> confdefs.h <<\EOF
11554 #define LDAP_NOCACHE 1
11555 EOF
11556
11557 fi
11558 if test "$ol_enable_dns" != no ; then
11559         cat >> confdefs.h <<\EOF
11560 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11561 EOF
11562
11563 fi
11564 if test "$ol_enable_proctitle" != no ; then
11565         cat >> confdefs.h <<\EOF
11566 #define LDAP_PROCTITLE 1
11567 EOF
11568
11569 fi
11570 if test "$ol_enable_referrals" != no ; then
11571         cat >> confdefs.h <<\EOF
11572 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11573 EOF
11574
11575 fi
11576 if test "$ol_enable_cldap" != no ; then
11577         cat >> confdefs.h <<\EOF
11578 #define LDAP_CONNECTIONLESS 1
11579 EOF
11580
11581 fi
11582
11583 if test "$ol_enable_aclgroups" != no ; then
11584         cat >> confdefs.h <<\EOF
11585 #define SLAPD_ACLGROUPS 1
11586 EOF
11587
11588 fi
11589 if test "$ol_enable_crypt" != no ; then
11590         cat >> confdefs.h <<\EOF
11591 #define SLAPD_CRYPT 1
11592 EOF
11593
11594 fi
11595 if test "$ol_enable_cleartext" != no ; then
11596         cat >> confdefs.h <<\EOF
11597 #define SLAPD_CLEARTEXT 1
11598 EOF
11599
11600 fi
11601 if test "$ol_enable_phonetic" != no ; then
11602         cat >> confdefs.h <<\EOF
11603 #define SLAPD_PHONETIC 1
11604 EOF
11605
11606 fi
11607 if test "$ol_enable_rlookups" != no ; then
11608         cat >> confdefs.h <<\EOF
11609 #define SLAPD_RLOOKUPS 1
11610 EOF
11611
11612 fi
11613
11614 if test "$ol_link_modules" != no ; then
11615         cat >> confdefs.h <<\EOF
11616 #define SLAPD_MODULES 1
11617 EOF
11618
11619         BUILD_SLAPD=yes
11620 fi
11621
11622 if test "$ol_link_bdb2" != no ; then
11623         cat >> confdefs.h <<\EOF
11624 #define SLAPD_BDB2 1
11625 EOF
11626
11627         BUILD_SLAPD=yes
11628         BUILD_BDB2=yes
11629 fi
11630
11631 if test "$ol_enable_ldap" != no ; then
11632         cat >> confdefs.h <<\EOF
11633 #define SLAPD_LDAP 1
11634 EOF
11635
11636         BUILD_SLAPD=yes
11637         BUILD_LDAP=yes
11638 fi
11639
11640 if test "$ol_link_ldbm" != no ; then
11641         cat >> confdefs.h <<\EOF
11642 #define SLAPD_LDBM 1
11643 EOF
11644
11645         BUILD_SLAPD=yes
11646         BUILD_LDBM=yes
11647 fi
11648
11649 if test "$ol_enable_passwd" != no ; then
11650         cat >> confdefs.h <<\EOF
11651 #define SLAPD_PASSWD 1
11652 EOF
11653
11654         BUILD_SLAPD=yes
11655         BUILD_PASSWD=yes
11656 fi
11657
11658 if test "$ol_link_perl" != no ; then
11659         cat >> confdefs.h <<\EOF
11660 #define SLAPD_PERL 1
11661 EOF
11662
11663         BUILD_SLAPD=yes
11664         BUILD_PERL=yes
11665 fi
11666
11667 if test "$ol_enable_shell" != no ; then
11668         cat >> confdefs.h <<\EOF
11669 #define SLAPD_SHELL 1
11670 EOF
11671
11672         BUILD_SLAPD=yes
11673         BUILD_SHELL=yes
11674 fi
11675
11676 if test "$ol_enable_tcl" != no ; then
11677         cat >> confdefs.h <<\EOF
11678 #define SLAPD_TCL 1
11679 EOF
11680
11681         BUILD_SLAPD=yes
11682         BUILD_TCL=yes
11683 fi
11684
11685 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11686         $BUILD_SLAPD = yes ; then
11687         BUILD_SLURPD=yes
11688 fi
11689
11690 if test "$ol_link_isode" != no ; then
11691         BUILD_LDAPD=yes
11692 fi
11693
11694
11695
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 trap '' 1 2 15
11727
11728 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11729
11730 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11731 # Let make expand exec_prefix.
11732 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11733
11734 # Any assignment to VPATH causes Sun make to only execute
11735 # the first set of double-colon rules, so remove it if not needed.
11736 # If there is a colon in the path, we need to keep it.
11737 if test "x$srcdir" = x.; then
11738   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11739 fi
11740
11741 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11742
11743 DEFS=-DHAVE_CONFIG_H
11744
11745 # Without the "./", some shells look in PATH for config.status.
11746 : ${CONFIG_STATUS=./config.status}
11747
11748 echo creating $CONFIG_STATUS
11749 rm -f $CONFIG_STATUS
11750 cat > $CONFIG_STATUS <<EOF
11751 #! /bin/sh
11752 # Generated automatically by configure.
11753 # Run this file to recreate the current configuration.
11754 # This directory was configured as follows,
11755 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11756 #
11757 # $0 $ac_configure_args
11758 #
11759 # Compiler output produced by configure, useful for debugging
11760 # configure, is in ./config.log if it exists.
11761
11762 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11763 for ac_option
11764 do
11765   case "\$ac_option" in
11766   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11767     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11768     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11769   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11770     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11771     exit 0 ;;
11772   -help | --help | --hel | --he | --h)
11773     echo "\$ac_cs_usage"; exit 0 ;;
11774   *) echo "\$ac_cs_usage"; exit 1 ;;
11775   esac
11776 done
11777
11778 ac_given_srcdir=$srcdir
11779 ac_given_INSTALL="$INSTALL"
11780
11781 trap 'rm -fr `echo "\
11782 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11783 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11784 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11785 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11786 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11787 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11788 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11789 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11790 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11791 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11792 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11793 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11794 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11795 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11796 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11797 include/Makefile:build/top.mk:include/Makefile.in \
11798 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11799 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11800 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11801 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11802 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11803 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11804 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11805 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11806 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11807 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11808 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11809 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11810 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11811 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11812 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11813 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11814 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11815 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11816 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11817 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11818 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11819 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11820 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11821 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11822 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11823 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11824  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11825 EOF
11826 cat >> $CONFIG_STATUS <<EOF
11827
11828 # Protect against being on the right side of a sed subst in config.status.
11829 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11830  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11831 $ac_vpsub
11832 $extrasub
11833 s%@SHELL@%$SHELL%g
11834 s%@CFLAGS@%$CFLAGS%g
11835 s%@CPPFLAGS@%$CPPFLAGS%g
11836 s%@CXXFLAGS@%$CXXFLAGS%g
11837 s%@FFLAGS@%$FFLAGS%g
11838 s%@DEFS@%$DEFS%g
11839 s%@LDFLAGS@%$LDFLAGS%g
11840 s%@LIBS@%$LIBS%g
11841 s%@exec_prefix@%$exec_prefix%g
11842 s%@prefix@%$prefix%g
11843 s%@program_transform_name@%$program_transform_name%g
11844 s%@bindir@%$bindir%g
11845 s%@sbindir@%$sbindir%g
11846 s%@libexecdir@%$libexecdir%g
11847 s%@datadir@%$datadir%g
11848 s%@sysconfdir@%$sysconfdir%g
11849 s%@sharedstatedir@%$sharedstatedir%g
11850 s%@localstatedir@%$localstatedir%g
11851 s%@libdir@%$libdir%g
11852 s%@includedir@%$includedir%g
11853 s%@oldincludedir@%$oldincludedir%g
11854 s%@infodir@%$infodir%g
11855 s%@mandir@%$mandir%g
11856 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11857 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11858 s%@INSTALL_DATA@%$INSTALL_DATA%g
11859 s%@PACKAGE@%$PACKAGE%g
11860 s%@VERSION@%$VERSION%g
11861 s%@ACLOCAL@%$ACLOCAL%g
11862 s%@AUTOCONF@%$AUTOCONF%g
11863 s%@AUTOMAKE@%$AUTOMAKE%g
11864 s%@AUTOHEADER@%$AUTOHEADER%g
11865 s%@MAKEINFO@%$MAKEINFO%g
11866 s%@SET_MAKE@%$SET_MAKE%g
11867 s%@top_builddir@%$top_builddir%g
11868 s%@ldap_subdir@%$ldap_subdir%g
11869 s%@host@%$host%g
11870 s%@host_alias@%$host_alias%g
11871 s%@host_cpu@%$host_cpu%g
11872 s%@host_vendor@%$host_vendor%g
11873 s%@host_os@%$host_os%g
11874 s%@CC@%$CC%g
11875 s%@RANLIB@%$RANLIB%g
11876 s%@LD@%$LD%g
11877 s%@NM@%$NM%g
11878 s%@LN_S@%$LN_S%g
11879 s%@LIBTOOL@%$LIBTOOL%g
11880 s%@AWK@%$AWK%g
11881 s%@LN_H@%$LN_H%g
11882 s%@SENDMAIL@%$SENDMAIL%g
11883 s%@EDITOR@%$EDITOR%g
11884 s%@FINGER@%$FINGER%g
11885 s%@GLIBCONFIG@%$GLIBCONFIG%g
11886 s%@PERLBIN@%$PERLBIN%g
11887 s%@CPP@%$CPP%g
11888 s%@EXEEXT@%$EXEEXT%g
11889 s%@OBJEXT@%$OBJEXT%g
11890 s%@OL_MKDEP@%$OL_MKDEP%g
11891 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
11892 s%@PEPSY@%$PEPSY%g
11893 s%@LIBOBJS@%$LIBOBJS%g
11894 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11895 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11896 s%@BUILD_BDB2@%$BUILD_BDB2%g
11897 s%@BUILD_LDAP@%$BUILD_LDAP%g
11898 s%@BUILD_LDBM@%$BUILD_LDBM%g
11899 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11900 s%@BUILD_PERL@%$BUILD_PERL%g
11901 s%@BUILD_SHELL@%$BUILD_SHELL%g
11902 s%@BUILD_TCL@%$BUILD_TCL%g
11903 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11904 s%@LDAP_LIBS@%$LDAP_LIBS%g
11905 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11906 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11907 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11908 s%@LDBM_LIBS@%$LDBM_LIBS%g
11909 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11910 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11911 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11912 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11913 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11914 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11915 s%@KRB_LIBS@%$KRB_LIBS%g
11916 s%@READLINE_LIBS@%$READLINE_LIBS%g
11917 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11918 s%@TLS_LIBS@%$TLS_LIBS%g
11919
11920 CEOF
11921 EOF
11922
11923 cat >> $CONFIG_STATUS <<\EOF
11924
11925 # Split the substitutions into bite-sized pieces for seds with
11926 # small command number limits, like on Digital OSF/1 and HP-UX.
11927 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11928 ac_file=1 # Number of current file.
11929 ac_beg=1 # First line for current file.
11930 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11931 ac_more_lines=:
11932 ac_sed_cmds=""
11933 while $ac_more_lines; do
11934   if test $ac_beg -gt 1; then
11935     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11936   else
11937     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11938   fi
11939   if test ! -s conftest.s$ac_file; then
11940     ac_more_lines=false
11941     rm -f conftest.s$ac_file
11942   else
11943     if test -z "$ac_sed_cmds"; then
11944       ac_sed_cmds="sed -f conftest.s$ac_file"
11945     else
11946       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11947     fi
11948     ac_file=`expr $ac_file + 1`
11949     ac_beg=$ac_end
11950     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11951   fi
11952 done
11953 if test -z "$ac_sed_cmds"; then
11954   ac_sed_cmds=cat
11955 fi
11956 EOF
11957
11958 cat >> $CONFIG_STATUS <<EOF
11959
11960 CONFIG_FILES=\${CONFIG_FILES-"\
11961 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11962 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11963 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11964 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11965 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11966 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11967 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11968 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11969 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11970 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11971 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11972 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11973 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11974 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11975 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11976 include/Makefile:build/top.mk:include/Makefile.in \
11977 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11978 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11979 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11980 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11981 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11982 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11983 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11984 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11985 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11986 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11987 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11988 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11989 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11990 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11991 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11992 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11993 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11994 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11995 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11996 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11997 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11998 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11999 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12000 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12001 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12002 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12003 "}
12004 EOF
12005 cat >> $CONFIG_STATUS <<\EOF
12006 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12007   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12008   case "$ac_file" in
12009   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12010        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12011   *) ac_file_in="${ac_file}.in" ;;
12012   esac
12013
12014   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12015
12016   # Remove last slash and all that follows it.  Not all systems have dirname.
12017   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12018   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12019     # The file is in a subdirectory.
12020     test ! -d "$ac_dir" && mkdir "$ac_dir"
12021     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12022     # A "../" for each directory in $ac_dir_suffix.
12023     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12024   else
12025     ac_dir_suffix= ac_dots=
12026   fi
12027
12028   case "$ac_given_srcdir" in
12029   .)  srcdir=.
12030       if test -z "$ac_dots"; then top_srcdir=.
12031       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12032   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12033   *) # Relative path.
12034     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12035     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12036   esac
12037
12038   case "$ac_given_INSTALL" in
12039   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12040   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12041   esac
12042
12043   echo creating "$ac_file"
12044   rm -f "$ac_file"
12045   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12046   case "$ac_file" in
12047   *Makefile*) ac_comsub="1i\\
12048 # $configure_input" ;;
12049   *) ac_comsub= ;;
12050   esac
12051
12052   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12053   sed -e "$ac_comsub
12054 s%@configure_input@%$configure_input%g
12055 s%@srcdir@%$srcdir%g
12056 s%@top_srcdir@%$top_srcdir%g
12057 s%@INSTALL@%$INSTALL%g
12058 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12059 fi; done
12060 rm -f conftest.s*
12061
12062 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12063 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12064 #
12065 # ac_d sets the value in "#define NAME VALUE" lines.
12066 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12067 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12068 ac_dC='\3'
12069 ac_dD='%g'
12070 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12071 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12072 ac_uB='\([      ]\)%\1#\2define\3'
12073 ac_uC=' '
12074 ac_uD='\4%g'
12075 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12076 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12077 ac_eB='$%\1#\2define\3'
12078 ac_eC=' '
12079 ac_eD='%g'
12080
12081 if test "${CONFIG_HEADERS+set}" != set; then
12082 EOF
12083 cat >> $CONFIG_STATUS <<EOF
12084   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
12085 EOF
12086 cat >> $CONFIG_STATUS <<\EOF
12087 fi
12088 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12089   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12090   case "$ac_file" in
12091   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12092        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12093   *) ac_file_in="${ac_file}.in" ;;
12094   esac
12095
12096   echo creating $ac_file
12097
12098   rm -f conftest.frag conftest.in conftest.out
12099   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12100   cat $ac_file_inputs > conftest.in
12101
12102 EOF
12103
12104 # Transform confdefs.h into a sed script conftest.vals that substitutes
12105 # the proper values into config.h.in to produce config.h.  And first:
12106 # Protect against being on the right side of a sed subst in config.status.
12107 # Protect against being in an unquoted here document in config.status.
12108 rm -f conftest.vals
12109 cat > conftest.hdr <<\EOF
12110 s/[\\&%]/\\&/g
12111 s%[\\$`]%\\&%g
12112 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12113 s%ac_d%ac_u%gp
12114 s%ac_u%ac_e%gp
12115 EOF
12116 sed -n -f conftest.hdr confdefs.h > conftest.vals
12117 rm -f conftest.hdr
12118
12119 # This sed command replaces #undef with comments.  This is necessary, for
12120 # example, in the case of _POSIX_SOURCE, which is predefined and required
12121 # on some systems where configure will not decide to define it.
12122 cat >> conftest.vals <<\EOF
12123 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12124 EOF
12125
12126 # Break up conftest.vals because some shells have a limit on
12127 # the size of here documents, and old seds have small limits too.
12128
12129 rm -f conftest.tail
12130 while :
12131 do
12132   ac_lines=`grep -c . conftest.vals`
12133   # grep -c gives empty output for an empty file on some AIX systems.
12134   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12135   # Write a limited-size here document to conftest.frag.
12136   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12137   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12138   echo 'CEOF
12139   sed -f conftest.frag conftest.in > conftest.out
12140   rm -f conftest.in
12141   mv conftest.out conftest.in
12142 ' >> $CONFIG_STATUS
12143   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12144   rm -f conftest.vals
12145   mv conftest.tail conftest.vals
12146 done
12147 rm -f conftest.vals
12148
12149 cat >> $CONFIG_STATUS <<\EOF
12150   rm -f conftest.frag conftest.h
12151   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12152   cat conftest.in >> conftest.h
12153   rm -f conftest.in
12154   if cmp -s $ac_file conftest.h 2>/dev/null; then
12155     echo "$ac_file is unchanged"
12156     rm -f conftest.h
12157   else
12158     # Remove last slash and all that follows it.  Not all systems have dirname.
12159       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12160       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12161       # The file is in a subdirectory.
12162       test ! -d "$ac_dir" && mkdir "$ac_dir"
12163     fi
12164     rm -f $ac_file
12165     mv conftest.h $ac_file
12166   fi
12167 fi; done
12168
12169 EOF
12170 cat >> $CONFIG_STATUS <<EOF
12171
12172 EOF
12173 cat >> $CONFIG_STATUS <<\EOF
12174
12175 date > stamp-h
12176 echo Please \"make depend\" to build dependencies
12177
12178 exit 0
12179 EOF
12180 chmod +x $CONFIG_STATUS
12181 rm -fr confdefs* $ac_clean_files
12182 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12183