]> git.sur5r.net Git - openldap/blob - configure
Relocate headers checks to above libraries such that their results can
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.1 
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-cleartext  enable cleartext passwords (yes)"
55 ac_help="$ac_help
56     --enable-crypt      enable crypt(3) passwords (auto)"
57 ac_help="$ac_help
58     --enable-modules    enable dynamic module support (no)"
59 ac_help="$ac_help
60     --enable-phonetic   enable phonetic/soundex (no)"
61 ac_help="$ac_help
62     --enable-rlookups   enable reverse lookups (auto)"
63 ac_help="$ac_help
64     --enable-wrappers   enable tcp wrapper support (no)"
65 ac_help="$ac_help
66     --enable-bdb2       enable bdb2 backend (no)"
67 ac_help="$ac_help
68       --with-bdb2-module        module type (static)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72       --with-ldap-module        module type (static)"
73 ac_help="$ac_help
74     --enable-ldbm       enable ldbm backend (yes)"
75 ac_help="$ac_help
76       --with-ldbm-module        module type (static)"
77 ac_help="$ac_help
78       --with-ldbm-api   use LDBM API (auto)"
79 ac_help="$ac_help
80       --with-ldbm-type  use LDBM type (auto)"
81 ac_help="$ac_help
82     --enable-passwd     enable passwd backend (no)"
83 ac_help="$ac_help
84       --with-passwd-module      module type (static)"
85 ac_help="$ac_help
86     --enable-perl       enable perl backend (no)"
87 ac_help="$ac_help
88       --with-perl-module        module type (static)"
89 ac_help="$ac_help
90     --enable-shell      enable shell backend (no)"
91 ac_help="$ac_help
92       --with-shell-module       module type (static)"
93 ac_help="$ac_help
94     --enable-tcl        enable tcl backend (no)"
95 ac_help="$ac_help
96       --with-tcl-module module type (static)"
97 ac_help="$ac_help
98 SLURPD Options:"
99 ac_help="$ac_help
100   --enable-slurpd       enable building slurpd (auto)"
101 ac_help="$ac_help
102 Library Generation & Linking Options"
103 ac_help="$ac_help
104   --enable-static[=PKGS]  build static libraries [default=yes]"
105 ac_help="$ac_help
106   --enable-shared[=PKGS]  build shared libraries [default=yes]"
107 ac_help="$ac_help
108   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
109 ac_help="$ac_help
110   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
111 ac_help="$ac_help
112   --disable-libtool-lock  avoid locking (might break parallel builds)"
113
114 # Initialize some variables set by options.
115 # The variables have the same names as the options, with
116 # dashes changed to underlines.
117 build=NONE
118 cache_file=./config.cache
119 exec_prefix=NONE
120 host=NONE
121 no_create=
122 nonopt=NONE
123 no_recursion=
124 prefix=NONE
125 program_prefix=NONE
126 program_suffix=NONE
127 program_transform_name=s,x,x,
128 silent=
129 site=
130 srcdir=
131 target=NONE
132 verbose=
133 x_includes=NONE
134 x_libraries=NONE
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datadir='${prefix}/share'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${prefix}/info'
146 mandir='${prefix}/man'
147
148 # Initialize some other variables.
149 subdirs=
150 MFLAGS= MAKEFLAGS=
151 SHELL=${CONFIG_SHELL-/bin/sh}
152 # Maximum number of lines to put in a shell here document.
153 ac_max_here_lines=12
154
155 ac_prev=
156 for ac_option
157 do
158
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   case "$ac_option" in
167   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
168   *) ac_optarg= ;;
169   esac
170
171   # Accept the important Cygnus configure options, so we can diagnose typos.
172
173   case "$ac_option" in
174
175   -bindir | --bindir | --bindi | --bind | --bin | --bi)
176     ac_prev=bindir ;;
177   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
178     bindir="$ac_optarg" ;;
179
180   -build | --build | --buil | --bui | --bu)
181     ac_prev=build ;;
182   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
183     build="$ac_optarg" ;;
184
185   -cache-file | --cache-file | --cache-fil | --cache-fi \
186   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
187     ac_prev=cache_file ;;
188   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
189   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
190     cache_file="$ac_optarg" ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir="$ac_optarg" ;;
197
198   -disable-* | --disable-*)
199     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
200     # Reject names that are not valid shell variable names.
201     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
202       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
203     fi
204     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
205     eval "enable_${ac_feature}=no" ;;
206
207   -enable-* | --enable-*)
208     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
209     # Reject names that are not valid shell variable names.
210     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
211       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
212     fi
213     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
214     case "$ac_option" in
215       *=*) ;;
216       *) ac_optarg=yes ;;
217     esac
218     eval "enable_${ac_feature}='$ac_optarg'" ;;
219
220   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
221   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
222   | --exec | --exe | --ex)
223     ac_prev=exec_prefix ;;
224   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
225   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
226   | --exec=* | --exe=* | --ex=*)
227     exec_prefix="$ac_optarg" ;;
228
229   -gas | --gas | --ga | --g)
230     # Obsolete; use --with-gas.
231     with_gas=yes ;;
232
233   -help | --help | --hel | --he)
234     # Omit some internal or obsolete options to make the list less imposing.
235     # This message is too long to be a string in the A/UX 3.1 sh.
236     cat << EOF
237 Usage: configure [options] [host]
238 Options: [defaults in brackets after descriptions]
239 Configuration:
240   --cache-file=FILE       cache test results in FILE
241   --help                  print this message
242   --no-create             do not create output files
243   --quiet, --silent       do not print \`checking...' messages
244   --version               print the version of autoconf that created configure
245 Directory and file names:
246   --prefix=PREFIX         install architecture-independent files in PREFIX
247                           [$ac_default_prefix]
248   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
249                           [same as prefix]
250   --bindir=DIR            user executables in DIR [EPREFIX/bin]
251   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
252   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
253   --datadir=DIR           read-only architecture-independent data in DIR
254                           [PREFIX/share]
255   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
256   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
257                           [PREFIX/com]
258   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
259   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
260   --includedir=DIR        C header files in DIR [PREFIX/include]
261   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
262   --infodir=DIR           info documentation in DIR [PREFIX/info]
263   --mandir=DIR            man documentation in DIR [PREFIX/man]
264   --srcdir=DIR            find the sources in DIR [configure dir or ..]
265   --program-prefix=PREFIX prepend PREFIX to installed program names
266   --program-suffix=SUFFIX append SUFFIX to installed program names
267   --program-transform-name=PROGRAM
268                           run sed PROGRAM on installed program names
269 EOF
270     cat << EOF
271 Host type:
272   --build=BUILD           configure for building on BUILD [BUILD=HOST]
273   --host=HOST             configure for HOST [guessed]
274   --target=TARGET         configure for TARGET [TARGET=HOST]
275 Features and packages:
276   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
277   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
278   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
279   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
280   --x-includes=DIR        X include files are in DIR
281   --x-libraries=DIR       X library files are in DIR
282 EOF
283     if test -n "$ac_help"; then
284       echo "--enable and --with options recognized:$ac_help"
285     fi
286     exit 0 ;;
287
288   -host | --host | --hos | --ho)
289     ac_prev=host ;;
290   -host=* | --host=* | --hos=* | --ho=*)
291     host="$ac_optarg" ;;
292
293   -includedir | --includedir | --includedi | --included | --include \
294   | --includ | --inclu | --incl | --inc)
295     ac_prev=includedir ;;
296   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
297   | --includ=* | --inclu=* | --incl=* | --inc=*)
298     includedir="$ac_optarg" ;;
299
300   -infodir | --infodir | --infodi | --infod | --info | --inf)
301     ac_prev=infodir ;;
302   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
303     infodir="$ac_optarg" ;;
304
305   -libdir | --libdir | --libdi | --libd)
306     ac_prev=libdir ;;
307   -libdir=* | --libdir=* | --libdi=* | --libd=*)
308     libdir="$ac_optarg" ;;
309
310   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
311   | --libexe | --libex | --libe)
312     ac_prev=libexecdir ;;
313   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
314   | --libexe=* | --libex=* | --libe=*)
315     libexecdir="$ac_optarg" ;;
316
317   -localstatedir | --localstatedir | --localstatedi | --localstated \
318   | --localstate | --localstat | --localsta | --localst \
319   | --locals | --local | --loca | --loc | --lo)
320     ac_prev=localstatedir ;;
321   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
322   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
323   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
324     localstatedir="$ac_optarg" ;;
325
326   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
327     ac_prev=mandir ;;
328   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
329     mandir="$ac_optarg" ;;
330
331   -nfp | --nfp | --nf)
332     # Obsolete; use --without-fp.
333     with_fp=no ;;
334
335   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
336   | --no-cr | --no-c)
337     no_create=yes ;;
338
339   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
340   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
341     no_recursion=yes ;;
342
343   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
344   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
345   | --oldin | --oldi | --old | --ol | --o)
346     ac_prev=oldincludedir ;;
347   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
348   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
349   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
350     oldincludedir="$ac_optarg" ;;
351
352   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
353     ac_prev=prefix ;;
354   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
355     prefix="$ac_optarg" ;;
356
357   -program-prefix | --program-prefix | --program-prefi | --program-pref \
358   | --program-pre | --program-pr | --program-p)
359     ac_prev=program_prefix ;;
360   -program-prefix=* | --program-prefix=* | --program-prefi=* \
361   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
362     program_prefix="$ac_optarg" ;;
363
364   -program-suffix | --program-suffix | --program-suffi | --program-suff \
365   | --program-suf | --program-su | --program-s)
366     ac_prev=program_suffix ;;
367   -program-suffix=* | --program-suffix=* | --program-suffi=* \
368   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
369     program_suffix="$ac_optarg" ;;
370
371   -program-transform-name | --program-transform-name \
372   | --program-transform-nam | --program-transform-na \
373   | --program-transform-n | --program-transform- \
374   | --program-transform | --program-transfor \
375   | --program-transfo | --program-transf \
376   | --program-trans | --program-tran \
377   | --progr-tra | --program-tr | --program-t)
378     ac_prev=program_transform_name ;;
379   -program-transform-name=* | --program-transform-name=* \
380   | --program-transform-nam=* | --program-transform-na=* \
381   | --program-transform-n=* | --program-transform-=* \
382   | --program-transform=* | --program-transfor=* \
383   | --program-transfo=* | --program-transf=* \
384   | --program-trans=* | --program-tran=* \
385   | --progr-tra=* | --program-tr=* | --program-t=*)
386     program_transform_name="$ac_optarg" ;;
387
388   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
389   | -silent | --silent | --silen | --sile | --sil)
390     silent=yes ;;
391
392   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
393     ac_prev=sbindir ;;
394   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
395   | --sbi=* | --sb=*)
396     sbindir="$ac_optarg" ;;
397
398   -sharedstatedir | --sharedstatedir | --sharedstatedi \
399   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
400   | --sharedst | --shareds | --shared | --share | --shar \
401   | --sha | --sh)
402     ac_prev=sharedstatedir ;;
403   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
404   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
405   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
406   | --sha=* | --sh=*)
407     sharedstatedir="$ac_optarg" ;;
408
409   -site | --site | --sit)
410     ac_prev=site ;;
411   -site=* | --site=* | --sit=*)
412     site="$ac_optarg" ;;
413
414   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
415     ac_prev=srcdir ;;
416   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
417     srcdir="$ac_optarg" ;;
418
419   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
420   | --syscon | --sysco | --sysc | --sys | --sy)
421     ac_prev=sysconfdir ;;
422   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
423   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
424     sysconfdir="$ac_optarg" ;;
425
426   -target | --target | --targe | --targ | --tar | --ta | --t)
427     ac_prev=target ;;
428   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
429     target="$ac_optarg" ;;
430
431   -v | -verbose | --verbose | --verbos | --verbo | --verb)
432     verbose=yes ;;
433
434   -version | --version | --versio | --versi | --vers)
435     echo "configure generated by autoconf version 2.13.1"
436     exit 0 ;;
437
438   -with-* | --with-*)
439     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
440     # Reject names that are not valid shell variable names.
441     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
442       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
443     fi
444     ac_package=`echo $ac_package| sed 's/-/_/g'`
445     case "$ac_option" in
446       *=*) ;;
447       *) ac_optarg=yes ;;
448     esac
449     eval "with_${ac_package}='$ac_optarg'" ;;
450
451   -without-* | --without-*)
452     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
453     # Reject names that are not valid shell variable names.
454     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
455       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
456     fi
457     ac_package=`echo $ac_package| sed 's/-/_/g'`
458     eval "with_${ac_package}=no" ;;
459
460   --x)
461     # Obsolete; use --with-x.
462     with_x=yes ;;
463
464   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
465   | --x-incl | --x-inc | --x-in | --x-i)
466     ac_prev=x_includes ;;
467   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
468   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
469     x_includes="$ac_optarg" ;;
470
471   -x-libraries | --x-libraries | --x-librarie | --x-librari \
472   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
473     ac_prev=x_libraries ;;
474   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
475   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
476     x_libraries="$ac_optarg" ;;
477
478   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
479     ;;
480
481   *)
482     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
483       echo "configure: warning: $ac_option: invalid host type" 1>&2
484     fi
485     if test "x$nonopt" != xNONE; then
486       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
487     fi
488     nonopt="$ac_option"
489     ;;
490
491   esac
492 done
493
494 if test -n "$ac_prev"; then
495   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
496 fi
497
498 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
499
500 # File descriptor usage:
501 # 0 standard input
502 # 1 file creation
503 # 2 errors and warnings
504 # 3 some systems may open it to /dev/tty
505 # 4 used on the Kubota Titan
506 # 6 checking for... messages and results
507 # 5 compiler messages saved in config.log
508 if test "$silent" = yes; then
509   exec 6>/dev/null
510 else
511   exec 6>&1
512 fi
513 exec 5>./config.log
514
515 echo "\
516 This file contains any messages produced by compilers while
517 running configure, to aid debugging if configure makes a mistake.
518 " 1>&5
519
520 # Strip out --no-create and --no-recursion so they do not pile up.
521 # Also quote any args containing shell metacharacters.
522 ac_configure_args=
523 for ac_arg
524 do
525   case "$ac_arg" in
526   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
527   | --no-cr | --no-c) ;;
528   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
529   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
530   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
531   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
532   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
533   esac
534 done
535
536 # NLS nuisances.
537 # Only set these to C if already set.  These must not be set unconditionally
538 # because not all systems understand e.g. LANG=C (notably SCO).
539 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
540 # Non-C LC_CTYPE values break the ctype check.
541 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
542 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
543 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
544 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
545
546 # confdefs.h avoids OS command line length limits that DEFS can exceed.
547 rm -rf conftest* confdefs.h
548 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
549 echo > confdefs.h
550
551 # A filename unique to this package, relative to the directory that
552 # configure is in, which we can look for to find out if srcdir is correct.
553 ac_unique_file=build/version
554
555 # Find the source files, if location was not specified.
556 if test -z "$srcdir"; then
557   ac_srcdir_defaulted=yes
558   # Try the directory containing this script, then its parent.
559   ac_prog=$0
560   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
561   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
562   srcdir=$ac_confdir
563   if test ! -r $srcdir/$ac_unique_file; then
564     srcdir=..
565   fi
566 else
567   ac_srcdir_defaulted=no
568 fi
569 if test ! -r $srcdir/$ac_unique_file; then
570   if test "$ac_srcdir_defaulted" = yes; then
571     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
572   else
573     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
574   fi
575 fi
576 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
577
578 # Prefer explicitly selected file to automatically selected ones.
579 if test -z "$CONFIG_SITE"; then
580   if test "x$prefix" != xNONE; then
581     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
582   else
583     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
584   fi
585 fi
586 for ac_site_file in $CONFIG_SITE; do
587   if test -r "$ac_site_file"; then
588     echo "loading site script $ac_site_file"
589     . "$ac_site_file"
590   fi
591 done
592
593
594 ac_ext=c
595 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
596 ac_cpp='$CPP $CPPFLAGS'
597 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
598 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
599 cross_compiling=$ac_cv_prog_cc_cross
600
601 ac_exeext=
602 ac_objext=o
603 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
604   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
605   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
606     ac_n= ac_c='
607 ' ac_t='        '
608   else
609     ac_n=-n ac_c= ac_t=
610   fi
611 else
612   ac_n= ac_c='\c' ac_t=
613 fi
614
615 ac_aux_dir=
616 for ac_dir in build $srcdir/build; do
617   if test -f $ac_dir/install-sh; then
618     ac_aux_dir=$ac_dir
619     ac_install_sh="$ac_aux_dir/install-sh -c"
620     break
621   elif test -f $ac_dir/install.sh; then
622     ac_aux_dir=$ac_dir
623     ac_install_sh="$ac_aux_dir/install.sh -c"
624     break
625   fi
626 done
627 if test -z "$ac_aux_dir"; then
628   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
629 fi
630 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
631 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
632 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
633
634 OL_VERSION=`cat $ac_aux_dir/version`
635 if test -z "$OL_VERSION"; then
636         { echo "configure: error: could not determine version" 1>&2; exit 1; }
637 fi
638
639
640 echo $ac_n "checking host system type""... $ac_c" 1>&6
641 echo "configure:642: checking host system type" >&5
642 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
643
644 # Make sure we can run config.sub.
645   if $ac_config_sub sun4 >/dev/null 2>&1; then :
646     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
647   fi
648
649   ac_cv_host_alias=$host
650   case "$ac_cv_host_alias" in
651   NONE)
652     case $nonopt in
653     NONE)
654       if ac_cv_host_alias=`$ac_config_guess`; then :
655       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
656       fi ;;
657     *) ac_cv_host_alias=$nonopt ;;
658     esac ;;
659   esac
660
661   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
662   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
663   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
664   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
665 else
666   echo $ac_n "(cached) $ac_c" 1>&6
667 fi
668
669 echo "$ac_t""$ac_cv_host" 1>&6
670
671 host=$ac_cv_host
672 host_alias=$ac_cv_host_alias
673 host_cpu=$ac_cv_host_cpu
674 host_vendor=$ac_cv_host_vendor
675 host_os=$ac_cv_host_os
676
677
678
679
680
681 echo $ac_n "checking target system type""... $ac_c" 1>&6
682 echo "configure:683: checking target system type" >&5
683 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
684
685 # Make sure we can run config.sub.
686   if $ac_config_sub sun4 >/dev/null 2>&1; then :
687     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
688   fi
689
690   ac_cv_target_alias=$target
691   case "$ac_cv_target_alias" in
692   NONE)
693     case $nonopt in
694     NONE)
695       ac_cv_target_alias=$host_alias ;;
696
697     *) ac_cv_target_alias=$nonopt ;;
698     esac ;;
699   esac
700
701   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
702   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
703   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
704   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
705 else
706   echo $ac_n "(cached) $ac_c" 1>&6
707 fi
708
709 echo "$ac_t""$ac_cv_target" 1>&6
710
711 target=$ac_cv_target
712 target_alias=$ac_cv_target_alias
713 target_cpu=$ac_cv_target_cpu
714 target_vendor=$ac_cv_target_vendor
715 target_os=$ac_cv_target_os
716
717
718
719
720
721 echo $ac_n "checking build system type""... $ac_c" 1>&6
722 echo "configure:723: checking build system type" >&5
723 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
724
725 # Make sure we can run config.sub.
726   if $ac_config_sub sun4 >/dev/null 2>&1; then :
727     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
728   fi
729
730   ac_cv_build_alias=$build
731   case "$ac_cv_build_alias" in
732   NONE)
733     case $nonopt in
734     NONE)
735       ac_cv_build_alias=$host_alias ;;
736
737     *) ac_cv_build_alias=$nonopt ;;
738     esac ;;
739   esac
740
741   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
742   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
743   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
744   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
745 else
746   echo $ac_n "(cached) $ac_c" 1>&6
747 fi
748
749 echo "$ac_t""$ac_cv_build" 1>&6
750
751 build=$ac_cv_build
752 build_alias=$ac_cv_build_alias
753 build_cpu=$ac_cv_build_cpu
754 build_vendor=$ac_cv_build_vendor
755 build_os=$ac_cv_build_os
756
757
758
759
760
761 # Do some error checking and defaulting for the host and target type.
762 # The inputs are:
763 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
764 #
765 # The rules are:
766 # 1. You are not allowed to specify --host, --target, and nonopt at the
767 #    same time.
768 # 2. Host defaults to nonopt.
769 # 3. If nonopt is not specified, then host defaults to the current host,
770 #    as determined by config.guess.
771 # 4. Target and build default to nonopt.
772 # 5. If nonopt is not specified, then target and build default to host.
773
774 # The aliases save the names the user supplied, while $host etc.
775 # will get canonicalized.
776 case $host---$target---$nonopt in
777 NONE---*---* | *---NONE---* | *---*---NONE) ;;
778 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
779 esac
780
781 test "$host_alias" != "$target_alias" &&
782   test "$program_prefix$program_suffix$program_transform_name" = \
783     NONENONEs,x,x, &&
784   program_prefix=${target_alias}-
785
786
787 # Find a good install program.  We prefer a C program (faster),
788 # so one script is as good as another.  But avoid the broken or
789 # incompatible versions:
790 # SysV /etc/install, /usr/sbin/install
791 # SunOS /usr/etc/install
792 # IRIX /sbin/install
793 # AIX /bin/install
794 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
795 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
796 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
797 # ./install, which can be erroneously created by make from ./install.sh.
798 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
799 echo "configure:800: checking for a BSD compatible install" >&5
800 if test -z "$INSTALL"; then
801 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
802   echo $ac_n "(cached) $ac_c" 1>&6
803 else
804     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
805   for ac_dir in $PATH; do
806     # Account for people who put trailing slashes in PATH elements.
807     case "$ac_dir/" in
808     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
809     *)
810       # OSF1 and SCO ODT 3.0 have their own names for install.
811       # Don't use installbsd from OSF since it installs stuff as root
812       # by default.
813       for ac_prog in ginstall scoinst install; do
814         if test -f $ac_dir/$ac_prog; then
815           if test $ac_prog = install &&
816             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
817             # AIX install.  It has an incompatible calling convention.
818             :
819           elif test $ac_prog = install &&
820             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
821             # program-specific install script used by HP pwplus--don't use.
822             :
823           else
824             ac_cv_path_install="$ac_dir/$ac_prog -c"
825             break 2
826           fi
827         fi
828       done
829       ;;
830     esac
831   done
832   IFS="$ac_save_IFS"
833
834 fi
835   if test "${ac_cv_path_install+set}" = set; then
836     INSTALL="$ac_cv_path_install"
837   else
838     # As a last resort, use the slow shell script.  We don't cache a
839     # path for INSTALL within a source directory, because that will
840     # break other packages using the cache if that directory is
841     # removed, or if the path is relative.
842     INSTALL="$ac_install_sh"
843   fi
844 fi
845 echo "$ac_t""$INSTALL" 1>&6
846
847 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
848 # It thinks the first close brace ends the variable substitution.
849 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
850
851 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
852
853 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
854
855 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
856 echo "configure:857: checking whether build environment is sane" >&5
857 # Just in case
858 sleep 1
859 echo timestamp > conftestfile
860 # Do `set' in a subshell so we don't clobber the current shell's
861 # arguments.  Must try -L first in case configure is actually a
862 # symlink; some systems play weird games with the mod time of symlinks
863 # (eg FreeBSD returns the mod time of the symlink's containing
864 # directory).
865 if (
866    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
867    if test "$*" = "X"; then
868       # -L didn't work.
869       set X `ls -t $srcdir/configure conftestfile`
870    fi
871    if test "$*" != "X $srcdir/configure conftestfile" \
872       && test "$*" != "X conftestfile $srcdir/configure"; then
873
874       # If neither matched, then we have a broken ls.  This can happen
875       # if, for instance, CONFIG_SHELL is bash and it inherits a
876       # broken ls alias from the environment.  This has actually
877       # happened.  Such a system could not be considered "sane".
878       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
879 alias in your environment" 1>&2; exit 1; }
880    fi
881
882    test "$2" = conftestfile
883    )
884 then
885    # Ok.
886    :
887 else
888    { echo "configure: error: newly created file is older than distributed files!
889 Check your system clock" 1>&2; exit 1; }
890 fi
891 rm -f conftest*
892 echo "$ac_t""yes" 1>&6
893 if test "$program_transform_name" = s,x,x,; then
894   program_transform_name=
895 else
896   # Double any \ or $.  echo might interpret backslashes.
897   cat <<\EOF_SED > conftestsed
898 s,\\,\\\\,g; s,\$,$$,g
899 EOF_SED
900   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
901   rm -f conftestsed
902 fi
903 test "$program_prefix" != NONE &&
904   program_transform_name="s,^,${program_prefix},;$program_transform_name"
905 # Use a double $ so make ignores it.
906 test "$program_suffix" != NONE &&
907   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
908
909 # sed with no file args requires a program.
910 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
911
912 for ac_prog in mawk gawk nawk awk
913 do
914 # Extract the first word of "$ac_prog", so it can be a program name with args.
915 set dummy $ac_prog; ac_word=$2
916 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
917 echo "configure:918: checking for $ac_word" >&5
918 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
919   echo $ac_n "(cached) $ac_c" 1>&6
920 else
921   if test -n "$AWK"; then
922   ac_cv_prog_AWK="$AWK" # Let the user override the test.
923 else
924   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
925   ac_dummy="$PATH"
926   for ac_dir in $ac_dummy; do
927     test -z "$ac_dir" && ac_dir=.
928     if test -f $ac_dir/$ac_word; then
929       ac_cv_prog_AWK="$ac_prog"
930       break
931     fi
932   done
933   IFS="$ac_save_ifs"
934 fi
935 fi
936 AWK="$ac_cv_prog_AWK"
937 if test -n "$AWK"; then
938   echo "$ac_t""$AWK" 1>&6
939 else
940   echo "$ac_t""no" 1>&6
941 fi
942
943 test -n "$AWK" && break
944 done
945
946 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
947 echo "configure:948: checking whether ${MAKE-make} sets \${MAKE}" >&5
948 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
949 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
950   echo $ac_n "(cached) $ac_c" 1>&6
951 else
952   cat > conftestmake <<\EOF
953 all:
954         @echo 'ac_maketemp="${MAKE}"'
955 EOF
956 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
957 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
958 if test -n "$ac_maketemp"; then
959   eval ac_cv_prog_make_${ac_make}_set=yes
960 else
961   eval ac_cv_prog_make_${ac_make}_set=no
962 fi
963 rm -f conftestmake
964 fi
965 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
966   echo "$ac_t""yes" 1>&6
967   SET_MAKE=
968 else
969   echo "$ac_t""no" 1>&6
970   SET_MAKE="MAKE=${MAKE-make}"
971 fi
972
973
974
975 PACKAGE=OpenLDAP
976
977 VERSION=$OL_VERSION
978
979 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
980   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
981 fi
982
983
984
985 missing_dir=`cd $ac_aux_dir && pwd`
986 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
987 echo "configure:988: checking for working aclocal" >&5
988 # Run test in a subshell; some versions of sh will print an error if
989 # an executable is not found, even if stderr is redirected.
990 # Redirect stdin to placate older versions of autoconf.  Sigh.
991 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
992    ACLOCAL=aclocal
993    echo "$ac_t""found" 1>&6
994 else
995    ACLOCAL="$missing_dir/missing aclocal"
996    echo "$ac_t""missing" 1>&6
997 fi
998
999 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1000 echo "configure:1001: checking for working autoconf" >&5
1001 # Run test in a subshell; some versions of sh will print an error if
1002 # an executable is not found, even if stderr is redirected.
1003 # Redirect stdin to placate older versions of autoconf.  Sigh.
1004 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1005    AUTOCONF=autoconf
1006    echo "$ac_t""found" 1>&6
1007 else
1008    AUTOCONF="$missing_dir/missing autoconf"
1009    echo "$ac_t""missing" 1>&6
1010 fi
1011
1012 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1013 echo "configure:1014: checking for working automake" >&5
1014 # Run test in a subshell; some versions of sh will print an error if
1015 # an executable is not found, even if stderr is redirected.
1016 # Redirect stdin to placate older versions of autoconf.  Sigh.
1017 if (automake --version) < /dev/null > /dev/null 2>&1; then
1018    AUTOMAKE=automake
1019    echo "$ac_t""found" 1>&6
1020 else
1021    AUTOMAKE="$missing_dir/missing automake"
1022    echo "$ac_t""missing" 1>&6
1023 fi
1024
1025 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1026 echo "configure:1027: checking for working autoheader" >&5
1027 # Run test in a subshell; some versions of sh will print an error if
1028 # an executable is not found, even if stderr is redirected.
1029 # Redirect stdin to placate older versions of autoconf.  Sigh.
1030 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1031    AUTOHEADER=autoheader
1032    echo "$ac_t""found" 1>&6
1033 else
1034    AUTOHEADER="$missing_dir/missing autoheader"
1035    echo "$ac_t""missing" 1>&6
1036 fi
1037
1038 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1039 echo "configure:1040: checking for working makeinfo" >&5
1040 # Run test in a subshell; some versions of sh will print an error if
1041 # an executable is not found, even if stderr is redirected.
1042 # Redirect stdin to placate older versions of autoconf.  Sigh.
1043 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1044    MAKEINFO=makeinfo
1045    echo "$ac_t""found" 1>&6
1046 else
1047    MAKEINFO="$missing_dir/missing makeinfo"
1048    echo "$ac_t""missing" 1>&6
1049 fi
1050
1051 install_sh="$missing_dir/install-sh"
1052 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1053
1054 for ac_prog in gnutar gtar tar
1055 do
1056 # Extract the first word of "$ac_prog", so it can be a program name with args.
1057 set dummy $ac_prog; ac_word=$2
1058 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1059 echo "configure:1060: checking for $ac_word" >&5
1060 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1061   echo $ac_n "(cached) $ac_c" 1>&6
1062 else
1063   if test -n "$AMTAR"; then
1064   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1065 else
1066   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1067   ac_dummy="$PATH"
1068   for ac_dir in $ac_dummy; do
1069     test -z "$ac_dir" && ac_dir=.
1070     if test -f $ac_dir/$ac_word; then
1071       ac_cv_prog_AMTAR="$ac_prog"
1072       break
1073     fi
1074   done
1075   IFS="$ac_save_ifs"
1076 fi
1077 fi
1078 AMTAR="$ac_cv_prog_AMTAR"
1079 if test -n "$AMTAR"; then
1080   echo "$ac_t""$AMTAR" 1>&6
1081 else
1082   echo "$ac_t""no" 1>&6
1083 fi
1084
1085 test -n "$AMTAR" && break
1086 done
1087
1088
1089 AMTARFLAGS=
1090 if test -n "$AMTAR"; then
1091   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1092         AMTARFLAGS=o
1093   fi
1094 fi
1095
1096
1097
1098 cat >> confdefs.h <<EOF
1099 #define OPENLDAP_PACKAGE "$PACKAGE"
1100 EOF
1101
1102 cat >> confdefs.h <<EOF
1103 #define OPENLDAP_VERSION "$VERSION"
1104 EOF
1105
1106
1107
1108
1109 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1110 echo "configure:1111: checking configure arguments" >&5
1111
1112
1113 top_builddir=`pwd`
1114
1115 ldap_subdir="openldap"
1116
1117 # Check whether --with-subdir or --without-subdir was given.
1118 if test "${with_subdir+set}" = set; then
1119   withval="$with_subdir"
1120   
1121         if test "$withval" = "no"; then
1122                 ldap_subdir=""
1123         elif test "$withval" != "yes"; then
1124                 ldap_subdir="$withval"
1125         fi
1126
1127 fi
1128
1129
1130 # OpenLDAP --enable-debug
1131         # Check whether --enable-debug or --disable-debug was given.
1132 if test "${enable_debug+set}" = set; then
1133   enableval="$enable_debug"
1134   
1135         ol_arg=invalid
1136         for ol_val in auto yes no ; do
1137                 if test "$enableval" = "$ol_val" ; then
1138                         ol_arg="$ol_val"
1139                 fi
1140         done
1141         if test "$ol_arg" = "invalid" ; then
1142                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1143         fi
1144         ol_enable_debug="$ol_arg"
1145
1146 else
1147         ol_enable_debug="yes"
1148 fi
1149 # end --enable-debug
1150 # OpenLDAP --enable-syslog
1151         # Check whether --enable-syslog or --disable-syslog was given.
1152 if test "${enable_syslog+set}" = set; then
1153   enableval="$enable_syslog"
1154   
1155         ol_arg=invalid
1156         for ol_val in auto yes no ; do
1157                 if test "$enableval" = "$ol_val" ; then
1158                         ol_arg="$ol_val"
1159                 fi
1160         done
1161         if test "$ol_arg" = "invalid" ; then
1162                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1163         fi
1164         ol_enable_syslog="$ol_arg"
1165
1166 else
1167         ol_enable_syslog="auto"
1168 fi
1169 # end --enable-syslog
1170 # OpenLDAP --enable-proctitle
1171         # Check whether --enable-proctitle or --disable-proctitle was given.
1172 if test "${enable_proctitle+set}" = set; then
1173   enableval="$enable_proctitle"
1174   
1175         ol_arg=invalid
1176         for ol_val in auto yes no ; do
1177                 if test "$enableval" = "$ol_val" ; then
1178                         ol_arg="$ol_val"
1179                 fi
1180         done
1181         if test "$ol_arg" = "invalid" ; then
1182                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1183         fi
1184         ol_enable_proctitle="$ol_arg"
1185
1186 else
1187         ol_enable_proctitle="yes"
1188 fi
1189 # end --enable-proctitle
1190 # OpenLDAP --enable-cache
1191         # Check whether --enable-cache or --disable-cache was given.
1192 if test "${enable_cache+set}" = set; then
1193   enableval="$enable_cache"
1194   
1195         ol_arg=invalid
1196         for ol_val in auto yes no ; do
1197                 if test "$enableval" = "$ol_val" ; then
1198                         ol_arg="$ol_val"
1199                 fi
1200         done
1201         if test "$ol_arg" = "invalid" ; then
1202                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1203         fi
1204         ol_enable_cache="$ol_arg"
1205
1206 else
1207         ol_enable_cache="yes"
1208 fi
1209 # end --enable-cache
1210 # OpenLDAP --enable-dns
1211         # Check whether --enable-dns or --disable-dns was given.
1212 if test "${enable_dns+set}" = set; then
1213   enableval="$enable_dns"
1214   
1215         ol_arg=invalid
1216         for ol_val in auto yes no ; do
1217                 if test "$enableval" = "$ol_val" ; then
1218                         ol_arg="$ol_val"
1219                 fi
1220         done
1221         if test "$ol_arg" = "invalid" ; then
1222                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1223         fi
1224         ol_enable_dns="$ol_arg"
1225
1226 else
1227         ol_enable_dns="no"
1228 fi
1229 # end --enable-dns
1230 # OpenLDAP --enable-referrals
1231         # Check whether --enable-referrals or --disable-referrals was given.
1232 if test "${enable_referrals+set}" = set; then
1233   enableval="$enable_referrals"
1234   
1235         ol_arg=invalid
1236         for ol_val in auto yes no ; do
1237                 if test "$enableval" = "$ol_val" ; then
1238                         ol_arg="$ol_val"
1239                 fi
1240         done
1241         if test "$ol_arg" = "invalid" ; then
1242                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1243         fi
1244         ol_enable_referrals="$ol_arg"
1245
1246 else
1247         ol_enable_referrals="yes"
1248 fi
1249 # end --enable-referrals
1250 # OpenLDAP --enable-cldap
1251         # Check whether --enable-cldap or --disable-cldap was given.
1252 if test "${enable_cldap+set}" = set; then
1253   enableval="$enable_cldap"
1254   
1255         ol_arg=invalid
1256         for ol_val in auto yes no ; do
1257                 if test "$enableval" = "$ol_val" ; then
1258                         ol_arg="$ol_val"
1259                 fi
1260         done
1261         if test "$ol_arg" = "invalid" ; then
1262                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1263         fi
1264         ol_enable_cldap="$ol_arg"
1265
1266 else
1267         ol_enable_cldap="no"
1268 fi
1269 # end --enable-cldap
1270 # OpenLDAP --enable-x_compile
1271         # Check whether --enable-x_compile or --disable-x_compile was given.
1272 if test "${enable_x_compile+set}" = set; then
1273   enableval="$enable_x_compile"
1274   
1275         ol_arg=invalid
1276         for ol_val in yes no ; do
1277                 if test "$enableval" = "$ol_val" ; then
1278                         ol_arg="$ol_val"
1279                 fi
1280         done
1281         if test "$ol_arg" = "invalid" ; then
1282                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1283         fi
1284         ol_enable_x_compile="$ol_arg"
1285
1286 else
1287         ol_enable_x_compile="no"
1288 fi
1289 # end --enable-x_compile
1290
1291 # OpenLDAP --enable-dmalloc
1292         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1293 if test "${enable_dmalloc+set}" = set; then
1294   enableval="$enable_dmalloc"
1295   
1296         ol_arg=invalid
1297         for ol_val in auto yes no ; do
1298                 if test "$enableval" = "$ol_val" ; then
1299                         ol_arg="$ol_val"
1300                 fi
1301         done
1302         if test "$ol_arg" = "invalid" ; then
1303                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1304         fi
1305         ol_enable_dmalloc="$ol_arg"
1306
1307 else
1308         ol_enable_dmalloc="no"
1309 fi
1310 # end --enable-dmalloc
1311
1312 # OpenLDAP --with-kerberos
1313         # Check whether --with-kerberos or --without-kerberos was given.
1314 if test "${with_kerberos+set}" = set; then
1315   withval="$with_kerberos"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto k5 k4 afs yes no ; do
1319                 if test "$withval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1325         fi
1326         ol_with_kerberos="$ol_arg"
1327
1328 else
1329         ol_with_kerberos="auto"
1330 fi
1331 # end --with-kerberos
1332
1333 # OpenLDAP --with-readline
1334         # Check whether --with-readline or --without-readline was given.
1335 if test "${with_readline+set}" = set; then
1336   withval="$with_readline"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no  ; do
1340                 if test "$withval" = "$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 $withval for --with-readline" 1>&2; exit 1; }
1346         fi
1347         ol_with_readline="$ol_arg"
1348
1349 else
1350         ol_with_readline="auto"
1351 fi
1352 # end --with-readline
1353
1354 # OpenLDAP --with-threads
1355         # Check whether --with-threads or --without-threads was given.
1356 if test "${with_threads+set}" = set; then
1357   withval="$with_threads"
1358   
1359         ol_arg=invalid
1360         for ol_val in auto posix mach lwp yes no manual  ; do
1361                 if test "$withval" = "$ol_val" ; then
1362                         ol_arg="$ol_val"
1363                 fi
1364         done
1365         if test "$ol_arg" = "invalid" ; then
1366                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1367         fi
1368         ol_with_threads="$ol_arg"
1369
1370 else
1371         ol_with_threads="auto"
1372 fi
1373 # end --with-threads
1374
1375 # OpenLDAP --with-tls
1376         # Check whether --with-tls or --without-tls was given.
1377 if test "${with_tls+set}" = set; then
1378   withval="$with_tls"
1379   
1380         ol_arg=invalid
1381         for ol_val in auto ssleay openssl yes no  ; do
1382                 if test "$withval" = "$ol_val" ; then
1383                         ol_arg="$ol_val"
1384                 fi
1385         done
1386         if test "$ol_arg" = "invalid" ; then
1387                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1388         fi
1389         ol_with_tls="$ol_arg"
1390
1391 else
1392         ol_with_tls="auto"
1393 fi
1394 # end --with-tls
1395
1396 # OpenLDAP --with-yielding_select
1397         # Check whether --with-yielding_select or --without-yielding_select was given.
1398 if test "${with_yielding_select+set}" = set; then
1399   withval="$with_yielding_select"
1400   
1401         ol_arg=invalid
1402         for ol_val in auto yes no manual  ; do
1403                 if test "$withval" = "$ol_val" ; then
1404                         ol_arg="$ol_val"
1405                 fi
1406         done
1407         if test "$ol_arg" = "invalid" ; then
1408                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1409         fi
1410         ol_with_yielding_select="$ol_arg"
1411
1412 else
1413         ol_with_yielding_select="auto"
1414 fi
1415 # end --with-yielding_select
1416
1417
1418
1419 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1420 if test "${with_xxldapdoptions+set}" = set; then
1421   withval="$with_xxldapdoptions"
1422   :
1423 fi
1424
1425 # OpenLDAP --enable-ldapd
1426         # Check whether --enable-ldapd or --disable-ldapd was given.
1427 if test "${enable_ldapd+set}" = set; then
1428   enableval="$enable_ldapd"
1429   
1430         ol_arg=invalid
1431         for ol_val in auto yes no ; do
1432                 if test "$enableval" = "$ol_val" ; then
1433                         ol_arg="$ol_val"
1434                 fi
1435         done
1436         if test "$ol_arg" = "invalid" ; then
1437                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1438         fi
1439         ol_enable_ldapd="$ol_arg"
1440
1441 else
1442         ol_enable_ldapd="no"
1443 fi
1444 # end --enable-ldapd
1445
1446 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1447 if test "${with_xxslapdoptions+set}" = set; then
1448   withval="$with_xxslapdoptions"
1449   :
1450 fi
1451
1452 # OpenLDAP --enable-slapd
1453         # Check whether --enable-slapd or --disable-slapd was given.
1454 if test "${enable_slapd+set}" = set; then
1455   enableval="$enable_slapd"
1456   
1457         ol_arg=invalid
1458         for ol_val in auto yes no ; do
1459                 if test "$enableval" = "$ol_val" ; then
1460                         ol_arg="$ol_val"
1461                 fi
1462         done
1463         if test "$ol_arg" = "invalid" ; then
1464                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1465         fi
1466         ol_enable_slapd="$ol_arg"
1467
1468 else
1469         ol_enable_slapd="yes"
1470 fi
1471 # end --enable-slapd
1472 # OpenLDAP --enable-cleartext
1473         # Check whether --enable-cleartext or --disable-cleartext was given.
1474 if test "${enable_cleartext+set}" = set; then
1475   enableval="$enable_cleartext"
1476   
1477         ol_arg=invalid
1478         for ol_val in auto yes no ; do
1479                 if test "$enableval" = "$ol_val" ; then
1480                         ol_arg="$ol_val"
1481                 fi
1482         done
1483         if test "$ol_arg" = "invalid" ; then
1484                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1485         fi
1486         ol_enable_cleartext="$ol_arg"
1487
1488 else
1489         ol_enable_cleartext="yes"
1490 fi
1491 # end --enable-cleartext
1492 # OpenLDAP --enable-crypt
1493         # Check whether --enable-crypt or --disable-crypt was given.
1494 if test "${enable_crypt+set}" = set; then
1495   enableval="$enable_crypt"
1496   
1497         ol_arg=invalid
1498         for ol_val in auto yes no ; do
1499                 if test "$enableval" = "$ol_val" ; then
1500                         ol_arg="$ol_val"
1501                 fi
1502         done
1503         if test "$ol_arg" = "invalid" ; then
1504                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1505         fi
1506         ol_enable_crypt="$ol_arg"
1507
1508 else
1509         ol_enable_crypt="auto"
1510 fi
1511 # end --enable-crypt
1512 # OpenLDAP --enable-modules
1513         # Check whether --enable-modules or --disable-modules was given.
1514 if test "${enable_modules+set}" = set; then
1515   enableval="$enable_modules"
1516   
1517         ol_arg=invalid
1518         for ol_val in auto yes no ; do
1519                 if test "$enableval" = "$ol_val" ; then
1520                         ol_arg="$ol_val"
1521                 fi
1522         done
1523         if test "$ol_arg" = "invalid" ; then
1524                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1525         fi
1526         ol_enable_modules="$ol_arg"
1527
1528 else
1529         ol_enable_modules="no"
1530 fi
1531 # end --enable-modules
1532 # OpenLDAP --enable-phonetic
1533         # Check whether --enable-phonetic or --disable-phonetic was given.
1534 if test "${enable_phonetic+set}" = set; then
1535   enableval="$enable_phonetic"
1536   
1537         ol_arg=invalid
1538         for ol_val in auto yes no ; do
1539                 if test "$enableval" = "$ol_val" ; then
1540                         ol_arg="$ol_val"
1541                 fi
1542         done
1543         if test "$ol_arg" = "invalid" ; then
1544                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1545         fi
1546         ol_enable_phonetic="$ol_arg"
1547
1548 else
1549         ol_enable_phonetic="no"
1550 fi
1551 # end --enable-phonetic
1552 # OpenLDAP --enable-rlookups
1553         # Check whether --enable-rlookups or --disable-rlookups was given.
1554 if test "${enable_rlookups+set}" = set; then
1555   enableval="$enable_rlookups"
1556   
1557         ol_arg=invalid
1558         for ol_val in auto yes no ; do
1559                 if test "$enableval" = "$ol_val" ; then
1560                         ol_arg="$ol_val"
1561                 fi
1562         done
1563         if test "$ol_arg" = "invalid" ; then
1564                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1565         fi
1566         ol_enable_rlookups="$ol_arg"
1567
1568 else
1569         ol_enable_rlookups="auto"
1570 fi
1571 # end --enable-rlookups
1572 # OpenLDAP --enable-wrappers
1573         # Check whether --enable-wrappers or --disable-wrappers was given.
1574 if test "${enable_wrappers+set}" = set; then
1575   enableval="$enable_wrappers"
1576   
1577         ol_arg=invalid
1578         for ol_val in auto yes no ; do
1579                 if test "$enableval" = "$ol_val" ; then
1580                         ol_arg="$ol_val"
1581                 fi
1582         done
1583         if test "$ol_arg" = "invalid" ; then
1584                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1585         fi
1586         ol_enable_wrappers="$ol_arg"
1587
1588 else
1589         ol_enable_wrappers="no"
1590 fi
1591 # end --enable-wrappers
1592
1593 # OpenLDAP --enable-bdb2
1594         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1595 if test "${enable_bdb2+set}" = set; then
1596   enableval="$enable_bdb2"
1597   
1598         ol_arg=invalid
1599         for ol_val in auto yes no ; do
1600                 if test "$enableval" = "$ol_val" ; then
1601                         ol_arg="$ol_val"
1602                 fi
1603         done
1604         if test "$ol_arg" = "invalid" ; then
1605                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1606         fi
1607         ol_enable_bdb2="$ol_arg"
1608
1609 else
1610         ol_enable_bdb2="no"
1611 fi
1612 # end --enable-bdb2
1613 # OpenLDAP --with-bdb2_module
1614         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1615 if test "${with_bdb2_module+set}" = set; then
1616   withval="$with_bdb2_module"
1617   
1618         ol_arg=invalid
1619         for ol_val in static dynamic ; do
1620                 if test "$withval" = "$ol_val" ; then
1621                         ol_arg="$ol_val"
1622                 fi
1623         done
1624         if test "$ol_arg" = "invalid" ; then
1625                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1626         fi
1627         ol_with_bdb2_module="$ol_arg"
1628
1629 else
1630         ol_with_bdb2_module="static"
1631 fi
1632 # end --with-bdb2_module
1633
1634 # OpenLDAP --enable-ldap
1635         # Check whether --enable-ldap or --disable-ldap was given.
1636 if test "${enable_ldap+set}" = set; then
1637   enableval="$enable_ldap"
1638   
1639         ol_arg=invalid
1640         for ol_val in auto yes no ; do
1641                 if test "$enableval" = "$ol_val" ; then
1642                         ol_arg="$ol_val"
1643                 fi
1644         done
1645         if test "$ol_arg" = "invalid" ; then
1646                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1647         fi
1648         ol_enable_ldap="$ol_arg"
1649
1650 else
1651         ol_enable_ldap="no"
1652 fi
1653 # end --enable-ldap
1654 # OpenLDAP --with-ldap_module
1655         # Check whether --with-ldap_module or --without-ldap_module was given.
1656 if test "${with_ldap_module+set}" = set; then
1657   withval="$with_ldap_module"
1658   
1659         ol_arg=invalid
1660         for ol_val in static dynamic ; do
1661                 if test "$withval" = "$ol_val" ; then
1662                         ol_arg="$ol_val"
1663                 fi
1664         done
1665         if test "$ol_arg" = "invalid" ; then
1666                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1667         fi
1668         ol_with_ldap_module="$ol_arg"
1669
1670 else
1671         ol_with_ldap_module="static"
1672 fi
1673 # end --with-ldap_module
1674
1675 # OpenLDAP --enable-ldbm
1676         # Check whether --enable-ldbm or --disable-ldbm was given.
1677 if test "${enable_ldbm+set}" = set; then
1678   enableval="$enable_ldbm"
1679   
1680         ol_arg=invalid
1681         for ol_val in auto yes no ; do
1682                 if test "$enableval" = "$ol_val" ; then
1683                         ol_arg="$ol_val"
1684                 fi
1685         done
1686         if test "$ol_arg" = "invalid" ; then
1687                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1688         fi
1689         ol_enable_ldbm="$ol_arg"
1690
1691 else
1692         ol_enable_ldbm="yes"
1693 fi
1694 # end --enable-ldbm
1695 # OpenLDAP --with-ldbm_module
1696         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1697 if test "${with_ldbm_module+set}" = set; then
1698   withval="$with_ldbm_module"
1699   
1700         ol_arg=invalid
1701         for ol_val in static dynamic ; do
1702                 if test "$withval" = "$ol_val" ; then
1703                         ol_arg="$ol_val"
1704                 fi
1705         done
1706         if test "$ol_arg" = "invalid" ; then
1707                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1708         fi
1709         ol_with_ldbm_module="$ol_arg"
1710
1711 else
1712         ol_with_ldbm_module="static"
1713 fi
1714 # end --with-ldbm_module
1715
1716 # OpenLDAP --with-ldbm_api
1717         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1718 if test "${with_ldbm_api+set}" = set; then
1719   withval="$with_ldbm_api"
1720   
1721         ol_arg=invalid
1722         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1723                 if test "$withval" = "$ol_val" ; then
1724                         ol_arg="$ol_val"
1725                 fi
1726         done
1727         if test "$ol_arg" = "invalid" ; then
1728                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1729         fi
1730         ol_with_ldbm_api="$ol_arg"
1731
1732 else
1733         ol_with_ldbm_api="auto"
1734 fi
1735 # end --with-ldbm_api
1736
1737 # OpenLDAP --with-ldbm_type
1738         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1739 if test "${with_ldbm_type+set}" = set; then
1740   withval="$with_ldbm_type"
1741   
1742         ol_arg=invalid
1743         for ol_val in auto btree hash ; do
1744                 if test "$withval" = "$ol_val" ; then
1745                         ol_arg="$ol_val"
1746                 fi
1747         done
1748         if test "$ol_arg" = "invalid" ; then
1749                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1750         fi
1751         ol_with_ldbm_type="$ol_arg"
1752
1753 else
1754         ol_with_ldbm_type="auto"
1755 fi
1756 # end --with-ldbm_type
1757
1758
1759 # OpenLDAP --enable-passwd
1760         # Check whether --enable-passwd or --disable-passwd was given.
1761 if test "${enable_passwd+set}" = set; then
1762   enableval="$enable_passwd"
1763   
1764         ol_arg=invalid
1765         for ol_val in auto yes no ; do
1766                 if test "$enableval" = "$ol_val" ; then
1767                         ol_arg="$ol_val"
1768                 fi
1769         done
1770         if test "$ol_arg" = "invalid" ; then
1771                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1772         fi
1773         ol_enable_passwd="$ol_arg"
1774
1775 else
1776         ol_enable_passwd="no"
1777 fi
1778 # end --enable-passwd
1779 # OpenLDAP --with-passwd_module
1780         # Check whether --with-passwd_module or --without-passwd_module was given.
1781 if test "${with_passwd_module+set}" = set; then
1782   withval="$with_passwd_module"
1783   
1784         ol_arg=invalid
1785         for ol_val in static dynamic ; do
1786                 if test "$withval" = "$ol_val" ; then
1787                         ol_arg="$ol_val"
1788                 fi
1789         done
1790         if test "$ol_arg" = "invalid" ; then
1791                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1792         fi
1793         ol_with_passwd_module="$ol_arg"
1794
1795 else
1796         ol_with_passwd_module="static"
1797 fi
1798 # end --with-passwd_module
1799
1800 # OpenLDAP --enable-perl
1801         # Check whether --enable-perl or --disable-perl was given.
1802 if test "${enable_perl+set}" = set; then
1803   enableval="$enable_perl"
1804   
1805         ol_arg=invalid
1806         for ol_val in auto yes no ; do
1807                 if test "$enableval" = "$ol_val" ; then
1808                         ol_arg="$ol_val"
1809                 fi
1810         done
1811         if test "$ol_arg" = "invalid" ; then
1812                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1813         fi
1814         ol_enable_perl="$ol_arg"
1815
1816 else
1817         ol_enable_perl="no"
1818 fi
1819 # end --enable-perl
1820 # OpenLDAP --with-perl_module
1821         # Check whether --with-perl_module or --without-perl_module was given.
1822 if test "${with_perl_module+set}" = set; then
1823   withval="$with_perl_module"
1824   
1825         ol_arg=invalid
1826         for ol_val in static dynamic ; do
1827                 if test "$withval" = "$ol_val" ; then
1828                         ol_arg="$ol_val"
1829                 fi
1830         done
1831         if test "$ol_arg" = "invalid" ; then
1832                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
1833         fi
1834         ol_with_perl_module="$ol_arg"
1835
1836 else
1837         ol_with_perl_module="static"
1838 fi
1839 # end --with-perl_module
1840
1841 # OpenLDAP --enable-shell
1842         # Check whether --enable-shell or --disable-shell was given.
1843 if test "${enable_shell+set}" = set; then
1844   enableval="$enable_shell"
1845   
1846         ol_arg=invalid
1847         for ol_val in auto yes no ; do
1848                 if test "$enableval" = "$ol_val" ; then
1849                         ol_arg="$ol_val"
1850                 fi
1851         done
1852         if test "$ol_arg" = "invalid" ; then
1853                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1854         fi
1855         ol_enable_shell="$ol_arg"
1856
1857 else
1858         ol_enable_shell="no"
1859 fi
1860 # end --enable-shell
1861 # OpenLDAP --with-shell_module
1862         # Check whether --with-shell_module or --without-shell_module was given.
1863 if test "${with_shell_module+set}" = set; then
1864   withval="$with_shell_module"
1865   
1866         ol_arg=invalid
1867         for ol_val in static dynamic ; do
1868                 if test "$withval" = "$ol_val" ; then
1869                         ol_arg="$ol_val"
1870                 fi
1871         done
1872         if test "$ol_arg" = "invalid" ; then
1873                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1874         fi
1875         ol_with_shell_module="$ol_arg"
1876
1877 else
1878         ol_with_shell_module="static"
1879 fi
1880 # end --with-shell_module
1881
1882 # OpenLDAP --enable-tcl
1883         # Check whether --enable-tcl or --disable-tcl was given.
1884 if test "${enable_tcl+set}" = set; then
1885   enableval="$enable_tcl"
1886   
1887         ol_arg=invalid
1888         for ol_val in auto yes no ; do
1889                 if test "$enableval" = "$ol_val" ; then
1890                         ol_arg="$ol_val"
1891                 fi
1892         done
1893         if test "$ol_arg" = "invalid" ; then
1894                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1895         fi
1896         ol_enable_tcl="$ol_arg"
1897
1898 else
1899         ol_enable_tcl="no"
1900 fi
1901 # end --enable-tcl
1902 # OpenLDAP --with-tcl_module
1903         # Check whether --with-tcl_module or --without-tcl_module was given.
1904 if test "${with_tcl_module+set}" = set; then
1905   withval="$with_tcl_module"
1906   
1907         ol_arg=invalid
1908         for ol_val in static dynamic ; do
1909                 if test "$withval" = "$ol_val" ; then
1910                         ol_arg="$ol_val"
1911                 fi
1912         done
1913         if test "$ol_arg" = "invalid" ; then
1914                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
1915         fi
1916         ol_with_tcl_module="$ol_arg"
1917
1918 else
1919         ol_with_tcl_module="static"
1920 fi
1921 # end --with-tcl_module
1922
1923
1924 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1925 if test "${with_xxslurpdoptions+set}" = set; then
1926   withval="$with_xxslurpdoptions"
1927   :
1928 fi
1929
1930 # OpenLDAP --enable-slurpd
1931         # Check whether --enable-slurpd or --disable-slurpd was given.
1932 if test "${enable_slurpd+set}" = set; then
1933   enableval="$enable_slurpd"
1934   
1935         ol_arg=invalid
1936         for ol_val in auto yes no ; do
1937                 if test "$enableval" = "$ol_val" ; then
1938                         ol_arg="$ol_val"
1939                 fi
1940         done
1941         if test "$ol_arg" = "invalid" ; then
1942                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1943         fi
1944         ol_enable_slurpd="$ol_arg"
1945
1946 else
1947         ol_enable_slurpd="auto"
1948 fi
1949 # end --enable-slurpd
1950
1951 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1952 if test "${with_xxliboptions+set}" = set; then
1953   withval="$with_xxliboptions"
1954   :
1955 fi
1956
1957 # Check whether --enable-static or --disable-static was given.
1958 if test "${enable_static+set}" = set; then
1959   enableval="$enable_static"
1960   p=${PACKAGE-default}
1961 case "$enableval" in
1962 yes) enable_static=yes ;;
1963 no) enable_static=no ;;
1964 *)
1965   enable_static=no
1966   # Look at the argument we got.  We use all the common list separators.
1967   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1968   for pkg in $enableval; do
1969     if test "X$pkg" = "X$p"; then
1970       enable_static=yes
1971     fi
1972   done
1973   IFS="$ac_save_ifs"
1974   ;;
1975 esac
1976 else
1977   enable_static=yes
1978 fi
1979
1980 # Check whether --enable-shared or --disable-shared was given.
1981 if test "${enable_shared+set}" = set; then
1982   enableval="$enable_shared"
1983   p=${PACKAGE-default}
1984 case "$enableval" in
1985 yes) enable_shared=yes ;;
1986 no) enable_shared=no ;;
1987 *)
1988   enable_shared=no
1989   # Look at the argument we got.  We use all the common list separators.
1990   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1991   for pkg in $enableval; do
1992     if test "X$pkg" = "X$p"; then
1993       enable_shared=yes
1994     fi
1995   done
1996   IFS="$ac_save_ifs"
1997   ;;
1998 esac
1999 else
2000   enable_shared=yes
2001 fi
2002
2003
2004 # validate options
2005 if test $ol_enable_dns = yes ; then
2006         if test $ol_enable_referrals = no ; then
2007                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
2008         fi
2009         if test $ol_enable_referrals = auto ; then
2010                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
2011                 ol_enable_referrals=yes
2012         fi
2013 fi
2014
2015 if test $ol_enable_slapd = no ; then
2016                 if test $ol_enable_bdb2 = yes ; then
2017                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
2018         fi
2019         if test $ol_enable_ldap = yes ; then
2020                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2021         fi
2022         if test $ol_enable_ldbm = yes ; then
2023                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2024         fi
2025         if test $ol_enable_passwd = yes ; then
2026                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2027         fi
2028         if test $ol_enable_perl = yes ; then
2029                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2030         fi
2031         if test $ol_enable_shell = yes ; then
2032                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2033         fi
2034         if test $ol_enable_tcl = yes ; then
2035                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2036         fi
2037         if test $ol_enable_modules = yes ; then
2038                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2039         fi
2040         if test $ol_enable_wrappers = yes ; then
2041                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2042         fi
2043         if test $ol_enable_phonetic = yes ; then
2044                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2045         fi
2046         if test $ol_enable_rlookups = yes ; then
2047                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2048         fi
2049         if test $ol_with_ldbm_api != auto ; then
2050                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2051         fi
2052         if test $ol_with_ldbm_type != auto ; then
2053                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2054         fi
2055         if test $ol_with_bdb2_module != static ; then
2056                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
2057         fi
2058         if test $ol_with_ldap_module != static ; then
2059                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2060         fi
2061         if test $ol_with_ldbm_module != static ; then
2062                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2063         fi
2064         if test $ol_with_passwd_module != static ; then
2065                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2066         fi
2067         if test $ol_with_perl_module != static ; then
2068                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2069         fi
2070         if test $ol_with_shell_module != static ; then
2071                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2072         fi
2073         if test $ol_with_tcl_module != static ; then
2074                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2075         fi
2076         if test $ol_enable_slurpd = yes ; then
2077                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2078         fi
2079
2080         # force settings to no
2081         ol_enable_bdb2=no
2082         ol_enable_ldap=no
2083         ol_enable_ldbm=no
2084         ol_enable_passwd=no
2085         ol_enable_perl=no
2086         ol_enable_shell=no
2087         ol_enable_tcl=no
2088
2089         ol_enable_modules=no
2090         ol_enable_phonetic=no
2091         ol_enable_rlookups=no
2092         ol_enable_wrappers=no
2093
2094         ol_with_ldbm_api=no
2095         ol_with_ldbm_type=no
2096
2097         ol_with_bdb2_module=static
2098         ol_with_ldap_module=static
2099         ol_with_ldbm_module=static
2100         ol_with_passwd_module=static
2101         ol_with_perl_module=static
2102         ol_with_shell_module=static
2103         ol_with_tcl_module=static
2104
2105         ol_enable_slurpd=no
2106
2107 elif test $ol_enable_ldbm = no ; then
2108         
2109         if test $ol_with_ldbm_api != auto ; then
2110                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2111         fi
2112
2113         if test $ol_with_ldbm_type != auto ; then
2114                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2115         fi
2116
2117         if test $ol_with_ldbm_module != static ; then
2118                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2119         fi
2120
2121         if test $ol_enable_bdb2 = yes ; then
2122                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
2123         fi
2124
2125         if test $ol_enable_modules != yes -a \
2126                 $ol_enable_ldap = no -a \
2127                 $ol_enable_passwd = no -a \
2128                 $ol_enable_perl = no -a \
2129                 $ol_enable_shell = no -a \
2130                 $ol_enable_tcl = no ; then
2131                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2132         fi
2133
2134         ol_with_ldbm_api=no
2135         ol_with_ldbm_type=no
2136         ol_with_ldbm_module=static
2137
2138 elif test $ol_enable_bdb2 = yes ; then
2139         
2140         if test $ol_with_ldbm_api != auto -a \
2141                 $ol_with_ldbm_api != db2 ; then
2142                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2143         fi
2144
2145         ol_with_ldbm_api=db2
2146
2147 else
2148         
2149         if test $ol_enable_bdb2 != no ; then
2150                 if test $ol_with_ldbm_api != auto -a \
2151                         $ol_with_ldbm_api != db2 ; then
2152                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2153                         ol_enable_bdb2=no
2154                 fi
2155         fi
2156
2157         if test $ol_with_ldbm_api = gdbm -a \
2158                 $ol_with_ldbm_type = btree ; then
2159                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2160         fi
2161         if test $ol_with_ldbm_api = mdbm -a \
2162                 $ol_with_ldbm_type = btree ; then
2163                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2164         fi
2165         if test $ol_with_ldbm_api = ndbm -a \
2166                 $ol_with_ldbm_type = btree ; then
2167                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2168         fi
2169 fi
2170
2171 if test $ol_enable_slurpd = yes ; then
2172                 if test $ol_with_threads = no ; then
2173                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2174         fi
2175 fi
2176
2177 echo "$ac_t""done" 1>&6
2178
2179 ## Initialize vars
2180 LDAP_LIBS=
2181 LDBM_LIBS=
2182 LTHREAD_LIBS=
2183 LUTIL_LIBS=
2184
2185 LDAPD_LIBS=
2186 SLAPD_LIBS=
2187 SLURPD_LIBS=
2188
2189 BUILD_LDAPD=no
2190 BUILD_SLAPD=no
2191 BUILD_SLURPD=no
2192
2193 BUILD_BDB2=no
2194 BUILD_LDAP=no
2195 BUILD_LDBM=no
2196 BUILD_PASSWD=no
2197 BUILD_PERL=no
2198 BUILD_SHELL=no
2199 BUILD_TCL=no
2200 BUILD_THREAD=no
2201
2202 BUILD_BDB2_DYNAMIC=no
2203 BUILD_LDAP_DYNAMIC=no
2204 BUILD_LDBM_DYNAMIC=no
2205 BUILD_PASSWD_DYNAMIC=no
2206 BUILD_PERL_DYNAMIC=no
2207 BUILD_SHELL_DYNAMIC=no
2208 BUILD_TCL_DYNAMIC=no
2209
2210 SLAPD_MODULES_LDFLAGS=
2211 SLAPD_MODULES_CPPFLAGS=
2212
2213 SLAPD_PERL_LDFLAGS=
2214 SLAPD_PERL_CPPFLAGS=
2215
2216 KRB_LIBS=
2217 READLINE_LIBS=
2218 TERMCAP_LIBS=
2219 TLS_LIBS=
2220
2221
2222
2223 cat >> confdefs.h <<\EOF
2224 #define HAVE_MKVERSION 1
2225 EOF
2226
2227
2228
2229
2230
2231 ol_aix_threads=no
2232 case "$target" in
2233 *-*-aix*)       if test -z "$CC" ; then
2234                 case "$ol_with_threads" in
2235                 auto | yes |  posix) ol_aix_threads=yes ;;
2236                 esac
2237         fi
2238 ;;
2239 esac
2240
2241 if test $ol_aix_threads = yes ; then
2242         if test -z "${CC}" ; then
2243                 for ac_prog in cc_r xlc_r cc
2244 do
2245 # Extract the first word of "$ac_prog", so it can be a program name with args.
2246 set dummy $ac_prog; ac_word=$2
2247 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2248 echo "configure:2249: checking for $ac_word" >&5
2249 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2250   echo $ac_n "(cached) $ac_c" 1>&6
2251 else
2252   if test -n "$CC"; then
2253   ac_cv_prog_CC="$CC" # Let the user override the test.
2254 else
2255   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2256   ac_dummy="$PATH"
2257   for ac_dir in $ac_dummy; do
2258     test -z "$ac_dir" && ac_dir=.
2259     if test -f $ac_dir/$ac_word; then
2260       ac_cv_prog_CC="$ac_prog"
2261       break
2262     fi
2263   done
2264   IFS="$ac_save_ifs"
2265 fi
2266 fi
2267 CC="$ac_cv_prog_CC"
2268 if test -n "$CC"; then
2269   echo "$ac_t""$CC" 1>&6
2270 else
2271   echo "$ac_t""no" 1>&6
2272 fi
2273
2274 test -n "$CC" && break
2275 done
2276
2277
2278                 if test "$CC" = cc ; then
2279                                                 if test $ol_with_threads != auto ; then
2280                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2281                         else
2282                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2283                         fi
2284                         ol_with_threads=no
2285                 fi
2286         fi
2287
2288         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2289                 ol_with_threads=posix
2290                 ol_cv_pthread_create=yes
2291         fi
2292 fi
2293
2294 if test -z "${CC}"; then
2295         for ac_prog in cc
2296 do
2297 # Extract the first word of "$ac_prog", so it can be a program name with args.
2298 set dummy $ac_prog; ac_word=$2
2299 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2300 echo "configure:2301: checking for $ac_word" >&5
2301 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2302   echo $ac_n "(cached) $ac_c" 1>&6
2303 else
2304   if test -n "$CC"; then
2305   ac_cv_prog_CC="$CC" # Let the user override the test.
2306 else
2307   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2308   ac_dummy="$PATH"
2309   for ac_dir in $ac_dummy; do
2310     test -z "$ac_dir" && ac_dir=.
2311     if test -f $ac_dir/$ac_word; then
2312       ac_cv_prog_CC="$ac_prog"
2313       break
2314     fi
2315   done
2316   IFS="$ac_save_ifs"
2317 fi
2318 fi
2319 CC="$ac_cv_prog_CC"
2320 if test -n "$CC"; then
2321   echo "$ac_t""$CC" 1>&6
2322 else
2323   echo "$ac_t""no" 1>&6
2324 fi
2325
2326 test -n "$CC" && break
2327 done
2328
2329 fi
2330
2331
2332 # Check whether --enable-fast-install or --disable-fast-install was given.
2333 if test "${enable_fast_install+set}" = set; then
2334   enableval="$enable_fast_install"
2335   p=${PACKAGE-default}
2336 case "$enableval" in
2337 yes) enable_fast_install=yes ;;
2338 no) enable_fast_install=no ;;
2339 *)
2340   enable_fast_install=no
2341   # Look at the argument we got.  We use all the common list separators.
2342   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2343   for pkg in $enableval; do
2344     if test "X$pkg" = "X$p"; then
2345       enable_fast_install=yes
2346     fi
2347   done
2348   IFS="$ac_save_ifs"
2349   ;;
2350 esac
2351 else
2352   enable_fast_install=yes
2353 fi
2354
2355 # Extract the first word of "ranlib", so it can be a program name with args.
2356 set dummy ranlib; ac_word=$2
2357 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2358 echo "configure:2359: checking for $ac_word" >&5
2359 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2360   echo $ac_n "(cached) $ac_c" 1>&6
2361 else
2362   if test -n "$RANLIB"; then
2363   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2364 else
2365   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2366   ac_dummy="$PATH"
2367   for ac_dir in $ac_dummy; do
2368     test -z "$ac_dir" && ac_dir=.
2369     if test -f $ac_dir/$ac_word; then
2370       ac_cv_prog_RANLIB="ranlib"
2371       break
2372     fi
2373   done
2374   IFS="$ac_save_ifs"
2375   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2376 fi
2377 fi
2378 RANLIB="$ac_cv_prog_RANLIB"
2379 if test -n "$RANLIB"; then
2380   echo "$ac_t""$RANLIB" 1>&6
2381 else
2382   echo "$ac_t""no" 1>&6
2383 fi
2384
2385 # Extract the first word of "gcc", so it can be a program name with args.
2386 set dummy gcc; ac_word=$2
2387 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2388 echo "configure:2389: checking for $ac_word" >&5
2389 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2390   echo $ac_n "(cached) $ac_c" 1>&6
2391 else
2392   if test -n "$CC"; then
2393   ac_cv_prog_CC="$CC" # Let the user override the test.
2394 else
2395   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2396   ac_dummy="$PATH"
2397   for ac_dir in $ac_dummy; do
2398     test -z "$ac_dir" && ac_dir=.
2399     if test -f $ac_dir/$ac_word; then
2400       ac_cv_prog_CC="gcc"
2401       break
2402     fi
2403   done
2404   IFS="$ac_save_ifs"
2405 fi
2406 fi
2407 CC="$ac_cv_prog_CC"
2408 if test -n "$CC"; then
2409   echo "$ac_t""$CC" 1>&6
2410 else
2411   echo "$ac_t""no" 1>&6
2412 fi
2413
2414 if test -z "$CC"; then
2415   # Extract the first word of "cc", so it can be a program name with args.
2416 set dummy cc; ac_word=$2
2417 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2418 echo "configure:2419: checking for $ac_word" >&5
2419 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2420   echo $ac_n "(cached) $ac_c" 1>&6
2421 else
2422   if test -n "$CC"; then
2423   ac_cv_prog_CC="$CC" # Let the user override the test.
2424 else
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2426   ac_prog_rejected=no
2427   ac_dummy="$PATH"
2428   for ac_dir in $ac_dummy; do
2429     test -z "$ac_dir" && ac_dir=.
2430     if test -f $ac_dir/$ac_word; then
2431       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2432         ac_prog_rejected=yes
2433         continue
2434       fi
2435       ac_cv_prog_CC="cc"
2436       break
2437     fi
2438   done
2439   IFS="$ac_save_ifs"
2440 if test $ac_prog_rejected = yes; then
2441   # We found a bogon in the path, so make sure we never use it.
2442   set dummy $ac_cv_prog_CC
2443   shift
2444   if test $# -gt 0; then
2445     # We chose a different compiler from the bogus one.
2446     # However, it has the same basename, so the bogon will be chosen
2447     # first if we set CC to just the basename; use the full file name.
2448     shift
2449     set dummy "$ac_dir/$ac_word" "$@"
2450     shift
2451     ac_cv_prog_CC="$@"
2452   fi
2453 fi
2454 fi
2455 fi
2456 CC="$ac_cv_prog_CC"
2457 if test -n "$CC"; then
2458   echo "$ac_t""$CC" 1>&6
2459 else
2460   echo "$ac_t""no" 1>&6
2461 fi
2462
2463   if test -z "$CC"; then
2464     case "`uname -s`" in
2465     *win32* | *WIN32* | *CYGWIN*)
2466       # Extract the first word of "cl", so it can be a program name with args.
2467 set dummy cl; ac_word=$2
2468 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2469 echo "configure:2470: checking for $ac_word" >&5
2470 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2471   echo $ac_n "(cached) $ac_c" 1>&6
2472 else
2473   if test -n "$CC"; then
2474   ac_cv_prog_CC="$CC" # Let the user override the test.
2475 else
2476   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2477   ac_dummy="$PATH"
2478   for ac_dir in $ac_dummy; do
2479     test -z "$ac_dir" && ac_dir=.
2480     if test -f $ac_dir/$ac_word; then
2481       ac_cv_prog_CC="cl"
2482       break
2483     fi
2484   done
2485   IFS="$ac_save_ifs"
2486 fi
2487 fi
2488 CC="$ac_cv_prog_CC"
2489 if test -n "$CC"; then
2490   echo "$ac_t""$CC" 1>&6
2491 else
2492   echo "$ac_t""no" 1>&6
2493 fi
2494  ;;
2495     esac
2496   fi
2497   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2498 fi
2499
2500 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2501 echo "configure:2502: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2502
2503 ac_ext=c
2504 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2505 ac_cpp='$CPP $CPPFLAGS'
2506 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2507 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2508 cross_compiling=$ac_cv_prog_cc_cross
2509
2510 cat > conftest.$ac_ext << EOF
2511
2512 #line 2513 "configure"
2513 #include "confdefs.h"
2514
2515 main(){return(0);}
2516 EOF
2517 if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2518   ac_cv_prog_cc_works=yes
2519   # If we can't run a trivial program, we are probably using a cross compiler.
2520   if (./conftest; exit) 2>/dev/null; then
2521     ac_cv_prog_cc_cross=no
2522   else
2523     ac_cv_prog_cc_cross=yes
2524   fi
2525 else
2526   echo "configure: failed program was:" >&5
2527   cat conftest.$ac_ext >&5
2528   ac_cv_prog_cc_works=no
2529 fi
2530 rm -fr conftest*
2531 ac_ext=c
2532 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2533 ac_cpp='$CPP $CPPFLAGS'
2534 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2535 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2536 cross_compiling=$ac_cv_prog_cc_cross
2537
2538 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2539 if test $ac_cv_prog_cc_works = no; then
2540   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2541 fi
2542 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2543 echo "configure:2544: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2544 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2545 cross_compiling=$ac_cv_prog_cc_cross
2546
2547 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2548 echo "configure:2549: checking whether we are using GNU C" >&5
2549 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2550   echo $ac_n "(cached) $ac_c" 1>&6
2551 else
2552   cat > conftest.c <<EOF
2553 #ifdef __GNUC__
2554   yes;
2555 #endif
2556 EOF
2557 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2558   ac_cv_prog_gcc=yes
2559 else
2560   ac_cv_prog_gcc=no
2561 fi
2562 fi
2563
2564 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2565
2566 if test $ac_cv_prog_gcc = yes; then
2567   GCC=yes
2568 else
2569   GCC=
2570 fi
2571
2572 ac_test_CFLAGS="${CFLAGS+set}"
2573 ac_save_CFLAGS="$CFLAGS"
2574 CFLAGS=
2575 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2576 echo "configure:2577: checking whether ${CC-cc} accepts -g" >&5
2577 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2578   echo $ac_n "(cached) $ac_c" 1>&6
2579 else
2580   echo 'void f(){}' > conftest.c
2581 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2582   ac_cv_prog_cc_g=yes
2583 else
2584   ac_cv_prog_cc_g=no
2585 fi
2586 rm -f conftest*
2587
2588 fi
2589
2590 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2591 if test "$ac_test_CFLAGS" = set; then
2592   CFLAGS="$ac_save_CFLAGS"
2593 elif test $ac_cv_prog_cc_g = yes; then
2594   if test "$GCC" = yes; then
2595     CFLAGS="-g -O2"
2596   else
2597     CFLAGS="-g"
2598   fi
2599 else
2600   if test "$GCC" = yes; then
2601     CFLAGS="-O2"
2602   else
2603     CFLAGS=
2604   fi
2605 fi
2606
2607 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2608 if test "${with_gnu_ld+set}" = set; then
2609   withval="$with_gnu_ld"
2610   test "$withval" = no || with_gnu_ld=yes
2611 else
2612   with_gnu_ld=no
2613 fi
2614
2615 ac_prog=ld
2616 if test "$ac_cv_prog_gcc" = yes; then
2617   # Check if gcc -print-prog-name=ld gives a path.
2618   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2619 echo "configure:2620: checking for ld used by GCC" >&5
2620   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2621   case "$ac_prog" in
2622     # Accept absolute paths.
2623     [\\/]* | [A-Za-z]:[\\/]*)
2624       re_direlt='/[^/][^/]*/\.\./'
2625       # Canonicalize the path of ld
2626       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2627       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2628         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2629       done
2630       test -z "$LD" && LD="$ac_prog"
2631       ;;
2632   "")
2633     # If it fails, then pretend we aren't using GCC.
2634     ac_prog=ld
2635     ;;
2636   *)
2637     # If it is relative, then search for the first ld in PATH.
2638     with_gnu_ld=unknown
2639     ;;
2640   esac
2641 elif test "$with_gnu_ld" = yes; then
2642   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2643 echo "configure:2644: checking for GNU ld" >&5
2644 else
2645   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2646 echo "configure:2647: checking for non-GNU ld" >&5
2647 fi
2648 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2649   echo $ac_n "(cached) $ac_c" 1>&6
2650 else
2651   if test -z "$LD"; then
2652   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2653   for ac_dir in $PATH; do
2654     test -z "$ac_dir" && ac_dir=.
2655     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2656       ac_cv_path_LD="$ac_dir/$ac_prog"
2657       # Check to see if the program is GNU ld.  I'd rather use --version,
2658       # but apparently some GNU ld's only accept -v.
2659       # Break only if it was the GNU/non-GNU ld that we prefer.
2660       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2661         test "$with_gnu_ld" != no && break
2662       else
2663         test "$with_gnu_ld" != yes && break
2664       fi
2665     fi
2666   done
2667   IFS="$ac_save_ifs"
2668 else
2669   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2670 fi
2671 fi
2672
2673 LD="$ac_cv_path_LD"
2674 if test -n "$LD"; then
2675   echo "$ac_t""$LD" 1>&6
2676 else
2677   echo "$ac_t""no" 1>&6
2678 fi
2679 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2680
2681 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2682 echo "configure:2683: checking if the linker ($LD) is GNU ld" >&5
2683 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2684   echo $ac_n "(cached) $ac_c" 1>&6
2685 else
2686   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2687 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2688   ac_cv_prog_gnu_ld=yes
2689 else
2690   ac_cv_prog_gnu_ld=no
2691 fi
2692 fi
2693
2694 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2695
2696
2697 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2698 echo "configure:2699: checking for BSD-compatible nm" >&5
2699 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2700   echo $ac_n "(cached) $ac_c" 1>&6
2701 else
2702   if test -n "$NM"; then
2703   # Let the user override the test.
2704   ac_cv_path_NM="$NM"
2705 else
2706   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2707   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2708     test -z "$ac_dir" && ac_dir=.
2709     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2710       # Check to see if the nm accepts a BSD-compat flag.
2711       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2712       #   nm: unknown option "B" ignored
2713       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2714         ac_cv_path_NM="$ac_dir/nm -B"
2715         break
2716       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2717         ac_cv_path_NM="$ac_dir/nm -p"
2718         break
2719       else
2720         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2721         continue # so that we can try to find one that supports BSD flags
2722       fi
2723     fi
2724   done
2725   IFS="$ac_save_ifs"
2726   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2727 fi
2728 fi
2729
2730 NM="$ac_cv_path_NM"
2731 echo "$ac_t""$NM" 1>&6
2732
2733
2734 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2735 echo "configure:2736: checking whether ln -s works" >&5
2736 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2737   echo $ac_n "(cached) $ac_c" 1>&6
2738 else
2739   rm -f conftestdata
2740 if ln -s X conftestdata 2>/dev/null
2741 then
2742   rm -f conftestdata
2743   ac_cv_prog_LN_S="ln -s"
2744 else
2745   ac_cv_prog_LN_S=ln
2746 fi
2747 fi
2748 LN_S="$ac_cv_prog_LN_S"
2749 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2750   echo "$ac_t""yes" 1>&6
2751 else
2752   echo "$ac_t""no" 1>&6
2753 fi
2754
2755
2756 # Check for any special flags to pass to ltconfig.
2757 libtool_flags="--cache-file=$cache_file"
2758 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2759 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2760 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2761 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2762 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2763
2764
2765 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2766 if test "${enable_libtool_lock+set}" = set; then
2767   enableval="$enable_libtool_lock"
2768   :
2769 fi
2770
2771 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2772 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2773
2774 # Some flags need to be propagated to the compiler or linker for good
2775 # libtool support.
2776 case "$host" in
2777 *-*-irix6*)
2778   # Find out which ABI we are using.
2779   echo '#line 2780 "configure"' > conftest.$ac_ext
2780   if { (eval echo configure:2781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2781     case "`/usr/bin/file conftest.o`" in
2782     *32-bit*)
2783       LD="${LD-ld} -32"
2784       ;;
2785     *N32*)
2786       LD="${LD-ld} -n32"
2787       ;;
2788     *64-bit*)
2789       LD="${LD-ld} -64"
2790       ;;
2791     esac
2792   fi
2793   rm -rf conftest*
2794   ;;
2795
2796 *-*-sco3.2v5*)
2797   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2798   SAVE_CFLAGS="$CFLAGS"
2799   CFLAGS="$CFLAGS -belf"
2800   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2801 echo "configure:2802: checking whether the C compiler needs -belf" >&5
2802 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2803   echo $ac_n "(cached) $ac_c" 1>&6
2804 else
2805   cat > conftest.$ac_ext <<EOF
2806 #line 2807 "configure"
2807 #include "confdefs.h"
2808
2809 int main() {
2810
2811 ; return 0; }
2812 EOF
2813 if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2814   rm -rf conftest*
2815   lt_cv_cc_needs_belf=yes
2816 else
2817   echo "configure: failed program was:" >&5
2818   cat conftest.$ac_ext >&5
2819   rm -rf conftest*
2820   lt_cv_cc_needs_belf=no
2821 fi
2822 rm -f conftest*
2823 fi
2824
2825 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2826   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2827     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2828     CFLAGS="$SAVE_CFLAGS"
2829   fi
2830   ;;
2831
2832
2833 esac
2834
2835
2836 # Save cache, so that ltconfig can load it
2837
2838
2839 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2840 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2841 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
2842 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
2843 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
2844 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
2845 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2846 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2847
2848 # Reload cache, that may have been modified by ltconfig
2849
2850
2851 # This can be used to rebuild libtool when needed
2852 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
2853
2854 # Always use our own libtool.
2855 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2856
2857 # Redirect the config.log output again, so that the ltconfig log is not
2858 # clobbered by the next message.
2859 exec 5>>./config.log
2860
2861
2862 for ac_prog in mawk gawk nawk awk
2863 do
2864 # Extract the first word of "$ac_prog", so it can be a program name with args.
2865 set dummy $ac_prog; ac_word=$2
2866 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2867 echo "configure:2868: checking for $ac_word" >&5
2868 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
2869   echo $ac_n "(cached) $ac_c" 1>&6
2870 else
2871   if test -n "$AWK"; then
2872   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2873 else
2874   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2875   ac_dummy="$PATH"
2876   for ac_dir in $ac_dummy; do
2877     test -z "$ac_dir" && ac_dir=.
2878     if test -f $ac_dir/$ac_word; then
2879       ac_cv_prog_AWK="$ac_prog"
2880       break
2881     fi
2882   done
2883   IFS="$ac_save_ifs"
2884 fi
2885 fi
2886 AWK="$ac_cv_prog_AWK"
2887 if test -n "$AWK"; then
2888   echo "$ac_t""$AWK" 1>&6
2889 else
2890   echo "$ac_t""no" 1>&6
2891 fi
2892
2893 test -n "$AWK" && break
2894 done
2895
2896 # test for ln hardlink support
2897 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2898 echo "configure:2899: checking whether ln works" >&5
2899 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
2900   echo $ac_n "(cached) $ac_c" 1>&6
2901 else
2902   rm -f conftest.src conftest.dst
2903 echo "conftest" > conftest.src
2904 if ln conftest.src conftest.dst 2>/dev/null
2905 then
2906   ol_cv_prog_LN_H="ln"
2907 else
2908   ol_cv_prog_LN_H="cp"
2909 fi
2910 rm -f conftest.src conftest.dst
2911
2912 fi
2913 LN_H="$ol_cv_prog_LN_H"
2914 if test "$ol_cv_prog_LN_H" = "ln"; then
2915         echo "$ac_t""yes" 1>&6
2916 else
2917         echo "$ac_t""no" 1>&6
2918 fi
2919
2920 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2921 echo "configure:2922: checking whether ln -s works" >&5
2922 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2923   echo $ac_n "(cached) $ac_c" 1>&6
2924 else
2925   rm -f conftestdata
2926 if ln -s X conftestdata 2>/dev/null
2927 then
2928   rm -f conftestdata
2929   ac_cv_prog_LN_S="ln -s"
2930 else
2931   ac_cv_prog_LN_S=ln
2932 fi
2933 fi
2934 LN_S="$ac_cv_prog_LN_S"
2935 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2936   echo "$ac_t""yes" 1>&6
2937 else
2938   echo "$ac_t""no" 1>&6
2939 fi
2940
2941
2942 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2943         LN_S="$LN_H"
2944 fi
2945
2946 # Extract the first word of "sendmail", so it can be a program name with args.
2947 set dummy sendmail; ac_word=$2
2948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2949 echo "configure:2950: checking for $ac_word" >&5
2950 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   case "$SENDMAIL" in
2954   /*)
2955   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2956   ;;
2957   ?:/*)                  
2958   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2959   ;;
2960   *)
2961   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2962   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2963   for ac_dir in $ac_dummy; do 
2964     test -z "$ac_dir" && ac_dir=.
2965     if test -f $ac_dir/$ac_word; then
2966       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2967       break
2968     fi
2969   done
2970   IFS="$ac_save_ifs"
2971   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2972   ;;
2973 esac
2974 fi
2975 SENDMAIL="$ac_cv_path_SENDMAIL"
2976 if test -n "$SENDMAIL"; then
2977   echo "$ac_t""$SENDMAIL" 1>&6
2978 else
2979   echo "$ac_t""no" 1>&6
2980 fi
2981
2982 # Extract the first word of "vi", so it can be a program name with args.
2983 set dummy vi; ac_word=$2
2984 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2985 echo "configure:2986: checking for $ac_word" >&5
2986 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
2987   echo $ac_n "(cached) $ac_c" 1>&6
2988 else
2989   case "$EDITOR" in
2990   /*)
2991   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2992   ;;
2993   ?:/*)                  
2994   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2995   ;;
2996   *)
2997   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2998   ac_dummy="$PATH:/usr/ucb"
2999   for ac_dir in $ac_dummy; do 
3000     test -z "$ac_dir" && ac_dir=.
3001     if test -f $ac_dir/$ac_word; then
3002       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3003       break
3004     fi
3005   done
3006   IFS="$ac_save_ifs"
3007   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3008   ;;
3009 esac
3010 fi
3011 EDITOR="$ac_cv_path_EDITOR"
3012 if test -n "$EDITOR"; then
3013   echo "$ac_t""$EDITOR" 1>&6
3014 else
3015   echo "$ac_t""no" 1>&6
3016 fi
3017
3018 # Extract the first word of "finger", so it can be a program name with args.
3019 set dummy finger; ac_word=$2
3020 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3021 echo "configure:3022: checking for $ac_word" >&5
3022 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3023   echo $ac_n "(cached) $ac_c" 1>&6
3024 else
3025   case "$FINGER" in
3026   /*)
3027   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3028   ;;
3029   ?:/*)                  
3030   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3031   ;;
3032   *)
3033   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3034   ac_dummy="$PATH:/usr/ucb"
3035   for ac_dir in $ac_dummy; do 
3036     test -z "$ac_dir" && ac_dir=.
3037     if test -f $ac_dir/$ac_word; then
3038       ac_cv_path_FINGER="$ac_dir/$ac_word"
3039       break
3040     fi
3041   done
3042   IFS="$ac_save_ifs"
3043   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3044   ;;
3045 esac
3046 fi
3047 FINGER="$ac_cv_path_FINGER"
3048 if test -n "$FINGER"; then
3049   echo "$ac_t""$FINGER" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054
3055 ol_link_perl=no
3056 if test $ol_enable_perl != no ; then
3057         # Extract the first word of "perl", so it can be a program name with args.
3058 set dummy perl; ac_word=$2
3059 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3060 echo "configure:3061: checking for $ac_word" >&5
3061 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3062   echo $ac_n "(cached) $ac_c" 1>&6
3063 else
3064   case "$PERLBIN" in
3065   /*)
3066   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3067   ;;
3068   ?:/*)                  
3069   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3070   ;;
3071   *)
3072   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3073   ac_dummy="$PATH"
3074   for ac_dir in $ac_dummy; do 
3075     test -z "$ac_dir" && ac_dir=.
3076     if test -f $ac_dir/$ac_word; then
3077       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3078       break
3079     fi
3080   done
3081   IFS="$ac_save_ifs"
3082   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3083   ;;
3084 esac
3085 fi
3086 PERLBIN="$ac_cv_path_PERLBIN"
3087 if test -n "$PERLBIN"; then
3088   echo "$ac_t""$PERLBIN" 1>&6
3089 else
3090   echo "$ac_t""no" 1>&6
3091 fi
3092
3093
3094         if test "no$PERLBIN" = "no" ; then
3095                 if test $ol_enable_perl = yes ; then
3096                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3097                 fi
3098
3099         else
3100                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3101                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3102
3103                                 ol_link_perl=yes
3104         fi
3105 fi
3106
3107 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3108 echo "configure:3109: checking how to run the C preprocessor" >&5
3109 # On Suns, sometimes $CPP names a directory.
3110 if test -n "$CPP" && test -d "$CPP"; then
3111   CPP=
3112 fi
3113 if test -z "$CPP"; then
3114 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3115   echo $ac_n "(cached) $ac_c" 1>&6
3116 else
3117     # This must be in double quotes, not single quotes, because CPP may get
3118   # substituted into the Makefile and "${CC-cc}" will confuse make.
3119   CPP="${CC-cc} -E"
3120   # On the NeXT, cc -E runs the code through the compiler's parser,
3121   # not just through cpp.
3122   cat > conftest.$ac_ext <<EOF
3123 #line 3124 "configure"
3124 #include "confdefs.h"
3125 #include <assert.h>
3126 Syntax Error
3127 EOF
3128 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3129 { (eval echo configure:3130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3130 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3131 if test -z "$ac_err"; then
3132   :
3133 else
3134   echo "$ac_err" >&5
3135   echo "configure: failed program was:" >&5
3136   cat conftest.$ac_ext >&5
3137   rm -rf conftest*
3138   CPP="${CC-cc} -E -traditional-cpp"
3139   cat > conftest.$ac_ext <<EOF
3140 #line 3141 "configure"
3141 #include "confdefs.h"
3142 #include <assert.h>
3143 Syntax Error
3144 EOF
3145 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3146 { (eval echo configure:3147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3147 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3148 if test -z "$ac_err"; then
3149   :
3150 else
3151   echo "$ac_err" >&5
3152   echo "configure: failed program was:" >&5
3153   cat conftest.$ac_ext >&5
3154   rm -rf conftest*
3155   CPP="${CC-cc} -nologo -E"
3156   cat > conftest.$ac_ext <<EOF
3157 #line 3158 "configure"
3158 #include "confdefs.h"
3159 #include <assert.h>
3160 Syntax Error
3161 EOF
3162 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3163 { (eval echo configure:3164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3164 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3165 if test -z "$ac_err"; then
3166   :
3167 else
3168   echo "$ac_err" >&5
3169   echo "configure: failed program was:" >&5
3170   cat conftest.$ac_ext >&5
3171   rm -rf conftest*
3172   CPP=/lib/cpp
3173 fi
3174 rm -f conftest*
3175 fi
3176 rm -f conftest*
3177 fi
3178 rm -f conftest*
3179   ac_cv_prog_CPP="$CPP"
3180 fi
3181   CPP="$ac_cv_prog_CPP"
3182 else
3183   ac_cv_prog_CPP="$CPP"
3184 fi
3185 echo "$ac_t""$CPP" 1>&6
3186
3187
3188 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3189         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3190
3191 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3192         echo "configure: warning: programs compiled here do run here..." 1>&2
3193         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3194
3195 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3196         echo "configure: warning: programs compiled here do not run here..." 1>&2
3197         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3198 fi
3199
3200 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3201 echo "configure:3202: checking for AIX" >&5
3202 cat > conftest.$ac_ext <<EOF
3203 #line 3204 "configure"
3204 #include "confdefs.h"
3205 #ifdef _AIX
3206   yes
3207 #endif
3208
3209 EOF
3210 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3211   egrep "yes" >/dev/null 2>&1; then
3212   rm -rf conftest*
3213   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3214 #define _ALL_SOURCE 1
3215 EOF
3216
3217 else
3218   rm -rf conftest*
3219   echo "$ac_t""no" 1>&6
3220 fi
3221 rm -f conftest*
3222
3223
3224 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3225 echo "configure:3226: checking for POSIXized ISC" >&5
3226 if test -d /etc/conf/kconfig.d &&
3227   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3228 then
3229   echo "$ac_t""yes" 1>&6
3230   ISC=yes # If later tests want to check for ISC.
3231   cat >> confdefs.h <<\EOF
3232 #define _POSIX_SOURCE 1
3233 EOF
3234
3235   if test "$GCC" = yes; then
3236     CC="$CC -posix"
3237   else
3238     CC="$CC -Xp"
3239   fi
3240 else
3241   echo "$ac_t""no" 1>&6
3242   ISC=
3243 fi
3244
3245 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3246 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3247 echo "configure:3248: checking for minix/config.h" >&5
3248 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3249   echo $ac_n "(cached) $ac_c" 1>&6
3250 else
3251   cat > conftest.$ac_ext <<EOF
3252 #line 3253 "configure"
3253 #include "confdefs.h"
3254 #include <minix/config.h>
3255 EOF
3256 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3257 { (eval echo configure:3258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3258 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3259 if test -z "$ac_err"; then
3260   rm -rf conftest*
3261   eval "ac_cv_header_$ac_safe=yes"
3262 else
3263   echo "$ac_err" >&5
3264   echo "configure: failed program was:" >&5
3265   cat conftest.$ac_ext >&5
3266   rm -rf conftest*
3267   eval "ac_cv_header_$ac_safe=no"
3268 fi
3269 rm -f conftest*
3270 fi
3271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3272   echo "$ac_t""yes" 1>&6
3273   MINIX=yes
3274 else
3275   echo "$ac_t""no" 1>&6
3276 MINIX=
3277 fi
3278
3279 if test "$MINIX" = yes; then
3280   cat >> confdefs.h <<\EOF
3281 #define _POSIX_SOURCE 1
3282 EOF
3283
3284   cat >> confdefs.h <<\EOF
3285 #define _POSIX_1_SOURCE 2
3286 EOF
3287
3288   cat >> confdefs.h <<\EOF
3289 #define _MINIX 1
3290 EOF
3291
3292 fi
3293
3294
3295 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3296 echo "configure:3297: checking for Cygwin environment" >&5
3297 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3298   echo $ac_n "(cached) $ac_c" 1>&6
3299 else
3300   cat > conftest.$ac_ext <<EOF
3301 #line 3302 "configure"
3302 #include "confdefs.h"
3303
3304 int main() {
3305
3306 #ifndef __CYGWIN__
3307 #define __CYGWIN__ __CYGWIN32__
3308 #endif
3309 return __CYGWIN__;
3310 ; return 0; }
3311 EOF
3312 if { (eval echo configure:3313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3313   rm -rf conftest*
3314   ac_cv_cygwin=yes
3315 else
3316   echo "configure: failed program was:" >&5
3317   cat conftest.$ac_ext >&5
3318   rm -rf conftest*
3319   ac_cv_cygwin=no
3320 fi
3321 rm -f conftest*
3322 fi
3323
3324 echo "$ac_t""$ac_cv_cygwin" 1>&6
3325 CYGWIN=
3326 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3327 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3328 echo "configure:3329: checking for mingw32 environment" >&5
3329 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3330   echo $ac_n "(cached) $ac_c" 1>&6
3331 else
3332   cat > conftest.$ac_ext <<EOF
3333 #line 3334 "configure"
3334 #include "confdefs.h"
3335
3336 int main() {
3337 return __MINGW32__;
3338 ; return 0; }
3339 EOF
3340 if { (eval echo configure:3341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3341   rm -rf conftest*
3342   ac_cv_mingw32=yes
3343 else
3344   echo "configure: failed program was:" >&5
3345   cat conftest.$ac_ext >&5
3346   rm -rf conftest*
3347   ac_cv_mingw32=no
3348 fi
3349 rm -f conftest*
3350 fi
3351
3352 echo "$ac_t""$ac_cv_mingw32" 1>&6
3353 MINGW32=
3354 test "$ac_cv_mingw32" = yes && MINGW32=yes
3355 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3356 echo "configure:3357: checking for EMX OS/2 environment" >&5
3357 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3358   echo $ac_n "(cached) $ac_c" 1>&6
3359 else
3360   cat > conftest.$ac_ext <<EOF
3361 #line 3362 "configure"
3362 #include "confdefs.h"
3363
3364 int main() {
3365 return __EMX__;
3366 ; return 0; }
3367 EOF
3368 if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3369   rm -rf conftest*
3370   ac_cv_emxos2=yes
3371 else
3372   echo "configure: failed program was:" >&5
3373   cat conftest.$ac_ext >&5
3374   rm -rf conftest*
3375   ac_cv_emxos2=no
3376 fi
3377 rm -f conftest*
3378 fi
3379
3380 echo "$ac_t""$ac_cv_emxos2" 1>&6
3381 EMXOS2=
3382 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3383
3384
3385
3386 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3387 echo "configure:3388: checking for executable suffix" >&5
3388 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3389   echo $ac_n "(cached) $ac_c" 1>&6
3390 else
3391   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3392   ac_cv_exeext=.exe
3393 else
3394   rm -f conftest*
3395   echo 'int main () { return 0; }' > conftest.$ac_ext
3396   ac_cv_exeext=
3397   if { (eval echo configure:3398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3398     for file in conftest.*; do
3399       case $file in
3400       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3401       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3402       esac
3403     done
3404   else
3405     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3406   fi
3407   rm -f conftest*
3408   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3409 fi
3410 fi
3411
3412 EXEEXT=""
3413 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3414 echo "$ac_t""${ac_cv_exeext}" 1>&6
3415 ac_exeext=$EXEEXT
3416
3417 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3418 echo "configure:3419: checking for object suffix" >&5
3419 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3420   echo $ac_n "(cached) $ac_c" 1>&6
3421 else
3422   rm -f conftest*
3423 echo 'int i = 1;' > conftest.$ac_ext
3424 if { (eval echo configure:3425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3425   for ac_file in conftest.*; do
3426     case $ac_file in
3427     *.c) ;;
3428     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3429     esac
3430   done
3431 else
3432   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3433 fi
3434 rm -f conftest*
3435 fi
3436
3437 echo "$ac_t""$ac_cv_objext" 1>&6
3438 OBJEXT=$ac_cv_objext
3439 ac_objext=$ac_cv_objext
3440
3441
3442 cat >> confdefs.h <<EOF
3443 #define EXEEXT "${EXEEXT}"
3444 EOF
3445
3446
3447 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3448 echo "configure:3449: checking for be_app in -lbe" >&5
3449 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3450 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3451   echo $ac_n "(cached) $ac_c" 1>&6
3452 else
3453   ac_save_LIBS="$LIBS"
3454 LIBS="-lbe -lroot -lnet $LIBS"
3455 cat > conftest.$ac_ext <<EOF
3456 #line 3457 "configure"
3457 #include "confdefs.h"
3458 /* Override any gcc2 internal prototype to avoid an error.  */
3459 /* We use char because int might match the return type of a gcc2
3460     builtin and then its argument prototype would still apply.  */
3461 char be_app();
3462
3463 int main() {
3464 be_app()
3465 ; return 0; }
3466 EOF
3467 if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3468   rm -rf conftest*
3469   eval "ac_cv_lib_$ac_lib_var=yes"
3470 else
3471   echo "configure: failed program was:" >&5
3472   cat conftest.$ac_ext >&5
3473   rm -rf conftest*
3474   eval "ac_cv_lib_$ac_lib_var=no"
3475 fi
3476 rm -f conftest*
3477 LIBS="$ac_save_LIBS"
3478
3479 fi
3480 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3481   echo "$ac_t""yes" 1>&6
3482   LIBS="$LIBS -lbe -lroot -lnet"
3483 else
3484   echo "$ac_t""no" 1>&6
3485 :
3486 fi
3487
3488
3489
3490
3491
3492 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3493 echo "configure:3494: checking for ${CC-cc} option to accept ANSI C" >&5
3494 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3495   echo $ac_n "(cached) $ac_c" 1>&6
3496 else
3497   am_cv_prog_cc_stdc=no
3498 ac_save_CC="$CC"
3499 # Don't try gcc -ansi; that turns off useful extensions and
3500 # breaks some systems' header files.
3501 # AIX                   -qlanglvl=ansi
3502 # Ultrix and OSF/1      -std1
3503 # HP-UX 10.20 and later -Ae
3504 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3505 # SVR4                  -Xc -D__EXTENSIONS__
3506 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3507 do
3508   CC="$ac_save_CC $ac_arg"
3509   cat > conftest.$ac_ext <<EOF
3510 #line 3511 "configure"
3511 #include "confdefs.h"
3512 #include <stdarg.h>
3513 #include <stdio.h>
3514 #include <sys/types.h>
3515 #include <sys/stat.h>
3516 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3517 struct buf { int x; };
3518 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3519 static char *e (p, i)
3520      char **p;
3521      int i;
3522 {
3523   return p[i];
3524 }
3525 static char *f (char * (*g) (char **, int), char **p, ...)
3526 {
3527   char *s;
3528   va_list v;
3529   va_start (v,p);
3530   s = g (p, va_arg (v,int));
3531   va_end (v);
3532   return s;
3533 }
3534 int test (int i, double x);
3535 struct s1 {int (*f) (int a);};
3536 struct s2 {int (*f) (double a);};
3537 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3538 int argc;
3539 char **argv;
3540
3541 int main() {
3542
3543 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3544
3545 ; return 0; }
3546 EOF
3547 if { (eval echo configure:3548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3548   rm -rf conftest*
3549   am_cv_prog_cc_stdc="$ac_arg"; break
3550 else
3551   echo "configure: failed program was:" >&5
3552   cat conftest.$ac_ext >&5
3553 fi
3554 rm -f conftest*
3555 done
3556 CC="$ac_save_CC"
3557
3558 fi
3559
3560 if test -z "$am_cv_prog_cc_stdc"; then
3561   echo "$ac_t""none needed" 1>&6
3562 else
3563   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3564 fi
3565 case "x$am_cv_prog_cc_stdc" in
3566   x|xno) ;;
3567   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3568 esac
3569
3570 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3571         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3572 fi
3573
3574 # test for make depend flag
3575 OL_MKDEP=
3576 OL_MKDEP_FLAGS=
3577 if test -z "${MKDEP}"; then
3578         OL_MKDEP="${CC-cc}"
3579         if test -z "${MKDEP_FLAGS}"; then
3580                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3581 echo "configure:3582: checking for ${OL_MKDEP} depend flag" >&5
3582 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3583   echo $ac_n "(cached) $ac_c" 1>&6
3584 else
3585   
3586                         ol_cv_mkdep=no
3587                         for flag in "-M" "-xM"; do
3588                                 cat > conftest.c <<EOF
3589  noCode;
3590 EOF
3591                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3592                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3593                                 then
3594                                         if test ! -f conftest."${ac_object}" ; then
3595                                                 ol_cv_mkdep=$flag
3596                                                 OL_MKDEP_FLAGS="$flag"
3597                                                 break
3598                                         fi
3599                                 fi
3600                         done
3601                         rm -f conftest*
3602                 
3603 fi
3604
3605 echo "$ac_t""$ol_cv_mkdep" 1>&6
3606         else
3607                 cc_cv_mkdep=yes
3608                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3609         fi
3610 else
3611         cc_cv_mkdep=yes
3612         OL_MKDEP="${MKDEP}"
3613         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3614 fi
3615
3616
3617
3618 if test "${ol_cv_mkdep}" = no ; then
3619         # this will soon become an error
3620         echo "configure: warning: do not know how to generate dependencies" 1>&2
3621 fi
3622
3623 ol_link_modules=no
3624 if test $ol_enable_modules != no ; then
3625         # Extract the first word of "glib-config", so it can be a program name with args.
3626 set dummy glib-config; ac_word=$2
3627 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3628 echo "configure:3629: checking for $ac_word" >&5
3629 if eval "test \"\${ac_cv_path_GLIBCONFIG+set}\" = set"; then
3630   echo $ac_n "(cached) $ac_c" 1>&6
3631 else
3632   case "$GLIBCONFIG" in
3633   /*)
3634   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
3635   ;;
3636   ?:/*)                  
3637   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
3638   ;;
3639   *)
3640   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3641   ac_dummy="$PATH"
3642   for ac_dir in $ac_dummy; do 
3643     test -z "$ac_dir" && ac_dir=.
3644     if test -f $ac_dir/$ac_word; then
3645       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
3646       break
3647     fi
3648   done
3649   IFS="$ac_save_ifs"
3650   ;;
3651 esac
3652 fi
3653 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
3654 if test -n "$GLIBCONFIG"; then
3655   echo "$ac_t""$GLIBCONFIG" 1>&6
3656 else
3657   echo "$ac_t""no" 1>&6
3658 fi
3659
3660
3661         if test "no$GLIBCONFIG" = "no" ; then
3662                 if test $ol_enable_modules = yes ; then
3663                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
3664                 fi
3665
3666         else
3667                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
3668                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
3669                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
3670
3671                                 ol_link_modules=yes
3672         fi
3673 else
3674         ol_with_bdb2_module=static
3675         ol_with_ldap_module=static
3676         ol_with_ldbm_module=static
3677         ol_with_passwd_module=static
3678         ol_with_perl_module=static
3679         ol_with_shell_module=static
3680         ol_with_tcl_module=static
3681 fi
3682
3683 # test for EBCDIC
3684 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
3685 echo "configure:3686: checking for EBCDIC" >&5
3686 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
3687   echo $ac_n "(cached) $ac_c" 1>&6
3688 else
3689   
3690         cat > conftest.$ac_ext <<EOF
3691 #line 3692 "configure"
3692 #include "confdefs.h"
3693
3694 #if !('M' == 0xd4)
3695 #include <__ASCII__/generate_error.h>
3696 #endif
3697
3698 EOF
3699 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3700 { (eval echo configure:3701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3701 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3702 if test -z "$ac_err"; then
3703   rm -rf conftest*
3704   ol_cv_cpp_ebcdic=yes
3705 else
3706   echo "$ac_err" >&5
3707   echo "configure: failed program was:" >&5
3708   cat conftest.$ac_ext >&5
3709   rm -rf conftest*
3710   ol_cv_cpp_ebcdic=no
3711 fi
3712 rm -f conftest*
3713 fi
3714
3715 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
3716 if test $ol_cv_cpp_ebcdic = yes ; then
3717         cat >> confdefs.h <<\EOF
3718 #define HAVE_EBCDIC 1
3719 EOF
3720
3721 fi
3722
3723 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3724 echo "configure:3725: checking for ANSI C header files" >&5
3725 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
3726   echo $ac_n "(cached) $ac_c" 1>&6
3727 else
3728   cat > conftest.$ac_ext <<EOF
3729 #line 3730 "configure"
3730 #include "confdefs.h"
3731 #include <stdlib.h>
3732 #include <stdarg.h>
3733 #include <string.h>
3734 #include <float.h>
3735 EOF
3736 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3737 { (eval echo configure:3738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3738 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3739 if test -z "$ac_err"; then
3740   rm -rf conftest*
3741   ol_cv_header_stdc=yes
3742 else
3743   echo "$ac_err" >&5
3744   echo "configure: failed program was:" >&5
3745   cat conftest.$ac_ext >&5
3746   rm -rf conftest*
3747   ol_cv_header_stdc=no
3748 fi
3749 rm -f conftest*
3750
3751 if test $ol_cv_header_stdc = yes; then
3752   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3753 cat > conftest.$ac_ext <<EOF
3754 #line 3755 "configure"
3755 #include "confdefs.h"
3756 #include <string.h>
3757 EOF
3758 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3759   egrep "memchr" >/dev/null 2>&1; then
3760   :
3761 else
3762   rm -rf conftest*
3763   ol_cv_header_stdc=no
3764 fi
3765 rm -f conftest*
3766
3767 fi
3768
3769 if test $ol_cv_header_stdc = yes; then
3770   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3771 cat > conftest.$ac_ext <<EOF
3772 #line 3773 "configure"
3773 #include "confdefs.h"
3774 #include <stdlib.h>
3775 EOF
3776 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3777   egrep "free" >/dev/null 2>&1; then
3778   :
3779 else
3780   rm -rf conftest*
3781   ol_cv_header_stdc=no
3782 fi
3783 rm -f conftest*
3784
3785 fi
3786
3787 if test $ol_cv_header_stdc = yes; then
3788   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3789 if test "$cross_compiling" = yes; then
3790   :
3791 else
3792   cat > conftest.$ac_ext <<EOF
3793 #line 3794 "configure"
3794 #include "confdefs.h"
3795 #include <ctype.h>
3796 #ifndef HAVE_EBCDIC
3797 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3798 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3799 #else
3800 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
3801                 || ('j' <= (c) && (c) <= 'r') \
3802                 || ('s' <= (c) && (c) <= 'z'))
3803 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
3804 #endif
3805 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3806 int main () { int i; for (i = 0; i < 256; i++)
3807 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3808 exit (0); }
3809
3810 EOF
3811 if { (eval echo configure:3812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3812 then
3813   :
3814 else
3815   echo "configure: failed program was:" >&5
3816   cat conftest.$ac_ext >&5
3817   rm -fr conftest*
3818   ol_cv_header_stdc=no
3819 fi
3820 rm -fr conftest*
3821 fi
3822
3823 fi
3824 fi
3825
3826 echo "$ac_t""$ol_cv_header_stdc" 1>&6
3827 if test $ol_cv_header_stdc = yes; then
3828   cat >> confdefs.h <<\EOF
3829 #define STDC_HEADERS 1
3830 EOF
3831
3832 fi
3833 ac_cv_header_stdc=disable
3834
3835
3836 if test $ol_cv_header_stdc != yes; then
3837         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
3838 fi
3839
3840 ac_header_dirent=no
3841 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
3842 do
3843 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3844 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
3845 echo "configure:3846: checking for $ac_hdr that defines DIR" >&5
3846 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
3847   echo $ac_n "(cached) $ac_c" 1>&6
3848 else
3849   cat > conftest.$ac_ext <<EOF
3850 #line 3851 "configure"
3851 #include "confdefs.h"
3852 #include <sys/types.h>
3853 #include <$ac_hdr>
3854 int main() {
3855 DIR *dirp = 0;
3856 ; return 0; }
3857 EOF
3858 if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3859   rm -rf conftest*
3860   eval "ac_cv_header_dirent_$ac_safe=yes"
3861 else
3862   echo "configure: failed program was:" >&5
3863   cat conftest.$ac_ext >&5
3864   rm -rf conftest*
3865   eval "ac_cv_header_dirent_$ac_safe=no"
3866 fi
3867 rm -f conftest*
3868 fi
3869 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
3870   echo "$ac_t""yes" 1>&6
3871     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3872   cat >> confdefs.h <<EOF
3873 #define $ac_tr_hdr 1
3874 EOF
3875  ac_header_dirent=$ac_hdr; break
3876 else
3877   echo "$ac_t""no" 1>&6
3878 fi
3879 done
3880 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
3881 if test $ac_header_dirent = dirent.h; then
3882 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
3883 echo "configure:3884: checking for opendir in -ldir" >&5
3884 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
3885 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3886   echo $ac_n "(cached) $ac_c" 1>&6
3887 else
3888   ac_save_LIBS="$LIBS"
3889 LIBS="-ldir  $LIBS"
3890 cat > conftest.$ac_ext <<EOF
3891 #line 3892 "configure"
3892 #include "confdefs.h"
3893 /* Override any gcc2 internal prototype to avoid an error.  */
3894 /* We use char because int might match the return type of a gcc2
3895     builtin and then its argument prototype would still apply.  */
3896 char opendir();
3897
3898 int main() {
3899 opendir()
3900 ; return 0; }
3901 EOF
3902 if { (eval echo configure:3903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3903   rm -rf conftest*
3904   eval "ac_cv_lib_$ac_lib_var=yes"
3905 else
3906   echo "configure: failed program was:" >&5
3907   cat conftest.$ac_ext >&5
3908   rm -rf conftest*
3909   eval "ac_cv_lib_$ac_lib_var=no"
3910 fi
3911 rm -f conftest*
3912 LIBS="$ac_save_LIBS"
3913
3914 fi
3915 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3916   echo "$ac_t""yes" 1>&6
3917   LIBS="$LIBS -ldir"
3918 else
3919   echo "$ac_t""no" 1>&6
3920 fi
3921
3922 else
3923 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
3924 echo "configure:3925: checking for opendir in -lx" >&5
3925 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
3926 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3927   echo $ac_n "(cached) $ac_c" 1>&6
3928 else
3929   ac_save_LIBS="$LIBS"
3930 LIBS="-lx  $LIBS"
3931 cat > conftest.$ac_ext <<EOF
3932 #line 3933 "configure"
3933 #include "confdefs.h"
3934 /* Override any gcc2 internal prototype to avoid an error.  */
3935 /* We use char because int might match the return type of a gcc2
3936     builtin and then its argument prototype would still apply.  */
3937 char opendir();
3938
3939 int main() {
3940 opendir()
3941 ; return 0; }
3942 EOF
3943 if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3944   rm -rf conftest*
3945   eval "ac_cv_lib_$ac_lib_var=yes"
3946 else
3947   echo "configure: failed program was:" >&5
3948   cat conftest.$ac_ext >&5
3949   rm -rf conftest*
3950   eval "ac_cv_lib_$ac_lib_var=no"
3951 fi
3952 rm -f conftest*
3953 LIBS="$ac_save_LIBS"
3954
3955 fi
3956 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3957   echo "$ac_t""yes" 1>&6
3958   LIBS="$LIBS -lx"
3959 else
3960   echo "$ac_t""no" 1>&6
3961 fi
3962
3963 fi
3964
3965 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
3966 echo "configure:3967: checking for sys/wait.h that is POSIX.1 compatible" >&5
3967 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
3968   echo $ac_n "(cached) $ac_c" 1>&6
3969 else
3970   cat > conftest.$ac_ext <<EOF
3971 #line 3972 "configure"
3972 #include "confdefs.h"
3973 #include <sys/types.h>
3974 #include <sys/wait.h>
3975 #ifndef WEXITSTATUS
3976 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
3977 #endif
3978 #ifndef WIFEXITED
3979 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3980 #endif
3981 int main() {
3982 int s;
3983 wait (&s);
3984 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
3985 ; return 0; }
3986 EOF
3987 if { (eval echo configure:3988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3988   rm -rf conftest*
3989   ac_cv_header_sys_wait_h=yes
3990 else
3991   echo "configure: failed program was:" >&5
3992   cat conftest.$ac_ext >&5
3993   rm -rf conftest*
3994   ac_cv_header_sys_wait_h=no
3995 fi
3996 rm -f conftest*
3997 fi
3998
3999 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4000 if test $ac_cv_header_sys_wait_h = yes; then
4001   cat >> confdefs.h <<\EOF
4002 #define HAVE_SYS_WAIT_H 1
4003 EOF
4004
4005 fi
4006
4007 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4008 echo "configure:4009: checking POSIX termios" >&5
4009 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4010   echo $ac_n "(cached) $ac_c" 1>&6
4011 else
4012   cat > conftest.$ac_ext <<EOF
4013 #line 4014 "configure"
4014 #include "confdefs.h"
4015 #include <sys/types.h>
4016 #include <unistd.h>
4017 #include <termios.h>
4018 int main() {
4019 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4020    tcgetattr(0, 0);
4021 ; return 0; }
4022 EOF
4023 if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4024   rm -rf conftest*
4025   am_cv_sys_posix_termios=yes
4026 else
4027   echo "configure: failed program was:" >&5
4028   cat conftest.$ac_ext >&5
4029   rm -rf conftest*
4030   am_cv_sys_posix_termios=no
4031 fi
4032 rm -f conftest*
4033 fi
4034
4035 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4036
4037
4038  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4039 echo "configure:4040: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4040 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4041   echo $ac_n "(cached) $ac_c" 1>&6
4042 else
4043   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4044
4045   gwinsz_in_termios_h=no
4046   if test $am_cv_sys_posix_termios = yes; then
4047     cat > conftest.$ac_ext <<EOF
4048 #line 4049 "configure"
4049 #include "confdefs.h"
4050 #include <sys/types.h>
4051 #     include <termios.h>
4052 #     ifdef TIOCGWINSZ
4053         yes
4054 #     endif
4055     
4056 EOF
4057 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4058   egrep "yes" >/dev/null 2>&1; then
4059   rm -rf conftest*
4060   gwinsz_in_termios_h=yes
4061 fi
4062 rm -f conftest*
4063
4064   fi
4065
4066   if test $gwinsz_in_termios_h = no; then
4067     cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070 #include <sys/types.h>
4071 #     include <sys/ioctl.h>
4072 #     ifdef TIOCGWINSZ
4073         yes
4074 #     endif
4075     
4076 EOF
4077 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4078   egrep "yes" >/dev/null 2>&1; then
4079   rm -rf conftest*
4080   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4081 fi
4082 rm -f conftest*
4083
4084   fi
4085   
4086 fi
4087
4088 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4089   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4090     cat >> confdefs.h <<\EOF
4091 #define GWINSZ_IN_SYS_IOCTL 1
4092 EOF
4093
4094   fi
4095
4096 if test $am_cv_sys_posix_termios = yes ; then
4097         cat >> confdefs.h <<\EOF
4098 #define HAVE_POSIX_TERMIOS 1
4099 EOF
4100
4101 fi
4102
4103 for ac_hdr in \
4104         arpa/inet.h             \
4105         arpa/nameser.h  \
4106         assert.h                \
4107         crypt.h                 \
4108         errno.h                 \
4109         fcntl.h                 \
4110         filio.h                 \
4111         getopt.h                \
4112         grp.h                   \
4113         libutil.h               \
4114         limits.h                \
4115         locale.h                \
4116         netinet/tcp.h   \
4117         malloc.h                \
4118         memory.h                \
4119         psap.h                  \
4120         pwd.h                   \
4121         resolv.h                \
4122         sgtty.h                 \
4123         shadow.h                \
4124         stdarg.h                \
4125         stddef.h                \
4126         string.h                \
4127         strings.h               \
4128         sysexits.h              \
4129         sys/file.h              \
4130         sys/filio.h             \
4131         sys/errno.h             \
4132         sys/ioctl.h             \
4133         sys/param.h             \
4134         sys/resource.h  \
4135         sys/select.h    \
4136         sys/socket.h    \
4137         sys/syslog.h    \
4138         sys/time.h              \
4139         sys/types.h             \
4140         syslog.h                \
4141         termios.h               \
4142         unistd.h                \
4143
4144 do
4145 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4146 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4147 echo "configure:4148: checking for $ac_hdr" >&5
4148 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4149   echo $ac_n "(cached) $ac_c" 1>&6
4150 else
4151   cat > conftest.$ac_ext <<EOF
4152 #line 4153 "configure"
4153 #include "confdefs.h"
4154 #include <$ac_hdr>
4155 EOF
4156 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4157 { (eval echo configure:4158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4158 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4159 if test -z "$ac_err"; then
4160   rm -rf conftest*
4161   eval "ac_cv_header_$ac_safe=yes"
4162 else
4163   echo "$ac_err" >&5
4164   echo "configure: failed program was:" >&5
4165   cat conftest.$ac_ext >&5
4166   rm -rf conftest*
4167   eval "ac_cv_header_$ac_safe=no"
4168 fi
4169 rm -f conftest*
4170 fi
4171 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4172   echo "$ac_t""yes" 1>&6
4173     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4174   cat >> confdefs.h <<EOF
4175 #define $ac_tr_hdr 1
4176 EOF
4177  
4178 else
4179   echo "$ac_t""no" 1>&6
4180 fi
4181 done
4182
4183
4184
4185
4186 echo $ac_n "checking for socket""... $ac_c" 1>&6
4187 echo "configure:4188: checking for socket" >&5
4188 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4189   echo $ac_n "(cached) $ac_c" 1>&6
4190 else
4191   cat > conftest.$ac_ext <<EOF
4192 #line 4193 "configure"
4193 #include "confdefs.h"
4194 /* System header to define __stub macros and hopefully few prototypes,
4195     which can conflict with char socket(); below.  */
4196 #include <assert.h>
4197 /* Override any gcc2 internal prototype to avoid an error.  */
4198 /* We use char because int might match the return type of a gcc2
4199     builtin and then its argument prototype would still apply.  */
4200 char socket();
4201 char (*f)();
4202
4203 int main() {
4204
4205 /* The GNU C library defines this for functions which it implements
4206     to always fail with ENOSYS.  Some functions are actually named
4207     something starting with __ and the normal name is an alias.  */
4208 #if defined (__stub_socket) || defined (__stub___socket)
4209 choke me
4210 #else
4211 f = socket;
4212 #endif
4213
4214 ; return 0; }
4215 EOF
4216 if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4217   rm -rf conftest*
4218   eval "ac_cv_func_socket=yes"
4219 else
4220   echo "configure: failed program was:" >&5
4221   cat conftest.$ac_ext >&5
4222   rm -rf conftest*
4223   eval "ac_cv_func_socket=no"
4224 fi
4225 rm -f conftest*
4226 fi
4227
4228 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4229   echo "$ac_t""yes" 1>&6
4230   :
4231 else
4232   echo "$ac_t""no" 1>&6
4233         
4234         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4235 echo "configure:4236: checking for main in -lsocket" >&5
4236 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4237 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4238   echo $ac_n "(cached) $ac_c" 1>&6
4239 else
4240   ac_save_LIBS="$LIBS"
4241 LIBS="-lsocket  $LIBS"
4242 cat > conftest.$ac_ext <<EOF
4243 #line 4244 "configure"
4244 #include "confdefs.h"
4245
4246 int main() {
4247 main()
4248 ; return 0; }
4249 EOF
4250 if { (eval echo configure:4251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4251   rm -rf conftest*
4252   eval "ac_cv_lib_$ac_lib_var=yes"
4253 else
4254   echo "configure: failed program was:" >&5
4255   cat conftest.$ac_ext >&5
4256   rm -rf conftest*
4257   eval "ac_cv_lib_$ac_lib_var=no"
4258 fi
4259 rm -f conftest*
4260 LIBS="$ac_save_LIBS"
4261
4262 fi
4263 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4264   echo "$ac_t""yes" 1>&6
4265     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4266     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4267   cat >> confdefs.h <<EOF
4268 #define $ac_tr_lib 1
4269 EOF
4270
4271   LIBS="-lsocket $LIBS"
4272
4273 else
4274   echo "$ac_t""no" 1>&6
4275 fi
4276
4277         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4278 echo "configure:4279: checking for main in -lnet" >&5
4279 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4280 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4281   echo $ac_n "(cached) $ac_c" 1>&6
4282 else
4283   ac_save_LIBS="$LIBS"
4284 LIBS="-lnet  $LIBS"
4285 cat > conftest.$ac_ext <<EOF
4286 #line 4287 "configure"
4287 #include "confdefs.h"
4288
4289 int main() {
4290 main()
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4294   rm -rf conftest*
4295   eval "ac_cv_lib_$ac_lib_var=yes"
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299   rm -rf conftest*
4300   eval "ac_cv_lib_$ac_lib_var=no"
4301 fi
4302 rm -f conftest*
4303 LIBS="$ac_save_LIBS"
4304
4305 fi
4306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4307   echo "$ac_t""yes" 1>&6
4308     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4309     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4310   cat >> confdefs.h <<EOF
4311 #define $ac_tr_lib 1
4312 EOF
4313
4314   LIBS="-lnet $LIBS"
4315
4316 else
4317   echo "$ac_t""no" 1>&6
4318 fi
4319
4320         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
4321 echo "configure:4322: checking for socket in -lnet" >&5
4322 ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
4323 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4324   echo $ac_n "(cached) $ac_c" 1>&6
4325 else
4326   ac_save_LIBS="$LIBS"
4327 LIBS="-lnet  $LIBS"
4328 cat > conftest.$ac_ext <<EOF
4329 #line 4330 "configure"
4330 #include "confdefs.h"
4331 /* Override any gcc2 internal prototype to avoid an error.  */
4332 /* We use char because int might match the return type of a gcc2
4333     builtin and then its argument prototype would still apply.  */
4334 char socket();
4335
4336 int main() {
4337 socket()
4338 ; return 0; }
4339 EOF
4340 if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4341   rm -rf conftest*
4342   eval "ac_cv_lib_$ac_lib_var=yes"
4343 else
4344   echo "configure: failed program was:" >&5
4345   cat conftest.$ac_ext >&5
4346   rm -rf conftest*
4347   eval "ac_cv_lib_$ac_lib_var=no"
4348 fi
4349 rm -f conftest*
4350 LIBS="$ac_save_LIBS"
4351
4352 fi
4353 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4354   echo "$ac_t""yes" 1>&6
4355     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4356     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4357   cat >> confdefs.h <<EOF
4358 #define $ac_tr_lib 1
4359 EOF
4360
4361   LIBS="-lnet $LIBS"
4362
4363 else
4364   echo "$ac_t""no" 1>&6
4365 fi
4366
4367         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4368 echo "configure:4369: checking for main in -lnsl_s" >&5
4369 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4370 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4371   echo $ac_n "(cached) $ac_c" 1>&6
4372 else
4373   ac_save_LIBS="$LIBS"
4374 LIBS="-lnsl_s  $LIBS"
4375 cat > conftest.$ac_ext <<EOF
4376 #line 4377 "configure"
4377 #include "confdefs.h"
4378
4379 int main() {
4380 main()
4381 ; return 0; }
4382 EOF
4383 if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4384   rm -rf conftest*
4385   eval "ac_cv_lib_$ac_lib_var=yes"
4386 else
4387   echo "configure: failed program was:" >&5
4388   cat conftest.$ac_ext >&5
4389   rm -rf conftest*
4390   eval "ac_cv_lib_$ac_lib_var=no"
4391 fi
4392 rm -f conftest*
4393 LIBS="$ac_save_LIBS"
4394
4395 fi
4396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4397   echo "$ac_t""yes" 1>&6
4398     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4399     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4400   cat >> confdefs.h <<EOF
4401 #define $ac_tr_lib 1
4402 EOF
4403
4404   LIBS="-lnsl_s $LIBS"
4405
4406 else
4407   echo "$ac_t""no" 1>&6
4408 fi
4409
4410         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4411 echo "configure:4412: checking for main in -lnsl" >&5
4412 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4413 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4414   echo $ac_n "(cached) $ac_c" 1>&6
4415 else
4416   ac_save_LIBS="$LIBS"
4417 LIBS="-lnsl  $LIBS"
4418 cat > conftest.$ac_ext <<EOF
4419 #line 4420 "configure"
4420 #include "confdefs.h"
4421
4422 int main() {
4423 main()
4424 ; return 0; }
4425 EOF
4426 if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4427   rm -rf conftest*
4428   eval "ac_cv_lib_$ac_lib_var=yes"
4429 else
4430   echo "configure: failed program was:" >&5
4431   cat conftest.$ac_ext >&5
4432   rm -rf conftest*
4433   eval "ac_cv_lib_$ac_lib_var=no"
4434 fi
4435 rm -f conftest*
4436 LIBS="$ac_save_LIBS"
4437
4438 fi
4439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4440   echo "$ac_t""yes" 1>&6
4441     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4442     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4443   cat >> confdefs.h <<EOF
4444 #define $ac_tr_lib 1
4445 EOF
4446
4447   LIBS="-lnsl $LIBS"
4448
4449 else
4450   echo "$ac_t""no" 1>&6
4451 fi
4452
4453         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4454 echo "configure:4455: checking for socket in -linet" >&5
4455 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4456 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4457   echo $ac_n "(cached) $ac_c" 1>&6
4458 else
4459   ac_save_LIBS="$LIBS"
4460 LIBS="-linet  $LIBS"
4461 cat > conftest.$ac_ext <<EOF
4462 #line 4463 "configure"
4463 #include "confdefs.h"
4464 /* Override any gcc2 internal prototype to avoid an error.  */
4465 /* We use char because int might match the return type of a gcc2
4466     builtin and then its argument prototype would still apply.  */
4467 char socket();
4468
4469 int main() {
4470 socket()
4471 ; return 0; }
4472 EOF
4473 if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4474   rm -rf conftest*
4475   eval "ac_cv_lib_$ac_lib_var=yes"
4476 else
4477   echo "configure: failed program was:" >&5
4478   cat conftest.$ac_ext >&5
4479   rm -rf conftest*
4480   eval "ac_cv_lib_$ac_lib_var=no"
4481 fi
4482 rm -f conftest*
4483 LIBS="$ac_save_LIBS"
4484
4485 fi
4486 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4487   echo "$ac_t""yes" 1>&6
4488     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4489     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4490   cat >> confdefs.h <<EOF
4491 #define $ac_tr_lib 1
4492 EOF
4493
4494   LIBS="-linet $LIBS"
4495
4496 else
4497   echo "$ac_t""no" 1>&6
4498 fi
4499
4500         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4501 echo "configure:4502: checking for main in -lgen" >&5
4502 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4503 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4504   echo $ac_n "(cached) $ac_c" 1>&6
4505 else
4506   ac_save_LIBS="$LIBS"
4507 LIBS="-lgen  $LIBS"
4508 cat > conftest.$ac_ext <<EOF
4509 #line 4510 "configure"
4510 #include "confdefs.h"
4511
4512 int main() {
4513 main()
4514 ; return 0; }
4515 EOF
4516 if { (eval echo configure:4517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4517   rm -rf conftest*
4518   eval "ac_cv_lib_$ac_lib_var=yes"
4519 else
4520   echo "configure: failed program was:" >&5
4521   cat conftest.$ac_ext >&5
4522   rm -rf conftest*
4523   eval "ac_cv_lib_$ac_lib_var=no"
4524 fi
4525 rm -f conftest*
4526 LIBS="$ac_save_LIBS"
4527
4528 fi
4529 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4530   echo "$ac_t""yes" 1>&6
4531     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4532     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4533   cat >> confdefs.h <<EOF
4534 #define $ac_tr_lib 1
4535 EOF
4536
4537   LIBS="-lgen $LIBS"
4538
4539 else
4540   echo "$ac_t""no" 1>&6
4541 fi
4542
4543
4544 fi
4545
4546
4547 echo $ac_n "checking for select""... $ac_c" 1>&6
4548 echo "configure:4549: checking for select" >&5
4549 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4550   echo $ac_n "(cached) $ac_c" 1>&6
4551 else
4552   cat > conftest.$ac_ext <<EOF
4553 #line 4554 "configure"
4554 #include "confdefs.h"
4555 /* System header to define __stub macros and hopefully few prototypes,
4556     which can conflict with char select(); below.  */
4557 #include <assert.h>
4558 /* Override any gcc2 internal prototype to avoid an error.  */
4559 /* We use char because int might match the return type of a gcc2
4560     builtin and then its argument prototype would still apply.  */
4561 char select();
4562 char (*f)();
4563
4564 int main() {
4565
4566 /* The GNU C library defines this for functions which it implements
4567     to always fail with ENOSYS.  Some functions are actually named
4568     something starting with __ and the normal name is an alias.  */
4569 #if defined (__stub_select) || defined (__stub___select)
4570 choke me
4571 #else
4572 f = select;
4573 #endif
4574
4575 ; return 0; }
4576 EOF
4577 if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4578   rm -rf conftest*
4579   eval "ac_cv_func_select=yes"
4580 else
4581   echo "configure: failed program was:" >&5
4582   cat conftest.$ac_ext >&5
4583   rm -rf conftest*
4584   eval "ac_cv_func_select=no"
4585 fi
4586 rm -f conftest*
4587 fi
4588
4589 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4590   echo "$ac_t""yes" 1>&6
4591   :
4592 else
4593   echo "$ac_t""no" 1>&6
4594 { echo "configure: error: select() required." 1>&2; exit 1; }
4595 fi
4596
4597
4598 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4599 echo "configure:4600: checking types of arguments for select()" >&5
4600  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4601   echo $ac_n "(cached) $ac_c" 1>&6
4602 else
4603    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4604   echo $ac_n "(cached) $ac_c" 1>&6
4605 else
4606     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4607   echo $ac_n "(cached) $ac_c" 1>&6
4608 else
4609      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4610      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4611       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4612        cat > conftest.$ac_ext <<EOF
4613 #line 4614 "configure"
4614 #include "confdefs.h"
4615 #ifdef HAVE_SYS_TYPES_H
4616 #include <sys/types.h>
4617 #endif
4618 #ifdef HAVE_SYS_TIME_H
4619 #include <sys/time.h>
4620 #endif
4621 #ifdef HAVE_SYS_SELECT_H
4622 #include <sys/select.h>
4623 #endif
4624 #ifdef HAVE_SYS_SOCKET_H
4625 #include <sys/socket.h>
4626 #endif
4627 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);
4628 int main() {
4629
4630 ; return 0; }
4631 EOF
4632 if { (eval echo configure:4633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4633   rm -rf conftest*
4634           ac_not_found=no ; break 3
4635 else
4636   echo "configure: failed program was:" >&5
4637   cat conftest.$ac_ext >&5
4638   rm -rf conftest*
4639   ac_not_found=yes
4640 fi
4641 rm -f conftest*
4642       done
4643      done
4644     done
4645    
4646 fi
4647   
4648 fi
4649  
4650 fi
4651  if test "$ac_not_found" = yes; then
4652   ac_cv_func_select_arg1=int 
4653   ac_cv_func_select_arg234='int *' 
4654   ac_cv_func_select_arg5='struct timeval *'
4655  fi
4656  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4657  cat >> confdefs.h <<EOF
4658 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4659 EOF
4660
4661  cat >> confdefs.h <<EOF
4662 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4663 EOF
4664
4665  cat >> confdefs.h <<EOF
4666 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4667 EOF
4668
4669
4670
4671
4672 for ac_hdr in regex.h 
4673 do
4674 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4675 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4676 echo "configure:4677: checking for $ac_hdr" >&5
4677 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4678   echo $ac_n "(cached) $ac_c" 1>&6
4679 else
4680   cat > conftest.$ac_ext <<EOF
4681 #line 4682 "configure"
4682 #include "confdefs.h"
4683 #include <$ac_hdr>
4684 EOF
4685 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4686 { (eval echo configure:4687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4687 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4688 if test -z "$ac_err"; then
4689   rm -rf conftest*
4690   eval "ac_cv_header_$ac_safe=yes"
4691 else
4692   echo "$ac_err" >&5
4693   echo "configure: failed program was:" >&5
4694   cat conftest.$ac_ext >&5
4695   rm -rf conftest*
4696   eval "ac_cv_header_$ac_safe=no"
4697 fi
4698 rm -f conftest*
4699 fi
4700 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4701   echo "$ac_t""yes" 1>&6
4702     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4703   cat >> confdefs.h <<EOF
4704 #define $ac_tr_hdr 1
4705 EOF
4706  
4707 else
4708   echo "$ac_t""no" 1>&6
4709 fi
4710 done
4711
4712 if test "$ac_cv_header_regex_h" != yes ; then
4713         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4714 fi
4715 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4716 echo "configure:4717: checking for regfree" >&5
4717 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
4718   echo $ac_n "(cached) $ac_c" 1>&6
4719 else
4720   cat > conftest.$ac_ext <<EOF
4721 #line 4722 "configure"
4722 #include "confdefs.h"
4723 /* System header to define __stub macros and hopefully few prototypes,
4724     which can conflict with char regfree(); below.  */
4725 #include <assert.h>
4726 /* Override any gcc2 internal prototype to avoid an error.  */
4727 /* We use char because int might match the return type of a gcc2
4728     builtin and then its argument prototype would still apply.  */
4729 char regfree();
4730 char (*f)();
4731
4732 int main() {
4733
4734 /* The GNU C library defines this for functions which it implements
4735     to always fail with ENOSYS.  Some functions are actually named
4736     something starting with __ and the normal name is an alias.  */
4737 #if defined (__stub_regfree) || defined (__stub___regfree)
4738 choke me
4739 #else
4740 f = regfree;
4741 #endif
4742
4743 ; return 0; }
4744 EOF
4745 if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4746   rm -rf conftest*
4747   eval "ac_cv_func_regfree=yes"
4748 else
4749   echo "configure: failed program was:" >&5
4750   cat conftest.$ac_ext >&5
4751   rm -rf conftest*
4752   eval "ac_cv_func_regfree=no"
4753 fi
4754 rm -f conftest*
4755 fi
4756
4757 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
4758   echo "$ac_t""yes" 1>&6
4759   :
4760 else
4761   echo "$ac_t""no" 1>&6
4762 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
4763 fi
4764
4765
4766
4767 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
4768 echo "configure:4769: checking for compatible POSIX regex" >&5
4769 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
4770   echo $ac_n "(cached) $ac_c" 1>&6
4771 else
4772   
4773         if test "$cross_compiling" = yes; then
4774   ol_cv_c_posix_regex=cross
4775 else
4776   cat > conftest.$ac_ext <<EOF
4777 #line 4778 "configure"
4778 #include "confdefs.h"
4779
4780 #include <sys/types.h>
4781 #include <regex.h>
4782 static char *pattern, *string;
4783 main()
4784 {
4785         int rc;
4786         regex_t re;
4787
4788         pattern = "^A";
4789
4790         if(regcomp(&re, pattern, 0)) {
4791                 return -1;
4792         }
4793         
4794         string = "ALL MATCH";
4795         
4796         rc = regexec(&re, string, 0, (void*)0, 0);
4797
4798         regfree(&re);
4799
4800         return rc;
4801 }
4802 EOF
4803 if { (eval echo configure:4804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4804 then
4805   ol_cv_c_posix_regex=yes
4806 else
4807   echo "configure: failed program was:" >&5
4808   cat conftest.$ac_ext >&5
4809   rm -fr conftest*
4810   ol_cv_c_posix_regex=no
4811 fi
4812 rm -fr conftest*
4813 fi
4814
4815 fi
4816
4817 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
4818
4819 if test "$ol_cv_c_posix_regex" = no ; then
4820         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
4821 fi
4822
4823
4824 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4825 echo "configure:4826: checking for sigset in -lV3" >&5
4826 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4827 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4828   echo $ac_n "(cached) $ac_c" 1>&6
4829 else
4830   ac_save_LIBS="$LIBS"
4831 LIBS="-lV3  $LIBS"
4832 cat > conftest.$ac_ext <<EOF
4833 #line 4834 "configure"
4834 #include "confdefs.h"
4835 /* Override any gcc2 internal prototype to avoid an error.  */
4836 /* We use char because int might match the return type of a gcc2
4837     builtin and then its argument prototype would still apply.  */
4838 char sigset();
4839
4840 int main() {
4841 sigset()
4842 ; return 0; }
4843 EOF
4844 if { (eval echo configure:4845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4845   rm -rf conftest*
4846   eval "ac_cv_lib_$ac_lib_var=yes"
4847 else
4848   echo "configure: failed program was:" >&5
4849   cat conftest.$ac_ext >&5
4850   rm -rf conftest*
4851   eval "ac_cv_lib_$ac_lib_var=no"
4852 fi
4853 rm -f conftest*
4854 LIBS="$ac_save_LIBS"
4855
4856 fi
4857 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4858   echo "$ac_t""yes" 1>&6
4859     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4860     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4861   cat >> confdefs.h <<EOF
4862 #define $ac_tr_lib 1
4863 EOF
4864
4865   LIBS="-lV3 $LIBS"
4866
4867 else
4868   echo "$ac_t""no" 1>&6
4869 fi
4870
4871
4872
4873 # find res_search
4874 if test $ol_enable_dns != no ; then
4875                 echo $ac_n "checking for res_search""... $ac_c" 1>&6
4876 echo "configure:4877: checking for res_search" >&5
4877 if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
4878   echo $ac_n "(cached) $ac_c" 1>&6
4879 else
4880   cat > conftest.$ac_ext <<EOF
4881 #line 4882 "configure"
4882 #include "confdefs.h"
4883 /* System header to define __stub macros and hopefully few prototypes,
4884     which can conflict with char res_search(); below.  */
4885 #include <assert.h>
4886 /* Override any gcc2 internal prototype to avoid an error.  */
4887 /* We use char because int might match the return type of a gcc2
4888     builtin and then its argument prototype would still apply.  */
4889 char res_search();
4890 char (*f)();
4891
4892 int main() {
4893
4894 /* The GNU C library defines this for functions which it implements
4895     to always fail with ENOSYS.  Some functions are actually named
4896     something starting with __ and the normal name is an alias.  */
4897 #if defined (__stub_res_search) || defined (__stub___res_search)
4898 choke me
4899 #else
4900 f = res_search;
4901 #endif
4902
4903 ; return 0; }
4904 EOF
4905 if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4906   rm -rf conftest*
4907   eval "ac_cv_func_res_search=yes"
4908 else
4909   echo "configure: failed program was:" >&5
4910   cat conftest.$ac_ext >&5
4911   rm -rf conftest*
4912   eval "ac_cv_func_res_search=no"
4913 fi
4914 rm -f conftest*
4915 fi
4916
4917 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
4918   echo "$ac_t""yes" 1>&6
4919   :
4920 else
4921   echo "$ac_t""no" 1>&6
4922 fi
4923
4924         if test $ac_cv_func_res_search = no ; then 
4925                 echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
4926 echo "configure:4927: checking for res_search in -lbind" >&5
4927 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
4928 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4929   echo $ac_n "(cached) $ac_c" 1>&6
4930 else
4931   ac_save_LIBS="$LIBS"
4932 LIBS="-lbind  $LIBS"
4933 cat > conftest.$ac_ext <<EOF
4934 #line 4935 "configure"
4935 #include "confdefs.h"
4936 /* Override any gcc2 internal prototype to avoid an error.  */
4937 /* We use char because int might match the return type of a gcc2
4938     builtin and then its argument prototype would still apply.  */
4939 char res_search();
4940
4941 int main() {
4942 res_search()
4943 ; return 0; }
4944 EOF
4945 if { (eval echo configure:4946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4946   rm -rf conftest*
4947   eval "ac_cv_lib_$ac_lib_var=yes"
4948 else
4949   echo "configure: failed program was:" >&5
4950   cat conftest.$ac_ext >&5
4951   rm -rf conftest*
4952   eval "ac_cv_lib_$ac_lib_var=no"
4953 fi
4954 rm -f conftest*
4955 LIBS="$ac_save_LIBS"
4956
4957 fi
4958 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4959   echo "$ac_t""yes" 1>&6
4960     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4961     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4962   cat >> confdefs.h <<EOF
4963 #define $ac_tr_lib 1
4964 EOF
4965
4966   LIBS="-lbind $LIBS"
4967
4968 else
4969   echo "$ac_t""no" 1>&6
4970 fi
4971
4972                 ac_cv_func_res_search=$ac_cv_lib_bind_res_search
4973         fi
4974         if test $ac_cv_func_res_search = no ; then 
4975                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
4976 echo "configure:4977: checking for res_search in -lresolv" >&5
4977 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
4978 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4979   echo $ac_n "(cached) $ac_c" 1>&6
4980 else
4981   ac_save_LIBS="$LIBS"
4982 LIBS="-lresolv  $LIBS"
4983 cat > conftest.$ac_ext <<EOF
4984 #line 4985 "configure"
4985 #include "confdefs.h"
4986 /* Override any gcc2 internal prototype to avoid an error.  */
4987 /* We use char because int might match the return type of a gcc2
4988     builtin and then its argument prototype would still apply.  */
4989 char res_search();
4990
4991 int main() {
4992 res_search()
4993 ; return 0; }
4994 EOF
4995 if { (eval echo configure:4996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4996   rm -rf conftest*
4997   eval "ac_cv_lib_$ac_lib_var=yes"
4998 else
4999   echo "configure: failed program was:" >&5
5000   cat conftest.$ac_ext >&5
5001   rm -rf conftest*
5002   eval "ac_cv_lib_$ac_lib_var=no"
5003 fi
5004 rm -f conftest*
5005 LIBS="$ac_save_LIBS"
5006
5007 fi
5008 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5009   echo "$ac_t""yes" 1>&6
5010     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5011     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5012   cat >> confdefs.h <<EOF
5013 #define $ac_tr_lib 1
5014 EOF
5015
5016   LIBS="-lresolv $LIBS"
5017
5018 else
5019   echo "$ac_t""no" 1>&6
5020 fi
5021
5022                 ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
5023         fi
5024
5025         if test "$ac_cv_func_res_search" = yes ; then
5026                 cat >> confdefs.h <<\EOF
5027 #define HAVE_RES_SEARCH 1
5028 EOF
5029
5030         elif test $ol_enable_dns = yes ; then
5031                 { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
5032         else
5033                 echo "configure: warning: no res_search, disabling DNS support" 1>&2
5034         fi
5035 fi
5036
5037
5038 # ISODE tests
5039 ol_link_isode=no
5040 if test $ol_enable_ldapd != no ; then
5041         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
5042
5043                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
5044 echo "configure:5045: checking for main in -lxtpp" >&5
5045 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-:%__p__%'`
5046 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5047   echo $ac_n "(cached) $ac_c" 1>&6
5048 else
5049   ac_save_LIBS="$LIBS"
5050 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
5051 cat > conftest.$ac_ext <<EOF
5052 #line 5053 "configure"
5053 #include "confdefs.h"
5054
5055 int main() {
5056 main()
5057 ; return 0; }
5058 EOF
5059 if { (eval echo configure:5060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5060   rm -rf conftest*
5061   eval "ac_cv_lib_$ac_lib_var=yes"
5062 else
5063   echo "configure: failed program was:" >&5
5064   cat conftest.$ac_ext >&5
5065   rm -rf conftest*
5066   eval "ac_cv_lib_$ac_lib_var=no"
5067 fi
5068 rm -f conftest*
5069 LIBS="$ac_save_LIBS"
5070
5071 fi
5072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5073   echo "$ac_t""yes" 1>&6
5074   
5075                 ol_link_isode=yes
5076                 cat >> confdefs.h <<\EOF
5077 #define HAVE_XTPP 1
5078 EOF
5079
5080                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
5081                 
5082 else
5083   echo "$ac_t""no" 1>&6
5084 :
5085 fi
5086
5087         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
5088 echo "configure:5089: checking for main in -ldsap" >&5
5089 ac_lib_var=`echo dsap'_'main | sed 'y%./+-:%__p__%'`
5090 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5091   echo $ac_n "(cached) $ac_c" 1>&6
5092 else
5093   ac_save_LIBS="$LIBS"
5094 LIBS="-ldsap -lisode $LIBS"
5095 cat > conftest.$ac_ext <<EOF
5096 #line 5097 "configure"
5097 #include "confdefs.h"
5098
5099 int main() {
5100 main()
5101 ; return 0; }
5102 EOF
5103 if { (eval echo configure:5104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5104   rm -rf conftest*
5105   eval "ac_cv_lib_$ac_lib_var=yes"
5106 else
5107   echo "configure: failed program was:" >&5
5108   cat conftest.$ac_ext >&5
5109   rm -rf conftest*
5110   eval "ac_cv_lib_$ac_lib_var=no"
5111 fi
5112 rm -f conftest*
5113 LIBS="$ac_save_LIBS"
5114
5115 fi
5116 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5117   echo "$ac_t""yes" 1>&6
5118   
5119                 ol_link_isode=yes
5120                 cat >> confdefs.h <<\EOF
5121 #define HAVE_DSAP 1
5122 EOF
5123
5124                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
5125                 
5126 else
5127   echo "$ac_t""no" 1>&6
5128 :
5129 fi
5130
5131         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
5132 echo "configure:5133: checking for main in -lisode" >&5
5133 ac_lib_var=`echo isode'_'main | sed 'y%./+-:%__p__%'`
5134 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5135   echo $ac_n "(cached) $ac_c" 1>&6
5136 else
5137   ac_save_LIBS="$LIBS"
5138 LIBS="-lisode  $LIBS"
5139 cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142
5143 int main() {
5144 main()
5145 ; return 0; }
5146 EOF
5147 if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5148   rm -rf conftest*
5149   eval "ac_cv_lib_$ac_lib_var=yes"
5150 else
5151   echo "configure: failed program was:" >&5
5152   cat conftest.$ac_ext >&5
5153   rm -rf conftest*
5154   eval "ac_cv_lib_$ac_lib_var=no"
5155 fi
5156 rm -f conftest*
5157 LIBS="$ac_save_LIBS"
5158
5159 fi
5160 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5161   echo "$ac_t""yes" 1>&6
5162   
5163                 ol_link_isode=yes
5164                 cat >> confdefs.h <<\EOF
5165 #define HAVE_ISODE 1
5166 EOF
5167
5168                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
5169                 
5170 else
5171   echo "$ac_t""no" 1>&6
5172 :
5173 fi
5174
5175 fi
5176
5177 if test $ol_link_isode != no; then
5178         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
5179 echo "configure:5180: checking for main in -lpp" >&5
5180 ac_lib_var=`echo pp'_'main | sed 'y%./+-:%__p__%'`
5181 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5182   echo $ac_n "(cached) $ac_c" 1>&6
5183 else
5184   ac_save_LIBS="$LIBS"
5185 LIBS="-lpp  $LIBS"
5186 cat > conftest.$ac_ext <<EOF
5187 #line 5188 "configure"
5188 #include "confdefs.h"
5189
5190 int main() {
5191 main()
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   eval "ac_cv_lib_$ac_lib_var=yes"
5197 else
5198   echo "configure: failed program was:" >&5
5199   cat conftest.$ac_ext >&5
5200   rm -rf conftest*
5201   eval "ac_cv_lib_$ac_lib_var=no"
5202 fi
5203 rm -f conftest*
5204 LIBS="$ac_save_LIBS"
5205
5206 fi
5207 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5208   echo "$ac_t""yes" 1>&6
5209   
5210                 cat >> confdefs.h <<\EOF
5211 #define HAVE_PP 1
5212 EOF
5213
5214                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
5215                 
5216 else
5217   echo "$ac_t""no" 1>&6
5218 :
5219 fi
5220
5221
5222         # Extract the first word of "pepsy", so it can be a program name with args.
5223 set dummy pepsy; ac_word=$2
5224 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5225 echo "configure:5226: checking for $ac_word" >&5
5226 if eval "test \"\${ac_cv_path_PEPSY+set}\" = set"; then
5227   echo $ac_n "(cached) $ac_c" 1>&6
5228 else
5229   case "$PEPSY" in
5230   /*)
5231   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
5232   ;;
5233   ?:/*)                  
5234   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
5235   ;;
5236   *)
5237   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5238   ac_dummy="$PATH"
5239   for ac_dir in $ac_dummy; do 
5240     test -z "$ac_dir" && ac_dir=.
5241     if test -f $ac_dir/$ac_word; then
5242       ac_cv_path_PEPSY="$ac_dir/$ac_word"
5243       break
5244     fi
5245   done
5246   IFS="$ac_save_ifs"
5247   ;;
5248 esac
5249 fi
5250 PEPSY="$ac_cv_path_PEPSY"
5251 if test -n "$PEPSY"; then
5252   echo "$ac_t""$PEPSY" 1>&6
5253 else
5254   echo "$ac_t""no" 1>&6
5255 fi
5256
5257 fi
5258
5259 ol_link_kerberos=no
5260
5261 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
5262         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5263 do
5264 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5265 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5266 echo "configure:5267: checking for $ac_hdr" >&5
5267 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5268   echo $ac_n "(cached) $ac_c" 1>&6
5269 else
5270   cat > conftest.$ac_ext <<EOF
5271 #line 5272 "configure"
5272 #include "confdefs.h"
5273 #include <$ac_hdr>
5274 EOF
5275 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5276 { (eval echo configure:5277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5277 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5278 if test -z "$ac_err"; then
5279   rm -rf conftest*
5280   eval "ac_cv_header_$ac_safe=yes"
5281 else
5282   echo "$ac_err" >&5
5283   echo "configure: failed program was:" >&5
5284   cat conftest.$ac_ext >&5
5285   rm -rf conftest*
5286   eval "ac_cv_header_$ac_safe=no"
5287 fi
5288 rm -f conftest*
5289 fi
5290 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5291   echo "$ac_t""yes" 1>&6
5292     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5293   cat >> confdefs.h <<EOF
5294 #define $ac_tr_hdr 1
5295 EOF
5296  
5297 else
5298   echo "$ac_t""no" 1>&6
5299 fi
5300 done
5301
5302
5303         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5304                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5305 echo "configure:5306: checking for main in -lkrb4" >&5
5306 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5307 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5308   echo $ac_n "(cached) $ac_c" 1>&6
5309 else
5310   ac_save_LIBS="$LIBS"
5311 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
5312 cat > conftest.$ac_ext <<EOF
5313 #line 5314 "configure"
5314 #include "confdefs.h"
5315
5316 int main() {
5317 main()
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   eval "ac_cv_lib_$ac_lib_var=yes"
5323 else
5324   echo "configure: failed program was:" >&5
5325   cat conftest.$ac_ext >&5
5326   rm -rf conftest*
5327   eval "ac_cv_lib_$ac_lib_var=no"
5328 fi
5329 rm -f conftest*
5330 LIBS="$ac_save_LIBS"
5331
5332 fi
5333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5334   echo "$ac_t""yes" 1>&6
5335   have_k5=yes
5336 else
5337   echo "$ac_t""no" 1>&6
5338 have_k5=no
5339 fi
5340
5341
5342                 if test $have_k5 = yes ; then
5343                         ol_with_kerberos=found
5344                         ol_link_kerberos=yes
5345
5346                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
5347
5348                         LIBS="$KRB_LIBS $LIBS"
5349
5350                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5351 echo "configure:5352: checking for des_debug in Kerberos libraries" >&5
5352 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5353   echo $ac_n "(cached) $ac_c" 1>&6
5354 else
5355   
5356                                                                 save_LIBS="$LIBS"
5357                                 LIBS="$KRB_LIBS $LIBS"
5358                                 cat > conftest.$ac_ext <<EOF
5359 #line 5360 "configure"
5360 #include "confdefs.h"
5361
5362 #include <kerberosIV/krb.h>
5363 #include <kerberosIV/des.h>
5364 extern int des_debug;
5365
5366 int main() {
5367
5368 des_debug = 1;
5369
5370 ; return 0; }
5371 EOF
5372 if { (eval echo configure:5373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5373   rm -rf conftest*
5374   ol_cv_var_des_debug=yes
5375 else
5376   echo "configure: failed program was:" >&5
5377   cat conftest.$ac_ext >&5
5378   rm -rf conftest*
5379   ol_cv_var_des_debug=no
5380 fi
5381 rm -f conftest*
5382                                                                 LIBS="$save_LIBS"
5383                         
5384 fi
5385
5386 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5387
5388                         if test $ol_cv_var_des_debug = yes ; then
5389                                 cat >> confdefs.h <<\EOF
5390 #define HAVE_DES_DEBUG 1
5391 EOF
5392
5393                         fi
5394
5395                         LIBS="$save_LIBS"
5396                 fi
5397         fi
5398 fi
5399
5400 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
5401         for ac_hdr in krb.h des.h
5402 do
5403 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5404 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5405 echo "configure:5406: checking for $ac_hdr" >&5
5406 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5407   echo $ac_n "(cached) $ac_c" 1>&6
5408 else
5409   cat > conftest.$ac_ext <<EOF
5410 #line 5411 "configure"
5411 #include "confdefs.h"
5412 #include <$ac_hdr>
5413 EOF
5414 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5415 { (eval echo configure:5416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5416 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5417 if test -z "$ac_err"; then
5418   rm -rf conftest*
5419   eval "ac_cv_header_$ac_safe=yes"
5420 else
5421   echo "$ac_err" >&5
5422   echo "configure: failed program was:" >&5
5423   cat conftest.$ac_ext >&5
5424   rm -rf conftest*
5425   eval "ac_cv_header_$ac_safe=no"
5426 fi
5427 rm -f conftest*
5428 fi
5429 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5430   echo "$ac_t""yes" 1>&6
5431     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5432   cat >> confdefs.h <<EOF
5433 #define $ac_tr_hdr 1
5434 EOF
5435  
5436 else
5437   echo "$ac_t""no" 1>&6
5438 fi
5439 done
5440
5441
5442         if test $ac_cv_header_krb_h = yes ; then
5443                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
5444 echo "configure:5445: checking for main in -lkrb" >&5
5445 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
5446 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5447   echo $ac_n "(cached) $ac_c" 1>&6
5448 else
5449   ac_save_LIBS="$LIBS"
5450 LIBS="-lkrb -ldes $LIBS"
5451 cat > conftest.$ac_ext <<EOF
5452 #line 5453 "configure"
5453 #include "confdefs.h"
5454
5455 int main() {
5456 main()
5457 ; return 0; }
5458 EOF
5459 if { (eval echo configure:5460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5460   rm -rf conftest*
5461   eval "ac_cv_lib_$ac_lib_var=yes"
5462 else
5463   echo "configure: failed program was:" >&5
5464   cat conftest.$ac_ext >&5
5465   rm -rf conftest*
5466   eval "ac_cv_lib_$ac_lib_var=no"
5467 fi
5468 rm -f conftest*
5469 LIBS="$ac_save_LIBS"
5470
5471 fi
5472 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5473   echo "$ac_t""yes" 1>&6
5474   have_k4=yes
5475 else
5476   echo "$ac_t""no" 1>&6
5477 have_k4=no
5478 fi
5479
5480
5481                 if test $have_k4 = yes ; then
5482                         ol_with_kerberos=found
5483                         ol_link_kerberos=yes
5484
5485                         KRB_LIBS="-lkrb -ldes"
5486                 fi
5487         fi
5488 fi
5489
5490 if test $ol_link_kerberos = yes ; then
5491         cat >> confdefs.h <<\EOF
5492 #define HAVE_KERBEROS 1
5493 EOF
5494
5495 fi
5496
5497 ol_link_tls=no
5498 if test $ol_with_tls != no ; then
5499         
5500         for ac_hdr in openssl/ssl.h ssl.h
5501 do
5502 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5503 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5504 echo "configure:5505: checking for $ac_hdr" >&5
5505 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5506   echo $ac_n "(cached) $ac_c" 1>&6
5507 else
5508   cat > conftest.$ac_ext <<EOF
5509 #line 5510 "configure"
5510 #include "confdefs.h"
5511 #include <$ac_hdr>
5512 EOF
5513 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5514 { (eval echo configure:5515: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5515 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5516 if test -z "$ac_err"; then
5517   rm -rf conftest*
5518   eval "ac_cv_header_$ac_safe=yes"
5519 else
5520   echo "$ac_err" >&5
5521   echo "configure: failed program was:" >&5
5522   cat conftest.$ac_ext >&5
5523   rm -rf conftest*
5524   eval "ac_cv_header_$ac_safe=no"
5525 fi
5526 rm -f conftest*
5527 fi
5528 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5529   echo "$ac_t""yes" 1>&6
5530     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5531   cat >> confdefs.h <<EOF
5532 #define $ac_tr_hdr 1
5533 EOF
5534  
5535 else
5536   echo "$ac_t""no" 1>&6
5537 fi
5538 done
5539
5540         
5541         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
5542                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
5543 echo "configure:5544: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
5544 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
5545 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5546   echo $ac_n "(cached) $ac_c" 1>&6
5547 else
5548   ac_save_LIBS="$LIBS"
5549 LIBS="-lssl -lcrypto $LIBS"
5550 cat > conftest.$ac_ext <<EOF
5551 #line 5552 "configure"
5552 #include "confdefs.h"
5553 /* Override any gcc2 internal prototype to avoid an error.  */
5554 /* We use char because int might match the return type of a gcc2
5555     builtin and then its argument prototype would still apply.  */
5556 char SSLeay_add_ssl_algorithms();
5557
5558 int main() {
5559 SSLeay_add_ssl_algorithms()
5560 ; return 0; }
5561 EOF
5562 if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5563   rm -rf conftest*
5564   eval "ac_cv_lib_$ac_lib_var=yes"
5565 else
5566   echo "configure: failed program was:" >&5
5567   cat conftest.$ac_ext >&5
5568   rm -rf conftest*
5569   eval "ac_cv_lib_$ac_lib_var=no"
5570 fi
5571 rm -f conftest*
5572 LIBS="$ac_save_LIBS"
5573
5574 fi
5575 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5576   echo "$ac_t""yes" 1>&6
5577   have_ssleay=yes
5578                         need_rsaref=no
5579 else
5580   echo "$ac_t""no" 1>&6
5581 have_ssleay=no
5582 fi
5583
5584                         
5585                 if test $have_ssleay = no ; then
5586                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
5587 echo "configure:5588: checking for SSL_library_init in -lssl" >&5
5588 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
5589 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5590   echo $ac_n "(cached) $ac_c" 1>&6
5591 else
5592   ac_save_LIBS="$LIBS"
5593 LIBS="-lssl -lcrypto $LIBS"
5594 cat > conftest.$ac_ext <<EOF
5595 #line 5596 "configure"
5596 #include "confdefs.h"
5597 /* Override any gcc2 internal prototype to avoid an error.  */
5598 /* We use char because int might match the return type of a gcc2
5599     builtin and then its argument prototype would still apply.  */
5600 char SSL_library_init();
5601
5602 int main() {
5603 SSL_library_init()
5604 ; return 0; }
5605 EOF
5606 if { (eval echo configure:5607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5607   rm -rf conftest*
5608   eval "ac_cv_lib_$ac_lib_var=yes"
5609 else
5610   echo "configure: failed program was:" >&5
5611   cat conftest.$ac_ext >&5
5612   rm -rf conftest*
5613   eval "ac_cv_lib_$ac_lib_var=no"
5614 fi
5615 rm -f conftest*
5616 LIBS="$ac_save_LIBS"
5617
5618 fi
5619 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5620   echo "$ac_t""yes" 1>&6
5621   have_ssleay=yes
5622                                 need_rsaref=no
5623 else
5624   echo "$ac_t""no" 1>&6
5625 have_ssleay=no
5626 fi
5627
5628                 fi
5629
5630                 if test $have_ssleay = no ; then
5631                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
5632 echo "configure:5633: checking for ssl3_accept in -lssl" >&5
5633 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
5634 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5635   echo $ac_n "(cached) $ac_c" 1>&6
5636 else
5637   ac_save_LIBS="$LIBS"
5638 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
5639 cat > conftest.$ac_ext <<EOF
5640 #line 5641 "configure"
5641 #include "confdefs.h"
5642 /* Override any gcc2 internal prototype to avoid an error.  */
5643 /* We use char because int might match the return type of a gcc2
5644     builtin and then its argument prototype would still apply.  */
5645 char ssl3_accept();
5646
5647 int main() {
5648 ssl3_accept()
5649 ; return 0; }
5650 EOF
5651 if { (eval echo configure:5652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5652   rm -rf conftest*
5653   eval "ac_cv_lib_$ac_lib_var=yes"
5654 else
5655   echo "configure: failed program was:" >&5
5656   cat conftest.$ac_ext >&5
5657   rm -rf conftest*
5658   eval "ac_cv_lib_$ac_lib_var=no"
5659 fi
5660 rm -f conftest*
5661 LIBS="$ac_save_LIBS"
5662
5663 fi
5664 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5665   echo "$ac_t""yes" 1>&6
5666   have_ssleay=yes
5667                                 need_rsaref=yes
5668 else
5669   echo "$ac_t""no" 1>&6
5670 have_ssleay=no
5671 fi
5672
5673                 fi
5674
5675                 if test $have_ssleay = yes ; then
5676                         ol_with_tls=found
5677                         ol_link_tls=yes
5678
5679                         cat >> confdefs.h <<\EOF
5680 #define HAVE_SSLEAY 1
5681 EOF
5682
5683
5684                         if test $need_rsaref = yes; then
5685                                 cat >> confdefs.h <<\EOF
5686 #define HAVE_RSAREF 1
5687 EOF
5688
5689
5690                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
5691                         else
5692                                 TLS_LIBS="-lssl -lcrypto"
5693                         fi
5694                 fi
5695         fi
5696 fi
5697
5698 if test $ol_link_tls = yes ; then
5699         cat >> confdefs.h <<\EOF
5700 #define HAVE_TLS 1
5701 EOF
5702
5703 fi      
5704
5705 for ac_func in \
5706         ctime_r                 \
5707         gethostbyname_r gethostbyaddr_r \
5708
5709 do
5710 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5711 echo "configure:5712: checking for $ac_func" >&5
5712 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5713   echo $ac_n "(cached) $ac_c" 1>&6
5714 else
5715   cat > conftest.$ac_ext <<EOF
5716 #line 5717 "configure"
5717 #include "confdefs.h"
5718 /* System header to define __stub macros and hopefully few prototypes,
5719     which can conflict with char $ac_func(); below.  */
5720 #include <assert.h>
5721 /* Override any gcc2 internal prototype to avoid an error.  */
5722 /* We use char because int might match the return type of a gcc2
5723     builtin and then its argument prototype would still apply.  */
5724 char $ac_func();
5725 char (*f)();
5726
5727 int main() {
5728
5729 /* The GNU C library defines this for functions which it implements
5730     to always fail with ENOSYS.  Some functions are actually named
5731     something starting with __ and the normal name is an alias.  */
5732 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5733 choke me
5734 #else
5735 f = $ac_func;
5736 #endif
5737
5738 ; return 0; }
5739 EOF
5740 if { (eval echo configure:5741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5741   rm -rf conftest*
5742   eval "ac_cv_func_$ac_func=yes"
5743 else
5744   echo "configure: failed program was:" >&5
5745   cat conftest.$ac_ext >&5
5746   rm -rf conftest*
5747   eval "ac_cv_func_$ac_func=no"
5748 fi
5749 rm -f conftest*
5750 fi
5751
5752 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5753   echo "$ac_t""yes" 1>&6
5754     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5755   cat >> confdefs.h <<EOF
5756 #define $ac_tr_func 1
5757 EOF
5758  
5759 else
5760   echo "$ac_t""no" 1>&6
5761 fi
5762 done
5763
5764
5765 if test "$ac_cv_func_ctime_r" = no ; then
5766         ol_cv_func_ctime_r_nargs=0
5767 else
5768         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
5769 echo "configure:5770: checking number of arguments of ctime_r" >&5
5770 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
5771   echo $ac_n "(cached) $ac_c" 1>&6
5772 else
5773   cat > conftest.$ac_ext <<EOF
5774 #line 5775 "configure"
5775 #include "confdefs.h"
5776 #include <time.h>
5777 int main() {
5778 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
5779 ; return 0; }
5780 EOF
5781 if { (eval echo configure:5782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5782   rm -rf conftest*
5783   ol_cv_func_ctime_r_nargs=3
5784 else
5785   echo "configure: failed program was:" >&5
5786   cat conftest.$ac_ext >&5
5787   rm -rf conftest*
5788   cat > conftest.$ac_ext <<EOF
5789 #line 5790 "configure"
5790 #include "confdefs.h"
5791 #include <time.h>
5792 int main() {
5793 time_t ti; char *buffer; ctime_r(&ti,buffer);
5794 ; return 0; }
5795 EOF
5796 if { (eval echo configure:5797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5797   rm -rf conftest*
5798   ol_cv_func_ctime_r_nargs=2
5799 else
5800   echo "configure: failed program was:" >&5
5801   cat conftest.$ac_ext >&5
5802   rm -rf conftest*
5803   ol_cv_func_ctime_r_nargs=0
5804 fi
5805 rm -f conftest*
5806 fi
5807 rm -f conftest*
5808 fi
5809
5810 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
5811   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
5812     cat >> confdefs.h <<EOF
5813 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
5814 EOF
5815
5816   fi
5817
5818 fi
5819
5820 if test "$ac_cv_func_gethostbyname_r" = yes ; then
5821         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
5822 echo "configure:5823: checking number of arguments of gethostbyname_r" >&5
5823 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
5824   echo $ac_n "(cached) $ac_c" 1>&6
5825 else
5826   cat > conftest.$ac_ext <<EOF
5827 #line 5828 "configure"
5828 #include "confdefs.h"
5829 #include <sys/types.h>
5830 #include <sys/socket.h>
5831 #include <netinet/in.h>
5832 #include <netdb.h>
5833 #define BUFSIZE (sizeof(struct hostent)+10)
5834 int main() {
5835 struct hostent hent; char buffer[BUFSIZE];
5836                 int bufsize=BUFSIZE;int h_errno;
5837                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
5838                         buffer, bufsize, &h_errno);
5839 ; return 0; }
5840 EOF
5841 if { (eval echo configure:5842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5842   rm -rf conftest*
5843   ol_cv_func_gethostbyname_r_nargs=5
5844 else
5845   echo "configure: failed program was:" >&5
5846   cat conftest.$ac_ext >&5
5847   rm -rf conftest*
5848   cat > conftest.$ac_ext <<EOF
5849 #line 5850 "configure"
5850 #include "confdefs.h"
5851 #include <sys/types.h>
5852 #include <sys/socket.h>
5853 #include <netinet/in.h>
5854 #include <netdb.h>
5855 #define BUFSIZE (sizeof(struct hostent)+10)
5856 int main() {
5857 struct hostent hent;struct hostent *rhent;
5858                         char buffer[BUFSIZE];
5859                         int bufsize=BUFSIZE;int h_errno;
5860                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
5861                                 &rhent, &h_errno);
5862 ; return 0; }
5863 EOF
5864 if { (eval echo configure:5865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5865   rm -rf conftest*
5866   ol_cv_func_gethostbyname_r_nargs=6
5867 else
5868   echo "configure: failed program was:" >&5
5869   cat conftest.$ac_ext >&5
5870   rm -rf conftest*
5871   ol_cv_func_gethostbyname_r_nargs=0
5872 fi
5873 rm -f conftest*
5874 fi
5875 rm -f conftest*
5876 fi
5877
5878 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
5879   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
5880         cat >> confdefs.h <<EOF
5881 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
5882 EOF
5883
5884   fi
5885
5886 else
5887         ol_cv_func_gethostbyname_r_nargs=0
5888 fi
5889  
5890 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
5891         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
5892 echo "configure:5893: checking number of arguments of gethostbyaddr_r" >&5
5893 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
5894   echo $ac_n "(cached) $ac_c" 1>&6
5895 else
5896   cat > conftest.$ac_ext <<EOF
5897 #line 5898 "configure"
5898 #include "confdefs.h"
5899 #include <sys/types.h>
5900 #include <sys/socket.h>
5901 #include <netinet/in.h>
5902 #include <netdb.h>
5903 #define BUFSIZE (sizeof(struct hostent)+10)
5904 int main() {
5905 struct hostent hent; char buffer[BUFSIZE]; 
5906             struct in_addr add;
5907             size_t alen=sizeof(struct in_addr);
5908             int bufsize=BUFSIZE;int h_errno;
5909                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
5910                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
5911 ; return 0; }
5912 EOF
5913 if { (eval echo configure:5914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5914   rm -rf conftest*
5915   ol_cv_func_gethostbyaddr_r_nargs=7
5916 else
5917   echo "configure: failed program was:" >&5
5918   cat conftest.$ac_ext >&5
5919   rm -rf conftest*
5920   cat > conftest.$ac_ext <<EOF
5921 #line 5922 "configure"
5922 #include "confdefs.h"
5923 #include <sys/types.h>
5924 #include <sys/socket.h>
5925 #include <netinet/in.h>
5926 #include <netdb.h>
5927 #define BUFSIZE (sizeof(struct hostent)+10)
5928 int main() {
5929 struct hostent hent;
5930                         struct hostent *rhent; char buffer[BUFSIZE]; 
5931                         struct in_addr add;
5932                         size_t alen=sizeof(struct in_addr);
5933                         int bufsize=BUFSIZE;int h_errno;
5934                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
5935                                 alen, AF_INET, &hent, buffer, bufsize, 
5936                                 &rhent, &h_errno);
5937 ; return 0; }
5938 EOF
5939 if { (eval echo configure:5940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5940   rm -rf conftest*
5941   ol_cv_func_gethostbyaddr_r_nargs=8
5942 else
5943   echo "configure: failed program was:" >&5
5944   cat conftest.$ac_ext >&5
5945   rm -rf conftest*
5946   ol_cv_func_gethostbyaddr_r_nargs=0
5947 fi
5948 rm -f conftest*
5949 fi
5950 rm -f conftest*
5951 fi
5952
5953 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
5954   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
5955     cat >> confdefs.h <<EOF
5956 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
5957 EOF
5958
5959   fi
5960
5961 else
5962         ol_cv_func_gethostbyaddr_r_nargs=0
5963 fi
5964
5965 if test "$ac_cv_func_ctime_r" = yes \
5966         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
5967         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
5968         -a "$ac_cv_func_gethostbyname_r" = yes \
5969         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
5970         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
5971         -a "$ac_cv_func_gethostbyaddr_r" = yes \
5972         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
5973         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
5974         ; then
5975  
5976         cat >> confdefs.h <<\EOF
5977 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
5978 EOF
5979
5980 fi
5981
5982 ol_link_threads=no
5983 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5984         -o $ol_with_threads = posix ; then
5985
5986         for ac_hdr in pthread.h sched.h
5987 do
5988 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5989 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5990 echo "configure:5991: checking for $ac_hdr" >&5
5991 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5992   echo $ac_n "(cached) $ac_c" 1>&6
5993 else
5994   cat > conftest.$ac_ext <<EOF
5995 #line 5996 "configure"
5996 #include "confdefs.h"
5997 #include <$ac_hdr>
5998 EOF
5999 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6000 { (eval echo configure:6001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6001 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6002 if test -z "$ac_err"; then
6003   rm -rf conftest*
6004   eval "ac_cv_header_$ac_safe=yes"
6005 else
6006   echo "$ac_err" >&5
6007   echo "configure: failed program was:" >&5
6008   cat conftest.$ac_ext >&5
6009   rm -rf conftest*
6010   eval "ac_cv_header_$ac_safe=no"
6011 fi
6012 rm -f conftest*
6013 fi
6014 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6015   echo "$ac_t""yes" 1>&6
6016     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6017   cat >> confdefs.h <<EOF
6018 #define $ac_tr_hdr 1
6019 EOF
6020  
6021 else
6022   echo "$ac_t""no" 1>&6
6023 fi
6024 done
6025
6026
6027         if test $ac_cv_header_pthread_h = yes ; then
6028                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6029 echo "configure:6030: checking POSIX thread version" >&5
6030 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6031   echo $ac_n "(cached) $ac_c" 1>&6
6032 else
6033   
6034         cat > conftest.$ac_ext <<EOF
6035 #line 6036 "configure"
6036 #include "confdefs.h"
6037
6038 #               include <pthread.h>
6039                 /* this check could be improved */
6040 #               ifdef PTHREAD_ONCE_INIT
6041                         pthread_version_final
6042 #               endif
6043         
6044 EOF
6045 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6046   egrep "pthread_version_final" >/dev/null 2>&1; then
6047   rm -rf conftest*
6048   ol_pthread_final=yes
6049 else
6050   rm -rf conftest*
6051   ol_pthread_final=no
6052 fi
6053 rm -f conftest*
6054
6055
6056         cat > conftest.$ac_ext <<EOF
6057 #line 6058 "configure"
6058 #include "confdefs.h"
6059
6060 #               include <pthread.h>
6061                 /* this check could be improved */
6062 #               ifdef pthread_once_init
6063                         pthread_version_draft4
6064 #               endif
6065         
6066 EOF
6067 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6068   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6069   rm -rf conftest*
6070   ol_pthread_draft4=yes
6071 else
6072   rm -rf conftest*
6073   ol_pthread_draft4=no
6074 fi
6075 rm -f conftest*
6076
6077
6078         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6079                 ol_cv_pthread_version=final
6080         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6081                 ol_cv_pthread_version=draft4
6082         else
6083                 ol_cv_pthread_version=unknown
6084         fi
6085
6086 fi
6087
6088 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6089
6090
6091                 if test $ol_cv_pthread_version = final ; then
6092                         cat >> confdefs.h <<\EOF
6093 #define HAVE_PTHREADS_FINAL 1
6094 EOF
6095
6096                 elif test $ol_cv_pthread_version = draft4 ; then
6097                         cat >> confdefs.h <<\EOF
6098 #define HAVE_PTHREADS_D4 1
6099 EOF
6100
6101                 else
6102                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6103                 fi
6104
6105                 # consider threads found
6106                 ol_with_threads=found
6107
6108                 
6109         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6110 echo "configure:6111: checking for LinuxThreads pthread.h" >&5
6111 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6112   echo $ac_n "(cached) $ac_c" 1>&6
6113 else
6114   cat > conftest.$ac_ext <<EOF
6115 #line 6116 "configure"
6116 #include "confdefs.h"
6117 #include <pthread.h>
6118 EOF
6119 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6120   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6121   rm -rf conftest*
6122   ol_cv_header_linux_threads=yes
6123 else
6124   rm -rf conftest*
6125   ol_cv_header_linux_threads=no
6126 fi
6127 rm -f conftest*
6128
6129                 
6130 fi
6131
6132 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6133         if test $ol_cv_header_linux_threads = yes; then
6134                 cat >> confdefs.h <<\EOF
6135 #define HAVE_LINUX_THREADS 1
6136 EOF
6137
6138         fi
6139
6140
6141                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6142                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6143 echo "configure:6144: checking for pthread_create in default libraries" >&5
6144 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6145   echo $ac_n "(cached) $ac_c" 1>&6
6146 else
6147   
6148                 if test "$cross_compiling" = yes; then
6149                         ol_cv_pthread_create=yes
6150 else
6151   cat > conftest.$ac_ext <<EOF
6152 #line 6153 "configure"
6153 #include "confdefs.h"
6154
6155 #include <pthread.h>
6156 #ifndef NULL
6157 #define NULL (void*)0
6158 #endif
6159
6160 static void *task(p)
6161         void *p;
6162 {
6163         return (void *) (p == NULL);
6164 }
6165
6166 int main(argc, argv)
6167         int argc;
6168         char **argv;
6169 {
6170         pthread_t t;
6171         int status;
6172
6173         /* make sure pthread_create() isn't just a stub */
6174 #if HAVE_PTHREADS_D4
6175         status = pthread_create(&t, pthread_attr_default, task, NULL);
6176 #else
6177         status = pthread_create(&t, NULL, task, NULL);
6178 #endif
6179
6180         if( status ) return status;
6181
6182         /* make sure pthread_detach() isn't just a stub */
6183 #if HAVE_PTHREADS_D4
6184         status = pthread_detach( &t );
6185 #else
6186         status = pthread_detach( t );
6187 #endif
6188
6189         return status;
6190 }
6191
6192 EOF
6193 if { (eval echo configure:6194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6194 then
6195   ol_cv_pthread_create=yes
6196 else
6197   echo "configure: failed program was:" >&5
6198   cat conftest.$ac_ext >&5
6199   rm -fr conftest*
6200   ol_cv_pthread_create=no
6201 fi
6202 rm -fr conftest*
6203 fi
6204
6205 fi
6206
6207 echo "$ac_t""$ol_cv_pthread_create" 1>&6
6208
6209                 if test $ol_cv_pthread_create != no ; then
6210                         ol_link_threads=posix
6211                         ol_link_pthreads=""
6212                 fi
6213                 
6214                 # Pthread try link: -mt (ol_cv_pthread_mt)
6215         if test "$ol_link_threads" = no ; then
6216                 # try -mt
6217                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
6218 echo "configure:6219: checking for pthread link with -mt" >&5
6219 if eval "test \"\${ol_cv_pthread_mt+set}\" = set"; then
6220   echo $ac_n "(cached) $ac_c" 1>&6
6221 else
6222   
6223                         # save the flags
6224                         ol_LIBS="$LIBS"
6225                         LIBS="-mt $LIBS"
6226
6227                         cat > conftest.$ac_ext <<EOF
6228 #line 6229 "configure"
6229 #include "confdefs.h"
6230
6231 #include <pthread.h>
6232 #ifndef NULL
6233 #define NULL (void*)0
6234 #endif
6235
6236 int main() {
6237
6238         pthread_t t;
6239
6240 #if HAVE_PTHREADS_D4
6241         pthread_create(&t, pthread_attr_default, NULL, NULL);
6242         pthread_detach( &t );
6243 #else
6244         pthread_create(&t, NULL, NULL, NULL);
6245         pthread_detach( t );
6246 #endif
6247 #ifdef HAVE_LINUX_THREADS
6248         pthread_kill_other_threads_np();
6249 #endif
6250
6251 ; return 0; }
6252 EOF
6253 if { (eval echo configure:6254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6254   rm -rf conftest*
6255   ol_cv_pthread_mt=yes
6256 else
6257   echo "configure: failed program was:" >&5
6258   cat conftest.$ac_ext >&5
6259   rm -rf conftest*
6260   ol_cv_pthread_mt=no
6261 fi
6262 rm -f conftest*
6263
6264                 # restore the LIBS
6265                 LIBS="$ol_LIBS"
6266                 
6267 fi
6268
6269 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
6270
6271                 if test $ol_cv_pthread_mt = yes ; then
6272                         ol_link_pthreads="-mt"
6273                         ol_link_threads=posix
6274                 fi
6275         fi
6276
6277                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
6278         if test "$ol_link_threads" = no ; then
6279                 # try -kthread
6280                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
6281 echo "configure:6282: checking for pthread link with -kthread" >&5
6282 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
6283   echo $ac_n "(cached) $ac_c" 1>&6
6284 else
6285   
6286                         # save the flags
6287                         ol_LIBS="$LIBS"
6288                         LIBS="-kthread $LIBS"
6289
6290                         cat > conftest.$ac_ext <<EOF
6291 #line 6292 "configure"
6292 #include "confdefs.h"
6293
6294 #include <pthread.h>
6295 #ifndef NULL
6296 #define NULL (void*)0
6297 #endif
6298
6299 int main() {
6300
6301         pthread_t t;
6302
6303 #if HAVE_PTHREADS_D4
6304         pthread_create(&t, pthread_attr_default, NULL, NULL);
6305         pthread_detach( &t );
6306 #else
6307         pthread_create(&t, NULL, NULL, NULL);
6308         pthread_detach( t );
6309 #endif
6310 #ifdef HAVE_LINUX_THREADS
6311         pthread_kill_other_threads_np();
6312 #endif
6313
6314 ; return 0; }
6315 EOF
6316 if { (eval echo configure:6317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6317   rm -rf conftest*
6318   ol_cv_pthread_kthread=yes
6319 else
6320   echo "configure: failed program was:" >&5
6321   cat conftest.$ac_ext >&5
6322   rm -rf conftest*
6323   ol_cv_pthread_kthread=no
6324 fi
6325 rm -f conftest*
6326
6327                 # restore the LIBS
6328                 LIBS="$ol_LIBS"
6329                 
6330 fi
6331
6332 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
6333
6334                 if test $ol_cv_pthread_kthread = yes ; then
6335                         ol_link_pthreads="-kthread"
6336                         ol_link_threads=posix
6337                 fi
6338         fi
6339
6340                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
6341         if test "$ol_link_threads" = no ; then
6342                 # try -pthread
6343                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
6344 echo "configure:6345: checking for pthread link with -pthread" >&5
6345 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
6346   echo $ac_n "(cached) $ac_c" 1>&6
6347 else
6348   
6349                         # save the flags
6350                         ol_LIBS="$LIBS"
6351                         LIBS="-pthread $LIBS"
6352
6353                         cat > conftest.$ac_ext <<EOF
6354 #line 6355 "configure"
6355 #include "confdefs.h"
6356
6357 #include <pthread.h>
6358 #ifndef NULL
6359 #define NULL (void*)0
6360 #endif
6361
6362 int main() {
6363
6364         pthread_t t;
6365
6366 #if HAVE_PTHREADS_D4
6367         pthread_create(&t, pthread_attr_default, NULL, NULL);
6368         pthread_detach( &t );
6369 #else
6370         pthread_create(&t, NULL, NULL, NULL);
6371         pthread_detach( t );
6372 #endif
6373 #ifdef HAVE_LINUX_THREADS
6374         pthread_kill_other_threads_np();
6375 #endif
6376
6377 ; return 0; }
6378 EOF
6379 if { (eval echo configure:6380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6380   rm -rf conftest*
6381   ol_cv_pthread_pthread=yes
6382 else
6383   echo "configure: failed program was:" >&5
6384   cat conftest.$ac_ext >&5
6385   rm -rf conftest*
6386   ol_cv_pthread_pthread=no
6387 fi
6388 rm -f conftest*
6389
6390                 # restore the LIBS
6391                 LIBS="$ol_LIBS"
6392                 
6393 fi
6394
6395 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
6396
6397                 if test $ol_cv_pthread_pthread = yes ; then
6398                         ol_link_pthreads="-pthread"
6399                         ol_link_threads=posix
6400                 fi
6401         fi
6402
6403                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
6404         if test "$ol_link_threads" = no ; then
6405                 # try -pthreads
6406                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
6407 echo "configure:6408: checking for pthread link with -pthreads" >&5
6408 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
6409   echo $ac_n "(cached) $ac_c" 1>&6
6410 else
6411   
6412                         # save the flags
6413                         ol_LIBS="$LIBS"
6414                         LIBS="-pthreads $LIBS"
6415
6416                         cat > conftest.$ac_ext <<EOF
6417 #line 6418 "configure"
6418 #include "confdefs.h"
6419
6420 #include <pthread.h>
6421 #ifndef NULL
6422 #define NULL (void*)0
6423 #endif
6424
6425 int main() {
6426
6427         pthread_t t;
6428
6429 #if HAVE_PTHREADS_D4
6430         pthread_create(&t, pthread_attr_default, NULL, NULL);
6431         pthread_detach( &t );
6432 #else
6433         pthread_create(&t, NULL, NULL, NULL);
6434         pthread_detach( t );
6435 #endif
6436 #ifdef HAVE_LINUX_THREADS
6437         pthread_kill_other_threads_np();
6438 #endif
6439
6440 ; return 0; }
6441 EOF
6442 if { (eval echo configure:6443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6443   rm -rf conftest*
6444   ol_cv_pthread_pthreads=yes
6445 else
6446   echo "configure: failed program was:" >&5
6447   cat conftest.$ac_ext >&5
6448   rm -rf conftest*
6449   ol_cv_pthread_pthreads=no
6450 fi
6451 rm -f conftest*
6452
6453                 # restore the LIBS
6454                 LIBS="$ol_LIBS"
6455                 
6456 fi
6457
6458 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
6459
6460                 if test $ol_cv_pthread_pthreads = yes ; then
6461                         ol_link_pthreads="-pthreads"
6462                         ol_link_threads=posix
6463                 fi
6464         fi
6465
6466                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
6467         if test "$ol_link_threads" = no ; then
6468                 # try -mthreads
6469                 echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
6470 echo "configure:6471: checking for pthread link with -mthreads" >&5
6471 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
6472   echo $ac_n "(cached) $ac_c" 1>&6
6473 else
6474   
6475                         # save the flags
6476                         ol_LIBS="$LIBS"
6477                         LIBS="-mthreads $LIBS"
6478
6479                         cat > conftest.$ac_ext <<EOF
6480 #line 6481 "configure"
6481 #include "confdefs.h"
6482
6483 #include <pthread.h>
6484 #ifndef NULL
6485 #define NULL (void*)0
6486 #endif
6487
6488 int main() {
6489
6490         pthread_t t;
6491
6492 #if HAVE_PTHREADS_D4
6493         pthread_create(&t, pthread_attr_default, NULL, NULL);
6494         pthread_detach( &t );
6495 #else
6496         pthread_create(&t, NULL, NULL, NULL);
6497         pthread_detach( t );
6498 #endif
6499 #ifdef HAVE_LINUX_THREADS
6500         pthread_kill_other_threads_np();
6501 #endif
6502
6503 ; return 0; }
6504 EOF
6505 if { (eval echo configure:6506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6506   rm -rf conftest*
6507   ol_cv_pthread_mthreads=yes
6508 else
6509   echo "configure: failed program was:" >&5
6510   cat conftest.$ac_ext >&5
6511   rm -rf conftest*
6512   ol_cv_pthread_mthreads=no
6513 fi
6514 rm -f conftest*
6515
6516                 # restore the LIBS
6517                 LIBS="$ol_LIBS"
6518                 
6519 fi
6520
6521 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
6522
6523                 if test $ol_cv_pthread_mthreads = yes ; then
6524                         ol_link_pthreads="-mthreads"
6525                         ol_link_threads=posix
6526                 fi
6527         fi
6528
6529                 # Pthread try link: -thread (ol_cv_pthread_thread)
6530         if test "$ol_link_threads" = no ; then
6531                 # try -thread
6532                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
6533 echo "configure:6534: checking for pthread link with -thread" >&5
6534 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
6535   echo $ac_n "(cached) $ac_c" 1>&6
6536 else
6537   
6538                         # save the flags
6539                         ol_LIBS="$LIBS"
6540                         LIBS="-thread $LIBS"
6541
6542                         cat > conftest.$ac_ext <<EOF
6543 #line 6544 "configure"
6544 #include "confdefs.h"
6545
6546 #include <pthread.h>
6547 #ifndef NULL
6548 #define NULL (void*)0
6549 #endif
6550
6551 int main() {
6552
6553         pthread_t t;
6554
6555 #if HAVE_PTHREADS_D4
6556         pthread_create(&t, pthread_attr_default, NULL, NULL);
6557         pthread_detach( &t );
6558 #else
6559         pthread_create(&t, NULL, NULL, NULL);
6560         pthread_detach( t );
6561 #endif
6562 #ifdef HAVE_LINUX_THREADS
6563         pthread_kill_other_threads_np();
6564 #endif
6565
6566 ; return 0; }
6567 EOF
6568 if { (eval echo configure:6569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6569   rm -rf conftest*
6570   ol_cv_pthread_thread=yes
6571 else
6572   echo "configure: failed program was:" >&5
6573   cat conftest.$ac_ext >&5
6574   rm -rf conftest*
6575   ol_cv_pthread_thread=no
6576 fi
6577 rm -f conftest*
6578
6579                 # restore the LIBS
6580                 LIBS="$ol_LIBS"
6581                 
6582 fi
6583
6584 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
6585
6586                 if test $ol_cv_pthread_thread = yes ; then
6587                         ol_link_pthreads="-thread"
6588                         ol_link_threads=posix
6589                 fi
6590         fi
6591
6592
6593                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
6594         if test "$ol_link_threads" = no ; then
6595                 # try -lpthread -lmach -lexc -lc_r
6596                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
6597 echo "configure:6598: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
6598 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
6599   echo $ac_n "(cached) $ac_c" 1>&6
6600 else
6601   
6602                         # save the flags
6603                         ol_LIBS="$LIBS"
6604                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
6605
6606                         cat > conftest.$ac_ext <<EOF
6607 #line 6608 "configure"
6608 #include "confdefs.h"
6609
6610 #include <pthread.h>
6611 #ifndef NULL
6612 #define NULL (void*)0
6613 #endif
6614
6615 int main() {
6616
6617         pthread_t t;
6618
6619 #if HAVE_PTHREADS_D4
6620         pthread_create(&t, pthread_attr_default, NULL, NULL);
6621         pthread_detach( &t );
6622 #else
6623         pthread_create(&t, NULL, NULL, NULL);
6624         pthread_detach( t );
6625 #endif
6626 #ifdef HAVE_LINUX_THREADS
6627         pthread_kill_other_threads_np();
6628 #endif
6629
6630 ; return 0; }
6631 EOF
6632 if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6633   rm -rf conftest*
6634   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
6635 else
6636   echo "configure: failed program was:" >&5
6637   cat conftest.$ac_ext >&5
6638   rm -rf conftest*
6639   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
6640 fi
6641 rm -f conftest*
6642
6643                 # restore the LIBS
6644                 LIBS="$ol_LIBS"
6645                 
6646 fi
6647
6648 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
6649
6650                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
6651                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
6652                         ol_link_threads=posix
6653                 fi
6654         fi
6655
6656                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
6657         if test "$ol_link_threads" = no ; then
6658                 # try -lpthread -lmach -lexc
6659                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
6660 echo "configure:6661: checking for pthread link with -lpthread -lmach -lexc" >&5
6661 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
6662   echo $ac_n "(cached) $ac_c" 1>&6
6663 else
6664   
6665                         # save the flags
6666                         ol_LIBS="$LIBS"
6667                         LIBS="-lpthread -lmach -lexc $LIBS"
6668
6669                         cat > conftest.$ac_ext <<EOF
6670 #line 6671 "configure"
6671 #include "confdefs.h"
6672
6673 #include <pthread.h>
6674 #ifndef NULL
6675 #define NULL (void*)0
6676 #endif
6677
6678 int main() {
6679
6680         pthread_t t;
6681
6682 #if HAVE_PTHREADS_D4
6683         pthread_create(&t, pthread_attr_default, NULL, NULL);
6684         pthread_detach( &t );
6685 #else
6686         pthread_create(&t, NULL, NULL, NULL);
6687         pthread_detach( t );
6688 #endif
6689 #ifdef HAVE_LINUX_THREADS
6690         pthread_kill_other_threads_np();
6691 #endif
6692
6693 ; return 0; }
6694 EOF
6695 if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6696   rm -rf conftest*
6697   ol_cv_pthread_lpthread_lmach_lexc=yes
6698 else
6699   echo "configure: failed program was:" >&5
6700   cat conftest.$ac_ext >&5
6701   rm -rf conftest*
6702   ol_cv_pthread_lpthread_lmach_lexc=no
6703 fi
6704 rm -f conftest*
6705
6706                 # restore the LIBS
6707                 LIBS="$ol_LIBS"
6708                 
6709 fi
6710
6711 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
6712
6713                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
6714                         ol_link_pthreads="-lpthread -lmach -lexc"
6715                         ol_link_threads=posix
6716                 fi
6717         fi
6718
6719
6720                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
6721         if test "$ol_link_threads" = no ; then
6722                 # try -lpthread -Wl,-woff,85
6723                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
6724 echo "configure:6725: checking for pthread link with -lpthread -Wl,-woff,85" >&5
6725 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
6726   echo $ac_n "(cached) $ac_c" 1>&6
6727 else
6728   
6729                         # save the flags
6730                         ol_LIBS="$LIBS"
6731                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
6732
6733                         cat > conftest.$ac_ext <<EOF
6734 #line 6735 "configure"
6735 #include "confdefs.h"
6736
6737 #include <pthread.h>
6738 #ifndef NULL
6739 #define NULL (void*)0
6740 #endif
6741
6742 int main() {
6743
6744         pthread_t t;
6745
6746 #if HAVE_PTHREADS_D4
6747         pthread_create(&t, pthread_attr_default, NULL, NULL);
6748         pthread_detach( &t );
6749 #else
6750         pthread_create(&t, NULL, NULL, NULL);
6751         pthread_detach( t );
6752 #endif
6753 #ifdef HAVE_LINUX_THREADS
6754         pthread_kill_other_threads_np();
6755 #endif
6756
6757 ; return 0; }
6758 EOF
6759 if { (eval echo configure:6760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6760   rm -rf conftest*
6761   ol_cv_pthread_lib_lpthread_woff=yes
6762 else
6763   echo "configure: failed program was:" >&5
6764   cat conftest.$ac_ext >&5
6765   rm -rf conftest*
6766   ol_cv_pthread_lib_lpthread_woff=no
6767 fi
6768 rm -f conftest*
6769
6770                 # restore the LIBS
6771                 LIBS="$ol_LIBS"
6772                 
6773 fi
6774
6775 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
6776
6777                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
6778                         ol_link_pthreads="-lpthread -Wl,-woff,85"
6779                         ol_link_threads=posix
6780                 fi
6781         fi
6782
6783
6784                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
6785         if test "$ol_link_threads" = no ; then
6786                 # try -lpthread
6787                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
6788 echo "configure:6789: checking for pthread link with -lpthread" >&5
6789 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
6790   echo $ac_n "(cached) $ac_c" 1>&6
6791 else
6792   
6793                         # save the flags
6794                         ol_LIBS="$LIBS"
6795                         LIBS="-lpthread $LIBS"
6796
6797                         cat > conftest.$ac_ext <<EOF
6798 #line 6799 "configure"
6799 #include "confdefs.h"
6800
6801 #include <pthread.h>
6802 #ifndef NULL
6803 #define NULL (void*)0
6804 #endif
6805
6806 int main() {
6807
6808         pthread_t t;
6809
6810 #if HAVE_PTHREADS_D4
6811         pthread_create(&t, pthread_attr_default, NULL, NULL);
6812         pthread_detach( &t );
6813 #else
6814         pthread_create(&t, NULL, NULL, NULL);
6815         pthread_detach( t );
6816 #endif
6817 #ifdef HAVE_LINUX_THREADS
6818         pthread_kill_other_threads_np();
6819 #endif
6820
6821 ; return 0; }
6822 EOF
6823 if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6824   rm -rf conftest*
6825   ol_cv_pthread_lpthread=yes
6826 else
6827   echo "configure: failed program was:" >&5
6828   cat conftest.$ac_ext >&5
6829   rm -rf conftest*
6830   ol_cv_pthread_lpthread=no
6831 fi
6832 rm -f conftest*
6833
6834                 # restore the LIBS
6835                 LIBS="$ol_LIBS"
6836                 
6837 fi
6838
6839 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
6840
6841                 if test $ol_cv_pthread_lpthread = yes ; then
6842                         ol_link_pthreads="-lpthread"
6843                         ol_link_threads=posix
6844                 fi
6845         fi
6846
6847                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
6848         if test "$ol_link_threads" = no ; then
6849                 # try -lc_r
6850                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
6851 echo "configure:6852: checking for pthread link with -lc_r" >&5
6852 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
6853   echo $ac_n "(cached) $ac_c" 1>&6
6854 else
6855   
6856                         # save the flags
6857                         ol_LIBS="$LIBS"
6858                         LIBS="-lc_r $LIBS"
6859
6860                         cat > conftest.$ac_ext <<EOF
6861 #line 6862 "configure"
6862 #include "confdefs.h"
6863
6864 #include <pthread.h>
6865 #ifndef NULL
6866 #define NULL (void*)0
6867 #endif
6868
6869 int main() {
6870
6871         pthread_t t;
6872
6873 #if HAVE_PTHREADS_D4
6874         pthread_create(&t, pthread_attr_default, NULL, NULL);
6875         pthread_detach( &t );
6876 #else
6877         pthread_create(&t, NULL, NULL, NULL);
6878         pthread_detach( t );
6879 #endif
6880 #ifdef HAVE_LINUX_THREADS
6881         pthread_kill_other_threads_np();
6882 #endif
6883
6884 ; return 0; }
6885 EOF
6886 if { (eval echo configure:6887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6887   rm -rf conftest*
6888   ol_cv_pthread_lc_r=yes
6889 else
6890   echo "configure: failed program was:" >&5
6891   cat conftest.$ac_ext >&5
6892   rm -rf conftest*
6893   ol_cv_pthread_lc_r=no
6894 fi
6895 rm -f conftest*
6896
6897                 # restore the LIBS
6898                 LIBS="$ol_LIBS"
6899                 
6900 fi
6901
6902 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
6903
6904                 if test $ol_cv_pthread_lc_r = yes ; then
6905                         ol_link_pthreads="-lc_r"
6906                         ol_link_threads=posix
6907                 fi
6908         fi
6909
6910
6911                 # Pthread try link: -threads (ol_cv_pthread_threads)
6912         if test "$ol_link_threads" = no ; then
6913                 # try -threads
6914                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
6915 echo "configure:6916: checking for pthread link with -threads" >&5
6916 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
6917   echo $ac_n "(cached) $ac_c" 1>&6
6918 else
6919   
6920                         # save the flags
6921                         ol_LIBS="$LIBS"
6922                         LIBS="-threads $LIBS"
6923
6924                         cat > conftest.$ac_ext <<EOF
6925 #line 6926 "configure"
6926 #include "confdefs.h"
6927
6928 #include <pthread.h>
6929 #ifndef NULL
6930 #define NULL (void*)0
6931 #endif
6932
6933 int main() {
6934
6935         pthread_t t;
6936
6937 #if HAVE_PTHREADS_D4
6938         pthread_create(&t, pthread_attr_default, NULL, NULL);
6939         pthread_detach( &t );
6940 #else
6941         pthread_create(&t, NULL, NULL, NULL);
6942         pthread_detach( t );
6943 #endif
6944 #ifdef HAVE_LINUX_THREADS
6945         pthread_kill_other_threads_np();
6946 #endif
6947
6948 ; return 0; }
6949 EOF
6950 if { (eval echo configure:6951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6951   rm -rf conftest*
6952   ol_cv_pthread_threads=yes
6953 else
6954   echo "configure: failed program was:" >&5
6955   cat conftest.$ac_ext >&5
6956   rm -rf conftest*
6957   ol_cv_pthread_threads=no
6958 fi
6959 rm -f conftest*
6960
6961                 # restore the LIBS
6962                 LIBS="$ol_LIBS"
6963                 
6964 fi
6965
6966 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
6967
6968                 if test $ol_cv_pthread_threads = yes ; then
6969                         ol_link_pthreads="-threads"
6970                         ol_link_threads=posix
6971                 fi
6972         fi
6973
6974
6975                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
6976         if test "$ol_link_threads" = no ; then
6977                 # try -lpthreads -lmach -lexc -lc_r
6978                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
6979 echo "configure:6980: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
6980 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
6981   echo $ac_n "(cached) $ac_c" 1>&6
6982 else
6983   
6984                         # save the flags
6985                         ol_LIBS="$LIBS"
6986                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
6987
6988                         cat > conftest.$ac_ext <<EOF
6989 #line 6990 "configure"
6990 #include "confdefs.h"
6991
6992 #include <pthread.h>
6993 #ifndef NULL
6994 #define NULL (void*)0
6995 #endif
6996
6997 int main() {
6998
6999         pthread_t t;
7000
7001 #if HAVE_PTHREADS_D4
7002         pthread_create(&t, pthread_attr_default, NULL, NULL);
7003         pthread_detach( &t );
7004 #else
7005         pthread_create(&t, NULL, NULL, NULL);
7006         pthread_detach( t );
7007 #endif
7008 #ifdef HAVE_LINUX_THREADS
7009         pthread_kill_other_threads_np();
7010 #endif
7011
7012 ; return 0; }
7013 EOF
7014 if { (eval echo configure:7015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7015   rm -rf conftest*
7016   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
7017 else
7018   echo "configure: failed program was:" >&5
7019   cat conftest.$ac_ext >&5
7020   rm -rf conftest*
7021   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
7022 fi
7023 rm -f conftest*
7024
7025                 # restore the LIBS
7026                 LIBS="$ol_LIBS"
7027                 
7028 fi
7029
7030 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
7031
7032                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
7033                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
7034                         ol_link_threads=posix
7035                 fi
7036         fi
7037
7038                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
7039         if test "$ol_link_threads" = no ; then
7040                 # try -lpthreads -lmach -lexc
7041                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
7042 echo "configure:7043: checking for pthread link with -lpthreads -lmach -lexc" >&5
7043 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
7044   echo $ac_n "(cached) $ac_c" 1>&6
7045 else
7046   
7047                         # save the flags
7048                         ol_LIBS="$LIBS"
7049                         LIBS="-lpthreads -lmach -lexc $LIBS"
7050
7051                         cat > conftest.$ac_ext <<EOF
7052 #line 7053 "configure"
7053 #include "confdefs.h"
7054
7055 #include <pthread.h>
7056 #ifndef NULL
7057 #define NULL (void*)0
7058 #endif
7059
7060 int main() {
7061
7062         pthread_t t;
7063
7064 #if HAVE_PTHREADS_D4
7065         pthread_create(&t, pthread_attr_default, NULL, NULL);
7066         pthread_detach( &t );
7067 #else
7068         pthread_create(&t, NULL, NULL, NULL);
7069         pthread_detach( t );
7070 #endif
7071 #ifdef HAVE_LINUX_THREADS
7072         pthread_kill_other_threads_np();
7073 #endif
7074
7075 ; return 0; }
7076 EOF
7077 if { (eval echo configure:7078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7078   rm -rf conftest*
7079   ol_cv_pthread_lpthreads_lmach_lexc=yes
7080 else
7081   echo "configure: failed program was:" >&5
7082   cat conftest.$ac_ext >&5
7083   rm -rf conftest*
7084   ol_cv_pthread_lpthreads_lmach_lexc=no
7085 fi
7086 rm -f conftest*
7087
7088                 # restore the LIBS
7089                 LIBS="$ol_LIBS"
7090                 
7091 fi
7092
7093 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
7094
7095                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
7096                         ol_link_pthreads="-lpthreads -lmach -lexc"
7097                         ol_link_threads=posix
7098                 fi
7099         fi
7100
7101                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
7102         if test "$ol_link_threads" = no ; then
7103                 # try -lpthreads -lexc
7104                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
7105 echo "configure:7106: checking for pthread link with -lpthreads -lexc" >&5
7106 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
7107   echo $ac_n "(cached) $ac_c" 1>&6
7108 else
7109   
7110                         # save the flags
7111                         ol_LIBS="$LIBS"
7112                         LIBS="-lpthreads -lexc $LIBS"
7113
7114                         cat > conftest.$ac_ext <<EOF
7115 #line 7116 "configure"
7116 #include "confdefs.h"
7117
7118 #include <pthread.h>
7119 #ifndef NULL
7120 #define NULL (void*)0
7121 #endif
7122
7123 int main() {
7124
7125         pthread_t t;
7126
7127 #if HAVE_PTHREADS_D4
7128         pthread_create(&t, pthread_attr_default, NULL, NULL);
7129         pthread_detach( &t );
7130 #else
7131         pthread_create(&t, NULL, NULL, NULL);
7132         pthread_detach( t );
7133 #endif
7134 #ifdef HAVE_LINUX_THREADS
7135         pthread_kill_other_threads_np();
7136 #endif
7137
7138 ; return 0; }
7139 EOF
7140 if { (eval echo configure:7141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7141   rm -rf conftest*
7142   ol_cv_pthread_lpthreads_lexc=yes
7143 else
7144   echo "configure: failed program was:" >&5
7145   cat conftest.$ac_ext >&5
7146   rm -rf conftest*
7147   ol_cv_pthread_lpthreads_lexc=no
7148 fi
7149 rm -f conftest*
7150
7151                 # restore the LIBS
7152                 LIBS="$ol_LIBS"
7153                 
7154 fi
7155
7156 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
7157
7158                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
7159                         ol_link_pthreads="-lpthreads -lexc"
7160                         ol_link_threads=posix
7161                 fi
7162         fi
7163
7164
7165                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
7166         if test "$ol_link_threads" = no ; then
7167                 # try -lpthreads
7168                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
7169 echo "configure:7170: checking for pthread link with -lpthreads" >&5
7170 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
7171   echo $ac_n "(cached) $ac_c" 1>&6
7172 else
7173   
7174                         # save the flags
7175                         ol_LIBS="$LIBS"
7176                         LIBS="-lpthreads $LIBS"
7177
7178                         cat > conftest.$ac_ext <<EOF
7179 #line 7180 "configure"
7180 #include "confdefs.h"
7181
7182 #include <pthread.h>
7183 #ifndef NULL
7184 #define NULL (void*)0
7185 #endif
7186
7187 int main() {
7188
7189         pthread_t t;
7190
7191 #if HAVE_PTHREADS_D4
7192         pthread_create(&t, pthread_attr_default, NULL, NULL);
7193         pthread_detach( &t );
7194 #else
7195         pthread_create(&t, NULL, NULL, NULL);
7196         pthread_detach( t );
7197 #endif
7198 #ifdef HAVE_LINUX_THREADS
7199         pthread_kill_other_threads_np();
7200 #endif
7201
7202 ; return 0; }
7203 EOF
7204 if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7205   rm -rf conftest*
7206   ol_cv_pthread_lib_lpthreads=yes
7207 else
7208   echo "configure: failed program was:" >&5
7209   cat conftest.$ac_ext >&5
7210   rm -rf conftest*
7211   ol_cv_pthread_lib_lpthreads=no
7212 fi
7213 rm -f conftest*
7214
7215                 # restore the LIBS
7216                 LIBS="$ol_LIBS"
7217                 
7218 fi
7219
7220 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
7221
7222                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
7223                         ol_link_pthreads="-lpthreads"
7224                         ol_link_threads=posix
7225                 fi
7226         fi
7227
7228
7229                 if test $ol_link_threads != no ; then
7230                         cat >> confdefs.h <<\EOF
7231 #define HAVE_PTHREADS 1
7232 EOF
7233
7234
7235                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
7236
7237                                                 save_CPPFLAGS="$CPPFLAGS"
7238                         save_LIBS="$LIBS"
7239                         LIBS="$LTHREAD_LIBS $LIBS"
7240
7241                                                                                                 for ac_func in sched_yield pthread_yield
7242 do
7243 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7244 echo "configure:7245: checking for $ac_func" >&5
7245 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7246   echo $ac_n "(cached) $ac_c" 1>&6
7247 else
7248   cat > conftest.$ac_ext <<EOF
7249 #line 7250 "configure"
7250 #include "confdefs.h"
7251 /* System header to define __stub macros and hopefully few prototypes,
7252     which can conflict with char $ac_func(); below.  */
7253 #include <assert.h>
7254 /* Override any gcc2 internal prototype to avoid an error.  */
7255 /* We use char because int might match the return type of a gcc2
7256     builtin and then its argument prototype would still apply.  */
7257 char $ac_func();
7258 char (*f)();
7259
7260 int main() {
7261
7262 /* The GNU C library defines this for functions which it implements
7263     to always fail with ENOSYS.  Some functions are actually named
7264     something starting with __ and the normal name is an alias.  */
7265 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7266 choke me
7267 #else
7268 f = $ac_func;
7269 #endif
7270
7271 ; return 0; }
7272 EOF
7273 if { (eval echo configure:7274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7274   rm -rf conftest*
7275   eval "ac_cv_func_$ac_func=yes"
7276 else
7277   echo "configure: failed program was:" >&5
7278   cat conftest.$ac_ext >&5
7279   rm -rf conftest*
7280   eval "ac_cv_func_$ac_func=no"
7281 fi
7282 rm -f conftest*
7283 fi
7284
7285 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7286   echo "$ac_t""yes" 1>&6
7287     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7288   cat >> confdefs.h <<EOF
7289 #define $ac_tr_func 1
7290 EOF
7291  
7292 else
7293   echo "$ac_t""no" 1>&6
7294 fi
7295 done
7296
7297
7298                         if test $ac_cv_func_sched_yield = no -a \
7299                                 $ac_cv_func_pthread_yield = no ; then
7300                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
7301 echo "configure:7302: checking for sched_yield in -lrt" >&5
7302 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
7303 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7304   echo $ac_n "(cached) $ac_c" 1>&6
7305 else
7306   ac_save_LIBS="$LIBS"
7307 LIBS="-lrt  $LIBS"
7308 cat > conftest.$ac_ext <<EOF
7309 #line 7310 "configure"
7310 #include "confdefs.h"
7311 /* Override any gcc2 internal prototype to avoid an error.  */
7312 /* We use char because int might match the return type of a gcc2
7313     builtin and then its argument prototype would still apply.  */
7314 char sched_yield();
7315
7316 int main() {
7317 sched_yield()
7318 ; return 0; }
7319 EOF
7320 if { (eval echo configure:7321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7321   rm -rf conftest*
7322   eval "ac_cv_lib_$ac_lib_var=yes"
7323 else
7324   echo "configure: failed program was:" >&5
7325   cat conftest.$ac_ext >&5
7326   rm -rf conftest*
7327   eval "ac_cv_lib_$ac_lib_var=no"
7328 fi
7329 rm -f conftest*
7330 LIBS="$ac_save_LIBS"
7331
7332 fi
7333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7334   echo "$ac_t""yes" 1>&6
7335   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
7336                                         cat >> confdefs.h <<\EOF
7337 #define HAVE_SCHED_YIELD 1
7338 EOF
7339
7340                                         ac_cv_func_sched_yield=yes
7341 else
7342   echo "$ac_t""no" 1>&6
7343 ac_cv_func_sched_yield=no
7344 fi
7345
7346                         fi
7347                         if test $ac_cv_func_sched_yield = no -a \
7348                                 $ac_cv_func_pthread_yield = no ; then
7349                                                                                                 for ac_func in thr_yield
7350 do
7351 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7352 echo "configure:7353: checking for $ac_func" >&5
7353 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7354   echo $ac_n "(cached) $ac_c" 1>&6
7355 else
7356   cat > conftest.$ac_ext <<EOF
7357 #line 7358 "configure"
7358 #include "confdefs.h"
7359 /* System header to define __stub macros and hopefully few prototypes,
7360     which can conflict with char $ac_func(); below.  */
7361 #include <assert.h>
7362 /* Override any gcc2 internal prototype to avoid an error.  */
7363 /* We use char because int might match the return type of a gcc2
7364     builtin and then its argument prototype would still apply.  */
7365 char $ac_func();
7366 char (*f)();
7367
7368 int main() {
7369
7370 /* The GNU C library defines this for functions which it implements
7371     to always fail with ENOSYS.  Some functions are actually named
7372     something starting with __ and the normal name is an alias.  */
7373 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7374 choke me
7375 #else
7376 f = $ac_func;
7377 #endif
7378
7379 ; return 0; }
7380 EOF
7381 if { (eval echo configure:7382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7382   rm -rf conftest*
7383   eval "ac_cv_func_$ac_func=yes"
7384 else
7385   echo "configure: failed program was:" >&5
7386   cat conftest.$ac_ext >&5
7387   rm -rf conftest*
7388   eval "ac_cv_func_$ac_func=no"
7389 fi
7390 rm -f conftest*
7391 fi
7392
7393 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7394   echo "$ac_t""yes" 1>&6
7395     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7396   cat >> confdefs.h <<EOF
7397 #define $ac_tr_func 1
7398 EOF
7399  
7400 else
7401   echo "$ac_t""no" 1>&6
7402 fi
7403 done
7404
7405                         fi
7406                         if test $ac_cv_func_sched_yield = no -a \
7407                                 $ac_cv_func_pthread_yield = no -a \
7408                                 "$ac_cv_func_thr_yield" = no ; then
7409                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
7410                         fi
7411
7412                                                 for ac_func in pthread_kill
7413 do
7414 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7415 echo "configure:7416: checking for $ac_func" >&5
7416 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7417   echo $ac_n "(cached) $ac_c" 1>&6
7418 else
7419   cat > conftest.$ac_ext <<EOF
7420 #line 7421 "configure"
7421 #include "confdefs.h"
7422 /* System header to define __stub macros and hopefully few prototypes,
7423     which can conflict with char $ac_func(); below.  */
7424 #include <assert.h>
7425 /* Override any gcc2 internal prototype to avoid an error.  */
7426 /* We use char because int might match the return type of a gcc2
7427     builtin and then its argument prototype would still apply.  */
7428 char $ac_func();
7429 char (*f)();
7430
7431 int main() {
7432
7433 /* The GNU C library defines this for functions which it implements
7434     to always fail with ENOSYS.  Some functions are actually named
7435     something starting with __ and the normal name is an alias.  */
7436 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7437 choke me
7438 #else
7439 f = $ac_func;
7440 #endif
7441
7442 ; return 0; }
7443 EOF
7444 if { (eval echo configure:7445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7445   rm -rf conftest*
7446   eval "ac_cv_func_$ac_func=yes"
7447 else
7448   echo "configure: failed program was:" >&5
7449   cat conftest.$ac_ext >&5
7450   rm -rf conftest*
7451   eval "ac_cv_func_$ac_func=no"
7452 fi
7453 rm -f conftest*
7454 fi
7455
7456 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7457   echo "$ac_t""yes" 1>&6
7458     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7459   cat >> confdefs.h <<EOF
7460 #define $ac_tr_func 1
7461 EOF
7462  
7463 else
7464   echo "$ac_t""no" 1>&6
7465 fi
7466 done
7467
7468
7469                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
7470 echo "configure:7471: checking for pthread_detach with <pthread.h>" >&5
7471 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
7472   echo $ac_n "(cached) $ac_c" 1>&6
7473 else
7474   
7475                                                                 cat > conftest.$ac_ext <<EOF
7476 #line 7477 "configure"
7477 #include "confdefs.h"
7478
7479 #include <pthread.h>
7480 #ifndef NULL
7481 #define NULL (void*)0
7482 #endif
7483
7484 int main() {
7485 pthread_detach(NULL);
7486 ; return 0; }
7487 EOF
7488 if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7489   rm -rf conftest*
7490   ol_cv_func_pthread_detach=yes
7491 else
7492   echo "configure: failed program was:" >&5
7493   cat conftest.$ac_ext >&5
7494   rm -rf conftest*
7495   ol_cv_func_pthread_detach=no
7496 fi
7497 rm -f conftest*
7498                         
7499 fi
7500
7501 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
7502
7503                         if test $ol_cv_func_pthread_detach = no ; then
7504                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
7505                         fi
7506
7507                         cat >> confdefs.h <<\EOF
7508 #define HAVE_PTHREAD_DETACH 1
7509 EOF
7510
7511
7512                                                 for ac_func in \
7513                                 pthread_setconcurrency \
7514                                 pthread_getconcurrency \
7515                                 thr_setconcurrency \
7516                                 thr_getconcurrency \
7517                         
7518 do
7519 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7520 echo "configure:7521: checking for $ac_func" >&5
7521 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7522   echo $ac_n "(cached) $ac_c" 1>&6
7523 else
7524   cat > conftest.$ac_ext <<EOF
7525 #line 7526 "configure"
7526 #include "confdefs.h"
7527 /* System header to define __stub macros and hopefully few prototypes,
7528     which can conflict with char $ac_func(); below.  */
7529 #include <assert.h>
7530 /* Override any gcc2 internal prototype to avoid an error.  */
7531 /* We use char because int might match the return type of a gcc2
7532     builtin and then its argument prototype would still apply.  */
7533 char $ac_func();
7534 char (*f)();
7535
7536 int main() {
7537
7538 /* The GNU C library defines this for functions which it implements
7539     to always fail with ENOSYS.  Some functions are actually named
7540     something starting with __ and the normal name is an alias.  */
7541 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7542 choke me
7543 #else
7544 f = $ac_func;
7545 #endif
7546
7547 ; return 0; }
7548 EOF
7549 if { (eval echo configure:7550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7550   rm -rf conftest*
7551   eval "ac_cv_func_$ac_func=yes"
7552 else
7553   echo "configure: failed program was:" >&5
7554   cat conftest.$ac_ext >&5
7555   rm -rf conftest*
7556   eval "ac_cv_func_$ac_func=no"
7557 fi
7558 rm -f conftest*
7559 fi
7560
7561 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7562   echo "$ac_t""yes" 1>&6
7563     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7564   cat >> confdefs.h <<EOF
7565 #define $ac_tr_func 1
7566 EOF
7567  
7568 else
7569   echo "$ac_t""no" 1>&6
7570 fi
7571 done
7572
7573
7574                         
7575         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
7576 echo "configure:7577: checking for pthread_kill_other_threads_np" >&5
7577 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
7578   echo $ac_n "(cached) $ac_c" 1>&6
7579 else
7580   cat > conftest.$ac_ext <<EOF
7581 #line 7582 "configure"
7582 #include "confdefs.h"
7583 /* System header to define __stub macros and hopefully few prototypes,
7584     which can conflict with char pthread_kill_other_threads_np(); below.  */
7585 #include <assert.h>
7586 /* Override any gcc2 internal prototype to avoid an error.  */
7587 /* We use char because int might match the return type of a gcc2
7588     builtin and then its argument prototype would still apply.  */
7589 char pthread_kill_other_threads_np();
7590 char (*f)();
7591
7592 int main() {
7593
7594 /* The GNU C library defines this for functions which it implements
7595     to always fail with ENOSYS.  Some functions are actually named
7596     something starting with __ and the normal name is an alias.  */
7597 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
7598 choke me
7599 #else
7600 f = pthread_kill_other_threads_np;
7601 #endif
7602
7603 ; return 0; }
7604 EOF
7605 if { (eval echo configure:7606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7606   rm -rf conftest*
7607   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
7608 else
7609   echo "configure: failed program was:" >&5
7610   cat conftest.$ac_ext >&5
7611   rm -rf conftest*
7612   eval "ac_cv_func_pthread_kill_other_threads_np=no"
7613 fi
7614 rm -f conftest*
7615 fi
7616
7617 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
7618   echo "$ac_t""yes" 1>&6
7619   :
7620 else
7621   echo "$ac_t""no" 1>&6
7622 fi
7623
7624         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
7625 echo "configure:7626: checking for LinuxThreads implementation" >&5
7626 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
7627   echo $ac_n "(cached) $ac_c" 1>&6
7628 else
7629   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
7630 fi
7631
7632 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
7633
7634                         
7635         
7636         
7637         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
7638 echo "configure:7639: checking for LinuxThreads consistency" >&5
7639 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
7640   echo $ac_n "(cached) $ac_c" 1>&6
7641 else
7642   
7643                 if test $ol_cv_header_linux_threads = yes -a \
7644                         $ol_cv_sys_linux_threads = yes; then
7645                         ol_cv_linux_threads=yes
7646                 elif test $ol_cv_header_linux_threads = no -a \
7647                         $ol_cv_sys_linux_threads = no; then
7648                         ol_cv_linux_threads=no
7649                 else
7650                         ol_cv_linux_threads=error
7651                 fi
7652         
7653 fi
7654
7655 echo "$ac_t""$ol_cv_linux_threads" 1>&6
7656
7657
7658                         if test $ol_cv_linux_threads = error; then
7659                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
7660                         fi
7661
7662                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
7663 echo "configure:7664: checking if pthread_create() works" >&5
7664 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
7665   echo $ac_n "(cached) $ac_c" 1>&6
7666 else
7667   
7668                         if test "$cross_compiling" = yes; then
7669                                 ol_cv_pthread_create_works=yes
7670 else
7671   cat > conftest.$ac_ext <<EOF
7672 #line 7673 "configure"
7673 #include "confdefs.h"
7674
7675 #include <pthread.h>
7676 #ifndef NULL
7677 #define NULL (void*)0
7678 #endif
7679
7680 static void *task(p)
7681         void *p;
7682 {
7683         return (void *) (p == NULL);
7684 }
7685
7686 int main(argc, argv)
7687         int argc;
7688         char **argv;
7689 {
7690         pthread_t t;
7691 #if HAVE_PTHREADS_D4
7692         exit(pthread_create(&t, pthread_attr_default, task, NULL));
7693 #else
7694         exit(pthread_create(&t, NULL, task, NULL));
7695 #endif
7696 }
7697
7698 EOF
7699 if { (eval echo configure:7700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7700 then
7701   ol_cv_pthread_create_works=yes
7702 else
7703   echo "configure: failed program was:" >&5
7704   cat conftest.$ac_ext >&5
7705   rm -fr conftest*
7706   ol_cv_pthread_create_works=no
7707 fi
7708 rm -fr conftest*
7709 fi
7710
7711 fi
7712
7713 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
7714
7715                         if test $ol_cv_pthread_create_works = no ; then
7716                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
7717                         fi
7718
7719                                                 if test $ol_with_yielding_select = auto ; then
7720                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
7721 echo "configure:7722: checking if select yields when using pthreads" >&5
7722 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
7723   echo $ac_n "(cached) $ac_c" 1>&6
7724 else
7725   
7726                                 if test "$cross_compiling" = yes; then
7727   ol_cv_pthread_select_yields=cross
7728 else
7729   cat > conftest.$ac_ext <<EOF
7730 #line 7731 "configure"
7731 #include "confdefs.h"
7732
7733 #include <sys/types.h>
7734 #include <sys/time.h>
7735 #include <unistd.h>
7736 #include <pthread.h>
7737 #ifndef NULL
7738 #define NULL (void*) 0
7739 #endif
7740
7741 static int fildes[2];
7742
7743 static void *task(p)
7744         void *p;
7745 {
7746         int i;
7747         struct timeval tv;
7748
7749         fd_set rfds;
7750
7751         tv.tv_sec=10;
7752         tv.tv_usec=0;
7753
7754         FD_ZERO(&rfds);
7755         FD_SET(fildes[0], &rfds);
7756
7757         /* we're not interested in any fds */
7758         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
7759
7760         if(i < 0) {
7761                 perror("select");
7762                 exit(10);
7763         }
7764
7765         exit(0); /* if we exit here, the select blocked the whole process */
7766 }
7767
7768 int main(argc, argv)
7769         int argc;
7770         char **argv;
7771 {
7772         pthread_t t;
7773
7774         /* create a pipe to select */
7775         if(pipe(&fildes[0])) {
7776                 perror("select");
7777                 exit(1);
7778         }
7779
7780 #ifdef HAVE_PTHREAD_SETCONCURRENCY
7781         (void) pthread_setconcurrency(2);
7782 #else
7783 #ifdef HAVE_THR_SETCONCURRENCY
7784         /* Set Solaris LWP concurrency to 2 */
7785         thr_setconcurrency(2);
7786 #endif
7787 #endif
7788
7789 #if HAVE_PTHREADS_D4
7790         pthread_create(&t, pthread_attr_default, task, NULL);
7791 #else
7792         pthread_create(&t, NULL, task, NULL);
7793 #endif
7794
7795 #if HAVE_SCHED_YIELD
7796         sched_yield();  /* make sure task runs first */
7797 #else
7798 #ifdef HAVE_PTHREAD_YIELD
7799         pthread_yield();        /* make sure task runs first */
7800 #endif
7801 #endif
7802
7803         exit(2);
7804 }
7805 EOF
7806 if { (eval echo configure:7807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7807 then
7808   ol_cv_pthread_select_yields=no
7809 else
7810   echo "configure: failed program was:" >&5
7811   cat conftest.$ac_ext >&5
7812   rm -fr conftest*
7813   ol_cv_pthread_select_yields=yes
7814 fi
7815 rm -fr conftest*
7816 fi
7817
7818 fi
7819
7820 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
7821
7822                                 if test $ol_cv_pthread_select_yields = cross ; then
7823                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
7824                                 fi
7825
7826                                 if test $ol_cv_pthread_select_yields = yes ; then
7827                                         ol_with_yielding_select=yes
7828                                 fi
7829                         fi
7830
7831                                                 CPPFLAGS="$save_CPPFLAGS"
7832                         LIBS="$save_LIBS"
7833                 else
7834                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
7835                 fi
7836         fi
7837
7838         if test $ol_with_threads = posix ; then
7839                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
7840         fi
7841 fi
7842
7843 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7844         -o $ol_with_threads = mach ; then
7845
7846                 for ac_hdr in mach/cthreads.h
7847 do
7848 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7849 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7850 echo "configure:7851: checking for $ac_hdr" >&5
7851 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7852   echo $ac_n "(cached) $ac_c" 1>&6
7853 else
7854   cat > conftest.$ac_ext <<EOF
7855 #line 7856 "configure"
7856 #include "confdefs.h"
7857 #include <$ac_hdr>
7858 EOF
7859 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7860 { (eval echo configure:7861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7861 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7862 if test -z "$ac_err"; then
7863   rm -rf conftest*
7864   eval "ac_cv_header_$ac_safe=yes"
7865 else
7866   echo "$ac_err" >&5
7867   echo "configure: failed program was:" >&5
7868   cat conftest.$ac_ext >&5
7869   rm -rf conftest*
7870   eval "ac_cv_header_$ac_safe=no"
7871 fi
7872 rm -f conftest*
7873 fi
7874 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7875   echo "$ac_t""yes" 1>&6
7876     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7877   cat >> confdefs.h <<EOF
7878 #define $ac_tr_hdr 1
7879 EOF
7880  
7881 else
7882   echo "$ac_t""no" 1>&6
7883 fi
7884 done
7885
7886         if test $ac_cv_header_mach_cthreads_h = yes ; then
7887                 ol_with_threads=found
7888
7889                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
7890 echo "configure:7891: checking for cthread_fork" >&5
7891 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
7892   echo $ac_n "(cached) $ac_c" 1>&6
7893 else
7894   cat > conftest.$ac_ext <<EOF
7895 #line 7896 "configure"
7896 #include "confdefs.h"
7897 /* System header to define __stub macros and hopefully few prototypes,
7898     which can conflict with char cthread_fork(); below.  */
7899 #include <assert.h>
7900 /* Override any gcc2 internal prototype to avoid an error.  */
7901 /* We use char because int might match the return type of a gcc2
7902     builtin and then its argument prototype would still apply.  */
7903 char cthread_fork();
7904 char (*f)();
7905
7906 int main() {
7907
7908 /* The GNU C library defines this for functions which it implements
7909     to always fail with ENOSYS.  Some functions are actually named
7910     something starting with __ and the normal name is an alias.  */
7911 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
7912 choke me
7913 #else
7914 f = cthread_fork;
7915 #endif
7916
7917 ; return 0; }
7918 EOF
7919 if { (eval echo configure:7920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7920   rm -rf conftest*
7921   eval "ac_cv_func_cthread_fork=yes"
7922 else
7923   echo "configure: failed program was:" >&5
7924   cat conftest.$ac_ext >&5
7925   rm -rf conftest*
7926   eval "ac_cv_func_cthread_fork=no"
7927 fi
7928 rm -f conftest*
7929 fi
7930
7931 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
7932   echo "$ac_t""yes" 1>&6
7933   ol_link_threads=yes
7934 else
7935   echo "$ac_t""no" 1>&6
7936 fi
7937
7938
7939                 if test $ol_link_threads = no ; then
7940                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
7941 echo "configure:7942: checking for cthread_fork with -all_load" >&5
7942 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
7943   echo $ac_n "(cached) $ac_c" 1>&6
7944 else
7945   
7946                                                                 save_LIBS="$LIBS"
7947                                 LIBS="-all_load $LIBS"
7948                                 cat > conftest.$ac_ext <<EOF
7949 #line 7950 "configure"
7950 #include "confdefs.h"
7951 #include <mach/cthreads.h>
7952 int main() {
7953
7954                                         cthread_fork((void *)0, (void *)0);
7955                                         
7956 ; return 0; }
7957 EOF
7958 if { (eval echo configure:7959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7959   rm -rf conftest*
7960   ol_cv_cthread_all_load=yes
7961 else
7962   echo "configure: failed program was:" >&5
7963   cat conftest.$ac_ext >&5
7964   rm -rf conftest*
7965   ol_cv_cthread_all_load=no
7966 fi
7967 rm -f conftest*
7968                                                                 LIBS="$save_LIBS"
7969                         
7970 fi
7971
7972 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
7973
7974                         if test $ol_cv_cthread_all_load = yes ; then
7975                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
7976                                 ol_link_threads=mach
7977                         fi
7978                 fi
7979
7980                 if test $ol_link_threads != no ; then
7981                         : check for cthread specific functionality here
7982                         cat >> confdefs.h <<\EOF
7983 #define HAVE_MACH_CTHREADS 1
7984 EOF
7985
7986                 else
7987                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
7988                 fi
7989         fi
7990
7991         if test $ol_with_threads = mach ; then
7992                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
7993         fi
7994 fi
7995
7996 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7997         -o $ol_with_threads = lwp ; then
7998
7999                 for ac_hdr in thread.h synch.h
8000 do
8001 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8002 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8003 echo "configure:8004: checking for $ac_hdr" >&5
8004 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8005   echo $ac_n "(cached) $ac_c" 1>&6
8006 else
8007   cat > conftest.$ac_ext <<EOF
8008 #line 8009 "configure"
8009 #include "confdefs.h"
8010 #include <$ac_hdr>
8011 EOF
8012 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8013 { (eval echo configure:8014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8014 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8015 if test -z "$ac_err"; then
8016   rm -rf conftest*
8017   eval "ac_cv_header_$ac_safe=yes"
8018 else
8019   echo "$ac_err" >&5
8020   echo "configure: failed program was:" >&5
8021   cat conftest.$ac_ext >&5
8022   rm -rf conftest*
8023   eval "ac_cv_header_$ac_safe=no"
8024 fi
8025 rm -f conftest*
8026 fi
8027 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8028   echo "$ac_t""yes" 1>&6
8029     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8030   cat >> confdefs.h <<EOF
8031 #define $ac_tr_hdr 1
8032 EOF
8033  
8034 else
8035   echo "$ac_t""no" 1>&6
8036 fi
8037 done
8038
8039         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
8040                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
8041 echo "configure:8042: checking for thr_create in -lthread" >&5
8042 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
8043 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8044   echo $ac_n "(cached) $ac_c" 1>&6
8045 else
8046   ac_save_LIBS="$LIBS"
8047 LIBS="-lthread  $LIBS"
8048 cat > conftest.$ac_ext <<EOF
8049 #line 8050 "configure"
8050 #include "confdefs.h"
8051 /* Override any gcc2 internal prototype to avoid an error.  */
8052 /* We use char because int might match the return type of a gcc2
8053     builtin and then its argument prototype would still apply.  */
8054 char thr_create();
8055
8056 int main() {
8057 thr_create()
8058 ; return 0; }
8059 EOF
8060 if { (eval echo configure:8061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8061   rm -rf conftest*
8062   eval "ac_cv_lib_$ac_lib_var=yes"
8063 else
8064   echo "configure: failed program was:" >&5
8065   cat conftest.$ac_ext >&5
8066   rm -rf conftest*
8067   eval "ac_cv_lib_$ac_lib_var=no"
8068 fi
8069 rm -f conftest*
8070 LIBS="$ac_save_LIBS"
8071
8072 fi
8073 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8074   echo "$ac_t""yes" 1>&6
8075   have_thr=yes
8076 else
8077   echo "$ac_t""no" 1>&6
8078 have_thr=no
8079 fi
8080
8081
8082                 if test $have_thr = yes ; then
8083                         cat >> confdefs.h <<\EOF
8084 #define HAVE_THR 1
8085 EOF
8086
8087                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
8088                         ol_link_threads=thr
8089
8090                         if test $ol_with_yielding_select = auto ; then
8091                                 ol_with_yielding_select=yes
8092                         fi
8093
8094                                                 for ac_func in \
8095                                 thr_setconcurrency \
8096                                 thr_getconcurrency \
8097                         
8098 do
8099 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8100 echo "configure:8101: checking for $ac_func" >&5
8101 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8102   echo $ac_n "(cached) $ac_c" 1>&6
8103 else
8104   cat > conftest.$ac_ext <<EOF
8105 #line 8106 "configure"
8106 #include "confdefs.h"
8107 /* System header to define __stub macros and hopefully few prototypes,
8108     which can conflict with char $ac_func(); below.  */
8109 #include <assert.h>
8110 /* Override any gcc2 internal prototype to avoid an error.  */
8111 /* We use char because int might match the return type of a gcc2
8112     builtin and then its argument prototype would still apply.  */
8113 char $ac_func();
8114 char (*f)();
8115
8116 int main() {
8117
8118 /* The GNU C library defines this for functions which it implements
8119     to always fail with ENOSYS.  Some functions are actually named
8120     something starting with __ and the normal name is an alias.  */
8121 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8122 choke me
8123 #else
8124 f = $ac_func;
8125 #endif
8126
8127 ; return 0; }
8128 EOF
8129 if { (eval echo configure:8130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8130   rm -rf conftest*
8131   eval "ac_cv_func_$ac_func=yes"
8132 else
8133   echo "configure: failed program was:" >&5
8134   cat conftest.$ac_ext >&5
8135   rm -rf conftest*
8136   eval "ac_cv_func_$ac_func=no"
8137 fi
8138 rm -f conftest*
8139 fi
8140
8141 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8142   echo "$ac_t""yes" 1>&6
8143     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8144   cat >> confdefs.h <<EOF
8145 #define $ac_tr_func 1
8146 EOF
8147  
8148 else
8149   echo "$ac_t""no" 1>&6
8150 fi
8151 done
8152
8153                 fi
8154         fi
8155
8156                 for ac_hdr in lwp/lwp.h
8157 do
8158 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8159 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8160 echo "configure:8161: checking for $ac_hdr" >&5
8161 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8162   echo $ac_n "(cached) $ac_c" 1>&6
8163 else
8164   cat > conftest.$ac_ext <<EOF
8165 #line 8166 "configure"
8166 #include "confdefs.h"
8167 #include <$ac_hdr>
8168 EOF
8169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8170 { (eval echo configure:8171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8172 if test -z "$ac_err"; then
8173   rm -rf conftest*
8174   eval "ac_cv_header_$ac_safe=yes"
8175 else
8176   echo "$ac_err" >&5
8177   echo "configure: failed program was:" >&5
8178   cat conftest.$ac_ext >&5
8179   rm -rf conftest*
8180   eval "ac_cv_header_$ac_safe=no"
8181 fi
8182 rm -f conftest*
8183 fi
8184 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8185   echo "$ac_t""yes" 1>&6
8186     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8187   cat >> confdefs.h <<EOF
8188 #define $ac_tr_hdr 1
8189 EOF
8190  
8191 else
8192   echo "$ac_t""no" 1>&6
8193 fi
8194 done
8195
8196         if test $ac_cv_header_lwp_lwp_h = yes ; then
8197                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
8198 echo "configure:8199: checking for lwp_create in -llwp" >&5
8199 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
8200 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8201   echo $ac_n "(cached) $ac_c" 1>&6
8202 else
8203   ac_save_LIBS="$LIBS"
8204 LIBS="-llwp  $LIBS"
8205 cat > conftest.$ac_ext <<EOF
8206 #line 8207 "configure"
8207 #include "confdefs.h"
8208 /* Override any gcc2 internal prototype to avoid an error.  */
8209 /* We use char because int might match the return type of a gcc2
8210     builtin and then its argument prototype would still apply.  */
8211 char lwp_create();
8212
8213 int main() {
8214 lwp_create()
8215 ; return 0; }
8216 EOF
8217 if { (eval echo configure:8218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8218   rm -rf conftest*
8219   eval "ac_cv_lib_$ac_lib_var=yes"
8220 else
8221   echo "configure: failed program was:" >&5
8222   cat conftest.$ac_ext >&5
8223   rm -rf conftest*
8224   eval "ac_cv_lib_$ac_lib_var=no"
8225 fi
8226 rm -f conftest*
8227 LIBS="$ac_save_LIBS"
8228
8229 fi
8230 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8231   echo "$ac_t""yes" 1>&6
8232   have_lwp=yes
8233 else
8234   echo "$ac_t""no" 1>&6
8235 have_lwp=no
8236 fi
8237
8238
8239                 if test $have_lwp = yes ; then
8240                         cat >> confdefs.h <<\EOF
8241 #define HAVE_LWP 1
8242 EOF
8243
8244                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
8245                         ol_link_threads=lwp
8246
8247                         if test $ol_with_yielding_select = auto ; then
8248                                 ol_with_yielding_select=no
8249                         fi
8250                 fi
8251         fi
8252 fi
8253
8254 if test $ol_with_yielding_select = yes ; then
8255         cat >> confdefs.h <<\EOF
8256 #define HAVE_YIELDING_SELECT 1
8257 EOF
8258
8259 fi
8260
8261 if test $ol_with_threads = manual ; then
8262                 ol_link_threads=yes
8263
8264         echo "configure: warning: thread defines and link options must be set manually" 1>&2
8265
8266         for ac_hdr in pthread.h sched.h
8267 do
8268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8269 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8270 echo "configure:8271: checking for $ac_hdr" >&5
8271 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8272   echo $ac_n "(cached) $ac_c" 1>&6
8273 else
8274   cat > conftest.$ac_ext <<EOF
8275 #line 8276 "configure"
8276 #include "confdefs.h"
8277 #include <$ac_hdr>
8278 EOF
8279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8280 { (eval echo configure:8281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8282 if test -z "$ac_err"; then
8283   rm -rf conftest*
8284   eval "ac_cv_header_$ac_safe=yes"
8285 else
8286   echo "$ac_err" >&5
8287   echo "configure: failed program was:" >&5
8288   cat conftest.$ac_ext >&5
8289   rm -rf conftest*
8290   eval "ac_cv_header_$ac_safe=no"
8291 fi
8292 rm -f conftest*
8293 fi
8294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8295   echo "$ac_t""yes" 1>&6
8296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8297   cat >> confdefs.h <<EOF
8298 #define $ac_tr_hdr 1
8299 EOF
8300  
8301 else
8302   echo "$ac_t""no" 1>&6
8303 fi
8304 done
8305
8306         for ac_func in sched_yield pthread_yield
8307 do
8308 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8309 echo "configure:8310: checking for $ac_func" >&5
8310 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
8311   echo $ac_n "(cached) $ac_c" 1>&6
8312 else
8313   cat > conftest.$ac_ext <<EOF
8314 #line 8315 "configure"
8315 #include "confdefs.h"
8316 /* System header to define __stub macros and hopefully few prototypes,
8317     which can conflict with char $ac_func(); below.  */
8318 #include <assert.h>
8319 /* Override any gcc2 internal prototype to avoid an error.  */
8320 /* We use char because int might match the return type of a gcc2
8321     builtin and then its argument prototype would still apply.  */
8322 char $ac_func();
8323 char (*f)();
8324
8325 int main() {
8326
8327 /* The GNU C library defines this for functions which it implements
8328     to always fail with ENOSYS.  Some functions are actually named
8329     something starting with __ and the normal name is an alias.  */
8330 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8331 choke me
8332 #else
8333 f = $ac_func;
8334 #endif
8335
8336 ; return 0; }
8337 EOF
8338 if { (eval echo configure:8339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8339   rm -rf conftest*
8340   eval "ac_cv_func_$ac_func=yes"
8341 else
8342   echo "configure: failed program was:" >&5
8343   cat conftest.$ac_ext >&5
8344   rm -rf conftest*
8345   eval "ac_cv_func_$ac_func=no"
8346 fi
8347 rm -f conftest*
8348 fi
8349
8350 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8351   echo "$ac_t""yes" 1>&6
8352     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8353   cat >> confdefs.h <<EOF
8354 #define $ac_tr_func 1
8355 EOF
8356  
8357 else
8358   echo "$ac_t""no" 1>&6
8359 fi
8360 done
8361
8362         
8363         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
8364 echo "configure:8365: checking for LinuxThreads pthread.h" >&5
8365 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
8366   echo $ac_n "(cached) $ac_c" 1>&6
8367 else
8368   cat > conftest.$ac_ext <<EOF
8369 #line 8370 "configure"
8370 #include "confdefs.h"
8371 #include <pthread.h>
8372 EOF
8373 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8374   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
8375   rm -rf conftest*
8376   ol_cv_header_linux_threads=yes
8377 else
8378   rm -rf conftest*
8379   ol_cv_header_linux_threads=no
8380 fi
8381 rm -f conftest*
8382
8383                 
8384 fi
8385
8386 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
8387         if test $ol_cv_header_linux_threads = yes; then
8388                 cat >> confdefs.h <<\EOF
8389 #define HAVE_LINUX_THREADS 1
8390 EOF
8391
8392         fi
8393
8394
8395         for ac_hdr in mach/cthreads.h
8396 do
8397 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8398 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8399 echo "configure:8400: checking for $ac_hdr" >&5
8400 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8401   echo $ac_n "(cached) $ac_c" 1>&6
8402 else
8403   cat > conftest.$ac_ext <<EOF
8404 #line 8405 "configure"
8405 #include "confdefs.h"
8406 #include <$ac_hdr>
8407 EOF
8408 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8409 { (eval echo configure:8410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8410 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8411 if test -z "$ac_err"; then
8412   rm -rf conftest*
8413   eval "ac_cv_header_$ac_safe=yes"
8414 else
8415   echo "$ac_err" >&5
8416   echo "configure: failed program was:" >&5
8417   cat conftest.$ac_ext >&5
8418   rm -rf conftest*
8419   eval "ac_cv_header_$ac_safe=no"
8420 fi
8421 rm -f conftest*
8422 fi
8423 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8424   echo "$ac_t""yes" 1>&6
8425     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8426   cat >> confdefs.h <<EOF
8427 #define $ac_tr_hdr 1
8428 EOF
8429  
8430 else
8431   echo "$ac_t""no" 1>&6
8432 fi
8433 done
8434
8435         for ac_hdr in lwp/lwp.h
8436 do
8437 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8438 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8439 echo "configure:8440: checking for $ac_hdr" >&5
8440 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8441   echo $ac_n "(cached) $ac_c" 1>&6
8442 else
8443   cat > conftest.$ac_ext <<EOF
8444 #line 8445 "configure"
8445 #include "confdefs.h"
8446 #include <$ac_hdr>
8447 EOF
8448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8449 { (eval echo configure:8450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8450 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8451 if test -z "$ac_err"; then
8452   rm -rf conftest*
8453   eval "ac_cv_header_$ac_safe=yes"
8454 else
8455   echo "$ac_err" >&5
8456   echo "configure: failed program was:" >&5
8457   cat conftest.$ac_ext >&5
8458   rm -rf conftest*
8459   eval "ac_cv_header_$ac_safe=no"
8460 fi
8461 rm -f conftest*
8462 fi
8463 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8464   echo "$ac_t""yes" 1>&6
8465     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8466   cat >> confdefs.h <<EOF
8467 #define $ac_tr_hdr 1
8468 EOF
8469  
8470 else
8471   echo "$ac_t""no" 1>&6
8472 fi
8473 done
8474
8475         for ac_hdr in thread.h synch.h
8476 do
8477 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8478 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8479 echo "configure:8480: checking for $ac_hdr" >&5
8480 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8481   echo $ac_n "(cached) $ac_c" 1>&6
8482 else
8483   cat > conftest.$ac_ext <<EOF
8484 #line 8485 "configure"
8485 #include "confdefs.h"
8486 #include <$ac_hdr>
8487 EOF
8488 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8489 { (eval echo configure:8490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8490 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8491 if test -z "$ac_err"; then
8492   rm -rf conftest*
8493   eval "ac_cv_header_$ac_safe=yes"
8494 else
8495   echo "$ac_err" >&5
8496   echo "configure: failed program was:" >&5
8497   cat conftest.$ac_ext >&5
8498   rm -rf conftest*
8499   eval "ac_cv_header_$ac_safe=no"
8500 fi
8501 rm -f conftest*
8502 fi
8503 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8504   echo "$ac_t""yes" 1>&6
8505     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8506   cat >> confdefs.h <<EOF
8507 #define $ac_tr_hdr 1
8508 EOF
8509  
8510 else
8511   echo "$ac_t""no" 1>&6
8512 fi
8513 done
8514
8515 fi
8516
8517 if test $ol_link_threads != no ; then  
8518                         cat >> confdefs.h <<\EOF
8519 #define REENTRANT 1
8520 EOF
8521
8522         cat >> confdefs.h <<\EOF
8523 #define _REENTRANT 1
8524 EOF
8525
8526         cat >> confdefs.h <<\EOF
8527 #define THREAD_SAFE 1
8528 EOF
8529
8530         cat >> confdefs.h <<\EOF
8531 #define _THREAD_SAFE 1
8532 EOF
8533
8534         cat >> confdefs.h <<\EOF
8535 #define THREADSAFE 1
8536 EOF
8537
8538         cat >> confdefs.h <<\EOF
8539 #define _THREADSAFE 1
8540 EOF
8541
8542         cat >> confdefs.h <<\EOF
8543 #define _SGI_MP_SOURCE 1
8544 EOF
8545
8546
8547                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
8548 echo "configure:8549: checking for thread specific errno" >&5
8549 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
8550   echo $ac_n "(cached) $ac_c" 1>&6
8551 else
8552   
8553                 cat > conftest.$ac_ext <<EOF
8554 #line 8555 "configure"
8555 #include "confdefs.h"
8556 #include <errno.h>
8557 int main() {
8558 errno = 0;
8559 ; return 0; }
8560 EOF
8561 if { (eval echo configure:8562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8562   rm -rf conftest*
8563   ol_cv_errno_thread_specific=yes
8564 else
8565   echo "configure: failed program was:" >&5
8566   cat conftest.$ac_ext >&5
8567   rm -rf conftest*
8568   ol_cv_errno_thread_specific=no
8569 fi
8570 rm -f conftest*
8571         
8572 fi
8573
8574 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
8575
8576                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
8577 echo "configure:8578: checking for thread specific h_errno" >&5
8578 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
8579   echo $ac_n "(cached) $ac_c" 1>&6
8580 else
8581   
8582                 cat > conftest.$ac_ext <<EOF
8583 #line 8584 "configure"
8584 #include "confdefs.h"
8585 #include <netdb.h>
8586 int main() {
8587 h_errno = 0;
8588 ; return 0; }
8589 EOF
8590 if { (eval echo configure:8591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8591   rm -rf conftest*
8592   ol_cv_h_errno_thread_specific=yes
8593 else
8594   echo "configure: failed program was:" >&5
8595   cat conftest.$ac_ext >&5
8596   rm -rf conftest*
8597   ol_cv_h_errno_thread_specific=no
8598 fi
8599 rm -f conftest*
8600         
8601 fi
8602
8603 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
8604
8605         if test $ol_cv_errno_thread_specific != yes \
8606                 -o $ol_cv_h_errno_thread_specific != yes ; then
8607                 LIBS="$LTHREAD_LIBS $LIBS"
8608                 LTHREAD_LIBS=""
8609         fi
8610
8611 fi  
8612
8613 if test $ol_link_threads = no ; then
8614         if test $ol_with_threads = yes ; then
8615                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
8616         fi
8617
8618         if test $ol_with_threads = auto ; then
8619                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
8620                 ol_with_threads=no
8621         fi
8622
8623         cat >> confdefs.h <<\EOF
8624 #define NO_THREADS 1
8625 EOF
8626
8627         LTHREAD_LIBS=""
8628 fi
8629
8630 if test $ol_link_threads != no ; then
8631         cat >> confdefs.h <<\EOF
8632 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
8633 EOF
8634
8635 fi
8636
8637
8638 ol_link_ldbm=no 
8639 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
8640         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
8641 echo "configure:8642: checking for DB2 library" >&5
8642 if eval "test \"\${ol_cv_lib_db2+set}\" = set"; then
8643   echo $ac_n "(cached) $ac_c" 1>&6
8644 else
8645         ol_LIBS="$LIBS"
8646         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
8647 echo "configure:8648: checking for db_open in -ldb" >&5
8648 ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
8649 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8650   echo $ac_n "(cached) $ac_c" 1>&6
8651 else
8652   ac_save_LIBS="$LIBS"
8653 LIBS="-ldb  $LIBS"
8654 cat > conftest.$ac_ext <<EOF
8655 #line 8656 "configure"
8656 #include "confdefs.h"
8657 /* Override any gcc2 internal prototype to avoid an error.  */
8658 /* We use char because int might match the return type of a gcc2
8659     builtin and then its argument prototype would still apply.  */
8660 char db_open();
8661
8662 int main() {
8663 db_open()
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   ol_cv_lib_db2=-ldb
8682 else
8683   echo "$ac_t""no" 1>&6
8684 ol_cv_lib_db2=no
8685 fi
8686
8687         LIBS="$ol_LIBS"
8688
8689 fi
8690
8691 echo "$ac_t""$ol_cv_lib_db2" 1>&6
8692
8693 for ac_hdr in db.h
8694 do
8695 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8696 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8697 echo "configure:8698: checking for $ac_hdr" >&5
8698 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8699   echo $ac_n "(cached) $ac_c" 1>&6
8700 else
8701   cat > conftest.$ac_ext <<EOF
8702 #line 8703 "configure"
8703 #include "confdefs.h"
8704 #include <$ac_hdr>
8705 EOF
8706 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8707 { (eval echo configure:8708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8708 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8709 if test -z "$ac_err"; then
8710   rm -rf conftest*
8711   eval "ac_cv_header_$ac_safe=yes"
8712 else
8713   echo "$ac_err" >&5
8714   echo "configure: failed program was:" >&5
8715   cat conftest.$ac_ext >&5
8716   rm -rf conftest*
8717   eval "ac_cv_header_$ac_safe=no"
8718 fi
8719 rm -f conftest*
8720 fi
8721 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8722   echo "$ac_t""yes" 1>&6
8723     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8724   cat >> confdefs.h <<EOF
8725 #define $ac_tr_hdr 1
8726 EOF
8727  
8728 else
8729   echo "$ac_t""no" 1>&6
8730 fi
8731 done
8732
8733 if test $ac_cv_header_db_h = yes ; then
8734         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
8735 echo "configure:8736: checking if db.h is DB2" >&5
8736 if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
8737   echo $ac_n "(cached) $ac_c" 1>&6
8738 else
8739   
8740                 cat > conftest.$ac_ext <<EOF
8741 #line 8742 "configure"
8742 #include "confdefs.h"
8743
8744 #                       include <db.h>
8745                         /* this check could be improved */
8746 #                       ifdef DB_VERSION_MAJOR
8747 #                               if DB_VERSION_MAJOR == 2
8748                                         __db_version_2
8749 #                               endif
8750 #                       endif
8751                 
8752 EOF
8753 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8754   egrep "__db_version_2" >/dev/null 2>&1; then
8755   rm -rf conftest*
8756   ol_cv_header_db2=yes
8757 else
8758   rm -rf conftest*
8759   ol_cv_header_db2=no
8760 fi
8761 rm -f conftest*
8762
8763 fi
8764
8765 echo "$ac_t""$ol_cv_header_db2" 1>&6
8766 else
8767         ol_cv_header_db2=no
8768 fi
8769
8770
8771  
8772  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
8773 echo "configure:8774: checking for Berkeley DB2" >&5
8774 if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
8775   echo $ac_n "(cached) $ac_c" 1>&6
8776 else
8777   
8778         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
8779                 ol_cv_berkeley_db2=no
8780         else
8781                 ol_cv_berkeley_db2=yes
8782         fi
8783
8784 fi
8785
8786 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
8787  if test $ol_cv_berkeley_db2 = yes ; then
8788         cat >> confdefs.h <<\EOF
8789 #define HAVE_BERKELEY_DB2 1
8790 EOF
8791
8792  fi
8793
8794
8795         if test $ol_cv_berkeley_db2 = yes ; then
8796                 ol_link_ldbm=db2
8797                 ol_with_ldbm_api=db2
8798
8799                 if test $ol_with_ldbm_type = hash ; then
8800                         cat >> confdefs.h <<\EOF
8801 #define LDBM_USE_DBHASH 1
8802 EOF
8803
8804                 else
8805                         cat >> confdefs.h <<\EOF
8806 #define LDBM_USE_DBBTREE 1
8807 EOF
8808
8809                 fi
8810
8811                                                 if test $ol_cv_lib_db2 != yes ; then
8812                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
8813                 fi
8814         fi
8815 fi
8816
8817 ol_link_bdb2=no
8818 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
8819         ol_link_bdb2=yes
8820 fi
8821
8822 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
8823         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
8824 echo "configure:8825: checking for Berkeley DB library" >&5
8825 if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
8826   echo $ac_n "(cached) $ac_c" 1>&6
8827 else
8828   
8829         for ac_hdr in db1/db.h
8830 do
8831 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8832 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8833 echo "configure:8834: checking for $ac_hdr" >&5
8834 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8835   echo $ac_n "(cached) $ac_c" 1>&6
8836 else
8837   cat > conftest.$ac_ext <<EOF
8838 #line 8839 "configure"
8839 #include "confdefs.h"
8840 #include <$ac_hdr>
8841 EOF
8842 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8843 { (eval echo configure:8844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8844 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8845 if test -z "$ac_err"; then
8846   rm -rf conftest*
8847   eval "ac_cv_header_$ac_safe=yes"
8848 else
8849   echo "$ac_err" >&5
8850   echo "configure: failed program was:" >&5
8851   cat conftest.$ac_ext >&5
8852   rm -rf conftest*
8853   eval "ac_cv_header_$ac_safe=no"
8854 fi
8855 rm -f conftest*
8856 fi
8857 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8858   echo "$ac_t""yes" 1>&6
8859     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8860   cat >> confdefs.h <<EOF
8861 #define $ac_tr_hdr 1
8862 EOF
8863  
8864 else
8865   echo "$ac_t""no" 1>&6
8866 fi
8867 done
8868
8869         ol_LIBS="$LIBS"
8870         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
8871 echo "configure:8872: checking for dbopen" >&5
8872 if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
8873   echo $ac_n "(cached) $ac_c" 1>&6
8874 else
8875   cat > conftest.$ac_ext <<EOF
8876 #line 8877 "configure"
8877 #include "confdefs.h"
8878 /* System header to define __stub macros and hopefully few prototypes,
8879     which can conflict with char dbopen(); below.  */
8880 #include <assert.h>
8881 /* Override any gcc2 internal prototype to avoid an error.  */
8882 /* We use char because int might match the return type of a gcc2
8883     builtin and then its argument prototype would still apply.  */
8884 char dbopen();
8885 char (*f)();
8886
8887 int main() {
8888
8889 /* The GNU C library defines this for functions which it implements
8890     to always fail with ENOSYS.  Some functions are actually named
8891     something starting with __ and the normal name is an alias.  */
8892 #if defined (__stub_dbopen) || defined (__stub___dbopen)
8893 choke me
8894 #else
8895 f = dbopen;
8896 #endif
8897
8898 ; return 0; }
8899 EOF
8900 if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8901   rm -rf conftest*
8902   eval "ac_cv_func_dbopen=yes"
8903 else
8904   echo "configure: failed program was:" >&5
8905   cat conftest.$ac_ext >&5
8906   rm -rf conftest*
8907   eval "ac_cv_func_dbopen=no"
8908 fi
8909 rm -f conftest*
8910 fi
8911
8912 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
8913   echo "$ac_t""yes" 1>&6
8914   ol_cv_lib_db=yes
8915 else
8916   echo "$ac_t""no" 1>&6
8917
8918                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
8919 echo "configure:8920: checking for dbopen in -ldb1" >&5
8920 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
8921 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8922   echo $ac_n "(cached) $ac_c" 1>&6
8923 else
8924   ac_save_LIBS="$LIBS"
8925 LIBS="-ldb1  $LIBS"
8926 cat > conftest.$ac_ext <<EOF
8927 #line 8928 "configure"
8928 #include "confdefs.h"
8929 /* Override any gcc2 internal prototype to avoid an error.  */
8930 /* We use char because int might match the return type of a gcc2
8931     builtin and then its argument prototype would still apply.  */
8932 char dbopen();
8933
8934 int main() {
8935 dbopen()
8936 ; return 0; }
8937 EOF
8938 if { (eval echo configure:8939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8939   rm -rf conftest*
8940   eval "ac_cv_lib_$ac_lib_var=yes"
8941 else
8942   echo "configure: failed program was:" >&5
8943   cat conftest.$ac_ext >&5
8944   rm -rf conftest*
8945   eval "ac_cv_lib_$ac_lib_var=no"
8946 fi
8947 rm -f conftest*
8948 LIBS="$ac_save_LIBS"
8949
8950 fi
8951 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8952   echo "$ac_t""yes" 1>&6
8953   ol_cv_lib_db=-ldb1
8954 else
8955   echo "$ac_t""no" 1>&6
8956
8957                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
8958 echo "configure:8959: checking for dbopen in -ldb" >&5
8959 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
8960 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8961   echo $ac_n "(cached) $ac_c" 1>&6
8962 else
8963   ac_save_LIBS="$LIBS"
8964 LIBS="-ldb  $LIBS"
8965 cat > conftest.$ac_ext <<EOF
8966 #line 8967 "configure"
8967 #include "confdefs.h"
8968 /* Override any gcc2 internal prototype to avoid an error.  */
8969 /* We use char because int might match the return type of a gcc2
8970     builtin and then its argument prototype would still apply.  */
8971 char dbopen();
8972
8973 int main() {
8974 dbopen()
8975 ; return 0; }
8976 EOF
8977 if { (eval echo configure:8978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8978   rm -rf conftest*
8979   eval "ac_cv_lib_$ac_lib_var=yes"
8980 else
8981   echo "configure: failed program was:" >&5
8982   cat conftest.$ac_ext >&5
8983   rm -rf conftest*
8984   eval "ac_cv_lib_$ac_lib_var=no"
8985 fi
8986 rm -f conftest*
8987 LIBS="$ac_save_LIBS"
8988
8989 fi
8990 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8991   echo "$ac_t""yes" 1>&6
8992   ol_cv_lib_db=-ldb
8993 else
8994   echo "$ac_t""no" 1>&6
8995 ol_cv_lib_db=no
8996 fi
8997
8998                 
8999 fi
9000
9001         
9002 fi
9003
9004         LIBS="$ol_LIBS"
9005
9006 fi
9007
9008 echo "$ac_t""$ol_cv_lib_db" 1>&6
9009
9010
9011 for ac_hdr in db_185.h
9012 do
9013 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9014 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9015 echo "configure:9016: checking for $ac_hdr" >&5
9016 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9017   echo $ac_n "(cached) $ac_c" 1>&6
9018 else
9019   cat > conftest.$ac_ext <<EOF
9020 #line 9021 "configure"
9021 #include "confdefs.h"
9022 #include <$ac_hdr>
9023 EOF
9024 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9025 { (eval echo configure:9026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9026 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9027 if test -z "$ac_err"; then
9028   rm -rf conftest*
9029   eval "ac_cv_header_$ac_safe=yes"
9030 else
9031   echo "$ac_err" >&5
9032   echo "configure: failed program was:" >&5
9033   cat conftest.$ac_ext >&5
9034   rm -rf conftest*
9035   eval "ac_cv_header_$ac_safe=no"
9036 fi
9037 rm -f conftest*
9038 fi
9039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9040   echo "$ac_t""yes" 1>&6
9041     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9042   cat >> confdefs.h <<EOF
9043 #define $ac_tr_hdr 1
9044 EOF
9045  
9046 else
9047   echo "$ac_t""no" 1>&6
9048 fi
9049 done
9050
9051 if test "$ol_cv_header_db2" = yes ; then
9052         
9053         ol_cv_header_db=$ac_cv_header_db_185_h
9054 else
9055         ol_cv_header_db=$ac_cv_header_db_h
9056 fi
9057
9058
9059  
9060  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
9061 echo "configure:9062: checking for Berkeley DB" >&5
9062 if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
9063   echo $ac_n "(cached) $ac_c" 1>&6
9064 else
9065   
9066         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
9067                 ol_cv_berkeley_db=no
9068         else
9069                 ol_cv_berkeley_db=yes
9070         fi
9071
9072 fi
9073
9074 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
9075  if test $ol_cv_berkeley_db = yes ; then
9076         cat >> confdefs.h <<\EOF
9077 #define HAVE_BERKELEY_DB 1
9078 EOF
9079
9080  fi
9081
9082
9083         if test $ol_cv_berkeley_db = yes ; then
9084                 ol_link_ldbm=db
9085                 ol_with_ldbm_api=db
9086
9087                 if test $ol_with_ldbm_type = hash ; then
9088                         cat >> confdefs.h <<\EOF
9089 #define LDBM_USE_DBHASH 1
9090 EOF
9091
9092                 else
9093                         cat >> confdefs.h <<\EOF
9094 #define LDBM_USE_DBBTREE 1
9095 EOF
9096
9097                 fi
9098
9099                                                 if test $ol_cv_lib_db != yes ; then
9100                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
9101                 fi
9102         fi
9103 fi
9104
9105 if test $ol_with_ldbm_api = manual ; then
9106                 ol_link_ldbm=yes
9107
9108         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
9109
9110         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
9111 do
9112 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9113 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9114 echo "configure:9115: checking for $ac_hdr" >&5
9115 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9116   echo $ac_n "(cached) $ac_c" 1>&6
9117 else
9118   cat > conftest.$ac_ext <<EOF
9119 #line 9120 "configure"
9120 #include "confdefs.h"
9121 #include <$ac_hdr>
9122 EOF
9123 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9124 { (eval echo configure:9125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9125 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9126 if test -z "$ac_err"; then
9127   rm -rf conftest*
9128   eval "ac_cv_header_$ac_safe=yes"
9129 else
9130   echo "$ac_err" >&5
9131   echo "configure: failed program was:" >&5
9132   cat conftest.$ac_ext >&5
9133   rm -rf conftest*
9134   eval "ac_cv_header_$ac_safe=no"
9135 fi
9136 rm -f conftest*
9137 fi
9138 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9139   echo "$ac_t""yes" 1>&6
9140     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9141   cat >> confdefs.h <<EOF
9142 #define $ac_tr_hdr 1
9143 EOF
9144  
9145 else
9146   echo "$ac_t""no" 1>&6
9147 fi
9148 done
9149
9150 fi
9151
9152 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
9153         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
9154         ol_with_ldbm_api=none
9155 fi
9156
9157 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
9158         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
9159 echo "configure:9160: checking for MDBM library" >&5
9160 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
9161   echo $ac_n "(cached) $ac_c" 1>&6
9162 else
9163         ol_LIBS="$LIBS"
9164         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
9165 echo "configure:9166: checking for mdbm_set_chain" >&5
9166 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
9167   echo $ac_n "(cached) $ac_c" 1>&6
9168 else
9169   cat > conftest.$ac_ext <<EOF
9170 #line 9171 "configure"
9171 #include "confdefs.h"
9172 /* System header to define __stub macros and hopefully few prototypes,
9173     which can conflict with char mdbm_set_chain(); below.  */
9174 #include <assert.h>
9175 /* Override any gcc2 internal prototype to avoid an error.  */
9176 /* We use char because int might match the return type of a gcc2
9177     builtin and then its argument prototype would still apply.  */
9178 char mdbm_set_chain();
9179 char (*f)();
9180
9181 int main() {
9182
9183 /* The GNU C library defines this for functions which it implements
9184     to always fail with ENOSYS.  Some functions are actually named
9185     something starting with __ and the normal name is an alias.  */
9186 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
9187 choke me
9188 #else
9189 f = mdbm_set_chain;
9190 #endif
9191
9192 ; return 0; }
9193 EOF
9194 if { (eval echo configure:9195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9195   rm -rf conftest*
9196   eval "ac_cv_func_mdbm_set_chain=yes"
9197 else
9198   echo "configure: failed program was:" >&5
9199   cat conftest.$ac_ext >&5
9200   rm -rf conftest*
9201   eval "ac_cv_func_mdbm_set_chain=no"
9202 fi
9203 rm -f conftest*
9204 fi
9205
9206 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
9207   echo "$ac_t""yes" 1>&6
9208   ol_cv_lib_mdbm=yes
9209 else
9210   echo "$ac_t""no" 1>&6
9211
9212                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
9213 echo "configure:9214: checking for mdbm_set_chain in -lmdbm" >&5
9214 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
9215 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9216   echo $ac_n "(cached) $ac_c" 1>&6
9217 else
9218   ac_save_LIBS="$LIBS"
9219 LIBS="-lmdbm  $LIBS"
9220 cat > conftest.$ac_ext <<EOF
9221 #line 9222 "configure"
9222 #include "confdefs.h"
9223 /* Override any gcc2 internal prototype to avoid an error.  */
9224 /* We use char because int might match the return type of a gcc2
9225     builtin and then its argument prototype would still apply.  */
9226 char mdbm_set_chain();
9227
9228 int main() {
9229 mdbm_set_chain()
9230 ; return 0; }
9231 EOF
9232 if { (eval echo configure:9233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9233   rm -rf conftest*
9234   eval "ac_cv_lib_$ac_lib_var=yes"
9235 else
9236   echo "configure: failed program was:" >&5
9237   cat conftest.$ac_ext >&5
9238   rm -rf conftest*
9239   eval "ac_cv_lib_$ac_lib_var=no"
9240 fi
9241 rm -f conftest*
9242 LIBS="$ac_save_LIBS"
9243
9244 fi
9245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9246   echo "$ac_t""yes" 1>&6
9247   ol_cv_lib_mdbm=-lmdbm
9248 else
9249   echo "$ac_t""no" 1>&6
9250 ol_cv_lib_mdbm=no
9251 fi
9252
9253         
9254 fi
9255
9256         LIBS="$ol_LIBS"
9257
9258 fi
9259
9260 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
9261
9262
9263  for ac_hdr in mdbm.h
9264 do
9265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9267 echo "configure:9268: checking for $ac_hdr" >&5
9268 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9269   echo $ac_n "(cached) $ac_c" 1>&6
9270 else
9271   cat > conftest.$ac_ext <<EOF
9272 #line 9273 "configure"
9273 #include "confdefs.h"
9274 #include <$ac_hdr>
9275 EOF
9276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9277 { (eval echo configure:9278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9278 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9279 if test -z "$ac_err"; then
9280   rm -rf conftest*
9281   eval "ac_cv_header_$ac_safe=yes"
9282 else
9283   echo "$ac_err" >&5
9284   echo "configure: failed program was:" >&5
9285   cat conftest.$ac_ext >&5
9286   rm -rf conftest*
9287   eval "ac_cv_header_$ac_safe=no"
9288 fi
9289 rm -f conftest*
9290 fi
9291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9292   echo "$ac_t""yes" 1>&6
9293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9294   cat >> confdefs.h <<EOF
9295 #define $ac_tr_hdr 1
9296 EOF
9297  
9298 else
9299   echo "$ac_t""no" 1>&6
9300 fi
9301 done
9302
9303  echo $ac_n "checking for db""... $ac_c" 1>&6
9304 echo "configure:9305: checking for db" >&5
9305 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
9306   echo $ac_n "(cached) $ac_c" 1>&6
9307 else
9308   
9309         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
9310                 ol_cv_mdbm=no
9311         else
9312                 ol_cv_mdbm=yes
9313         fi
9314
9315 fi
9316
9317 echo "$ac_t""$ol_cv_mdbm" 1>&6
9318  if test $ol_cv_mdbm = yes ; then
9319         cat >> confdefs.h <<\EOF
9320 #define HAVE_MDBM 1
9321 EOF
9322
9323  fi
9324
9325
9326         if test $ol_cv_mdbm = yes ; then
9327                 ol_link_ldbm=mdbm
9328                 ol_with_ldbm_api=mdbm
9329                 if test $ol_cv_lib_mdbm != yes ; then
9330                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
9331                 fi
9332         fi
9333 fi
9334
9335 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
9336         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
9337 echo "configure:9338: checking for GDBM library" >&5
9338 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
9339   echo $ac_n "(cached) $ac_c" 1>&6
9340 else
9341         ol_LIBS="$LIBS"
9342         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
9343 echo "configure:9344: checking for gdbm_open" >&5
9344 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
9345   echo $ac_n "(cached) $ac_c" 1>&6
9346 else
9347   cat > conftest.$ac_ext <<EOF
9348 #line 9349 "configure"
9349 #include "confdefs.h"
9350 /* System header to define __stub macros and hopefully few prototypes,
9351     which can conflict with char gdbm_open(); below.  */
9352 #include <assert.h>
9353 /* Override any gcc2 internal prototype to avoid an error.  */
9354 /* We use char because int might match the return type of a gcc2
9355     builtin and then its argument prototype would still apply.  */
9356 char gdbm_open();
9357 char (*f)();
9358
9359 int main() {
9360
9361 /* The GNU C library defines this for functions which it implements
9362     to always fail with ENOSYS.  Some functions are actually named
9363     something starting with __ and the normal name is an alias.  */
9364 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
9365 choke me
9366 #else
9367 f = gdbm_open;
9368 #endif
9369
9370 ; return 0; }
9371 EOF
9372 if { (eval echo configure:9373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9373   rm -rf conftest*
9374   eval "ac_cv_func_gdbm_open=yes"
9375 else
9376   echo "configure: failed program was:" >&5
9377   cat conftest.$ac_ext >&5
9378   rm -rf conftest*
9379   eval "ac_cv_func_gdbm_open=no"
9380 fi
9381 rm -f conftest*
9382 fi
9383
9384 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
9385   echo "$ac_t""yes" 1>&6
9386   ol_cv_lib_gdbm=yes
9387 else
9388   echo "$ac_t""no" 1>&6
9389
9390                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
9391 echo "configure:9392: checking for gdbm_open in -lgdbm" >&5
9392 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
9393 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9394   echo $ac_n "(cached) $ac_c" 1>&6
9395 else
9396   ac_save_LIBS="$LIBS"
9397 LIBS="-lgdbm  $LIBS"
9398 cat > conftest.$ac_ext <<EOF
9399 #line 9400 "configure"
9400 #include "confdefs.h"
9401 /* Override any gcc2 internal prototype to avoid an error.  */
9402 /* We use char because int might match the return type of a gcc2
9403     builtin and then its argument prototype would still apply.  */
9404 char gdbm_open();
9405
9406 int main() {
9407 gdbm_open()
9408 ; return 0; }
9409 EOF
9410 if { (eval echo configure:9411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9411   rm -rf conftest*
9412   eval "ac_cv_lib_$ac_lib_var=yes"
9413 else
9414   echo "configure: failed program was:" >&5
9415   cat conftest.$ac_ext >&5
9416   rm -rf conftest*
9417   eval "ac_cv_lib_$ac_lib_var=no"
9418 fi
9419 rm -f conftest*
9420 LIBS="$ac_save_LIBS"
9421
9422 fi
9423 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9424   echo "$ac_t""yes" 1>&6
9425   ol_cv_lib_gdbm=-lgdbm
9426 else
9427   echo "$ac_t""no" 1>&6
9428 ol_cv_lib_gdbm=no
9429 fi
9430
9431         
9432 fi
9433
9434         LIBS="$ol_LIBS"
9435
9436 fi
9437
9438 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
9439
9440
9441  for ac_hdr in gdbm.h
9442 do
9443 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9444 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9445 echo "configure:9446: checking for $ac_hdr" >&5
9446 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9447   echo $ac_n "(cached) $ac_c" 1>&6
9448 else
9449   cat > conftest.$ac_ext <<EOF
9450 #line 9451 "configure"
9451 #include "confdefs.h"
9452 #include <$ac_hdr>
9453 EOF
9454 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9455 { (eval echo configure:9456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9456 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9457 if test -z "$ac_err"; then
9458   rm -rf conftest*
9459   eval "ac_cv_header_$ac_safe=yes"
9460 else
9461   echo "$ac_err" >&5
9462   echo "configure: failed program was:" >&5
9463   cat conftest.$ac_ext >&5
9464   rm -rf conftest*
9465   eval "ac_cv_header_$ac_safe=no"
9466 fi
9467 rm -f conftest*
9468 fi
9469 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9470   echo "$ac_t""yes" 1>&6
9471     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9472   cat >> confdefs.h <<EOF
9473 #define $ac_tr_hdr 1
9474 EOF
9475  
9476 else
9477   echo "$ac_t""no" 1>&6
9478 fi
9479 done
9480
9481  echo $ac_n "checking for db""... $ac_c" 1>&6
9482 echo "configure:9483: checking for db" >&5
9483 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
9484   echo $ac_n "(cached) $ac_c" 1>&6
9485 else
9486   
9487         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
9488                 ol_cv_gdbm=no
9489         else
9490                 ol_cv_gdbm=yes
9491         fi
9492
9493 fi
9494
9495 echo "$ac_t""$ol_cv_gdbm" 1>&6
9496  if test $ol_cv_gdbm = yes ; then
9497         cat >> confdefs.h <<\EOF
9498 #define HAVE_GDBM 1
9499 EOF
9500
9501  fi
9502
9503
9504         if test $ol_cv_gdbm = yes ; then
9505                 ol_link_ldbm=gdbm
9506                 ol_with_ldbm_api=gdbm
9507
9508                 if test $ol_cv_lib_gdbm != yes ; then
9509                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
9510                 fi
9511         fi
9512 fi
9513
9514 if test $ol_with_ldbm_api = auto ; then
9515         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
9516 elif test $ol_with_ldbm_api = ndbm ; then
9517         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
9518 echo "configure:9519: checking for NDBM library" >&5
9519 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
9520   echo $ac_n "(cached) $ac_c" 1>&6
9521 else
9522         ol_LIBS="$LIBS"
9523         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
9524 echo "configure:9525: checking for dbm_open" >&5
9525 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
9526   echo $ac_n "(cached) $ac_c" 1>&6
9527 else
9528   cat > conftest.$ac_ext <<EOF
9529 #line 9530 "configure"
9530 #include "confdefs.h"
9531 /* System header to define __stub macros and hopefully few prototypes,
9532     which can conflict with char dbm_open(); below.  */
9533 #include <assert.h>
9534 /* Override any gcc2 internal prototype to avoid an error.  */
9535 /* We use char because int might match the return type of a gcc2
9536     builtin and then its argument prototype would still apply.  */
9537 char dbm_open();
9538 char (*f)();
9539
9540 int main() {
9541
9542 /* The GNU C library defines this for functions which it implements
9543     to always fail with ENOSYS.  Some functions are actually named
9544     something starting with __ and the normal name is an alias.  */
9545 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
9546 choke me
9547 #else
9548 f = dbm_open;
9549 #endif
9550
9551 ; return 0; }
9552 EOF
9553 if { (eval echo configure:9554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9554   rm -rf conftest*
9555   eval "ac_cv_func_dbm_open=yes"
9556 else
9557   echo "configure: failed program was:" >&5
9558   cat conftest.$ac_ext >&5
9559   rm -rf conftest*
9560   eval "ac_cv_func_dbm_open=no"
9561 fi
9562 rm -f conftest*
9563 fi
9564
9565 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
9566   echo "$ac_t""yes" 1>&6
9567   ol_cv_lib_ndbm=yes
9568 else
9569   echo "$ac_t""no" 1>&6
9570
9571                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
9572 echo "configure:9573: checking for dbm_open in -lndbm" >&5
9573 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
9574 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9575   echo $ac_n "(cached) $ac_c" 1>&6
9576 else
9577   ac_save_LIBS="$LIBS"
9578 LIBS="-lndbm  $LIBS"
9579 cat > conftest.$ac_ext <<EOF
9580 #line 9581 "configure"
9581 #include "confdefs.h"
9582 /* Override any gcc2 internal prototype to avoid an error.  */
9583 /* We use char because int might match the return type of a gcc2
9584     builtin and then its argument prototype would still apply.  */
9585 char dbm_open();
9586
9587 int main() {
9588 dbm_open()
9589 ; return 0; }
9590 EOF
9591 if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9592   rm -rf conftest*
9593   eval "ac_cv_lib_$ac_lib_var=yes"
9594 else
9595   echo "configure: failed program was:" >&5
9596   cat conftest.$ac_ext >&5
9597   rm -rf conftest*
9598   eval "ac_cv_lib_$ac_lib_var=no"
9599 fi
9600 rm -f conftest*
9601 LIBS="$ac_save_LIBS"
9602
9603 fi
9604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9605   echo "$ac_t""yes" 1>&6
9606   ol_cv_lib_ndbm=-lndbm
9607 else
9608   echo "$ac_t""no" 1>&6
9609
9610                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
9611 echo "configure:9612: checking for dbm_open in -ldbm" >&5
9612 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
9613 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9614   echo $ac_n "(cached) $ac_c" 1>&6
9615 else
9616   ac_save_LIBS="$LIBS"
9617 LIBS="-ldbm  $LIBS"
9618 cat > conftest.$ac_ext <<EOF
9619 #line 9620 "configure"
9620 #include "confdefs.h"
9621 /* Override any gcc2 internal prototype to avoid an error.  */
9622 /* We use char because int might match the return type of a gcc2
9623     builtin and then its argument prototype would still apply.  */
9624 char dbm_open();
9625
9626 int main() {
9627 dbm_open()
9628 ; return 0; }
9629 EOF
9630 if { (eval echo configure:9631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9631   rm -rf conftest*
9632   eval "ac_cv_lib_$ac_lib_var=yes"
9633 else
9634   echo "configure: failed program was:" >&5
9635   cat conftest.$ac_ext >&5
9636   rm -rf conftest*
9637   eval "ac_cv_lib_$ac_lib_var=no"
9638 fi
9639 rm -f conftest*
9640 LIBS="$ac_save_LIBS"
9641
9642 fi
9643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9644   echo "$ac_t""yes" 1>&6
9645   ol_cv_lib_ndbm=-ldbm
9646 else
9647   echo "$ac_t""no" 1>&6
9648 ol_cv_lib_ndbm=no
9649 fi
9650                 
9651 fi
9652
9653         
9654 fi
9655
9656         LIBS="$ol_LIBS"
9657
9658 fi
9659
9660 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
9661
9662
9663  for ac_hdr in ndbm.h
9664 do
9665 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9666 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9667 echo "configure:9668: checking for $ac_hdr" >&5
9668 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9669   echo $ac_n "(cached) $ac_c" 1>&6
9670 else
9671   cat > conftest.$ac_ext <<EOF
9672 #line 9673 "configure"
9673 #include "confdefs.h"
9674 #include <$ac_hdr>
9675 EOF
9676 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9677 { (eval echo configure:9678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9678 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9679 if test -z "$ac_err"; then
9680   rm -rf conftest*
9681   eval "ac_cv_header_$ac_safe=yes"
9682 else
9683   echo "$ac_err" >&5
9684   echo "configure: failed program was:" >&5
9685   cat conftest.$ac_ext >&5
9686   rm -rf conftest*
9687   eval "ac_cv_header_$ac_safe=no"
9688 fi
9689 rm -f conftest*
9690 fi
9691 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9692   echo "$ac_t""yes" 1>&6
9693     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9694   cat >> confdefs.h <<EOF
9695 #define $ac_tr_hdr 1
9696 EOF
9697  
9698 else
9699   echo "$ac_t""no" 1>&6
9700 fi
9701 done
9702
9703  echo $ac_n "checking for db""... $ac_c" 1>&6
9704 echo "configure:9705: checking for db" >&5
9705 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
9706   echo $ac_n "(cached) $ac_c" 1>&6
9707 else
9708   
9709         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
9710                 ol_cv_ndbm=no
9711         else
9712                 ol_cv_ndbm=yes
9713         fi
9714
9715 fi
9716
9717 echo "$ac_t""$ol_cv_ndbm" 1>&6
9718  if test $ol_cv_ndbm = yes ; then
9719         cat >> confdefs.h <<\EOF
9720 #define HAVE_NDBM 1
9721 EOF
9722
9723  fi
9724
9725
9726         if test $ol_cv_ndbm = yes ; then
9727                 ol_link_ldbm=ndbm
9728                 ol_with_ldbm_api=ndbm
9729
9730                 if test $ol_cv_lib_ndbm != yes ; then
9731                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
9732                 fi
9733         fi
9734 fi
9735
9736 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
9737         echo "configure: warning: could not find suitable LDBM backend" 1>&2
9738         if test $ol_enable_ldbm = yes ; then
9739                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
9740         fi
9741
9742         echo "configure: warning: disabling LDBM" 1>&2
9743         ol_enable_ldbm=no
9744 fi
9745
9746 if test $ol_enable_wrappers != no ; then
9747         for ac_hdr in tcpd.h
9748 do
9749 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9750 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9751 echo "configure:9752: checking for $ac_hdr" >&5
9752 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9753   echo $ac_n "(cached) $ac_c" 1>&6
9754 else
9755   cat > conftest.$ac_ext <<EOF
9756 #line 9757 "configure"
9757 #include "confdefs.h"
9758 #include <$ac_hdr>
9759 EOF
9760 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9761 { (eval echo configure:9762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9762 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9763 if test -z "$ac_err"; then
9764   rm -rf conftest*
9765   eval "ac_cv_header_$ac_safe=yes"
9766 else
9767   echo "$ac_err" >&5
9768   echo "configure: failed program was:" >&5
9769   cat conftest.$ac_ext >&5
9770   rm -rf conftest*
9771   eval "ac_cv_header_$ac_safe=no"
9772 fi
9773 rm -f conftest*
9774 fi
9775 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9776   echo "$ac_t""yes" 1>&6
9777     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9778   cat >> confdefs.h <<EOF
9779 #define $ac_tr_hdr 1
9780 EOF
9781  
9782 else
9783   echo "$ac_t""no" 1>&6
9784 fi
9785 done
9786
9787
9788         if test $ac_cv_header_tcpd_h != yes ; then
9789                 have_wrappers=no
9790         else
9791                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
9792 echo "configure:9793: checking for main in -lwrap" >&5
9793 ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
9794 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9795   echo $ac_n "(cached) $ac_c" 1>&6
9796 else
9797   ac_save_LIBS="$LIBS"
9798 LIBS="-lwrap  $LIBS"
9799 cat > conftest.$ac_ext <<EOF
9800 #line 9801 "configure"
9801 #include "confdefs.h"
9802
9803 int main() {
9804 main()
9805 ; return 0; }
9806 EOF
9807 if { (eval echo configure:9808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9808   rm -rf conftest*
9809   eval "ac_cv_lib_$ac_lib_var=yes"
9810 else
9811   echo "configure: failed program was:" >&5
9812   cat conftest.$ac_ext >&5
9813   rm -rf conftest*
9814   eval "ac_cv_lib_$ac_lib_var=no"
9815 fi
9816 rm -f conftest*
9817 LIBS="$ac_save_LIBS"
9818
9819 fi
9820 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9821   echo "$ac_t""yes" 1>&6
9822   have_wrappers=yes
9823 else
9824   echo "$ac_t""no" 1>&6
9825 have_wrappers=no
9826 fi
9827
9828         fi
9829
9830         if test $have_wrappers = yes ; then
9831                 cat >> confdefs.h <<\EOF
9832 #define HAVE_TCPD 1
9833 EOF
9834
9835                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
9836
9837                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9838 echo "configure:9839: checking for main in -lnsl" >&5
9839 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9840 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9841   echo $ac_n "(cached) $ac_c" 1>&6
9842 else
9843   ac_save_LIBS="$LIBS"
9844 LIBS="-lnsl  $LIBS"
9845 cat > conftest.$ac_ext <<EOF
9846 #line 9847 "configure"
9847 #include "confdefs.h"
9848
9849 int main() {
9850 main()
9851 ; return 0; }
9852 EOF
9853 if { (eval echo configure:9854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9854   rm -rf conftest*
9855   eval "ac_cv_lib_$ac_lib_var=yes"
9856 else
9857   echo "configure: failed program was:" >&5
9858   cat conftest.$ac_ext >&5
9859   rm -rf conftest*
9860   eval "ac_cv_lib_$ac_lib_var=no"
9861 fi
9862 rm -f conftest*
9863 LIBS="$ac_save_LIBS"
9864
9865 fi
9866 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9867   echo "$ac_t""yes" 1>&6
9868     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9869     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9870   cat >> confdefs.h <<EOF
9871 #define $ac_tr_lib 1
9872 EOF
9873
9874   LIBS="-lnsl $LIBS"
9875
9876 else
9877   echo "$ac_t""no" 1>&6
9878 fi
9879
9880         else
9881                 echo "configure: warning: could not find -lwrap" 1>&2
9882                 if test $ol_enable_wrappers = yes ; then
9883                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
9884                 fi
9885
9886                 echo "configure: warning: disabling wrappers support" 1>&2
9887                 ol_enable_wrappers=no
9888         fi
9889 fi
9890
9891 if test $ol_enable_syslog != no ; then
9892         echo $ac_n "checking for openlog""... $ac_c" 1>&6
9893 echo "configure:9894: checking for openlog" >&5
9894 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
9895   echo $ac_n "(cached) $ac_c" 1>&6
9896 else
9897   cat > conftest.$ac_ext <<EOF
9898 #line 9899 "configure"
9899 #include "confdefs.h"
9900 /* System header to define __stub macros and hopefully few prototypes,
9901     which can conflict with char openlog(); below.  */
9902 #include <assert.h>
9903 /* Override any gcc2 internal prototype to avoid an error.  */
9904 /* We use char because int might match the return type of a gcc2
9905     builtin and then its argument prototype would still apply.  */
9906 char openlog();
9907 char (*f)();
9908
9909 int main() {
9910
9911 /* The GNU C library defines this for functions which it implements
9912     to always fail with ENOSYS.  Some functions are actually named
9913     something starting with __ and the normal name is an alias.  */
9914 #if defined (__stub_openlog) || defined (__stub___openlog)
9915 choke me
9916 #else
9917 f = openlog;
9918 #endif
9919
9920 ; return 0; }
9921 EOF
9922 if { (eval echo configure:9923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9923   rm -rf conftest*
9924   eval "ac_cv_func_openlog=yes"
9925 else
9926   echo "configure: failed program was:" >&5
9927   cat conftest.$ac_ext >&5
9928   rm -rf conftest*
9929   eval "ac_cv_func_openlog=no"
9930 fi
9931 rm -f conftest*
9932 fi
9933
9934 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
9935   echo "$ac_t""yes" 1>&6
9936   :
9937 else
9938   echo "$ac_t""no" 1>&6
9939 fi
9940
9941         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
9942                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
9943         fi
9944         ol_enable_syslog=$ac_cv_func_openlog
9945 fi
9946
9947 if test $ol_enable_dmalloc != no ; then
9948         for ac_hdr in dmalloc.h
9949 do
9950 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9951 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9952 echo "configure:9953: checking for $ac_hdr" >&5
9953 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9954   echo $ac_n "(cached) $ac_c" 1>&6
9955 else
9956   cat > conftest.$ac_ext <<EOF
9957 #line 9958 "configure"
9958 #include "confdefs.h"
9959 #include <$ac_hdr>
9960 EOF
9961 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9962 { (eval echo configure:9963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9963 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9964 if test -z "$ac_err"; then
9965   rm -rf conftest*
9966   eval "ac_cv_header_$ac_safe=yes"
9967 else
9968   echo "$ac_err" >&5
9969   echo "configure: failed program was:" >&5
9970   cat conftest.$ac_ext >&5
9971   rm -rf conftest*
9972   eval "ac_cv_header_$ac_safe=no"
9973 fi
9974 rm -f conftest*
9975 fi
9976 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9977   echo "$ac_t""yes" 1>&6
9978     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9979   cat >> confdefs.h <<EOF
9980 #define $ac_tr_hdr 1
9981 EOF
9982  
9983 else
9984   echo "$ac_t""no" 1>&6
9985 fi
9986 done
9987
9988         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
9989 echo "configure:9990: checking for dmalloc_shutdown in -ldmalloc" >&5
9990 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
9991 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9992   echo $ac_n "(cached) $ac_c" 1>&6
9993 else
9994   ac_save_LIBS="$LIBS"
9995 LIBS="-ldmalloc  $LIBS"
9996 cat > conftest.$ac_ext <<EOF
9997 #line 9998 "configure"
9998 #include "confdefs.h"
9999 /* Override any gcc2 internal prototype to avoid an error.  */
10000 /* We use char because int might match the return type of a gcc2
10001     builtin and then its argument prototype would still apply.  */
10002 char dmalloc_shutdown();
10003
10004 int main() {
10005 dmalloc_shutdown()
10006 ; return 0; }
10007 EOF
10008 if { (eval echo configure:10009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10009   rm -rf conftest*
10010   eval "ac_cv_lib_$ac_lib_var=yes"
10011 else
10012   echo "configure: failed program was:" >&5
10013   cat conftest.$ac_ext >&5
10014   rm -rf conftest*
10015   eval "ac_cv_lib_$ac_lib_var=no"
10016 fi
10017 rm -f conftest*
10018 LIBS="$ac_save_LIBS"
10019
10020 fi
10021 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10022   echo "$ac_t""yes" 1>&6
10023     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10024     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10025   cat >> confdefs.h <<EOF
10026 #define $ac_tr_lib 1
10027 EOF
10028
10029   LIBS="-ldmalloc $LIBS"
10030
10031 else
10032   echo "$ac_t""no" 1>&6
10033 fi
10034
10035 fi
10036
10037 if test $ol_enable_tcl != no ; then
10038         for ac_hdr in tcl.h
10039 do
10040 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10041 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10042 echo "configure:10043: checking for $ac_hdr" >&5
10043 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10044   echo $ac_n "(cached) $ac_c" 1>&6
10045 else
10046   cat > conftest.$ac_ext <<EOF
10047 #line 10048 "configure"
10048 #include "confdefs.h"
10049 #include <$ac_hdr>
10050 EOF
10051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10052 { (eval echo configure:10053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10053 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10054 if test -z "$ac_err"; then
10055   rm -rf conftest*
10056   eval "ac_cv_header_$ac_safe=yes"
10057 else
10058   echo "$ac_err" >&5
10059   echo "configure: failed program was:" >&5
10060   cat conftest.$ac_ext >&5
10061   rm -rf conftest*
10062   eval "ac_cv_header_$ac_safe=no"
10063 fi
10064 rm -f conftest*
10065 fi
10066 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10067   echo "$ac_t""yes" 1>&6
10068     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10069   cat >> confdefs.h <<EOF
10070 #define $ac_tr_hdr 1
10071 EOF
10072  
10073 else
10074   echo "$ac_t""no" 1>&6
10075 fi
10076 done
10077
10078
10079         if test $ac_cv_header_tcl_h != yes ; then
10080                 have_tcl=no
10081         else
10082                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
10083 echo "configure:10084: checking for main in -ltcl" >&5
10084 ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
10085 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10086   echo $ac_n "(cached) $ac_c" 1>&6
10087 else
10088   ac_save_LIBS="$LIBS"
10089 LIBS="-ltcl  $LIBS"
10090 cat > conftest.$ac_ext <<EOF
10091 #line 10092 "configure"
10092 #include "confdefs.h"
10093
10094 int main() {
10095 main()
10096 ; return 0; }
10097 EOF
10098 if { (eval echo configure:10099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10099   rm -rf conftest*
10100   eval "ac_cv_lib_$ac_lib_var=yes"
10101 else
10102   echo "configure: failed program was:" >&5
10103   cat conftest.$ac_ext >&5
10104   rm -rf conftest*
10105   eval "ac_cv_lib_$ac_lib_var=no"
10106 fi
10107 rm -f conftest*
10108 LIBS="$ac_save_LIBS"
10109
10110 fi
10111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10112   echo "$ac_t""yes" 1>&6
10113   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
10114 else
10115   echo "$ac_t""no" 1>&6
10116 have_tcl=no
10117 fi
10118
10119
10120                 if test $have_tcl != yes; then
10121                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
10122 echo "configure:10123: checking for main in -ltcl7.6" >&5
10123 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
10124 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10125   echo $ac_n "(cached) $ac_c" 1>&6
10126 else
10127   ac_save_LIBS="$LIBS"
10128 LIBS="-ltcl7.6  $LIBS"
10129 cat > conftest.$ac_ext <<EOF
10130 #line 10131 "configure"
10131 #include "confdefs.h"
10132
10133 int main() {
10134 main()
10135 ; return 0; }
10136 EOF
10137 if { (eval echo configure:10138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10138   rm -rf conftest*
10139   eval "ac_cv_lib_$ac_lib_var=yes"
10140 else
10141   echo "configure: failed program was:" >&5
10142   cat conftest.$ac_ext >&5
10143   rm -rf conftest*
10144   eval "ac_cv_lib_$ac_lib_var=no"
10145 fi
10146 rm -f conftest*
10147 LIBS="$ac_save_LIBS"
10148
10149 fi
10150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10151   echo "$ac_t""yes" 1>&6
10152   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
10153 else
10154   echo "$ac_t""no" 1>&6
10155 have_tcl=no
10156 fi
10157
10158                 fi
10159
10160                 if test $have_tcl != yes; then
10161                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
10162 echo "configure:10163: checking for main in -ltcl8.0" >&5
10163 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
10164 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10165   echo $ac_n "(cached) $ac_c" 1>&6
10166 else
10167   ac_save_LIBS="$LIBS"
10168 LIBS="-ltcl8.0  $LIBS"
10169 cat > conftest.$ac_ext <<EOF
10170 #line 10171 "configure"
10171 #include "confdefs.h"
10172
10173 int main() {
10174 main()
10175 ; return 0; }
10176 EOF
10177 if { (eval echo configure:10178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10178   rm -rf conftest*
10179   eval "ac_cv_lib_$ac_lib_var=yes"
10180 else
10181   echo "configure: failed program was:" >&5
10182   cat conftest.$ac_ext >&5
10183   rm -rf conftest*
10184   eval "ac_cv_lib_$ac_lib_var=no"
10185 fi
10186 rm -f conftest*
10187 LIBS="$ac_save_LIBS"
10188
10189 fi
10190 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10191   echo "$ac_t""yes" 1>&6
10192   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
10193 else
10194   echo "$ac_t""no" 1>&6
10195 have_tcl=no
10196 fi
10197
10198                 fi
10199         fi
10200
10201         if test $have_tcl != yes ; then
10202                 echo "configure: warning: could not find -ltcl" 1>&2
10203                 if test $ol_enable_tcl = yes ; then
10204                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
10205                 fi
10206
10207                 ol_enable_tcl=no
10208         fi
10209 fi
10210
10211 # ud needs termcap (should insert check here)
10212 ol_link_termcap=no
10213 for ac_hdr in termcap.h ncurses.h
10214 do
10215 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10216 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10217 echo "configure:10218: checking for $ac_hdr" >&5
10218 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10219   echo $ac_n "(cached) $ac_c" 1>&6
10220 else
10221   cat > conftest.$ac_ext <<EOF
10222 #line 10223 "configure"
10223 #include "confdefs.h"
10224 #include <$ac_hdr>
10225 EOF
10226 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10227 { (eval echo configure:10228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10228 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10229 if test -z "$ac_err"; then
10230   rm -rf conftest*
10231   eval "ac_cv_header_$ac_safe=yes"
10232 else
10233   echo "$ac_err" >&5
10234   echo "configure: failed program was:" >&5
10235   cat conftest.$ac_ext >&5
10236   rm -rf conftest*
10237   eval "ac_cv_header_$ac_safe=no"
10238 fi
10239 rm -f conftest*
10240 fi
10241 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10242   echo "$ac_t""yes" 1>&6
10243     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10244   cat >> confdefs.h <<EOF
10245 #define $ac_tr_hdr 1
10246 EOF
10247  
10248 else
10249   echo "$ac_t""no" 1>&6
10250 fi
10251 done
10252
10253
10254 if test $ol_link_termcap = no ; then
10255         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
10256 echo "configure:10257: checking for tputs in -ltermcap" >&5
10257 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
10258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10259   echo $ac_n "(cached) $ac_c" 1>&6
10260 else
10261   ac_save_LIBS="$LIBS"
10262 LIBS="-ltermcap  $LIBS"
10263 cat > conftest.$ac_ext <<EOF
10264 #line 10265 "configure"
10265 #include "confdefs.h"
10266 /* Override any gcc2 internal prototype to avoid an error.  */
10267 /* We use char because int might match the return type of a gcc2
10268     builtin and then its argument prototype would still apply.  */
10269 char tputs();
10270
10271 int main() {
10272 tputs()
10273 ; return 0; }
10274 EOF
10275 if { (eval echo configure:10276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10276   rm -rf conftest*
10277   eval "ac_cv_lib_$ac_lib_var=yes"
10278 else
10279   echo "configure: failed program was:" >&5
10280   cat conftest.$ac_ext >&5
10281   rm -rf conftest*
10282   eval "ac_cv_lib_$ac_lib_var=no"
10283 fi
10284 rm -f conftest*
10285 LIBS="$ac_save_LIBS"
10286
10287 fi
10288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10289   echo "$ac_t""yes" 1>&6
10290   have_termcap=yes
10291 else
10292   echo "$ac_t""no" 1>&6
10293 have_termcap=no
10294 fi
10295
10296         if test $have_termcap = yes ; then
10297                 cat >> confdefs.h <<\EOF
10298 #define HAVE_TERMCAP 1
10299 EOF
10300
10301                 ol_link_termcap=yes
10302                 TERMCAP_LIBS=-ltermcap
10303         fi
10304 fi
10305
10306 if test $ol_link_termcap = no ; then
10307         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
10308 echo "configure:10309: checking for initscr in -lncurses" >&5
10309 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
10310 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10311   echo $ac_n "(cached) $ac_c" 1>&6
10312 else
10313   ac_save_LIBS="$LIBS"
10314 LIBS="-lncurses  $LIBS"
10315 cat > conftest.$ac_ext <<EOF
10316 #line 10317 "configure"
10317 #include "confdefs.h"
10318 /* Override any gcc2 internal prototype to avoid an error.  */
10319 /* We use char because int might match the return type of a gcc2
10320     builtin and then its argument prototype would still apply.  */
10321 char initscr();
10322
10323 int main() {
10324 initscr()
10325 ; return 0; }
10326 EOF
10327 if { (eval echo configure:10328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10328   rm -rf conftest*
10329   eval "ac_cv_lib_$ac_lib_var=yes"
10330 else
10331   echo "configure: failed program was:" >&5
10332   cat conftest.$ac_ext >&5
10333   rm -rf conftest*
10334   eval "ac_cv_lib_$ac_lib_var=no"
10335 fi
10336 rm -f conftest*
10337 LIBS="$ac_save_LIBS"
10338
10339 fi
10340 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10341   echo "$ac_t""yes" 1>&6
10342   have_ncurses=yes
10343 else
10344   echo "$ac_t""no" 1>&6
10345 have_ncurses=no
10346 fi
10347
10348         if test $have_ncurses = yes ; then
10349                 cat >> confdefs.h <<\EOF
10350 #define HAVE_NCURSES 1
10351 EOF
10352
10353                 ol_link_termcap=yes
10354                 TERMCAP_LIBS=-lncurses
10355         fi
10356 fi
10357
10358 if test $ol_link_termcap = no ; then
10359         cat >> confdefs.h <<\EOF
10360 #define NO_TERMCAP 1
10361 EOF
10362
10363         TERMCAP_LIBS=
10364 fi
10365
10366 ol_link_readline=no
10367 if test $ol_with_readline != no ; then
10368         for ac_hdr in readline/readline.h readline/history.h
10369 do
10370 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10371 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10372 echo "configure:10373: checking for $ac_hdr" >&5
10373 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10374   echo $ac_n "(cached) $ac_c" 1>&6
10375 else
10376   cat > conftest.$ac_ext <<EOF
10377 #line 10378 "configure"
10378 #include "confdefs.h"
10379 #include <$ac_hdr>
10380 EOF
10381 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10382 { (eval echo configure:10383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10383 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10384 if test -z "$ac_err"; then
10385   rm -rf conftest*
10386   eval "ac_cv_header_$ac_safe=yes"
10387 else
10388   echo "$ac_err" >&5
10389   echo "configure: failed program was:" >&5
10390   cat conftest.$ac_ext >&5
10391   rm -rf conftest*
10392   eval "ac_cv_header_$ac_safe=no"
10393 fi
10394 rm -f conftest*
10395 fi
10396 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10397   echo "$ac_t""yes" 1>&6
10398     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10399   cat >> confdefs.h <<EOF
10400 #define $ac_tr_hdr 1
10401 EOF
10402  
10403 else
10404   echo "$ac_t""no" 1>&6
10405 fi
10406 done
10407
10408
10409         if test $ac_cv_header_readline_readline_h = yes ; then
10410                 save_LIBS="$LIBS"
10411                 LIBS="$TERMCAP_LIBS $LIBS"
10412                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
10413 echo "configure:10414: checking for readline in -lreadline" >&5
10414 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
10415 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10416   echo $ac_n "(cached) $ac_c" 1>&6
10417 else
10418   ac_save_LIBS="$LIBS"
10419 LIBS="-lreadline  $LIBS"
10420 cat > conftest.$ac_ext <<EOF
10421 #line 10422 "configure"
10422 #include "confdefs.h"
10423 /* Override any gcc2 internal prototype to avoid an error.  */
10424 /* We use char because int might match the return type of a gcc2
10425     builtin and then its argument prototype would still apply.  */
10426 char readline();
10427
10428 int main() {
10429 readline()
10430 ; return 0; }
10431 EOF
10432 if { (eval echo configure:10433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10433   rm -rf conftest*
10434   eval "ac_cv_lib_$ac_lib_var=yes"
10435 else
10436   echo "configure: failed program was:" >&5
10437   cat conftest.$ac_ext >&5
10438   rm -rf conftest*
10439   eval "ac_cv_lib_$ac_lib_var=no"
10440 fi
10441 rm -f conftest*
10442 LIBS="$ac_save_LIBS"
10443
10444 fi
10445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10446   echo "$ac_t""yes" 1>&6
10447   have_readline=yes
10448 else
10449   echo "$ac_t""no" 1>&6
10450 have_readline=no
10451 fi
10452
10453                 LIBS="$save_LIBS"
10454                         
10455                 if test $have_readline = yes ; then
10456                         ol_with_readline=found
10457                         ol_link_readline=yes
10458
10459                         READLINE_LIBS="-lreadline"
10460                 fi
10461         fi
10462 fi
10463
10464 if test $ol_link_readline = yes ; then
10465         cat >> confdefs.h <<\EOF
10466 #define HAVE_READLINE 1
10467 EOF
10468
10469 fi
10470
10471
10472 # FreeBSD (and others) have crypt(3) in -lcrypt
10473 if test $ol_enable_crypt != no ; then
10474         echo $ac_n "checking for crypt""... $ac_c" 1>&6
10475 echo "configure:10476: checking for crypt" >&5
10476 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
10477   echo $ac_n "(cached) $ac_c" 1>&6
10478 else
10479   cat > conftest.$ac_ext <<EOF
10480 #line 10481 "configure"
10481 #include "confdefs.h"
10482 /* System header to define __stub macros and hopefully few prototypes,
10483     which can conflict with char crypt(); below.  */
10484 #include <assert.h>
10485 /* Override any gcc2 internal prototype to avoid an error.  */
10486 /* We use char because int might match the return type of a gcc2
10487     builtin and then its argument prototype would still apply.  */
10488 char crypt();
10489 char (*f)();
10490
10491 int main() {
10492
10493 /* The GNU C library defines this for functions which it implements
10494     to always fail with ENOSYS.  Some functions are actually named
10495     something starting with __ and the normal name is an alias.  */
10496 #if defined (__stub_crypt) || defined (__stub___crypt)
10497 choke me
10498 #else
10499 f = crypt;
10500 #endif
10501
10502 ; return 0; }
10503 EOF
10504 if { (eval echo configure:10505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10505   rm -rf conftest*
10506   eval "ac_cv_func_crypt=yes"
10507 else
10508   echo "configure: failed program was:" >&5
10509   cat conftest.$ac_ext >&5
10510   rm -rf conftest*
10511   eval "ac_cv_func_crypt=no"
10512 fi
10513 rm -f conftest*
10514 fi
10515
10516 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
10517   echo "$ac_t""yes" 1>&6
10518   have_crypt=yes
10519 else
10520   echo "$ac_t""no" 1>&6
10521
10522                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
10523 echo "configure:10524: checking for crypt in -lcrypt" >&5
10524 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
10525 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10526   echo $ac_n "(cached) $ac_c" 1>&6
10527 else
10528   ac_save_LIBS="$LIBS"
10529 LIBS="-lcrypt  $LIBS"
10530 cat > conftest.$ac_ext <<EOF
10531 #line 10532 "configure"
10532 #include "confdefs.h"
10533 /* Override any gcc2 internal prototype to avoid an error.  */
10534 /* We use char because int might match the return type of a gcc2
10535     builtin and then its argument prototype would still apply.  */
10536 char crypt();
10537
10538 int main() {
10539 crypt()
10540 ; return 0; }
10541 EOF
10542 if { (eval echo configure:10543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10543   rm -rf conftest*
10544   eval "ac_cv_lib_$ac_lib_var=yes"
10545 else
10546   echo "configure: failed program was:" >&5
10547   cat conftest.$ac_ext >&5
10548   rm -rf conftest*
10549   eval "ac_cv_lib_$ac_lib_var=no"
10550 fi
10551 rm -f conftest*
10552 LIBS="$ac_save_LIBS"
10553
10554 fi
10555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10556   echo "$ac_t""yes" 1>&6
10557   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
10558                         have_crypt=yes
10559 else
10560   echo "$ac_t""no" 1>&6
10561 have_crypt=no
10562 fi
10563
10564 fi
10565
10566
10567         if test $have_crypt = yes ; then
10568                 cat >> confdefs.h <<\EOF
10569 #define HAVE_CRYPT 1
10570 EOF
10571
10572         else
10573                 echo "configure: warning: could not find crypt" 1>&2
10574                 if test $ol_enable_crypt = yes ; then
10575                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
10576                 fi
10577
10578                 echo "configure: warning: disabling crypt support" 1>&2
10579                 ol_enable_crypt=no
10580         fi
10581 fi
10582
10583 # FreeBSD (and others) have setproctitle(3) in -lutil
10584 if test $ol_enable_proctitle != no ; then
10585         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
10586 echo "configure:10587: checking for setproctitle" >&5
10587 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
10588   echo $ac_n "(cached) $ac_c" 1>&6
10589 else
10590   cat > conftest.$ac_ext <<EOF
10591 #line 10592 "configure"
10592 #include "confdefs.h"
10593 /* System header to define __stub macros and hopefully few prototypes,
10594     which can conflict with char setproctitle(); below.  */
10595 #include <assert.h>
10596 /* Override any gcc2 internal prototype to avoid an error.  */
10597 /* We use char because int might match the return type of a gcc2
10598     builtin and then its argument prototype would still apply.  */
10599 char setproctitle();
10600 char (*f)();
10601
10602 int main() {
10603
10604 /* The GNU C library defines this for functions which it implements
10605     to always fail with ENOSYS.  Some functions are actually named
10606     something starting with __ and the normal name is an alias.  */
10607 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
10608 choke me
10609 #else
10610 f = setproctitle;
10611 #endif
10612
10613 ; return 0; }
10614 EOF
10615 if { (eval echo configure:10616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10616   rm -rf conftest*
10617   eval "ac_cv_func_setproctitle=yes"
10618 else
10619   echo "configure: failed program was:" >&5
10620   cat conftest.$ac_ext >&5
10621   rm -rf conftest*
10622   eval "ac_cv_func_setproctitle=no"
10623 fi
10624 rm -f conftest*
10625 fi
10626
10627 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
10628   echo "$ac_t""yes" 1>&6
10629   have_setproctitle=yes
10630 else
10631   echo "$ac_t""no" 1>&6
10632
10633                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
10634 echo "configure:10635: checking for setproctitle in -lutil" >&5
10635 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
10636 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10637   echo $ac_n "(cached) $ac_c" 1>&6
10638 else
10639   ac_save_LIBS="$LIBS"
10640 LIBS="-lutil  $LIBS"
10641 cat > conftest.$ac_ext <<EOF
10642 #line 10643 "configure"
10643 #include "confdefs.h"
10644 /* Override any gcc2 internal prototype to avoid an error.  */
10645 /* We use char because int might match the return type of a gcc2
10646     builtin and then its argument prototype would still apply.  */
10647 char setproctitle();
10648
10649 int main() {
10650 setproctitle()
10651 ; return 0; }
10652 EOF
10653 if { (eval echo configure:10654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10654   rm -rf conftest*
10655   eval "ac_cv_lib_$ac_lib_var=yes"
10656 else
10657   echo "configure: failed program was:" >&5
10658   cat conftest.$ac_ext >&5
10659   rm -rf conftest*
10660   eval "ac_cv_lib_$ac_lib_var=no"
10661 fi
10662 rm -f conftest*
10663 LIBS="$ac_save_LIBS"
10664
10665 fi
10666 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10667   echo "$ac_t""yes" 1>&6
10668   have_setproctitle=yes
10669                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
10670 else
10671   echo "$ac_t""no" 1>&6
10672 have_setproctitle=no
10673                         LIBOBJS="$LIBOBJS setproctitle.o"
10674 fi
10675
10676 fi
10677
10678
10679         if test $have_setproctitle = yes ; then
10680                 cat >> confdefs.h <<\EOF
10681 #define HAVE_SETPROCTITLE 1
10682 EOF
10683
10684         fi
10685 fi
10686
10687 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
10688 echo "configure:10689: checking for uid_t in sys/types.h" >&5
10689 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
10690   echo $ac_n "(cached) $ac_c" 1>&6
10691 else
10692   cat > conftest.$ac_ext <<EOF
10693 #line 10694 "configure"
10694 #include "confdefs.h"
10695 #include <sys/types.h>
10696 EOF
10697 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10698   egrep "uid_t" >/dev/null 2>&1; then
10699   rm -rf conftest*
10700   ac_cv_type_uid_t=yes
10701 else
10702   rm -rf conftest*
10703   ac_cv_type_uid_t=no
10704 fi
10705 rm -f conftest*
10706
10707 fi
10708
10709 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10710 if test $ac_cv_type_uid_t = no; then
10711   cat >> confdefs.h <<\EOF
10712 #define uid_t int
10713 EOF
10714
10715   cat >> confdefs.h <<\EOF
10716 #define gid_t int
10717 EOF
10718
10719 fi
10720
10721 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10722 echo "configure:10723: checking type of array argument to getgroups" >&5
10723 if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
10724   echo $ac_n "(cached) $ac_c" 1>&6
10725 else
10726   if test "$cross_compiling" = yes; then
10727   ac_cv_type_getgroups=cross
10728 else
10729   cat > conftest.$ac_ext <<EOF
10730 #line 10731 "configure"
10731 #include "confdefs.h"
10732
10733 /* Thanks to Mike Rendell for this test.  */
10734 #include <sys/types.h>
10735 #define NGID 256
10736 #undef MAX
10737 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10738 main()
10739 {
10740   gid_t gidset[NGID];
10741   int i, n;
10742   union { gid_t gval; long lval; }  val;
10743
10744   val.lval = -1;
10745   for (i = 0; i < NGID; i++)
10746     gidset[i] = val.gval;
10747   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10748                  gidset);
10749   /* Exit non-zero if getgroups seems to require an array of ints.  This
10750      happens when gid_t is short but getgroups modifies an array of ints.  */
10751   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10752 }
10753
10754 EOF
10755 if { (eval echo configure:10756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10756 then
10757     ac_cv_type_getgroups=gid_t
10758 else
10759   echo "configure: failed program was:" >&5
10760   cat conftest.$ac_ext >&5
10761   rm -fr conftest*
10762   ac_cv_type_getgroups=int
10763 fi
10764 rm -fr conftest*
10765 fi
10766
10767 if test $ac_cv_type_getgroups = cross; then
10768         cat > conftest.$ac_ext <<EOF
10769 #line 10770 "configure"
10770 #include "confdefs.h"
10771 #include <unistd.h>
10772 EOF
10773 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10774   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10775   rm -rf conftest*
10776   ac_cv_type_getgroups=gid_t
10777 else
10778   rm -rf conftest*
10779   ac_cv_type_getgroups=int
10780 fi
10781 rm -f conftest*
10782
10783 fi
10784 fi
10785
10786 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10787 cat >> confdefs.h <<EOF
10788 #define GETGROUPS_T $ac_cv_type_getgroups
10789 EOF
10790
10791  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10792 echo "configure:10793: checking for ANSI C header files" >&5
10793 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
10794   echo $ac_n "(cached) $ac_c" 1>&6
10795 else
10796   cat > conftest.$ac_ext <<EOF
10797 #line 10798 "configure"
10798 #include "confdefs.h"
10799 #include <stdlib.h>
10800 #include <stdarg.h>
10801 #include <string.h>
10802 #include <float.h>
10803 EOF
10804 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10805 { (eval echo configure:10806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10806 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10807 if test -z "$ac_err"; then
10808   rm -rf conftest*
10809   ac_cv_header_stdc=yes
10810 else
10811   echo "$ac_err" >&5
10812   echo "configure: failed program was:" >&5
10813   cat conftest.$ac_ext >&5
10814   rm -rf conftest*
10815   ac_cv_header_stdc=no
10816 fi
10817 rm -f conftest*
10818
10819 if test $ac_cv_header_stdc = yes; then
10820   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10821 cat > conftest.$ac_ext <<EOF
10822 #line 10823 "configure"
10823 #include "confdefs.h"
10824 #include <string.h>
10825 EOF
10826 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10827   egrep "memchr" >/dev/null 2>&1; then
10828   :
10829 else
10830   rm -rf conftest*
10831   ac_cv_header_stdc=no
10832 fi
10833 rm -f conftest*
10834
10835 fi
10836
10837 if test $ac_cv_header_stdc = yes; then
10838   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10839 cat > conftest.$ac_ext <<EOF
10840 #line 10841 "configure"
10841 #include "confdefs.h"
10842 #include <stdlib.h>
10843 EOF
10844 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10845   egrep "free" >/dev/null 2>&1; then
10846   :
10847 else
10848   rm -rf conftest*
10849   ac_cv_header_stdc=no
10850 fi
10851 rm -f conftest*
10852
10853 fi
10854
10855 if test $ac_cv_header_stdc = yes; then
10856   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10857 if test "$cross_compiling" = yes; then
10858   :
10859 else
10860   cat > conftest.$ac_ext <<EOF
10861 #line 10862 "configure"
10862 #include "confdefs.h"
10863 #include <ctype.h>
10864 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10865 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10866 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10867 int main () { int i; for (i = 0; i < 256; i++)
10868 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10869 exit (0); }
10870
10871 EOF
10872 if { (eval echo configure:10873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10873 then
10874   :
10875 else
10876   echo "configure: failed program was:" >&5
10877   cat conftest.$ac_ext >&5
10878   rm -fr conftest*
10879   ac_cv_header_stdc=no
10880 fi
10881 rm -fr conftest*
10882 fi
10883
10884 fi
10885 fi
10886
10887 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10888 if test $ac_cv_header_stdc = yes; then
10889   cat >> confdefs.h <<\EOF
10890 #define STDC_HEADERS 1
10891 EOF
10892
10893 fi
10894
10895 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10896 echo "configure:10897: checking for mode_t" >&5
10897 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
10898   echo $ac_n "(cached) $ac_c" 1>&6
10899 else
10900   cat > conftest.$ac_ext <<EOF
10901 #line 10902 "configure"
10902 #include "confdefs.h"
10903 #include <sys/types.h>
10904 #if STDC_HEADERS
10905 #include <stdlib.h>
10906 #include <stddef.h>
10907 #endif
10908 EOF
10909 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10910   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10911   rm -rf conftest*
10912   eval "ac_cv_type_mode_t=yes"
10913 else
10914   rm -rf conftest*
10915   eval "ac_cv_type_mode_t=no"
10916 fi
10917 rm -f conftest*
10918
10919 fi
10920 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
10921   echo "$ac_t""yes" 1>&6
10922 else
10923   echo "$ac_t""no" 1>&6
10924   cat >> confdefs.h <<EOF
10925 #define mode_t int
10926 EOF
10927
10928 fi
10929
10930 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10931 echo "configure:10932: checking for off_t" >&5
10932 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
10933   echo $ac_n "(cached) $ac_c" 1>&6
10934 else
10935   cat > conftest.$ac_ext <<EOF
10936 #line 10937 "configure"
10937 #include "confdefs.h"
10938 #include <sys/types.h>
10939 #if STDC_HEADERS
10940 #include <stdlib.h>
10941 #include <stddef.h>
10942 #endif
10943 EOF
10944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10945   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10946   rm -rf conftest*
10947   eval "ac_cv_type_off_t=yes"
10948 else
10949   rm -rf conftest*
10950   eval "ac_cv_type_off_t=no"
10951 fi
10952 rm -f conftest*
10953
10954 fi
10955 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
10956   echo "$ac_t""yes" 1>&6
10957 else
10958   echo "$ac_t""no" 1>&6
10959   cat >> confdefs.h <<EOF
10960 #define off_t long
10961 EOF
10962
10963 fi
10964
10965 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10966 echo "configure:10967: checking for pid_t" >&5
10967 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
10968   echo $ac_n "(cached) $ac_c" 1>&6
10969 else
10970   cat > conftest.$ac_ext <<EOF
10971 #line 10972 "configure"
10972 #include "confdefs.h"
10973 #include <sys/types.h>
10974 #if STDC_HEADERS
10975 #include <stdlib.h>
10976 #include <stddef.h>
10977 #endif
10978 EOF
10979 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10980   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10981   rm -rf conftest*
10982   eval "ac_cv_type_pid_t=yes"
10983 else
10984   rm -rf conftest*
10985   eval "ac_cv_type_pid_t=no"
10986 fi
10987 rm -f conftest*
10988
10989 fi
10990 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
10991   echo "$ac_t""yes" 1>&6
10992 else
10993   echo "$ac_t""no" 1>&6
10994   cat >> confdefs.h <<EOF
10995 #define pid_t int
10996 EOF
10997
10998 fi
10999
11000 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
11001 echo "configure:11002: checking for ptrdiff_t" >&5
11002 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
11003   echo $ac_n "(cached) $ac_c" 1>&6
11004 else
11005   cat > conftest.$ac_ext <<EOF
11006 #line 11007 "configure"
11007 #include "confdefs.h"
11008 #include <stddef.h>
11009 int main() {
11010 ptrdiff_t p
11011 ; return 0; }
11012 EOF
11013 if { (eval echo configure:11014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11014   rm -rf conftest*
11015   am_cv_type_ptrdiff_t=yes
11016 else
11017   echo "configure: failed program was:" >&5
11018   cat conftest.$ac_ext >&5
11019   rm -rf conftest*
11020   am_cv_type_ptrdiff_t=no
11021 fi
11022 rm -f conftest*
11023 fi
11024
11025 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
11026    if test $am_cv_type_ptrdiff_t = yes; then
11027      cat >> confdefs.h <<\EOF
11028 #define HAVE_PTRDIFF_T 1
11029 EOF
11030
11031    fi
11032
11033 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
11034 echo "configure:11035: checking return type of signal handlers" >&5
11035 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
11036   echo $ac_n "(cached) $ac_c" 1>&6
11037 else
11038   cat > conftest.$ac_ext <<EOF
11039 #line 11040 "configure"
11040 #include "confdefs.h"
11041 #include <sys/types.h>
11042 #include <signal.h>
11043 #ifdef signal
11044 #undef signal
11045 #endif
11046 #ifdef __cplusplus
11047 extern "C" void (*signal (int, void (*)(int)))(int);
11048 #else
11049 void (*signal ()) ();
11050 #endif
11051
11052 int main() {
11053 int i;
11054 ; return 0; }
11055 EOF
11056 if { (eval echo configure:11057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11057   rm -rf conftest*
11058   ac_cv_type_signal=void
11059 else
11060   echo "configure: failed program was:" >&5
11061   cat conftest.$ac_ext >&5
11062   rm -rf conftest*
11063   ac_cv_type_signal=int
11064 fi
11065 rm -f conftest*
11066 fi
11067
11068 echo "$ac_t""$ac_cv_type_signal" 1>&6
11069 cat >> confdefs.h <<EOF
11070 #define RETSIGTYPE $ac_cv_type_signal
11071 EOF
11072
11073
11074 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
11075 echo "configure:11076: checking for sig_atomic_t" >&5
11076 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
11077   echo $ac_n "(cached) $ac_c" 1>&6
11078 else
11079   cat > conftest.$ac_ext <<EOF
11080 #line 11081 "configure"
11081 #include "confdefs.h"
11082 #include <signal.h>
11083 int main() {
11084 sig_atomic_t atomic;
11085 ; return 0; }
11086 EOF
11087 if { (eval echo configure:11088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11088   rm -rf conftest*
11089   ol_cv_type_sig_atomic_t=yes
11090 else
11091   echo "configure: failed program was:" >&5
11092   cat conftest.$ac_ext >&5
11093   rm -rf conftest*
11094   ol_cv_type_sig_atomic_t=no
11095 fi
11096 rm -f conftest*
11097 fi
11098
11099 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
11100   if test $ol_cv_type_sig_atomic_t = no; then
11101     cat >> confdefs.h <<\EOF
11102 #define sig_atomic_t int
11103 EOF
11104
11105   fi
11106  
11107 echo $ac_n "checking for size_t""... $ac_c" 1>&6
11108 echo "configure:11109: checking for size_t" >&5
11109 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
11110   echo $ac_n "(cached) $ac_c" 1>&6
11111 else
11112   cat > conftest.$ac_ext <<EOF
11113 #line 11114 "configure"
11114 #include "confdefs.h"
11115 #include <sys/types.h>
11116 #if STDC_HEADERS
11117 #include <stdlib.h>
11118 #include <stddef.h>
11119 #endif
11120 EOF
11121 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11122   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
11123   rm -rf conftest*
11124   eval "ac_cv_type_size_t=yes"
11125 else
11126   rm -rf conftest*
11127   eval "ac_cv_type_size_t=no"
11128 fi
11129 rm -f conftest*
11130
11131 fi
11132 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
11133   echo "$ac_t""yes" 1>&6
11134 else
11135   echo "$ac_t""no" 1>&6
11136   cat >> confdefs.h <<EOF
11137 #define size_t unsigned
11138 EOF
11139
11140 fi
11141
11142 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
11143 echo "configure:11144: checking for socklen_t" >&5
11144 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
11145   echo $ac_n "(cached) $ac_c" 1>&6
11146 else
11147   cat > conftest.$ac_ext <<EOF
11148 #line 11149 "configure"
11149 #include "confdefs.h"
11150
11151 #ifdef HAVE_SYS_TYPES_H
11152 #include <sys/types.h>
11153 #endif
11154 #ifdef HAVE_SYS_SOCKET_H
11155 #include <sys/socket.h>
11156 #endif
11157
11158 int main() {
11159 socklen_t len;
11160 ; return 0; }
11161 EOF
11162 if { (eval echo configure:11163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11163   rm -rf conftest*
11164   ol_cv_type_socklen_t=yes
11165 else
11166   echo "configure: failed program was:" >&5
11167   cat conftest.$ac_ext >&5
11168   rm -rf conftest*
11169   ol_cv_type_socklen_t=no
11170 fi
11171 rm -f conftest*
11172 fi
11173
11174 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
11175   if test $ol_cv_type_socklen_t = no; then
11176     cat >> confdefs.h <<\EOF
11177 #define socklen_t int
11178 EOF
11179
11180   fi
11181  
11182 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
11183 echo "configure:11184: checking for member st_blksize in aggregate type struct stat" >&5
11184 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
11185   echo $ac_n "(cached) $ac_c" 1>&6
11186 else
11187   cat > conftest.$ac_ext <<EOF
11188 #line 11189 "configure"
11189 #include "confdefs.h"
11190 #include <sys/types.h>
11191 #include <sys/stat.h>
11192 int main() {
11193 struct stat foo; foo.st_blksize;
11194 ; return 0; }
11195 EOF
11196 if { (eval echo configure:11197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11197   rm -rf conftest*
11198   ac_cv_c_struct_member_st_blksize=yes
11199 else
11200   echo "configure: failed program was:" >&5
11201   cat conftest.$ac_ext >&5
11202   rm -rf conftest*
11203   ac_cv_c_struct_member_st_blksize=no
11204 fi
11205 rm -f conftest*
11206 fi
11207
11208 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
11209 st_blksize="$ac_cv_c_struct_member_st_blksize"
11210 if test $ac_cv_c_struct_member_st_blksize = yes; then
11211   cat >> confdefs.h <<\EOF
11212 #define HAVE_ST_BLKSIZE 1
11213 EOF
11214
11215 fi
11216
11217 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
11218 echo "configure:11219: checking whether time.h and sys/time.h may both be included" >&5
11219 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
11220   echo $ac_n "(cached) $ac_c" 1>&6
11221 else
11222   cat > conftest.$ac_ext <<EOF
11223 #line 11224 "configure"
11224 #include "confdefs.h"
11225 #include <sys/types.h>
11226 #include <sys/time.h>
11227 #include <time.h>
11228 int main() {
11229 struct tm *tp;
11230 ; return 0; }
11231 EOF
11232 if { (eval echo configure:11233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11233   rm -rf conftest*
11234   ac_cv_header_time=yes
11235 else
11236   echo "configure: failed program was:" >&5
11237   cat conftest.$ac_ext >&5
11238   rm -rf conftest*
11239   ac_cv_header_time=no
11240 fi
11241 rm -f conftest*
11242 fi
11243
11244 echo "$ac_t""$ac_cv_header_time" 1>&6
11245 if test $ac_cv_header_time = yes; then
11246   cat >> confdefs.h <<\EOF
11247 #define TIME_WITH_SYS_TIME 1
11248 EOF
11249
11250 fi
11251
11252 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
11253 echo "configure:11254: checking whether struct tm is in sys/time.h or time.h" >&5
11254 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
11255   echo $ac_n "(cached) $ac_c" 1>&6
11256 else
11257   cat > conftest.$ac_ext <<EOF
11258 #line 11259 "configure"
11259 #include "confdefs.h"
11260 #include <sys/types.h>
11261 #include <time.h>
11262 int main() {
11263 struct tm *tp; tp->tm_sec;
11264 ; return 0; }
11265 EOF
11266 if { (eval echo configure:11267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11267   rm -rf conftest*
11268   ac_cv_struct_tm=time.h
11269 else
11270   echo "configure: failed program was:" >&5
11271   cat conftest.$ac_ext >&5
11272   rm -rf conftest*
11273   ac_cv_struct_tm=sys/time.h
11274 fi
11275 rm -f conftest*
11276 fi
11277
11278 echo "$ac_t""$ac_cv_struct_tm" 1>&6
11279 if test $ac_cv_struct_tm = sys/time.h; then
11280   cat >> confdefs.h <<\EOF
11281 #define TM_IN_SYS_TIME 1
11282 EOF
11283
11284 fi
11285
11286 # test for pw_gecos in struct passwd
11287 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
11288 echo "configure:11289: checking struct passwd for pw_gecos" >&5
11289 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
11290   echo $ac_n "(cached) $ac_c" 1>&6
11291 else
11292   
11293         cat > conftest.$ac_ext <<EOF
11294 #line 11295 "configure"
11295 #include "confdefs.h"
11296 #include <pwd.h>
11297 int main() {
11298
11299         struct passwd pwd;
11300         pwd.pw_gecos = pwd.pw_name;
11301
11302 ; return 0; }
11303 EOF
11304 if { (eval echo configure:11305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11305   rm -rf conftest*
11306   ol_cv_struct_passwd_pw_gecos=yes
11307 else
11308   echo "configure: failed program was:" >&5
11309   cat conftest.$ac_ext >&5
11310   rm -rf conftest*
11311   ol_cv_struct_passwd_pw_gecos=no
11312 fi
11313 rm -f conftest*
11314 fi
11315
11316 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
11317 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
11318         cat >> confdefs.h <<\EOF
11319 #define HAVE_PW_GECOS 1
11320 EOF
11321
11322 fi
11323
11324 # test for pw_passwd in struct passwd
11325 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
11326 echo "configure:11327: checking struct passwd for pw_passwd" >&5
11327 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
11328   echo $ac_n "(cached) $ac_c" 1>&6
11329 else
11330   
11331         cat > conftest.$ac_ext <<EOF
11332 #line 11333 "configure"
11333 #include "confdefs.h"
11334 #include <pwd.h>
11335 int main() {
11336
11337         struct passwd pwd;
11338         pwd.pw_passwd = pwd.pw_name;
11339
11340 ; return 0; }
11341 EOF
11342 if { (eval echo configure:11343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11343   rm -rf conftest*
11344   ol_cv_struct_passwd_pw_passwd=yes
11345 else
11346   echo "configure: failed program was:" >&5
11347   cat conftest.$ac_ext >&5
11348   rm -rf conftest*
11349   ol_cv_struct_passwd_pw_passwd=no
11350 fi
11351 rm -f conftest*
11352 fi
11353
11354 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
11355 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
11356         cat >> confdefs.h <<\EOF
11357 #define HAVE_PW_PASSWD 1
11358 EOF
11359
11360 fi
11361
11362
11363 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
11364 echo "configure:11365: checking if toupper() requires islower()" >&5
11365 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
11366   echo $ac_n "(cached) $ac_c" 1>&6
11367 else
11368   
11369         if test "$cross_compiling" = yes; then
11370   ol_cv_c_upper_lower=safe
11371 else
11372   cat > conftest.$ac_ext <<EOF
11373 #line 11374 "configure"
11374 #include "confdefs.h"
11375
11376 #include <ctype.h>
11377 main()
11378 {
11379         if ('C' == toupper('C'))
11380                 exit(0);
11381         else
11382                 exit(1);
11383 }
11384 EOF
11385 if { (eval echo configure:11386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11386 then
11387   ol_cv_c_upper_lower=no
11388 else
11389   echo "configure: failed program was:" >&5
11390   cat conftest.$ac_ext >&5
11391   rm -fr conftest*
11392   ol_cv_c_upper_lower=yes
11393 fi
11394 rm -fr conftest*
11395 fi
11396
11397 fi
11398
11399 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
11400 if test $ol_cv_c_upper_lower != no ; then
11401         cat >> confdefs.h <<\EOF
11402 #define C_UPPER_LOWER 1
11403 EOF
11404
11405 fi
11406
11407 echo $ac_n "checking for working const""... $ac_c" 1>&6
11408 echo "configure:11409: checking for working const" >&5
11409 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
11410   echo $ac_n "(cached) $ac_c" 1>&6
11411 else
11412   cat > conftest.$ac_ext <<EOF
11413 #line 11414 "configure"
11414 #include "confdefs.h"
11415
11416 int main() {
11417
11418 /* Ultrix mips cc rejects this.  */
11419 typedef int charset[2]; const charset x;
11420 /* SunOS 4.1.1 cc rejects this.  */
11421 char const *const *ccp;
11422 char **p;
11423 /* NEC SVR4.0.2 mips cc rejects this.  */
11424 struct point {int x, y;};
11425 static struct point const zero = {0,0};
11426 /* AIX XL C 1.02.0.0 rejects this.
11427    It does not let you subtract one const X* pointer from another in an arm
11428    of an if-expression whose if-part is not a constant expression */
11429 const char *g = "string";
11430 ccp = &g + (g ? g-g : 0);
11431 /* HPUX 7.0 cc rejects these. */
11432 ++ccp;
11433 p = (char**) ccp;
11434 ccp = (char const *const *) p;
11435 { /* SCO 3.2v4 cc rejects this.  */
11436   char *t;
11437   char const *s = 0 ? (char *) 0 : (char const *) 0;
11438
11439   *t++ = 0;
11440 }
11441 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11442   int x[] = {25, 17};
11443   const int *foo = &x[0];
11444   ++foo;
11445 }
11446 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11447   typedef const int *iptr;
11448   iptr p = 0;
11449   ++p;
11450 }
11451 { /* AIX XL C 1.02.0.0 rejects this saying
11452      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11453   struct s { int j; const int *ap[3]; };
11454   struct s *b; b->j = 5;
11455 }
11456 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11457   const int foo = 10;
11458 }
11459
11460 ; return 0; }
11461 EOF
11462 if { (eval echo configure:11463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11463   rm -rf conftest*
11464   ac_cv_c_const=yes
11465 else
11466   echo "configure: failed program was:" >&5
11467   cat conftest.$ac_ext >&5
11468   rm -rf conftest*
11469   ac_cv_c_const=no
11470 fi
11471 rm -f conftest*
11472 fi
11473
11474 echo "$ac_t""$ac_cv_c_const" 1>&6
11475 if test $ac_cv_c_const = no; then
11476   cat >> confdefs.h <<\EOF
11477 #define const 
11478 EOF
11479
11480 fi
11481
11482 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
11483 echo "configure:11484: checking if compiler understands volatile" >&5
11484 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
11485   echo $ac_n "(cached) $ac_c" 1>&6
11486 else
11487   cat > conftest.$ac_ext <<EOF
11488 #line 11489 "configure"
11489 #include "confdefs.h"
11490 int x, y, z;
11491 int main() {
11492 volatile int a; int * volatile b = x ? &y : &z;
11493       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
11494       *b = 0;
11495 ; return 0; }
11496 EOF
11497 if { (eval echo configure:11498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11498   rm -rf conftest*
11499   ol_cv_c_volatile=yes
11500 else
11501   echo "configure: failed program was:" >&5
11502   cat conftest.$ac_ext >&5
11503   rm -rf conftest*
11504   ol_cv_c_volatile=no
11505 fi
11506 rm -f conftest*
11507 fi
11508
11509 echo "$ac_t""$ol_cv_c_volatile" 1>&6
11510   if test $ol_cv_c_volatile = yes; then
11511     : 
11512   else
11513     cat >> confdefs.h <<\EOF
11514 #define volatile 
11515 EOF
11516
11517   fi
11518  
11519
11520 if test $cross_compiling = yes ; then
11521         cat >> confdefs.h <<\EOF
11522 #define CROSS_COMPILING 1
11523 EOF
11524
11525
11526         cat >> confdefs.h <<\EOF
11527 #define LBER_INT_T long
11528 EOF
11529
11530         cat >> confdefs.h <<\EOF
11531 #define LBER_TAG_T long
11532 EOF
11533
11534         cat >> confdefs.h <<\EOF
11535 #define LBER_SOCKET_T int
11536 EOF
11537
11538
11539 else
11540         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
11541 echo "configure:11542: checking whether byte ordering is bigendian" >&5
11542 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
11543   echo $ac_n "(cached) $ac_c" 1>&6
11544 else
11545   ac_cv_c_bigendian=unknown
11546 # See if sys/param.h defines the BYTE_ORDER macro.
11547 cat > conftest.$ac_ext <<EOF
11548 #line 11549 "configure"
11549 #include "confdefs.h"
11550 #include <sys/types.h>
11551 #include <sys/param.h>
11552 int main() {
11553
11554 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
11555  bogus endian macros
11556 #endif
11557 ; return 0; }
11558 EOF
11559 if { (eval echo configure:11560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11560   rm -rf conftest*
11561   # It does; now see whether it defined to BIG_ENDIAN or not.
11562 cat > conftest.$ac_ext <<EOF
11563 #line 11564 "configure"
11564 #include "confdefs.h"
11565 #include <sys/types.h>
11566 #include <sys/param.h>
11567 int main() {
11568
11569 #if BYTE_ORDER != BIG_ENDIAN
11570  not big endian
11571 #endif
11572 ; return 0; }
11573 EOF
11574 if { (eval echo configure:11575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11575   rm -rf conftest*
11576   ac_cv_c_bigendian=yes
11577 else
11578   echo "configure: failed program was:" >&5
11579   cat conftest.$ac_ext >&5
11580   rm -rf conftest*
11581   ac_cv_c_bigendian=no
11582 fi
11583 rm -f conftest*
11584 else
11585   echo "configure: failed program was:" >&5
11586   cat conftest.$ac_ext >&5
11587 fi
11588 rm -f conftest*
11589 if test $ac_cv_c_bigendian = unknown; then
11590 if test "$cross_compiling" = yes; then
11591     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11592 else
11593   cat > conftest.$ac_ext <<EOF
11594 #line 11595 "configure"
11595 #include "confdefs.h"
11596 main () {
11597   /* Are we little or big endian?  From Harbison&Steele.  */
11598   union
11599   {
11600     long l;
11601     char c[sizeof (long)];
11602   } u;
11603   u.l = 1;
11604   exit (u.c[sizeof (long) - 1] == 1);
11605 }
11606 EOF
11607 if { (eval echo configure:11608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11608 then
11609   ac_cv_c_bigendian=no
11610 else
11611   echo "configure: failed program was:" >&5
11612   cat conftest.$ac_ext >&5
11613   rm -fr conftest*
11614   ac_cv_c_bigendian=yes
11615 fi
11616 rm -fr conftest*
11617 fi
11618
11619 fi
11620 fi
11621
11622 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
11623 if test $ac_cv_c_bigendian = yes; then
11624   cat >> confdefs.h <<\EOF
11625 #define WORDS_BIGENDIAN 1
11626 EOF
11627
11628 fi
11629
11630         echo $ac_n "checking size of short""... $ac_c" 1>&6
11631 echo "configure:11632: checking size of short" >&5
11632 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
11633   echo $ac_n "(cached) $ac_c" 1>&6
11634 else
11635   if test "$cross_compiling" = yes; then
11636     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11637 else
11638   cat > conftest.$ac_ext <<EOF
11639 #line 11640 "configure"
11640 #include "confdefs.h"
11641 #include <stdio.h>
11642 main()
11643 {
11644   FILE *f=fopen("conftestval", "w");
11645   if (!f) exit(1);
11646   fprintf(f, "%d\n", sizeof(short));
11647   exit(0);
11648 }
11649 EOF
11650 if { (eval echo configure:11651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11651 then
11652   ac_cv_sizeof_short=`cat conftestval`
11653 else
11654   echo "configure: failed program was:" >&5
11655   cat conftest.$ac_ext >&5
11656   rm -fr conftest*
11657   ac_cv_sizeof_short=0
11658 fi
11659 rm -fr conftest*
11660 fi
11661
11662 fi
11663 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
11664 cat >> confdefs.h <<EOF
11665 #define SIZEOF_SHORT $ac_cv_sizeof_short
11666 EOF
11667
11668  
11669         echo $ac_n "checking size of int""... $ac_c" 1>&6
11670 echo "configure:11671: checking size of int" >&5
11671 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
11672   echo $ac_n "(cached) $ac_c" 1>&6
11673 else
11674   if test "$cross_compiling" = yes; then
11675     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11676 else
11677   cat > conftest.$ac_ext <<EOF
11678 #line 11679 "configure"
11679 #include "confdefs.h"
11680 #include <stdio.h>
11681 main()
11682 {
11683   FILE *f=fopen("conftestval", "w");
11684   if (!f) exit(1);
11685   fprintf(f, "%d\n", sizeof(int));
11686   exit(0);
11687 }
11688 EOF
11689 if { (eval echo configure:11690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11690 then
11691   ac_cv_sizeof_int=`cat conftestval`
11692 else
11693   echo "configure: failed program was:" >&5
11694   cat conftest.$ac_ext >&5
11695   rm -fr conftest*
11696   ac_cv_sizeof_int=0
11697 fi
11698 rm -fr conftest*
11699 fi
11700
11701 fi
11702 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
11703 cat >> confdefs.h <<EOF
11704 #define SIZEOF_INT $ac_cv_sizeof_int
11705 EOF
11706
11707  
11708         echo $ac_n "checking size of long""... $ac_c" 1>&6
11709 echo "configure:11710: checking size of long" >&5
11710 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
11711   echo $ac_n "(cached) $ac_c" 1>&6
11712 else
11713   if test "$cross_compiling" = yes; then
11714     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11715 else
11716   cat > conftest.$ac_ext <<EOF
11717 #line 11718 "configure"
11718 #include "confdefs.h"
11719 #include <stdio.h>
11720 main()
11721 {
11722   FILE *f=fopen("conftestval", "w");
11723   if (!f) exit(1);
11724   fprintf(f, "%d\n", sizeof(long));
11725   exit(0);
11726 }
11727 EOF
11728 if { (eval echo configure:11729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11729 then
11730   ac_cv_sizeof_long=`cat conftestval`
11731 else
11732   echo "configure: failed program was:" >&5
11733   cat conftest.$ac_ext >&5
11734   rm -fr conftest*
11735   ac_cv_sizeof_long=0
11736 fi
11737 rm -fr conftest*
11738 fi
11739
11740 fi
11741 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
11742 cat >> confdefs.h <<EOF
11743 #define SIZEOF_LONG $ac_cv_sizeof_long
11744 EOF
11745
11746
11747
11748         if test "$ac_cv_sizeof_int" -lt 4 ; then
11749                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
11750
11751                 cat >> confdefs.h <<\EOF
11752 #define LBER_INT_T long
11753 EOF
11754
11755                 cat >> confdefs.h <<\EOF
11756 #define LBER_TAG_T long
11757 EOF
11758
11759                 cat >> confdefs.h <<\EOF
11760 #define LBER_SOCKET_T int
11761 EOF
11762
11763         else
11764                 cat >> confdefs.h <<\EOF
11765 #define LBER_INT_T int
11766 EOF
11767
11768                 cat >> confdefs.h <<\EOF
11769 #define LBER_TAG_T long
11770 EOF
11771
11772                 cat >> confdefs.h <<\EOF
11773 #define LBER_SOCKET_T int
11774 EOF
11775
11776         fi
11777 fi
11778
11779 cat >> confdefs.h <<\EOF
11780 #define LBER_LEN_T long
11781 EOF
11782
11783
11784 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
11785 echo "configure:11786: checking for 8-bit clean memcmp" >&5
11786 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
11787   echo $ac_n "(cached) $ac_c" 1>&6
11788 else
11789   if test "$cross_compiling" = yes; then
11790   ac_cv_func_memcmp_clean=no
11791 else
11792   cat > conftest.$ac_ext <<EOF
11793 #line 11794 "configure"
11794 #include "confdefs.h"
11795
11796 main()
11797 {
11798   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
11799   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
11800 }
11801
11802 EOF
11803 if { (eval echo configure:11804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11804 then
11805   ac_cv_func_memcmp_clean=yes
11806 else
11807   echo "configure: failed program was:" >&5
11808   cat conftest.$ac_ext >&5
11809   rm -fr conftest*
11810   ac_cv_func_memcmp_clean=no
11811 fi
11812 rm -fr conftest*
11813 fi
11814
11815 fi
11816
11817 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
11818 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
11819
11820 echo $ac_n "checking for strftime""... $ac_c" 1>&6
11821 echo "configure:11822: checking for strftime" >&5
11822 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
11823   echo $ac_n "(cached) $ac_c" 1>&6
11824 else
11825   cat > conftest.$ac_ext <<EOF
11826 #line 11827 "configure"
11827 #include "confdefs.h"
11828 /* System header to define __stub macros and hopefully few prototypes,
11829     which can conflict with char strftime(); below.  */
11830 #include <assert.h>
11831 /* Override any gcc2 internal prototype to avoid an error.  */
11832 /* We use char because int might match the return type of a gcc2
11833     builtin and then its argument prototype would still apply.  */
11834 char strftime();
11835 char (*f)();
11836
11837 int main() {
11838
11839 /* The GNU C library defines this for functions which it implements
11840     to always fail with ENOSYS.  Some functions are actually named
11841     something starting with __ and the normal name is an alias.  */
11842 #if defined (__stub_strftime) || defined (__stub___strftime)
11843 choke me
11844 #else
11845 f = strftime;
11846 #endif
11847
11848 ; return 0; }
11849 EOF
11850 if { (eval echo configure:11851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11851   rm -rf conftest*
11852   eval "ac_cv_func_strftime=yes"
11853 else
11854   echo "configure: failed program was:" >&5
11855   cat conftest.$ac_ext >&5
11856   rm -rf conftest*
11857   eval "ac_cv_func_strftime=no"
11858 fi
11859 rm -f conftest*
11860 fi
11861
11862 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11863   echo "$ac_t""yes" 1>&6
11864   cat >> confdefs.h <<\EOF
11865 #define HAVE_STRFTIME 1
11866 EOF
11867
11868 else
11869   echo "$ac_t""no" 1>&6
11870 # strftime is in -lintl on SCO UNIX.
11871 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11872 echo "configure:11873: checking for strftime in -lintl" >&5
11873 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
11874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11875   echo $ac_n "(cached) $ac_c" 1>&6
11876 else
11877   ac_save_LIBS="$LIBS"
11878 LIBS="-lintl  $LIBS"
11879 cat > conftest.$ac_ext <<EOF
11880 #line 11881 "configure"
11881 #include "confdefs.h"
11882 /* Override any gcc2 internal prototype to avoid an error.  */
11883 /* We use char because int might match the return type of a gcc2
11884     builtin and then its argument prototype would still apply.  */
11885 char strftime();
11886
11887 int main() {
11888 strftime()
11889 ; return 0; }
11890 EOF
11891 if { (eval echo configure:11892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11892   rm -rf conftest*
11893   eval "ac_cv_lib_$ac_lib_var=yes"
11894 else
11895   echo "configure: failed program was:" >&5
11896   cat conftest.$ac_ext >&5
11897   rm -rf conftest*
11898   eval "ac_cv_lib_$ac_lib_var=no"
11899 fi
11900 rm -f conftest*
11901 LIBS="$ac_save_LIBS"
11902
11903 fi
11904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11905   echo "$ac_t""yes" 1>&6
11906   cat >> confdefs.h <<\EOF
11907 #define HAVE_STRFTIME 1
11908 EOF
11909
11910 LIBS="-lintl $LIBS"
11911 else
11912   echo "$ac_t""no" 1>&6
11913 fi
11914
11915 fi
11916
11917
11918 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11919 echo "configure:11920: checking for vprintf" >&5
11920 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
11921   echo $ac_n "(cached) $ac_c" 1>&6
11922 else
11923   cat > conftest.$ac_ext <<EOF
11924 #line 11925 "configure"
11925 #include "confdefs.h"
11926 /* System header to define __stub macros and hopefully few prototypes,
11927     which can conflict with char vprintf(); below.  */
11928 #include <assert.h>
11929 /* Override any gcc2 internal prototype to avoid an error.  */
11930 /* We use char because int might match the return type of a gcc2
11931     builtin and then its argument prototype would still apply.  */
11932 char vprintf();
11933 char (*f)();
11934
11935 int main() {
11936
11937 /* The GNU C library defines this for functions which it implements
11938     to always fail with ENOSYS.  Some functions are actually named
11939     something starting with __ and the normal name is an alias.  */
11940 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11941 choke me
11942 #else
11943 f = vprintf;
11944 #endif
11945
11946 ; return 0; }
11947 EOF
11948 if { (eval echo configure:11949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11949   rm -rf conftest*
11950   eval "ac_cv_func_vprintf=yes"
11951 else
11952   echo "configure: failed program was:" >&5
11953   cat conftest.$ac_ext >&5
11954   rm -rf conftest*
11955   eval "ac_cv_func_vprintf=no"
11956 fi
11957 rm -f conftest*
11958 fi
11959
11960 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11961   echo "$ac_t""yes" 1>&6
11962   cat >> confdefs.h <<\EOF
11963 #define HAVE_VPRINTF 1
11964 EOF
11965
11966 else
11967   echo "$ac_t""no" 1>&6
11968 fi
11969
11970 if test "$ac_cv_func_vprintf" != yes; then
11971 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11972 echo "configure:11973: checking for _doprnt" >&5
11973 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
11974   echo $ac_n "(cached) $ac_c" 1>&6
11975 else
11976   cat > conftest.$ac_ext <<EOF
11977 #line 11978 "configure"
11978 #include "confdefs.h"
11979 /* System header to define __stub macros and hopefully few prototypes,
11980     which can conflict with char _doprnt(); below.  */
11981 #include <assert.h>
11982 /* Override any gcc2 internal prototype to avoid an error.  */
11983 /* We use char because int might match the return type of a gcc2
11984     builtin and then its argument prototype would still apply.  */
11985 char _doprnt();
11986 char (*f)();
11987
11988 int main() {
11989
11990 /* The GNU C library defines this for functions which it implements
11991     to always fail with ENOSYS.  Some functions are actually named
11992     something starting with __ and the normal name is an alias.  */
11993 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11994 choke me
11995 #else
11996 f = _doprnt;
11997 #endif
11998
11999 ; return 0; }
12000 EOF
12001 if { (eval echo configure:12002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12002   rm -rf conftest*
12003   eval "ac_cv_func__doprnt=yes"
12004 else
12005   echo "configure: failed program was:" >&5
12006   cat conftest.$ac_ext >&5
12007   rm -rf conftest*
12008   eval "ac_cv_func__doprnt=no"
12009 fi
12010 rm -f conftest*
12011 fi
12012
12013 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
12014   echo "$ac_t""yes" 1>&6
12015   cat >> confdefs.h <<\EOF
12016 #define HAVE_DOPRNT 1
12017 EOF
12018
12019 else
12020   echo "$ac_t""no" 1>&6
12021 fi
12022
12023 fi
12024
12025
12026 if test $ac_cv_func_vprintf = yes ; then
12027                 for ac_func in vsnprintf vsprintf
12028 do
12029 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12030 echo "configure:12031: checking for $ac_func" >&5
12031 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12032   echo $ac_n "(cached) $ac_c" 1>&6
12033 else
12034   cat > conftest.$ac_ext <<EOF
12035 #line 12036 "configure"
12036 #include "confdefs.h"
12037 /* System header to define __stub macros and hopefully few prototypes,
12038     which can conflict with char $ac_func(); below.  */
12039 #include <assert.h>
12040 /* Override any gcc2 internal prototype to avoid an error.  */
12041 /* We use char because int might match the return type of a gcc2
12042     builtin and then its argument prototype would still apply.  */
12043 char $ac_func();
12044 char (*f)();
12045
12046 int main() {
12047
12048 /* The GNU C library defines this for functions which it implements
12049     to always fail with ENOSYS.  Some functions are actually named
12050     something starting with __ and the normal name is an alias.  */
12051 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12052 choke me
12053 #else
12054 f = $ac_func;
12055 #endif
12056
12057 ; return 0; }
12058 EOF
12059 if { (eval echo configure:12060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12060   rm -rf conftest*
12061   eval "ac_cv_func_$ac_func=yes"
12062 else
12063   echo "configure: failed program was:" >&5
12064   cat conftest.$ac_ext >&5
12065   rm -rf conftest*
12066   eval "ac_cv_func_$ac_func=no"
12067 fi
12068 rm -f conftest*
12069 fi
12070
12071 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12072   echo "$ac_t""yes" 1>&6
12073     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12074   cat >> confdefs.h <<EOF
12075 #define $ac_tr_func 1
12076 EOF
12077  
12078 else
12079   echo "$ac_t""no" 1>&6
12080 fi
12081 done
12082
12083 fi
12084
12085 for ac_func in \
12086         bcopy                   \
12087         closesocket             \
12088         endgrent                \
12089         endpwent                \
12090         flock                   \
12091         getdtablesize   \
12092         getgrgid                \
12093         gethostname             \
12094         getpass                 \
12095         getpwuid                \
12096         getpwnam                \
12097         getspnam                \
12098         gettimeofday    \
12099         initgroups              \
12100         lockf                   \
12101         memcpy                  \
12102         memmove                 \
12103         mkstemp                 \
12104         read                    \
12105         recv                    \
12106         recvfrom                \
12107         setpwfile               \
12108         setgid                  \
12109         setegid                 \
12110         setsid                  \
12111         setuid                  \
12112         seteuid                 \
12113         signal                  \
12114         sigset                  \
12115         snprintf                \
12116         strdup                  \
12117         strerror                \
12118         strpbrk                 \
12119         strrchr                 \
12120         strsep                  \
12121         strstr                  \
12122         strtol                  \
12123         strtoul                 \
12124         strspn                  \
12125         sysconf                 \
12126         waitpid                 \
12127         wait4                   \
12128         write                   \
12129         send                    \
12130         sendto                  \
12131
12132 do
12133 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12134 echo "configure:12135: checking for $ac_func" >&5
12135 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12136   echo $ac_n "(cached) $ac_c" 1>&6
12137 else
12138   cat > conftest.$ac_ext <<EOF
12139 #line 12140 "configure"
12140 #include "confdefs.h"
12141 /* System header to define __stub macros and hopefully few prototypes,
12142     which can conflict with char $ac_func(); below.  */
12143 #include <assert.h>
12144 /* Override any gcc2 internal prototype to avoid an error.  */
12145 /* We use char because int might match the return type of a gcc2
12146     builtin and then its argument prototype would still apply.  */
12147 char $ac_func();
12148 char (*f)();
12149
12150 int main() {
12151
12152 /* The GNU C library defines this for functions which it implements
12153     to always fail with ENOSYS.  Some functions are actually named
12154     something starting with __ and the normal name is an alias.  */
12155 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12156 choke me
12157 #else
12158 f = $ac_func;
12159 #endif
12160
12161 ; return 0; }
12162 EOF
12163 if { (eval echo configure:12164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12164   rm -rf conftest*
12165   eval "ac_cv_func_$ac_func=yes"
12166 else
12167   echo "configure: failed program was:" >&5
12168   cat conftest.$ac_ext >&5
12169   rm -rf conftest*
12170   eval "ac_cv_func_$ac_func=no"
12171 fi
12172 rm -f conftest*
12173 fi
12174
12175 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12176   echo "$ac_t""yes" 1>&6
12177     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12178   cat >> confdefs.h <<EOF
12179 #define $ac_tr_func 1
12180 EOF
12181  
12182 else
12183   echo "$ac_t""no" 1>&6
12184 fi
12185 done
12186
12187
12188 for ac_func in getopt tempnam
12189 do
12190 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12191 echo "configure:12192: checking for $ac_func" >&5
12192 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12193   echo $ac_n "(cached) $ac_c" 1>&6
12194 else
12195   cat > conftest.$ac_ext <<EOF
12196 #line 12197 "configure"
12197 #include "confdefs.h"
12198 /* System header to define __stub macros and hopefully few prototypes,
12199     which can conflict with char $ac_func(); below.  */
12200 #include <assert.h>
12201 /* Override any gcc2 internal prototype to avoid an error.  */
12202 /* We use char because int might match the return type of a gcc2
12203     builtin and then its argument prototype would still apply.  */
12204 char $ac_func();
12205 char (*f)();
12206
12207 int main() {
12208
12209 /* The GNU C library defines this for functions which it implements
12210     to always fail with ENOSYS.  Some functions are actually named
12211     something starting with __ and the normal name is an alias.  */
12212 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12213 choke me
12214 #else
12215 f = $ac_func;
12216 #endif
12217
12218 ; return 0; }
12219 EOF
12220 if { (eval echo configure:12221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12221   rm -rf conftest*
12222   eval "ac_cv_func_$ac_func=yes"
12223 else
12224   echo "configure: failed program was:" >&5
12225   cat conftest.$ac_ext >&5
12226   rm -rf conftest*
12227   eval "ac_cv_func_$ac_func=no"
12228 fi
12229 rm -f conftest*
12230 fi
12231
12232 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12233   echo "$ac_t""yes" 1>&6
12234     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12235   cat >> confdefs.h <<EOF
12236 #define $ac_tr_func 1
12237 EOF
12238  
12239 else
12240   echo "$ac_t""no" 1>&6
12241 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
12242 fi
12243 done
12244
12245
12246
12247 # Check Configuration
12248 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
12249 echo "configure:12250: checking declaration of sys_errlist" >&5
12250 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
12251   echo $ac_n "(cached) $ac_c" 1>&6
12252 else
12253   
12254         cat > conftest.$ac_ext <<EOF
12255 #line 12256 "configure"
12256 #include "confdefs.h"
12257
12258 #include <stdio.h>
12259 #include <sys/types.h>
12260 #include <errno.h> 
12261 int main() {
12262 char *c = (char *) *sys_errlist
12263 ; return 0; }
12264 EOF
12265 if { (eval echo configure:12266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12266   rm -rf conftest*
12267   ol_cv_dcl_sys_errlist=yes
12268         ol_cv_have_sys_errlist=yes
12269 else
12270   echo "configure: failed program was:" >&5
12271   cat conftest.$ac_ext >&5
12272   rm -rf conftest*
12273   ol_cv_dcl_sys_errlist=no
12274 fi
12275 rm -f conftest*
12276 fi
12277
12278 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
12279 #
12280 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
12281 if test $ol_cv_dcl_sys_errlist = no ; then
12282         cat >> confdefs.h <<\EOF
12283 #define DECL_SYS_ERRLIST 1
12284 EOF
12285
12286
12287         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
12288 echo "configure:12289: checking existence of sys_errlist" >&5
12289 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
12290   echo $ac_n "(cached) $ac_c" 1>&6
12291 else
12292   
12293                 cat > conftest.$ac_ext <<EOF
12294 #line 12295 "configure"
12295 #include "confdefs.h"
12296 #include <errno.h>
12297 int main() {
12298 char *c = (char *) *sys_errlist
12299 ; return 0; }
12300 EOF
12301 if { (eval echo configure:12302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12302   rm -rf conftest*
12303   ol_cv_have_sys_errlist=yes
12304 else
12305   echo "configure: failed program was:" >&5
12306   cat conftest.$ac_ext >&5
12307   rm -rf conftest*
12308   ol_cv_have_sys_errlist=no
12309 fi
12310 rm -f conftest*
12311 fi
12312
12313 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
12314 fi
12315 if test $ol_cv_have_sys_errlist = yes ; then
12316         cat >> confdefs.h <<\EOF
12317 #define HAVE_SYS_ERRLIST 1
12318 EOF
12319
12320 fi
12321
12322
12323
12324 if test "$ol_enable_debug" != no ; then
12325         cat >> confdefs.h <<\EOF
12326 #define LDAP_DEBUG 1
12327 EOF
12328
12329 fi
12330 if test "$ol_enable_syslog" = yes ; then
12331         cat >> confdefs.h <<\EOF
12332 #define LDAP_SYSLOG 1
12333 EOF
12334
12335 fi
12336 if test "$ol_enable_libui" = yes ; then
12337         cat >> confdefs.h <<\EOF
12338 #define LDAP_LIBUI 1
12339 EOF
12340
12341 fi
12342 if test "$ol_enable_cache" = no ; then
12343         cat >> confdefs.h <<\EOF
12344 #define LDAP_NOCACHE 1
12345 EOF
12346
12347 fi
12348 if test "$ol_enable_dns" != no ; then
12349         cat >> confdefs.h <<\EOF
12350 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
12351 EOF
12352
12353 fi
12354 if test "$ol_enable_proctitle" != no ; then
12355         cat >> confdefs.h <<\EOF
12356 #define LDAP_PROCTITLE 1
12357 EOF
12358
12359 fi
12360 if test "$ol_enable_referrals" != no ; then
12361         cat >> confdefs.h <<\EOF
12362 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
12363 EOF
12364
12365 fi
12366 if test "$ol_enable_cldap" != no ; then
12367         cat >> confdefs.h <<\EOF
12368 #define LDAP_CONNECTIONLESS 1
12369 EOF
12370
12371 fi
12372
12373 if test "$ol_enable_crypt" != no ; then
12374         cat >> confdefs.h <<\EOF
12375 #define SLAPD_CRYPT 1
12376 EOF
12377
12378 fi
12379 if test "$ol_enable_cleartext" != no ; then
12380         cat >> confdefs.h <<\EOF
12381 #define SLAPD_CLEARTEXT 1
12382 EOF
12383
12384 fi
12385 if test "$ol_enable_phonetic" != no ; then
12386         cat >> confdefs.h <<\EOF
12387 #define SLAPD_PHONETIC 1
12388 EOF
12389
12390 fi
12391 if test "$ol_enable_rlookups" != no ; then
12392         cat >> confdefs.h <<\EOF
12393 #define SLAPD_RLOOKUPS 1
12394 EOF
12395
12396 fi
12397
12398 if test "$ol_link_modules" != no ; then
12399         cat >> confdefs.h <<\EOF
12400 #define SLAPD_MODULES 1
12401 EOF
12402
12403         BUILD_SLAPD=yes
12404 fi
12405
12406 if test "$ol_link_bdb2" != no ; then
12407         cat >> confdefs.h <<\EOF
12408 #define SLAPD_BDB2 1
12409 EOF
12410
12411         BUILD_SLAPD=yes
12412         BUILD_BDB2=yes
12413         if test "$ol_with_bdb2_module" != static ; then
12414                 cat >> confdefs.h <<\EOF
12415 #define SLAPD_BDB2_DYNAMIC 1
12416 EOF
12417
12418                 BUILD_BDB2_DYNAMIC=yes
12419         fi
12420 fi
12421
12422 if test "$ol_enable_ldap" != no ; then
12423         cat >> confdefs.h <<\EOF
12424 #define SLAPD_LDAP 1
12425 EOF
12426
12427         BUILD_SLAPD=yes
12428         BUILD_LDAP=yes
12429         if test "$ol_with_ldap_module" != static ; then
12430                 cat >> confdefs.h <<\EOF
12431 #define SLAPD_LDAP_DYNAMIC 1
12432 EOF
12433
12434                 BUILD_LDAP_DYNAMIC=yes
12435         fi
12436 fi
12437
12438 if test "$ol_link_ldbm" != no ; then
12439         cat >> confdefs.h <<\EOF
12440 #define SLAPD_LDBM 1
12441 EOF
12442
12443         BUILD_SLAPD=yes
12444         BUILD_LDBM=yes
12445         if test "$ol_with_ldbm_module" != static ; then
12446                 cat >> confdefs.h <<\EOF
12447 #define SLAPD_LDBM_DYNAMIC 1
12448 EOF
12449
12450                 BUILD_LDBM_DYNAMIC=yes
12451         fi
12452 fi
12453
12454 if test "$ol_enable_passwd" != no ; then
12455         cat >> confdefs.h <<\EOF
12456 #define SLAPD_PASSWD 1
12457 EOF
12458
12459         BUILD_SLAPD=yes
12460         BUILD_PASSWD=yes
12461         if test "$ol_with_passwd_module" != static ; then
12462                 cat >> confdefs.h <<\EOF
12463 #define SLAPD_PASSWD_DYNAMIC 1
12464 EOF
12465
12466                 BUILD_PASSWD_DYNAMIC=yes
12467         fi
12468 fi
12469
12470 if test "$ol_link_perl" != no ; then
12471         cat >> confdefs.h <<\EOF
12472 #define SLAPD_PERL 1
12473 EOF
12474
12475         BUILD_SLAPD=yes
12476         BUILD_PERL=yes
12477         if test "$ol_with_perl_module" != static ; then
12478                 cat >> confdefs.h <<\EOF
12479 #define SLAPD_PERL_DYNAMIC 1
12480 EOF
12481
12482                 BUILD_PERL_DYNAMIC=yes
12483         fi
12484 fi
12485
12486 if test "$ol_enable_shell" != no ; then
12487         cat >> confdefs.h <<\EOF
12488 #define SLAPD_SHELL 1
12489 EOF
12490
12491         BUILD_SLAPD=yes
12492         BUILD_SHELL=yes
12493         if test "$ol_with_shell_module" != static ; then
12494                 cat >> confdefs.h <<\EOF
12495 #define SLAPD_SHELL_DYNAMIC 1
12496 EOF
12497
12498                 BUILD_SHELL_DYNAMIC=yes
12499         fi
12500 fi
12501
12502 if test "$ol_enable_tcl" != no ; then
12503         cat >> confdefs.h <<\EOF
12504 #define SLAPD_TCL 1
12505 EOF
12506
12507         BUILD_SLAPD=yes
12508         BUILD_TCL=yes
12509         if test "$ol_with_tcl_module" != static; then
12510                 cat >> confdefs.h <<\EOF
12511 #define SLAPD_TCL_DYNAMIC 1
12512 EOF
12513
12514                 BUILD_TCL_DYNAMIC=yes
12515         fi
12516 fi
12517
12518 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
12519         $BUILD_SLAPD = yes ; then
12520         BUILD_SLURPD=yes
12521 fi
12522
12523 if test "$ol_link_isode" != no ; then
12524         BUILD_LDAPD=yes
12525 fi
12526
12527
12528
12529
12530   
12531   
12532   
12533   
12534   
12535   
12536   
12537   
12538   
12539   
12540   
12541   
12542   
12543   
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566 trap '' 1 2 15
12567
12568 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12569
12570 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12571 # Let make expand exec_prefix.
12572 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12573
12574 # Any assignment to VPATH causes Sun make to only execute
12575 # the first set of double-colon rules, so remove it if not needed.
12576 # If there is a colon in the path, we need to keep it.
12577 if test "x$srcdir" = x.; then
12578   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12579 fi
12580
12581 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12582
12583 DEFS=-DHAVE_CONFIG_H
12584
12585 # Without the "./", some shells look in PATH for config.status.
12586 : ${CONFIG_STATUS=./config.status}
12587
12588 echo creating $CONFIG_STATUS
12589 rm -f $CONFIG_STATUS
12590 cat > $CONFIG_STATUS <<EOF
12591 #! /bin/sh
12592 # Generated automatically by configure.
12593 # Run this file to recreate the current configuration.
12594 # This directory was configured as follows,
12595 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
12596 #
12597 # $0 $ac_configure_args
12598 #
12599 # Compiler output produced by configure, useful for debugging
12600 # configure, is in ./config.log if it exists.
12601
12602 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
12603 for ac_option
12604 do
12605   case "\$ac_option" in
12606   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12607     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
12608     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
12609   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
12610     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
12611     exit 0 ;;
12612   -help | --help | --hel | --he | --h)
12613     echo "\$ac_cs_usage"; exit 0 ;;
12614   *) echo "\$ac_cs_usage"; exit 1 ;;
12615   esac
12616 done
12617
12618 ac_given_srcdir=$srcdir
12619 ac_given_INSTALL="$INSTALL"
12620
12621 trap 'rm -fr `echo "\
12622 Makefile:build/top.mk:Makefile.in:build/dir.mk \
12623 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
12624 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
12625 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
12626 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
12627 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
12628 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
12629 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
12630 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
12631 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
12632 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
12633 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
12634 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
12635 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
12636 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
12637 include/Makefile:build/top.mk:include/Makefile.in \
12638 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
12639 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
12640 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12641 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12642 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
12643 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
12644 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
12645 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
12646 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
12647 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
12648 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
12649 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
12650 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
12651 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
12652 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
12653 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
12654 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
12655 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
12656 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
12657 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
12658 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
12659 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
12660 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12661 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12662 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12663 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12664  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
12665 EOF
12666 cat >> $CONFIG_STATUS <<EOF
12667
12668 # Protect against being on the right side of a sed subst in config.status.
12669 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
12670  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
12671 $ac_vpsub
12672 $extrasub
12673 s%@SHELL@%$SHELL%g
12674 s%@CFLAGS@%$CFLAGS%g
12675 s%@CPPFLAGS@%$CPPFLAGS%g
12676 s%@CXXFLAGS@%$CXXFLAGS%g
12677 s%@FFLAGS@%$FFLAGS%g
12678 s%@DEFS@%$DEFS%g
12679 s%@LDFLAGS@%$LDFLAGS%g
12680 s%@LIBS@%$LIBS%g
12681 s%@exec_prefix@%$exec_prefix%g
12682 s%@prefix@%$prefix%g
12683 s%@program_transform_name@%$program_transform_name%g
12684 s%@bindir@%$bindir%g
12685 s%@sbindir@%$sbindir%g
12686 s%@libexecdir@%$libexecdir%g
12687 s%@datadir@%$datadir%g
12688 s%@sysconfdir@%$sysconfdir%g
12689 s%@sharedstatedir@%$sharedstatedir%g
12690 s%@localstatedir@%$localstatedir%g
12691 s%@libdir@%$libdir%g
12692 s%@includedir@%$includedir%g
12693 s%@oldincludedir@%$oldincludedir%g
12694 s%@infodir@%$infodir%g
12695 s%@mandir@%$mandir%g
12696 s%@host@%$host%g
12697 s%@host_alias@%$host_alias%g
12698 s%@host_cpu@%$host_cpu%g
12699 s%@host_vendor@%$host_vendor%g
12700 s%@host_os@%$host_os%g
12701 s%@target@%$target%g
12702 s%@target_alias@%$target_alias%g
12703 s%@target_cpu@%$target_cpu%g
12704 s%@target_vendor@%$target_vendor%g
12705 s%@target_os@%$target_os%g
12706 s%@build@%$build%g
12707 s%@build_alias@%$build_alias%g
12708 s%@build_cpu@%$build_cpu%g
12709 s%@build_vendor@%$build_vendor%g
12710 s%@build_os@%$build_os%g
12711 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
12712 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
12713 s%@INSTALL_DATA@%$INSTALL_DATA%g
12714 s%@PACKAGE@%$PACKAGE%g
12715 s%@VERSION@%$VERSION%g
12716 s%@ACLOCAL@%$ACLOCAL%g
12717 s%@AUTOCONF@%$AUTOCONF%g
12718 s%@AUTOMAKE@%$AUTOMAKE%g
12719 s%@AUTOHEADER@%$AUTOHEADER%g
12720 s%@MAKEINFO@%$MAKEINFO%g
12721 s%@install_sh@%$install_sh%g
12722 s%@AMTAR@%$AMTAR%g
12723 s%@AWK@%$AWK%g
12724 s%@AMTARFLAGS@%$AMTARFLAGS%g
12725 s%@SET_MAKE@%$SET_MAKE%g
12726 s%@top_builddir@%$top_builddir%g
12727 s%@ldap_subdir@%$ldap_subdir%g
12728 s%@CC@%$CC%g
12729 s%@RANLIB@%$RANLIB%g
12730 s%@LD@%$LD%g
12731 s%@NM@%$NM%g
12732 s%@LN_S@%$LN_S%g
12733 s%@LIBTOOL@%$LIBTOOL%g
12734 s%@LN_H@%$LN_H%g
12735 s%@SENDMAIL@%$SENDMAIL%g
12736 s%@EDITOR@%$EDITOR%g
12737 s%@FINGER@%$FINGER%g
12738 s%@PERLBIN@%$PERLBIN%g
12739 s%@CPP@%$CPP%g
12740 s%@EXEEXT@%$EXEEXT%g
12741 s%@OBJEXT@%$OBJEXT%g
12742 s%@OL_MKDEP@%$OL_MKDEP%g
12743 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
12744 s%@GLIBCONFIG@%$GLIBCONFIG%g
12745 s%@PEPSY@%$PEPSY%g
12746 s%@LIBOBJS@%$LIBOBJS%g
12747 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
12748 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
12749 s%@BUILD_BDB2@%$BUILD_BDB2%g
12750 s%@BUILD_LDAP@%$BUILD_LDAP%g
12751 s%@BUILD_LDBM@%$BUILD_LDBM%g
12752 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
12753 s%@BUILD_PERL@%$BUILD_PERL%g
12754 s%@BUILD_SHELL@%$BUILD_SHELL%g
12755 s%@BUILD_TCL@%$BUILD_TCL%g
12756 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
12757 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
12758 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
12759 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
12760 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
12761 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
12762 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
12763 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
12764 s%@LDAP_LIBS@%$LDAP_LIBS%g
12765 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
12766 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
12767 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
12768 s%@LDBM_LIBS@%$LDBM_LIBS%g
12769 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
12770 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
12771 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
12772 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
12773 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
12774 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
12775 s%@KRB_LIBS@%$KRB_LIBS%g
12776 s%@READLINE_LIBS@%$READLINE_LIBS%g
12777 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
12778 s%@TLS_LIBS@%$TLS_LIBS%g
12779
12780 CEOF
12781 EOF
12782
12783 cat >> $CONFIG_STATUS <<\EOF
12784
12785 # Split the substitutions into bite-sized pieces for seds with
12786 # small command number limits, like on Digital OSF/1 and HP-UX.
12787 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
12788 ac_file=1 # Number of current file.
12789 ac_beg=1 # First line for current file.
12790 ac_end=$ac_max_sed_cmds # Line after last line for current file.
12791 ac_more_lines=:
12792 ac_sed_cmds=""
12793 while $ac_more_lines; do
12794   if test $ac_beg -gt 1; then
12795     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
12796   else
12797     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
12798   fi
12799   if test ! -s conftest.s$ac_file; then
12800     ac_more_lines=false
12801     rm -f conftest.s$ac_file
12802   else
12803     if test -z "$ac_sed_cmds"; then
12804       ac_sed_cmds="sed -f conftest.s$ac_file"
12805     else
12806       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
12807     fi
12808     ac_file=`expr $ac_file + 1`
12809     ac_beg=$ac_end
12810     ac_end=`expr $ac_end + $ac_max_sed_cmds`
12811   fi
12812 done
12813 if test -z "$ac_sed_cmds"; then
12814   ac_sed_cmds=cat
12815 fi
12816 EOF
12817
12818 cat >> $CONFIG_STATUS <<EOF
12819
12820 CONFIG_FILES=\${CONFIG_FILES-"\
12821 Makefile:build/top.mk:Makefile.in:build/dir.mk \
12822 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
12823 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
12824 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
12825 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
12826 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
12827 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
12828 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
12829 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
12830 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
12831 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
12832 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
12833 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
12834 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
12835 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
12836 include/Makefile:build/top.mk:include/Makefile.in \
12837 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
12838 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
12839 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12840 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12841 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
12842 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
12843 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
12844 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
12845 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
12846 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
12847 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
12848 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
12849 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
12850 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
12851 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
12852 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
12853 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
12854 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
12855 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
12856 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
12857 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
12858 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
12859 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12860 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12861 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12862 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12863 "}
12864 EOF
12865 cat >> $CONFIG_STATUS <<\EOF
12866 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12867   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12868   case "$ac_file" in
12869   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12870        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12871   *) ac_file_in="${ac_file}.in" ;;
12872   esac
12873
12874   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12875
12876   # Remove last slash and all that follows it.  Not all systems have dirname.
12877   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12878   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12879     # The file is in a subdirectory.
12880     test ! -d "$ac_dir" && mkdir "$ac_dir"
12881     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12882     # A "../" for each directory in $ac_dir_suffix.
12883     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12884   else
12885     ac_dir_suffix= ac_dots=
12886   fi
12887
12888   case "$ac_given_srcdir" in
12889   .)  srcdir=.
12890       if test -z "$ac_dots"; then top_srcdir=.
12891       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12892   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12893   *) # Relative path.
12894     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12895     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12896   esac
12897
12898   case "$ac_given_INSTALL" in
12899   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12900   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12901   esac
12902
12903   echo creating "$ac_file"
12904   rm -f "$ac_file"
12905   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12906   case "$ac_file" in
12907   *Makefile*) ac_comsub="1i\\
12908 # $configure_input" ;;
12909   *) ac_comsub= ;;
12910   esac
12911
12912   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12913   sed -e "$ac_comsub
12914 s%@configure_input@%$configure_input%g
12915 s%@srcdir@%$srcdir%g
12916 s%@top_srcdir@%$top_srcdir%g
12917 s%@INSTALL@%$INSTALL%g
12918 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12919 fi; done
12920 rm -f conftest.s*
12921
12922 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12923 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12924 #
12925 # ac_d sets the value in "#define NAME VALUE" lines.
12926 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12927 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12928 ac_dC='\3'
12929 ac_dD='%g'
12930 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12931 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12932 ac_uB='\([      ]\)%\1#\2define\3'
12933 ac_uC=' '
12934 ac_uD='\4%g'
12935 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12936 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12937 ac_eB='$%\1#\2define\3'
12938 ac_eC=' '
12939 ac_eD='%g'
12940
12941 if test "${CONFIG_HEADERS+set}" != set; then
12942 EOF
12943 cat >> $CONFIG_STATUS <<EOF
12944   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
12945 EOF
12946 cat >> $CONFIG_STATUS <<\EOF
12947 fi
12948 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12949   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12950   case "$ac_file" in
12951   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12952        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12953   *) ac_file_in="${ac_file}.in" ;;
12954   esac
12955
12956   echo creating $ac_file
12957
12958   rm -f conftest.frag conftest.in conftest.out
12959   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12960   cat $ac_file_inputs > conftest.in
12961
12962 EOF
12963
12964 # Transform confdefs.h into a sed script conftest.vals that substitutes
12965 # the proper values into config.h.in to produce config.h.  And first:
12966 # Protect against being on the right side of a sed subst in config.status.
12967 # Protect against being in an unquoted here document in config.status.
12968 rm -f conftest.vals
12969 cat > conftest.hdr <<\EOF
12970 s/[\\&%]/\\&/g
12971 s%[\\$`]%\\&%g
12972 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12973 s%ac_d%ac_u%gp
12974 s%ac_u%ac_e%gp
12975 EOF
12976 sed -n -f conftest.hdr confdefs.h > conftest.vals
12977 rm -f conftest.hdr
12978
12979 # This sed command replaces #undef with comments.  This is necessary, for
12980 # example, in the case of _POSIX_SOURCE, which is predefined and required
12981 # on some systems where configure will not decide to define it.
12982 cat >> conftest.vals <<\EOF
12983 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12984 EOF
12985
12986 # Break up conftest.vals because some shells have a limit on
12987 # the size of here documents, and old seds have small limits too.
12988
12989 rm -f conftest.tail
12990 while :
12991 do
12992   ac_lines=`grep -c . conftest.vals`
12993   # grep -c gives empty output for an empty file on some AIX systems.
12994   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12995   # Write a limited-size here document to conftest.frag.
12996   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12997   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12998   echo 'CEOF
12999   sed -f conftest.frag conftest.in > conftest.out
13000   rm -f conftest.in
13001   mv conftest.out conftest.in
13002 ' >> $CONFIG_STATUS
13003   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13004   rm -f conftest.vals
13005   mv conftest.tail conftest.vals
13006 done
13007 rm -f conftest.vals
13008
13009 cat >> $CONFIG_STATUS <<\EOF
13010   rm -f conftest.frag conftest.h
13011   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
13012   cat conftest.in >> conftest.h
13013   rm -f conftest.in
13014   if cmp -s $ac_file conftest.h 2>/dev/null; then
13015     echo "$ac_file is unchanged"
13016     rm -f conftest.h
13017   else
13018     # Remove last slash and all that follows it.  Not all systems have dirname.
13019       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
13020       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13021       # The file is in a subdirectory.
13022       test ! -d "$ac_dir" && mkdir "$ac_dir"
13023     fi
13024     rm -f $ac_file
13025     mv conftest.h $ac_file
13026   fi
13027 fi; done
13028
13029 EOF
13030 cat >> $CONFIG_STATUS <<EOF
13031
13032 EOF
13033 cat >> $CONFIG_STATUS <<\EOF
13034
13035 date > stamp-h
13036 echo Please \"make depend\" to build dependencies
13037
13038 exit 0
13039 EOF
13040 chmod +x $CONFIG_STATUS
13041 rm -fr confdefs* $ac_clean_files
13042 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
13043