]> git.sur5r.net Git - openldap/blob - configure
In preparation for IETF draft ldap c-api changes, 'int' must be 32 bits
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72     --enable-ldbm       enable ldbm backend (yes)"
73 ac_help="$ac_help
74       --with-ldbm-api   use LDBM API (auto)"
75 ac_help="$ac_help
76       --with-ldbm-type  use LDBM type (auto)"
77 ac_help="$ac_help
78     --enable-passwd     enable passwd backend (no)"
79 ac_help="$ac_help
80     --enable-perl       enable perl backend (no)"
81 ac_help="$ac_help
82     --enable-shell      enable shell backend (no)"
83 ac_help="$ac_help
84     --enable-tcl        enable tcl backend (no)"
85 ac_help="$ac_help
86 SLURPD Options:"
87 ac_help="$ac_help
88   --enable-slurpd       enable building slurpd (auto)"
89 ac_help="$ac_help
90 Library Generation & Linking Options"
91 ac_help="$ac_help
92   --enable-static         build static libraries [default=yes]
93   --enable-static=PKGS    only build shared libraries if the current package
94                           appears as an element in the PKGS list"
95 ac_help="$ac_help
96   --enable-shared         build shared libraries [default=yes]
97   --enable-shared=PKGS    only build shared libraries if the current package
98                           appears as an element in the PKGS list"
99 ac_help="$ac_help
100   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
101
102 # Initialize some variables set by options.
103 # The variables have the same names as the options, with
104 # dashes changed to underlines.
105 build=NONE
106 cache_file=./config.cache
107 exec_prefix=NONE
108 host=NONE
109 no_create=
110 nonopt=NONE
111 no_recursion=
112 prefix=NONE
113 program_prefix=NONE
114 program_suffix=NONE
115 program_transform_name=s,x,x,
116 silent=
117 site=
118 srcdir=
119 target=NONE
120 verbose=
121 x_includes=NONE
122 x_libraries=NONE
123 bindir='${exec_prefix}/bin'
124 sbindir='${exec_prefix}/sbin'
125 libexecdir='${exec_prefix}/libexec'
126 datadir='${prefix}/share'
127 sysconfdir='${prefix}/etc'
128 sharedstatedir='${prefix}/com'
129 localstatedir='${prefix}/var'
130 libdir='${exec_prefix}/lib'
131 includedir='${prefix}/include'
132 oldincludedir='/usr/include'
133 infodir='${prefix}/info'
134 mandir='${prefix}/man'
135
136 # Initialize some other variables.
137 subdirs=
138 MFLAGS= MAKEFLAGS=
139 SHELL=${CONFIG_SHELL-/bin/sh}
140 # Maximum number of lines to put in a shell here document.
141 ac_max_here_lines=12
142
143 ac_prev=
144 for ac_option
145 do
146
147   # If the previous option needs an argument, assign it.
148   if test -n "$ac_prev"; then
149     eval "$ac_prev=\$ac_option"
150     ac_prev=
151     continue
152   fi
153
154   case "$ac_option" in
155   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
156   *) ac_optarg= ;;
157   esac
158
159   # Accept the important Cygnus configure options, so we can diagnose typos.
160
161   case "$ac_option" in
162
163   -bindir | --bindir | --bindi | --bind | --bin | --bi)
164     ac_prev=bindir ;;
165   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
166     bindir="$ac_optarg" ;;
167
168   -build | --build | --buil | --bui | --bu)
169     ac_prev=build ;;
170   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
171     build="$ac_optarg" ;;
172
173   -cache-file | --cache-file | --cache-fil | --cache-fi \
174   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
175     ac_prev=cache_file ;;
176   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
177   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
178     cache_file="$ac_optarg" ;;
179
180   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
181     ac_prev=datadir ;;
182   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
183   | --da=*)
184     datadir="$ac_optarg" ;;
185
186   -disable-* | --disable-*)
187     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
188     # Reject names that are not valid shell variable names.
189     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
190       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
191     fi
192     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
193     eval "enable_${ac_feature}=no" ;;
194
195   -enable-* | --enable-*)
196     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
197     # Reject names that are not valid shell variable names.
198     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
199       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
200     fi
201     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
202     case "$ac_option" in
203       *=*) ;;
204       *) ac_optarg=yes ;;
205     esac
206     eval "enable_${ac_feature}='$ac_optarg'" ;;
207
208   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
209   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
210   | --exec | --exe | --ex)
211     ac_prev=exec_prefix ;;
212   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
213   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
214   | --exec=* | --exe=* | --ex=*)
215     exec_prefix="$ac_optarg" ;;
216
217   -gas | --gas | --ga | --g)
218     # Obsolete; use --with-gas.
219     with_gas=yes ;;
220
221   -help | --help | --hel | --he)
222     # Omit some internal or obsolete options to make the list less imposing.
223     # This message is too long to be a string in the A/UX 3.1 sh.
224     cat << EOF
225 Usage: configure [options] [host]
226 Options: [defaults in brackets after descriptions]
227 Configuration:
228   --cache-file=FILE       cache test results in FILE
229   --help                  print this message
230   --no-create             do not create output files
231   --quiet, --silent       do not print \`checking...' messages
232   --version               print the version of autoconf that created configure
233 Directory and file names:
234   --prefix=PREFIX         install architecture-independent files in PREFIX
235                           [$ac_default_prefix]
236   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
237                           [same as prefix]
238   --bindir=DIR            user executables in DIR [EPREFIX/bin]
239   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
240   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
241   --datadir=DIR           read-only architecture-independent data in DIR
242                           [PREFIX/share]
243   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
244   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
245                           [PREFIX/com]
246   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
247   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
248   --includedir=DIR        C header files in DIR [PREFIX/include]
249   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
250   --infodir=DIR           info documentation in DIR [PREFIX/info]
251   --mandir=DIR            man documentation in DIR [PREFIX/man]
252   --srcdir=DIR            find the sources in DIR [configure dir or ..]
253   --program-prefix=PREFIX prepend PREFIX to installed program names
254   --program-suffix=SUFFIX append SUFFIX to installed program names
255   --program-transform-name=PROGRAM
256                           run sed PROGRAM on installed program names
257 EOF
258     cat << EOF
259 Host type:
260   --build=BUILD           configure for building on BUILD [BUILD=HOST]
261   --host=HOST             configure for HOST [guessed]
262   --target=TARGET         configure for TARGET [TARGET=HOST]
263 Features and packages:
264   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
265   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
266   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
267   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
268   --x-includes=DIR        X include files are in DIR
269   --x-libraries=DIR       X library files are in DIR
270 EOF
271     if test -n "$ac_help"; then
272       echo "--enable and --with options recognized:$ac_help"
273     fi
274     exit 0 ;;
275
276   -host | --host | --hos | --ho)
277     ac_prev=host ;;
278   -host=* | --host=* | --hos=* | --ho=*)
279     host="$ac_optarg" ;;
280
281   -includedir | --includedir | --includedi | --included | --include \
282   | --includ | --inclu | --incl | --inc)
283     ac_prev=includedir ;;
284   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
285   | --includ=* | --inclu=* | --incl=* | --inc=*)
286     includedir="$ac_optarg" ;;
287
288   -infodir | --infodir | --infodi | --infod | --info | --inf)
289     ac_prev=infodir ;;
290   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
291     infodir="$ac_optarg" ;;
292
293   -libdir | --libdir | --libdi | --libd)
294     ac_prev=libdir ;;
295   -libdir=* | --libdir=* | --libdi=* | --libd=*)
296     libdir="$ac_optarg" ;;
297
298   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
299   | --libexe | --libex | --libe)
300     ac_prev=libexecdir ;;
301   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
302   | --libexe=* | --libex=* | --libe=*)
303     libexecdir="$ac_optarg" ;;
304
305   -localstatedir | --localstatedir | --localstatedi | --localstated \
306   | --localstate | --localstat | --localsta | --localst \
307   | --locals | --local | --loca | --loc | --lo)
308     ac_prev=localstatedir ;;
309   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
310   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
311   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
312     localstatedir="$ac_optarg" ;;
313
314   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
315     ac_prev=mandir ;;
316   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
317     mandir="$ac_optarg" ;;
318
319   -nfp | --nfp | --nf)
320     # Obsolete; use --without-fp.
321     with_fp=no ;;
322
323   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
324   | --no-cr | --no-c)
325     no_create=yes ;;
326
327   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
328   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
329     no_recursion=yes ;;
330
331   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
332   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
333   | --oldin | --oldi | --old | --ol | --o)
334     ac_prev=oldincludedir ;;
335   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
336   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
337   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
338     oldincludedir="$ac_optarg" ;;
339
340   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
341     ac_prev=prefix ;;
342   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
343     prefix="$ac_optarg" ;;
344
345   -program-prefix | --program-prefix | --program-prefi | --program-pref \
346   | --program-pre | --program-pr | --program-p)
347     ac_prev=program_prefix ;;
348   -program-prefix=* | --program-prefix=* | --program-prefi=* \
349   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
350     program_prefix="$ac_optarg" ;;
351
352   -program-suffix | --program-suffix | --program-suffi | --program-suff \
353   | --program-suf | --program-su | --program-s)
354     ac_prev=program_suffix ;;
355   -program-suffix=* | --program-suffix=* | --program-suffi=* \
356   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
357     program_suffix="$ac_optarg" ;;
358
359   -program-transform-name | --program-transform-name \
360   | --program-transform-nam | --program-transform-na \
361   | --program-transform-n | --program-transform- \
362   | --program-transform | --program-transfor \
363   | --program-transfo | --program-transf \
364   | --program-trans | --program-tran \
365   | --progr-tra | --program-tr | --program-t)
366     ac_prev=program_transform_name ;;
367   -program-transform-name=* | --program-transform-name=* \
368   | --program-transform-nam=* | --program-transform-na=* \
369   | --program-transform-n=* | --program-transform-=* \
370   | --program-transform=* | --program-transfor=* \
371   | --program-transfo=* | --program-transf=* \
372   | --program-trans=* | --program-tran=* \
373   | --progr-tra=* | --program-tr=* | --program-t=*)
374     program_transform_name="$ac_optarg" ;;
375
376   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
377   | -silent | --silent | --silen | --sile | --sil)
378     silent=yes ;;
379
380   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
381     ac_prev=sbindir ;;
382   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
383   | --sbi=* | --sb=*)
384     sbindir="$ac_optarg" ;;
385
386   -sharedstatedir | --sharedstatedir | --sharedstatedi \
387   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
388   | --sharedst | --shareds | --shared | --share | --shar \
389   | --sha | --sh)
390     ac_prev=sharedstatedir ;;
391   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
392   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
393   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
394   | --sha=* | --sh=*)
395     sharedstatedir="$ac_optarg" ;;
396
397   -site | --site | --sit)
398     ac_prev=site ;;
399   -site=* | --site=* | --sit=*)
400     site="$ac_optarg" ;;
401
402   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
403     ac_prev=srcdir ;;
404   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
405     srcdir="$ac_optarg" ;;
406
407   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
408   | --syscon | --sysco | --sysc | --sys | --sy)
409     ac_prev=sysconfdir ;;
410   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
411   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
412     sysconfdir="$ac_optarg" ;;
413
414   -target | --target | --targe | --targ | --tar | --ta | --t)
415     ac_prev=target ;;
416   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
417     target="$ac_optarg" ;;
418
419   -v | -verbose | --verbose | --verbos | --verbo | --verb)
420     verbose=yes ;;
421
422   -version | --version | --versio | --versi | --vers)
423     echo "configure generated by autoconf version 2.13"
424     exit 0 ;;
425
426   -with-* | --with-*)
427     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
428     # Reject names that are not valid shell variable names.
429     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
430       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
431     fi
432     ac_package=`echo $ac_package| sed 's/-/_/g'`
433     case "$ac_option" in
434       *=*) ;;
435       *) ac_optarg=yes ;;
436     esac
437     eval "with_${ac_package}='$ac_optarg'" ;;
438
439   -without-* | --without-*)
440     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
441     # Reject names that are not valid shell variable names.
442     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
443       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
444     fi
445     ac_package=`echo $ac_package| sed 's/-/_/g'`
446     eval "with_${ac_package}=no" ;;
447
448   --x)
449     # Obsolete; use --with-x.
450     with_x=yes ;;
451
452   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
453   | --x-incl | --x-inc | --x-in | --x-i)
454     ac_prev=x_includes ;;
455   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
456   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
457     x_includes="$ac_optarg" ;;
458
459   -x-libraries | --x-libraries | --x-librarie | --x-librari \
460   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
461     ac_prev=x_libraries ;;
462   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
463   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
464     x_libraries="$ac_optarg" ;;
465
466   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
467     ;;
468
469   *)
470     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
471       echo "configure: warning: $ac_option: invalid host type" 1>&2
472     fi
473     if test "x$nonopt" != xNONE; then
474       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
475     fi
476     nonopt="$ac_option"
477     ;;
478
479   esac
480 done
481
482 if test -n "$ac_prev"; then
483   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
484 fi
485
486 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
487
488 # File descriptor usage:
489 # 0 standard input
490 # 1 file creation
491 # 2 errors and warnings
492 # 3 some systems may open it to /dev/tty
493 # 4 used on the Kubota Titan
494 # 6 checking for... messages and results
495 # 5 compiler messages saved in config.log
496 if test "$silent" = yes; then
497   exec 6>/dev/null
498 else
499   exec 6>&1
500 fi
501 exec 5>./config.log
502
503 echo "\
504 This file contains any messages produced by compilers while
505 running configure, to aid debugging if configure makes a mistake.
506 " 1>&5
507
508 # Strip out --no-create and --no-recursion so they do not pile up.
509 # Also quote any args containing shell metacharacters.
510 ac_configure_args=
511 for ac_arg
512 do
513   case "$ac_arg" in
514   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
515   | --no-cr | --no-c) ;;
516   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
517   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
518   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
519   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
520   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
521   esac
522 done
523
524 # NLS nuisances.
525 # Only set these to C if already set.  These must not be set unconditionally
526 # because not all systems understand e.g. LANG=C (notably SCO).
527 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
528 # Non-C LC_CTYPE values break the ctype check.
529 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
530 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
531 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
532 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
533
534 # confdefs.h avoids OS command line length limits that DEFS can exceed.
535 rm -rf conftest* confdefs.h
536 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
537 echo > confdefs.h
538
539 # A filename unique to this package, relative to the directory that
540 # configure is in, which we can look for to find out if srcdir is correct.
541 ac_unique_file=build/version
542
543 # Find the source files, if location was not specified.
544 if test -z "$srcdir"; then
545   ac_srcdir_defaulted=yes
546   # Try the directory containing this script, then its parent.
547   ac_prog=$0
548   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
549   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
550   srcdir=$ac_confdir
551   if test ! -r $srcdir/$ac_unique_file; then
552     srcdir=..
553   fi
554 else
555   ac_srcdir_defaulted=no
556 fi
557 if test ! -r $srcdir/$ac_unique_file; then
558   if test "$ac_srcdir_defaulted" = yes; then
559     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
560   else
561     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
562   fi
563 fi
564 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
565
566 # Prefer explicitly selected file to automatically selected ones.
567 if test -z "$CONFIG_SITE"; then
568   if test "x$prefix" != xNONE; then
569     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
570   else
571     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
572   fi
573 fi
574 for ac_site_file in $CONFIG_SITE; do
575   if test -r "$ac_site_file"; then
576     echo "loading site script $ac_site_file"
577     . "$ac_site_file"
578   fi
579 done
580
581
582 ac_ext=c
583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
584 ac_cpp='$CPP $CPPFLAGS'
585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
587 cross_compiling=$ac_cv_prog_cc_cross
588
589 ac_exeext=
590 ac_objext=o
591 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
592   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
593   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
594     ac_n= ac_c='
595 ' ac_t='        '
596   else
597     ac_n=-n ac_c= ac_t=
598   fi
599 else
600   ac_n= ac_c='\c' ac_t=
601 fi
602
603 ac_aux_dir=
604 for ac_dir in build $srcdir/build; do
605   if test -f $ac_dir/install-sh; then
606     ac_aux_dir=$ac_dir
607     ac_install_sh="$ac_aux_dir/install-sh -c"
608     break
609   elif test -f $ac_dir/install.sh; then
610     ac_aux_dir=$ac_dir
611     ac_install_sh="$ac_aux_dir/install.sh -c"
612     break
613   fi
614 done
615 if test -z "$ac_aux_dir"; then
616   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
617 fi
618 ac_config_guess=$ac_aux_dir/config.guess
619 ac_config_sub=$ac_aux_dir/config.sub
620 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
621
622 OL_VERSION=`cat $ac_aux_dir/version`
623 if test -z "$OL_VERSION"; then
624         { echo "configure: error: could not determine version" 1>&2; exit 1; }
625 fi
626
627 # Find a good install program.  We prefer a C program (faster),
628 # so one script is as good as another.  But avoid the broken or
629 # incompatible versions:
630 # SysV /etc/install, /usr/sbin/install
631 # SunOS /usr/etc/install
632 # IRIX /sbin/install
633 # AIX /bin/install
634 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
635 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
636 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
637 # ./install, which can be erroneously created by make from ./install.sh.
638 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
639 echo "configure:640: checking for a BSD compatible install" >&5
640 if test -z "$INSTALL"; then
641 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
642   echo $ac_n "(cached) $ac_c" 1>&6
643 else
644     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
645   for ac_dir in $PATH; do
646     # Account for people who put trailing slashes in PATH elements.
647     case "$ac_dir/" in
648     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
649     *)
650       # OSF1 and SCO ODT 3.0 have their own names for install.
651       # Don't use installbsd from OSF since it installs stuff as root
652       # by default.
653       for ac_prog in ginstall scoinst install; do
654         if test -f $ac_dir/$ac_prog; then
655           if test $ac_prog = install &&
656             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
657             # AIX install.  It has an incompatible calling convention.
658             :
659           else
660             ac_cv_path_install="$ac_dir/$ac_prog -c"
661             break 2
662           fi
663         fi
664       done
665       ;;
666     esac
667   done
668   IFS="$ac_save_IFS"
669
670 fi
671   if test "${ac_cv_path_install+set}" = set; then
672     INSTALL="$ac_cv_path_install"
673   else
674     # As a last resort, use the slow shell script.  We don't cache a
675     # path for INSTALL within a source directory, because that will
676     # break other packages using the cache if that directory is
677     # removed, or if the path is relative.
678     INSTALL="$ac_install_sh"
679   fi
680 fi
681 echo "$ac_t""$INSTALL" 1>&6
682
683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
684 # It thinks the first close brace ends the variable substitution.
685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
686
687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
688
689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
690
691 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
692 echo "configure:693: checking whether build environment is sane" >&5
693 # Just in case
694 sleep 1
695 echo timestamp > conftestfile
696 # Do `set' in a subshell so we don't clobber the current shell's
697 # arguments.  Must try -L first in case configure is actually a
698 # symlink; some systems play weird games with the mod time of symlinks
699 # (eg FreeBSD returns the mod time of the symlink's containing
700 # directory).
701 if (
702    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
703    if test "$*" = "X"; then
704       # -L didn't work.
705       set X `ls -t $srcdir/configure conftestfile`
706    fi
707    if test "$*" != "X $srcdir/configure conftestfile" \
708       && test "$*" != "X conftestfile $srcdir/configure"; then
709
710       # If neither matched, then we have a broken ls.  This can happen
711       # if, for instance, CONFIG_SHELL is bash and it inherits a
712       # broken ls alias from the environment.  This has actually
713       # happened.  Such a system could not be considered "sane".
714       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
715 alias in your environment" 1>&2; exit 1; }
716    fi
717
718    test "$2" = conftestfile
719    )
720 then
721    # Ok.
722    :
723 else
724    { echo "configure: error: newly created file is older than distributed files!
725 Check your system clock" 1>&2; exit 1; }
726 fi
727 rm -f conftest*
728 echo "$ac_t""yes" 1>&6
729 if test "$program_transform_name" = s,x,x,; then
730   program_transform_name=
731 else
732   # Double any \ or $.  echo might interpret backslashes.
733   cat <<\EOF_SED > conftestsed
734 s,\\,\\\\,g; s,\$,$$,g
735 EOF_SED
736   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
737   rm -f conftestsed
738 fi
739 test "$program_prefix" != NONE &&
740   program_transform_name="s,^,${program_prefix},; $program_transform_name"
741 # Use a double $ so make ignores it.
742 test "$program_suffix" != NONE &&
743   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
744
745 # sed with no file args requires a program.
746 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
747
748 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
749 echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
750 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
751 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
752   echo $ac_n "(cached) $ac_c" 1>&6
753 else
754   cat > conftestmake <<\EOF
755 all:
756         @echo 'ac_maketemp="${MAKE}"'
757 EOF
758 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
759 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
760 if test -n "$ac_maketemp"; then
761   eval ac_cv_prog_make_${ac_make}_set=yes
762 else
763   eval ac_cv_prog_make_${ac_make}_set=no
764 fi
765 rm -f conftestmake
766 fi
767 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
768   echo "$ac_t""yes" 1>&6
769   SET_MAKE=
770 else
771   echo "$ac_t""no" 1>&6
772   SET_MAKE="MAKE=${MAKE-make}"
773 fi
774
775
776 PACKAGE=OpenLDAP
777
778 VERSION=$OL_VERSION
779
780 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
781   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
782 fi
783
784
785
786 missing_dir=`cd $ac_aux_dir && pwd`
787 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
788 echo "configure:789: checking for working aclocal" >&5
789 # Run test in a subshell; some versions of sh will print an error if
790 # an executable is not found, even if stderr is redirected.
791 # Redirect stdin to placate older versions of autoconf.  Sigh.
792 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
793    ACLOCAL=aclocal
794    echo "$ac_t""found" 1>&6
795 else
796    ACLOCAL="$missing_dir/missing aclocal"
797    echo "$ac_t""missing" 1>&6
798 fi
799
800 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
801 echo "configure:802: checking for working autoconf" >&5
802 # Run test in a subshell; some versions of sh will print an error if
803 # an executable is not found, even if stderr is redirected.
804 # Redirect stdin to placate older versions of autoconf.  Sigh.
805 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
806    AUTOCONF=autoconf
807    echo "$ac_t""found" 1>&6
808 else
809    AUTOCONF="$missing_dir/missing autoconf"
810    echo "$ac_t""missing" 1>&6
811 fi
812
813 echo $ac_n "checking for working automake""... $ac_c" 1>&6
814 echo "configure:815: checking for working automake" >&5
815 # Run test in a subshell; some versions of sh will print an error if
816 # an executable is not found, even if stderr is redirected.
817 # Redirect stdin to placate older versions of autoconf.  Sigh.
818 if (automake --version) < /dev/null > /dev/null 2>&1; then
819    AUTOMAKE=automake
820    echo "$ac_t""found" 1>&6
821 else
822    AUTOMAKE="$missing_dir/missing automake"
823    echo "$ac_t""missing" 1>&6
824 fi
825
826 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
827 echo "configure:828: checking for working autoheader" >&5
828 # Run test in a subshell; some versions of sh will print an error if
829 # an executable is not found, even if stderr is redirected.
830 # Redirect stdin to placate older versions of autoconf.  Sigh.
831 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
832    AUTOHEADER=autoheader
833    echo "$ac_t""found" 1>&6
834 else
835    AUTOHEADER="$missing_dir/missing autoheader"
836    echo "$ac_t""missing" 1>&6
837 fi
838
839 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
840 echo "configure:841: checking for working makeinfo" >&5
841 # Run test in a subshell; some versions of sh will print an error if
842 # an executable is not found, even if stderr is redirected.
843 # Redirect stdin to placate older versions of autoconf.  Sigh.
844 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
845    MAKEINFO=makeinfo
846    echo "$ac_t""found" 1>&6
847 else
848    MAKEINFO="$missing_dir/missing makeinfo"
849    echo "$ac_t""missing" 1>&6
850 fi
851
852
853
854 cat >> confdefs.h <<EOF
855 #define OPENLDAP_PACKAGE "$PACKAGE"
856 EOF
857
858 cat >> confdefs.h <<EOF
859 #define OPENLDAP_VERSION "$VERSION"
860 EOF
861
862
863
864
865 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
866 echo "configure:867: checking configure arguments" >&5
867
868
869 top_builddir=`pwd`
870
871 cat >> confdefs.h <<\EOF
872 #define HAVE_MKVERSION 1
873 EOF
874
875
876 ldap_subdir="openldap"
877
878 # Check whether --with-subdir or --without-subdir was given.
879 if test "${with_subdir+set}" = set; then
880   withval="$with_subdir"
881   
882         if test "$withval" = "no"; then
883                 ldap_subdir=""
884         elif test "$withval" != "yes"; then
885                 ldap_subdir="$withval"
886         fi
887
888 fi
889
890
891 # OpenLDAP --enable-debug
892         # Check whether --enable-debug or --disable-debug was given.
893 if test "${enable_debug+set}" = set; then
894   enableval="$enable_debug"
895   
896         ol_arg=invalid
897         for ol_val in auto yes no ; do
898                 if test "$enableval" = "$ol_val" ; then
899                         ol_arg="$ol_val"
900                 fi
901         done
902         if test "$ol_arg" = "invalid" ; then
903                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
904         fi
905         ol_enable_debug="$ol_arg"
906
907 else
908         ol_enable_debug="yes"
909 fi
910 # end --enable-debug
911 # OpenLDAP --enable-syslog
912         # Check whether --enable-syslog or --disable-syslog was given.
913 if test "${enable_syslog+set}" = set; then
914   enableval="$enable_syslog"
915   
916         ol_arg=invalid
917         for ol_val in auto yes no ; do
918                 if test "$enableval" = "$ol_val" ; then
919                         ol_arg="$ol_val"
920                 fi
921         done
922         if test "$ol_arg" = "invalid" ; then
923                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
924         fi
925         ol_enable_syslog="$ol_arg"
926
927 else
928         ol_enable_syslog="auto"
929 fi
930 # end --enable-syslog
931 # OpenLDAP --enable-proctitle
932         # Check whether --enable-proctitle or --disable-proctitle was given.
933 if test "${enable_proctitle+set}" = set; then
934   enableval="$enable_proctitle"
935   
936         ol_arg=invalid
937         for ol_val in auto yes no ; do
938                 if test "$enableval" = "$ol_val" ; then
939                         ol_arg="$ol_val"
940                 fi
941         done
942         if test "$ol_arg" = "invalid" ; then
943                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
944         fi
945         ol_enable_proctitle="$ol_arg"
946
947 else
948         ol_enable_proctitle="yes"
949 fi
950 # end --enable-proctitle
951 # OpenLDAP --enable-cache
952         # Check whether --enable-cache or --disable-cache was given.
953 if test "${enable_cache+set}" = set; then
954   enableval="$enable_cache"
955   
956         ol_arg=invalid
957         for ol_val in auto yes no ; do
958                 if test "$enableval" = "$ol_val" ; then
959                         ol_arg="$ol_val"
960                 fi
961         done
962         if test "$ol_arg" = "invalid" ; then
963                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
964         fi
965         ol_enable_cache="$ol_arg"
966
967 else
968         ol_enable_cache="yes"
969 fi
970 # end --enable-cache
971 # OpenLDAP --enable-dns
972         # Check whether --enable-dns or --disable-dns was given.
973 if test "${enable_dns+set}" = set; then
974   enableval="$enable_dns"
975   
976         ol_arg=invalid
977         for ol_val in auto yes no ; do
978                 if test "$enableval" = "$ol_val" ; then
979                         ol_arg="$ol_val"
980                 fi
981         done
982         if test "$ol_arg" = "invalid" ; then
983                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
984         fi
985         ol_enable_dns="$ol_arg"
986
987 else
988         ol_enable_dns="no"
989 fi
990 # end --enable-dns
991 # OpenLDAP --enable-referrals
992         # Check whether --enable-referrals or --disable-referrals was given.
993 if test "${enable_referrals+set}" = set; then
994   enableval="$enable_referrals"
995   
996         ol_arg=invalid
997         for ol_val in auto yes no ; do
998                 if test "$enableval" = "$ol_val" ; then
999                         ol_arg="$ol_val"
1000                 fi
1001         done
1002         if test "$ol_arg" = "invalid" ; then
1003                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1004         fi
1005         ol_enable_referrals="$ol_arg"
1006
1007 else
1008         ol_enable_referrals="yes"
1009 fi
1010 # end --enable-referrals
1011 # OpenLDAP --enable-cldap
1012         # Check whether --enable-cldap or --disable-cldap was given.
1013 if test "${enable_cldap+set}" = set; then
1014   enableval="$enable_cldap"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1024         fi
1025         ol_enable_cldap="$ol_arg"
1026
1027 else
1028         ol_enable_cldap="no"
1029 fi
1030 # end --enable-cldap
1031 # OpenLDAP --enable-x_compile
1032         # Check whether --enable-x_compile or --disable-x_compile was given.
1033 if test "${enable_x_compile+set}" = set; then
1034   enableval="$enable_x_compile"
1035   
1036         ol_arg=invalid
1037         for ol_val in yes no ; do
1038                 if test "$enableval" = "$ol_val" ; then
1039                         ol_arg="$ol_val"
1040                 fi
1041         done
1042         if test "$ol_arg" = "invalid" ; then
1043                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1044         fi
1045         ol_enable_x_compile="$ol_arg"
1046
1047 else
1048         ol_enable_x_compile="no"
1049 fi
1050 # end --enable-x_compile
1051
1052 # OpenLDAP --enable-dmalloc
1053         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1054 if test "${enable_dmalloc+set}" = set; then
1055   enableval="$enable_dmalloc"
1056   
1057         ol_arg=invalid
1058         for ol_val in auto yes no ; do
1059                 if test "$enableval" = "$ol_val" ; then
1060                         ol_arg="$ol_val"
1061                 fi
1062         done
1063         if test "$ol_arg" = "invalid" ; then
1064                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1065         fi
1066         ol_enable_dmalloc="$ol_arg"
1067
1068 else
1069         ol_enable_dmalloc="no"
1070 fi
1071 # end --enable-dmalloc
1072
1073 # OpenLDAP --with-kerberos
1074         # Check whether --with-kerberos or --without-kerberos was given.
1075 if test "${with_kerberos+set}" = set; then
1076   withval="$with_kerberos"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto k5 k4 afs yes no ; do
1080                 if test "$withval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1086         fi
1087         ol_with_kerberos="$ol_arg"
1088
1089 else
1090         ol_with_kerberos="auto"
1091 fi
1092 # end --with-kerberos
1093
1094 # OpenLDAP --with-readline
1095         # Check whether --with-readline or --without-readline was given.
1096 if test "${with_readline+set}" = set; then
1097   withval="$with_readline"
1098   
1099         ol_arg=invalid
1100         for ol_val in auto yes no  ; do
1101                 if test "$withval" = "$ol_val" ; then
1102                         ol_arg="$ol_val"
1103                 fi
1104         done
1105         if test "$ol_arg" = "invalid" ; then
1106                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1107         fi
1108         ol_with_readline="$ol_arg"
1109
1110 else
1111         ol_with_readline="auto"
1112 fi
1113 # end --with-readline
1114
1115 # OpenLDAP --with-threads
1116         # Check whether --with-threads or --without-threads was given.
1117 if test "${with_threads+set}" = set; then
1118   withval="$with_threads"
1119   
1120         ol_arg=invalid
1121         for ol_val in auto posix mach lwp yes no manual  ; do
1122                 if test "$withval" = "$ol_val" ; then
1123                         ol_arg="$ol_val"
1124                 fi
1125         done
1126         if test "$ol_arg" = "invalid" ; then
1127                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1128         fi
1129         ol_with_threads="$ol_arg"
1130
1131 else
1132         ol_with_threads="auto"
1133 fi
1134 # end --with-threads
1135
1136 # OpenLDAP --with-tls
1137         # Check whether --with-tls or --without-tls was given.
1138 if test "${with_tls+set}" = set; then
1139   withval="$with_tls"
1140   
1141         ol_arg=invalid
1142         for ol_val in auto ssleay openssl yes no  ; do
1143                 if test "$withval" = "$ol_val" ; then
1144                         ol_arg="$ol_val"
1145                 fi
1146         done
1147         if test "$ol_arg" = "invalid" ; then
1148                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1149         fi
1150         ol_with_tls="$ol_arg"
1151
1152 else
1153         ol_with_tls="auto"
1154 fi
1155 # end --with-tls
1156
1157 # OpenLDAP --with-yielding_select
1158         # Check whether --with-yielding_select or --without-yielding_select was given.
1159 if test "${with_yielding_select+set}" = set; then
1160   withval="$with_yielding_select"
1161   
1162         ol_arg=invalid
1163         for ol_val in auto yes no manual  ; do
1164                 if test "$withval" = "$ol_val" ; then
1165                         ol_arg="$ol_val"
1166                 fi
1167         done
1168         if test "$ol_arg" = "invalid" ; then
1169                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1170         fi
1171         ol_with_yielding_select="$ol_arg"
1172
1173 else
1174         ol_with_yielding_select="auto"
1175 fi
1176 # end --with-yielding_select
1177
1178
1179
1180 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1181 if test "${with_xxldapdoptions+set}" = set; then
1182   withval="$with_xxldapdoptions"
1183   :
1184 fi
1185
1186 # OpenLDAP --enable-ldapd
1187         # Check whether --enable-ldapd or --disable-ldapd was given.
1188 if test "${enable_ldapd+set}" = set; then
1189   enableval="$enable_ldapd"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1199         fi
1200         ol_enable_ldapd="$ol_arg"
1201
1202 else
1203         ol_enable_ldapd="no"
1204 fi
1205 # end --enable-ldapd
1206
1207 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1208 if test "${with_xxslapdoptions+set}" = set; then
1209   withval="$with_xxslapdoptions"
1210   :
1211 fi
1212
1213 # OpenLDAP --enable-slapd
1214         # Check whether --enable-slapd or --disable-slapd was given.
1215 if test "${enable_slapd+set}" = set; then
1216   enableval="$enable_slapd"
1217   
1218         ol_arg=invalid
1219         for ol_val in auto yes no ; do
1220                 if test "$enableval" = "$ol_val" ; then
1221                         ol_arg="$ol_val"
1222                 fi
1223         done
1224         if test "$ol_arg" = "invalid" ; then
1225                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1226         fi
1227         ol_enable_slapd="$ol_arg"
1228
1229 else
1230         ol_enable_slapd="yes"
1231 fi
1232 # end --enable-slapd
1233 # OpenLDAP --enable-aclgroups
1234         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1235 if test "${enable_aclgroups+set}" = set; then
1236   enableval="$enable_aclgroups"
1237   
1238         ol_arg=invalid
1239         for ol_val in auto yes no ; do
1240                 if test "$enableval" = "$ol_val" ; then
1241                         ol_arg="$ol_val"
1242                 fi
1243         done
1244         if test "$ol_arg" = "invalid" ; then
1245                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1246         fi
1247         ol_enable_aclgroups="$ol_arg"
1248
1249 else
1250         ol_enable_aclgroups="auto"
1251 fi
1252 # end --enable-aclgroups
1253 # OpenLDAP --enable-cleartext
1254         # Check whether --enable-cleartext or --disable-cleartext was given.
1255 if test "${enable_cleartext+set}" = set; then
1256   enableval="$enable_cleartext"
1257   
1258         ol_arg=invalid
1259         for ol_val in auto yes no ; do
1260                 if test "$enableval" = "$ol_val" ; then
1261                         ol_arg="$ol_val"
1262                 fi
1263         done
1264         if test "$ol_arg" = "invalid" ; then
1265                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1266         fi
1267         ol_enable_cleartext="$ol_arg"
1268
1269 else
1270         ol_enable_cleartext="yes"
1271 fi
1272 # end --enable-cleartext
1273 # OpenLDAP --enable-crypt
1274         # Check whether --enable-crypt or --disable-crypt was given.
1275 if test "${enable_crypt+set}" = set; then
1276   enableval="$enable_crypt"
1277   
1278         ol_arg=invalid
1279         for ol_val in auto yes no ; do
1280                 if test "$enableval" = "$ol_val" ; then
1281                         ol_arg="$ol_val"
1282                 fi
1283         done
1284         if test "$ol_arg" = "invalid" ; then
1285                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1286         fi
1287         ol_enable_crypt="$ol_arg"
1288
1289 else
1290         ol_enable_crypt="auto"
1291 fi
1292 # end --enable-crypt
1293 # OpenLDAP --enable-modules
1294         # Check whether --enable-modules or --disable-modules was given.
1295 if test "${enable_modules+set}" = set; then
1296   enableval="$enable_modules"
1297   
1298         ol_arg=invalid
1299         for ol_val in auto yes no ; do
1300                 if test "$enableval" = "$ol_val" ; then
1301                         ol_arg="$ol_val"
1302                 fi
1303         done
1304         if test "$ol_arg" = "invalid" ; then
1305                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1306         fi
1307         ol_enable_modules="$ol_arg"
1308
1309 else
1310         ol_enable_modules="no"
1311 fi
1312 # end --enable-modules
1313 # OpenLDAP --enable-phonetic
1314         # Check whether --enable-phonetic or --disable-phonetic was given.
1315 if test "${enable_phonetic+set}" = set; then
1316   enableval="$enable_phonetic"
1317   
1318         ol_arg=invalid
1319         for ol_val in auto yes no ; do
1320                 if test "$enableval" = "$ol_val" ; then
1321                         ol_arg="$ol_val"
1322                 fi
1323         done
1324         if test "$ol_arg" = "invalid" ; then
1325                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1326         fi
1327         ol_enable_phonetic="$ol_arg"
1328
1329 else
1330         ol_enable_phonetic="no"
1331 fi
1332 # end --enable-phonetic
1333 # OpenLDAP --enable-rlookups
1334         # Check whether --enable-rlookups or --disable-rlookups was given.
1335 if test "${enable_rlookups+set}" = set; then
1336   enableval="$enable_rlookups"
1337   
1338         ol_arg=invalid
1339         for ol_val in auto yes no ; do
1340                 if test "$enableval" = "$ol_val" ; then
1341                         ol_arg="$ol_val"
1342                 fi
1343         done
1344         if test "$ol_arg" = "invalid" ; then
1345                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1346         fi
1347         ol_enable_rlookups="$ol_arg"
1348
1349 else
1350         ol_enable_rlookups="auto"
1351 fi
1352 # end --enable-rlookups
1353 # OpenLDAP --enable-wrappers
1354         # Check whether --enable-wrappers or --disable-wrappers was given.
1355 if test "${enable_wrappers+set}" = set; then
1356   enableval="$enable_wrappers"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto yes no ; do
1360                 if test "$enableval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1366         fi
1367         ol_enable_wrappers="$ol_arg"
1368
1369 else
1370         ol_enable_wrappers="no"
1371 fi
1372 # end --enable-wrappers
1373
1374 # OpenLDAP --enable-bdb2
1375         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1376 if test "${enable_bdb2+set}" = set; then
1377   enableval="$enable_bdb2"
1378   
1379         ol_arg=invalid
1380         for ol_val in auto yes no ; do
1381                 if test "$enableval" = "$ol_val" ; then
1382                         ol_arg="$ol_val"
1383                 fi
1384         done
1385         if test "$ol_arg" = "invalid" ; then
1386                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1387         fi
1388         ol_enable_bdb2="$ol_arg"
1389
1390 else
1391         ol_enable_bdb2="no"
1392 fi
1393 # end --enable-bdb2
1394 # OpenLDAP --enable-ldap
1395         # Check whether --enable-ldap or --disable-ldap was given.
1396 if test "${enable_ldap+set}" = set; then
1397   enableval="$enable_ldap"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto yes no ; do
1401                 if test "$enableval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1407         fi
1408         ol_enable_ldap="$ol_arg"
1409
1410 else
1411         ol_enable_ldap="no"
1412 fi
1413 # end --enable-ldap
1414 # OpenLDAP --enable-ldbm
1415         # Check whether --enable-ldbm or --disable-ldbm was given.
1416 if test "${enable_ldbm+set}" = set; then
1417   enableval="$enable_ldbm"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no ; do
1421                 if test "$enableval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1427         fi
1428         ol_enable_ldbm="$ol_arg"
1429
1430 else
1431         ol_enable_ldbm="yes"
1432 fi
1433 # end --enable-ldbm
1434 # OpenLDAP --with-ldbm_api
1435         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1436 if test "${with_ldbm_api+set}" = set; then
1437   withval="$with_ldbm_api"
1438   
1439         ol_arg=invalid
1440         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1441                 if test "$withval" = "$ol_val" ; then
1442                         ol_arg="$ol_val"
1443                 fi
1444         done
1445         if test "$ol_arg" = "invalid" ; then
1446                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1447         fi
1448         ol_with_ldbm_api="$ol_arg"
1449
1450 else
1451         ol_with_ldbm_api="auto"
1452 fi
1453 # end --with-ldbm_api
1454
1455 # OpenLDAP --with-ldbm_type
1456         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1457 if test "${with_ldbm_type+set}" = set; then
1458   withval="$with_ldbm_type"
1459   
1460         ol_arg=invalid
1461         for ol_val in auto btree hash ; do
1462                 if test "$withval" = "$ol_val" ; then
1463                         ol_arg="$ol_val"
1464                 fi
1465         done
1466         if test "$ol_arg" = "invalid" ; then
1467                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1468         fi
1469         ol_with_ldbm_type="$ol_arg"
1470
1471 else
1472         ol_with_ldbm_type="auto"
1473 fi
1474 # end --with-ldbm_type
1475
1476
1477 # OpenLDAP --enable-passwd
1478         # Check whether --enable-passwd or --disable-passwd was given.
1479 if test "${enable_passwd+set}" = set; then
1480   enableval="$enable_passwd"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no ; do
1484                 if test "$enableval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1490         fi
1491         ol_enable_passwd="$ol_arg"
1492
1493 else
1494         ol_enable_passwd="no"
1495 fi
1496 # end --enable-passwd
1497 # OpenLDAP --enable-perl
1498         # Check whether --enable-perl or --disable-perl was given.
1499 if test "${enable_perl+set}" = set; then
1500   enableval="$enable_perl"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1510         fi
1511         ol_enable_perl="$ol_arg"
1512
1513 else
1514         ol_enable_perl="no"
1515 fi
1516 # end --enable-perl
1517 # OpenLDAP --enable-shell
1518         # Check whether --enable-shell or --disable-shell was given.
1519 if test "${enable_shell+set}" = set; then
1520   enableval="$enable_shell"
1521   
1522         ol_arg=invalid
1523         for ol_val in auto yes no ; do
1524                 if test "$enableval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1530         fi
1531         ol_enable_shell="$ol_arg"
1532
1533 else
1534         ol_enable_shell="no"
1535 fi
1536 # end --enable-shell
1537 # OpenLDAP --enable-tcl
1538         # Check whether --enable-tcl or --disable-tcl was given.
1539 if test "${enable_tcl+set}" = set; then
1540   enableval="$enable_tcl"
1541   
1542         ol_arg=invalid
1543         for ol_val in auto yes no ; do
1544                 if test "$enableval" = "$ol_val" ; then
1545                         ol_arg="$ol_val"
1546                 fi
1547         done
1548         if test "$ol_arg" = "invalid" ; then
1549                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1550         fi
1551         ol_enable_tcl="$ol_arg"
1552
1553 else
1554         ol_enable_tcl="no"
1555 fi
1556 # end --enable-tcl
1557
1558 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1559 if test "${with_xxslurpdoptions+set}" = set; then
1560   withval="$with_xxslurpdoptions"
1561   :
1562 fi
1563
1564 # OpenLDAP --enable-slurpd
1565         # Check whether --enable-slurpd or --disable-slurpd was given.
1566 if test "${enable_slurpd+set}" = set; then
1567   enableval="$enable_slurpd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_slurpd="$ol_arg"
1579
1580 else
1581         ol_enable_slurpd="auto"
1582 fi
1583 # end --enable-slurpd
1584
1585 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1586 if test "${with_xxliboptions+set}" = set; then
1587   withval="$with_xxliboptions"
1588   :
1589 fi
1590
1591 # Check whether --enable-static or --disable-static was given.
1592 if test "${enable_static+set}" = set; then
1593   enableval="$enable_static"
1594   p=${PACKAGE-default}
1595 case "$enableval" in
1596 yes) enable_static=yes ;;
1597 no) enable_static=no ;;
1598 *)
1599   enable_static=no
1600   # Look at the argument we got.  We use all the common list separators.
1601   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1602   for pkg in $enableval; do
1603     if test "X$pkg" = "X$p"; then
1604       enable_static=yes
1605     fi
1606   done
1607   IFS="$ac_save_ifs"
1608   ;;
1609 esac
1610 else
1611   enable_static=yes
1612 fi
1613
1614 # Check whether --enable-shared or --disable-shared was given.
1615 if test "${enable_shared+set}" = set; then
1616   enableval="$enable_shared"
1617   p=${PACKAGE-default}
1618 case "$enableval" in
1619 yes) enable_shared=yes ;;
1620 no) enable_shared=no ;;
1621 *)
1622   enable_shared=no
1623   # Look at the argument we got.  We use all the common list separators.
1624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1625   for pkg in $enableval; do
1626     if test "X$pkg" = "X$p"; then
1627       enable_shared=yes
1628     fi
1629   done
1630   IFS="$ac_save_ifs"
1631   ;;
1632 esac
1633 else
1634   enable_shared=yes
1635 fi
1636
1637
1638 # validate options
1639 if test $ol_enable_dns = yes ; then
1640         if test $ol_enable_referrals = no ; then
1641                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1642         fi
1643         if test $ol_enable_referrals = auto ; then
1644                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1645                 ol_enable_referrals=yes
1646         fi
1647 fi
1648
1649 if test $ol_enable_slapd = no ; then
1650                 if test $ol_enable_bdb2 = yes ; then
1651                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
1652         fi
1653         if test $ol_enable_ldap = yes ; then
1654                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
1655         fi
1656         if test $ol_enable_ldbm = yes ; then
1657                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
1658         fi
1659         if test $ol_enable_passwd = yes ; then
1660                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
1661         fi
1662         if test $ol_enable_perl = yes ; then
1663                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
1664         fi
1665         if test $ol_enable_shell = yes ; then
1666                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
1667         fi
1668         if test $ol_enable_tcl = yes ; then
1669                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
1670         fi
1671         if test $ol_enable_aclgroups = yes ; then
1672                 echo "configure: warning: slapd disabled, ignoring --enable-aclgroups argument" 1>&2
1673         fi
1674         if test $ol_enable_modules = yes ; then
1675                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
1676         fi
1677         if test $ol_enable_wrappers = yes ; then
1678                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
1679         fi
1680         if test $ol_enable_phonetic = yes ; then
1681                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
1682         fi
1683         if test $ol_enable_rlookups = yes ; then
1684                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
1685         fi
1686         if test $ol_with_ldbm_api != auto ; then
1687                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
1688         fi
1689         if test $ol_with_ldbm_type != auto ; then
1690                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
1691         fi
1692         if test $ol_enable_slurpd = yes ; then
1693                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1694         fi
1695
1696         # force settings to no
1697         ol_enable_bdb2=no
1698         ol_enable_ldap=no
1699         ol_enable_ldbm=no
1700         ol_enable_passwd=no
1701         ol_enable_perl=no
1702         ol_enable_shell=no
1703         ol_enable_tcl=no
1704
1705         ol_enable_aclgroups=no
1706         ol_enable_modules=no
1707         ol_enable_phonetic=no
1708         ol_enable_rlookups=no
1709         ol_enable_wrappers=no
1710
1711         ol_with_ldbm_api=no
1712         ol_with_ldbm_type=no
1713
1714         ol_enable_slurpd=no
1715
1716 elif test $ol_enable_ldbm = no ; then
1717         
1718         if test $ol_with_ldbm_api != auto ; then
1719                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
1720         fi
1721
1722         if test $ol_with_ldbm_type != auto ; then
1723                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
1724         fi
1725
1726         if test $ol_enable_bdb2 = yes ; then
1727                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1728         fi
1729
1730         if test $ol_enable_modules != yes -a \
1731                 $ol_enable_ldap = no -a \
1732                 $ol_enable_passwd = no -a \
1733                 $ol_enable_perl = no -a \
1734                 $ol_enable_shell = no -a \
1735                 $ol_enable_tcl = no ; then
1736                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1737         fi
1738
1739         ol_with_ldbm_api=no
1740         ol_with_ldbm_type=no
1741
1742 elif test $ol_enable_bdb2 = yes ; then
1743         
1744         if test $ol_with_ldbm_api != auto -a \
1745                 $ol_with_ldbm_api != db2 ; then
1746                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1747         fi
1748
1749         ol_with_ldbm_api=db2
1750
1751 else
1752         
1753         if test $ol_enable_bdb2 != no ; then
1754                 if test $ol_with_ldbm_api != auto -a \
1755                         $ol_with_ldbm_api != db2 ; then
1756                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1757                         ol_enable_bdb2=no
1758                 fi
1759         fi
1760
1761         if test $ol_with_ldbm_api = gdbm -a \
1762                 $ol_with_ldbm_type = btree ; then
1763                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1764         fi
1765         if test $ol_with_ldbm_api = mdbm -a \
1766                 $ol_with_ldbm_type = btree ; then
1767                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1768         fi
1769         if test $ol_with_ldbm_api = ndbm -a \
1770                 $ol_with_ldbm_type = btree ; then
1771                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1772         fi
1773 fi
1774
1775 if test $ol_enable_slurpd = yes ; then
1776                 if test $ol_with_threads = no ; then
1777                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1778         fi
1779 fi
1780
1781 echo "$ac_t""done" 1>&6
1782
1783 ## Initialize vars
1784 LDAP_LIBS=
1785 LDBM_LIBS=
1786 LTHREAD_LIBS=
1787 LUTIL_LIBS=
1788
1789 LDAPD_LIBS=
1790 SLAPD_LIBS=
1791 SLURPD_LIBS=
1792
1793 BUILD_LDAPD=no
1794 BUILD_SLAPD=no
1795 BUILD_SLURPD=no
1796
1797 BUILD_BDB2=no
1798 BUILD_LDAP=no
1799 BUILD_LDBM=no
1800 BUILD_PASSWD=no
1801 BUILD_PERL=no
1802 BUILD_SHELL=no
1803 BUILD_TCL=no
1804 BUILD_THREAD=no
1805
1806 SLAPD_MODULES_LDFLAGS=
1807 SLAPD_MODULES_CPPFLAGS=
1808
1809 SLAPD_PERL_LDFLAGS=
1810 SLAPD_PERL_CPPFLAGS=
1811
1812 KRB_LIBS=
1813 READLINE_LIBS=
1814 TERMCAP_LIBS=
1815 TLS_LIBS=
1816
1817
1818
1819 save_CC="$CC"
1820 if test -z "${CC}"; then
1821         for ac_prog in cc
1822 do
1823 # Extract the first word of "$ac_prog", so it can be a program name with args.
1824 set dummy $ac_prog; ac_word=$2
1825 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1826 echo "configure:1827: checking for $ac_word" >&5
1827 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1828   echo $ac_n "(cached) $ac_c" 1>&6
1829 else
1830   if test -n "$CC"; then
1831   ac_cv_prog_CC="$CC" # Let the user override the test.
1832 else
1833   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1834   ac_dummy="$PATH"
1835   for ac_dir in $ac_dummy; do
1836     test -z "$ac_dir" && ac_dir=.
1837     if test -f $ac_dir/$ac_word; then
1838       ac_cv_prog_CC="$ac_prog"
1839       break
1840     fi
1841   done
1842   IFS="$ac_save_ifs"
1843 fi
1844 fi
1845 CC="$ac_cv_prog_CC"
1846 if test -n "$CC"; then
1847   echo "$ac_t""$CC" 1>&6
1848 else
1849   echo "$ac_t""no" 1>&6
1850 fi
1851
1852 test -n "$CC" && break
1853 done
1854
1855 fi
1856
1857
1858
1859 # Make sure we can run config.sub.
1860 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1861 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1862 fi
1863
1864 echo $ac_n "checking host system type""... $ac_c" 1>&6
1865 echo "configure:1866: checking host system type" >&5
1866
1867 host_alias=$host
1868 case "$host_alias" in
1869 NONE)
1870   case $nonopt in
1871   NONE)
1872     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1873     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1874     fi ;;
1875   *) host_alias=$nonopt ;;
1876   esac ;;
1877 esac
1878
1879 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1880 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1881 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1882 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1883 echo "$ac_t""$host" 1>&6
1884
1885
1886 case "$host" in
1887         *-*-aix*) ol_host_os=aix ;;
1888 esac
1889
1890 ol_aix_threads=no
1891 if test -z "$save_CC" -a "$CC" = cc -a "$ol_host_os" = aix ; then
1892         case "$ol_with_threads" in
1893                 auto | yes |  posix) ol_aix_threads=yes ;;
1894         esac
1895 fi
1896
1897 if test ol_aix_threads = yes ; then
1898         CC=
1899         for ac_prog in cc_r xlc_r
1900 do
1901 # Extract the first word of "$ac_prog", so it can be a program name with args.
1902 set dummy $ac_prog; ac_word=$2
1903 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1904 echo "configure:1905: checking for $ac_word" >&5
1905 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1906   echo $ac_n "(cached) $ac_c" 1>&6
1907 else
1908   if test -n "$CC"; then
1909   ac_cv_prog_CC="$CC" # Let the user override the test.
1910 else
1911   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1912   ac_dummy="$PATH"
1913   for ac_dir in $ac_dummy; do
1914     test -z "$ac_dir" && ac_dir=.
1915     if test -f $ac_dir/$ac_word; then
1916       ac_cv_prog_CC="$ac_prog"
1917       break
1918     fi
1919   done
1920   IFS="$ac_save_ifs"
1921 fi
1922 fi
1923 CC="$ac_cv_prog_CC"
1924 if test -n "$CC"; then
1925   echo "$ac_t""$CC" 1>&6
1926 else
1927   echo "$ac_t""no" 1>&6
1928 fi
1929
1930 test -n "$CC" && break
1931 done
1932
1933
1934         if test "$CC" ; then
1935                 if test $ol_with_threads != auto ; then
1936                         { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
1937                 else
1938                         echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
1939                 fi
1940                 ol_with_threads=no
1941         else
1942                 ol_with_threads=posix
1943                 ol_cv_pthread_create=yes
1944         fi
1945 fi
1946
1947 # Extract the first word of "ranlib", so it can be a program name with args.
1948 set dummy ranlib; ac_word=$2
1949 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1950 echo "configure:1951: checking for $ac_word" >&5
1951 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1952   echo $ac_n "(cached) $ac_c" 1>&6
1953 else
1954   if test -n "$RANLIB"; then
1955   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1956 else
1957   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1958   ac_dummy="$PATH"
1959   for ac_dir in $ac_dummy; do
1960     test -z "$ac_dir" && ac_dir=.
1961     if test -f $ac_dir/$ac_word; then
1962       ac_cv_prog_RANLIB="ranlib"
1963       break
1964     fi
1965   done
1966   IFS="$ac_save_ifs"
1967   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1968 fi
1969 fi
1970 RANLIB="$ac_cv_prog_RANLIB"
1971 if test -n "$RANLIB"; then
1972   echo "$ac_t""$RANLIB" 1>&6
1973 else
1974   echo "$ac_t""no" 1>&6
1975 fi
1976
1977 # Extract the first word of "gcc", so it can be a program name with args.
1978 set dummy gcc; ac_word=$2
1979 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1980 echo "configure:1981: checking for $ac_word" >&5
1981 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1982   echo $ac_n "(cached) $ac_c" 1>&6
1983 else
1984   if test -n "$CC"; then
1985   ac_cv_prog_CC="$CC" # Let the user override the test.
1986 else
1987   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1988   ac_dummy="$PATH"
1989   for ac_dir in $ac_dummy; do
1990     test -z "$ac_dir" && ac_dir=.
1991     if test -f $ac_dir/$ac_word; then
1992       ac_cv_prog_CC="gcc"
1993       break
1994     fi
1995   done
1996   IFS="$ac_save_ifs"
1997 fi
1998 fi
1999 CC="$ac_cv_prog_CC"
2000 if test -n "$CC"; then
2001   echo "$ac_t""$CC" 1>&6
2002 else
2003   echo "$ac_t""no" 1>&6
2004 fi
2005
2006 if test -z "$CC"; then
2007   # Extract the first word of "cc", so it can be a program name with args.
2008 set dummy cc; ac_word=$2
2009 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2010 echo "configure:2011: checking for $ac_word" >&5
2011 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2012   echo $ac_n "(cached) $ac_c" 1>&6
2013 else
2014   if test -n "$CC"; then
2015   ac_cv_prog_CC="$CC" # Let the user override the test.
2016 else
2017   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2018   ac_prog_rejected=no
2019   ac_dummy="$PATH"
2020   for ac_dir in $ac_dummy; do
2021     test -z "$ac_dir" && ac_dir=.
2022     if test -f $ac_dir/$ac_word; then
2023       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2024         ac_prog_rejected=yes
2025         continue
2026       fi
2027       ac_cv_prog_CC="cc"
2028       break
2029     fi
2030   done
2031   IFS="$ac_save_ifs"
2032 if test $ac_prog_rejected = yes; then
2033   # We found a bogon in the path, so make sure we never use it.
2034   set dummy $ac_cv_prog_CC
2035   shift
2036   if test $# -gt 0; then
2037     # We chose a different compiler from the bogus one.
2038     # However, it has the same basename, so the bogon will be chosen
2039     # first if we set CC to just the basename; use the full file name.
2040     shift
2041     set dummy "$ac_dir/$ac_word" "$@"
2042     shift
2043     ac_cv_prog_CC="$@"
2044   fi
2045 fi
2046 fi
2047 fi
2048 CC="$ac_cv_prog_CC"
2049 if test -n "$CC"; then
2050   echo "$ac_t""$CC" 1>&6
2051 else
2052   echo "$ac_t""no" 1>&6
2053 fi
2054
2055   if test -z "$CC"; then
2056     case "`uname -s`" in
2057     *win32* | *WIN32*)
2058       # Extract the first word of "cl", so it can be a program name with args.
2059 set dummy cl; ac_word=$2
2060 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2061 echo "configure:2062: checking for $ac_word" >&5
2062 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2063   echo $ac_n "(cached) $ac_c" 1>&6
2064 else
2065   if test -n "$CC"; then
2066   ac_cv_prog_CC="$CC" # Let the user override the test.
2067 else
2068   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2069   ac_dummy="$PATH"
2070   for ac_dir in $ac_dummy; do
2071     test -z "$ac_dir" && ac_dir=.
2072     if test -f $ac_dir/$ac_word; then
2073       ac_cv_prog_CC="cl"
2074       break
2075     fi
2076   done
2077   IFS="$ac_save_ifs"
2078 fi
2079 fi
2080 CC="$ac_cv_prog_CC"
2081 if test -n "$CC"; then
2082   echo "$ac_t""$CC" 1>&6
2083 else
2084   echo "$ac_t""no" 1>&6
2085 fi
2086  ;;
2087     esac
2088   fi
2089   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2090 fi
2091
2092 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2093 echo "configure:2094: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2094
2095 ac_ext=c
2096 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2097 ac_cpp='$CPP $CPPFLAGS'
2098 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2099 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2100 cross_compiling=$ac_cv_prog_cc_cross
2101
2102 cat > conftest.$ac_ext << EOF
2103
2104 #line 2105 "configure"
2105 #include "confdefs.h"
2106
2107 main(){return(0);}
2108 EOF
2109 if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2110   ac_cv_prog_cc_works=yes
2111   # If we can't run a trivial program, we are probably using a cross compiler.
2112   if (./conftest; exit) 2>/dev/null; then
2113     ac_cv_prog_cc_cross=no
2114   else
2115     ac_cv_prog_cc_cross=yes
2116   fi
2117 else
2118   echo "configure: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   ac_cv_prog_cc_works=no
2121 fi
2122 rm -fr conftest*
2123 ac_ext=c
2124 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2125 ac_cpp='$CPP $CPPFLAGS'
2126 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2127 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2128 cross_compiling=$ac_cv_prog_cc_cross
2129
2130 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2131 if test $ac_cv_prog_cc_works = no; then
2132   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2133 fi
2134 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2135 echo "configure:2136: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2136 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2137 cross_compiling=$ac_cv_prog_cc_cross
2138
2139 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2140 echo "configure:2141: checking whether we are using GNU C" >&5
2141 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2142   echo $ac_n "(cached) $ac_c" 1>&6
2143 else
2144   cat > conftest.c <<EOF
2145 #ifdef __GNUC__
2146   yes;
2147 #endif
2148 EOF
2149 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2150   ac_cv_prog_gcc=yes
2151 else
2152   ac_cv_prog_gcc=no
2153 fi
2154 fi
2155
2156 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2157
2158 if test $ac_cv_prog_gcc = yes; then
2159   GCC=yes
2160 else
2161   GCC=
2162 fi
2163
2164 ac_test_CFLAGS="${CFLAGS+set}"
2165 ac_save_CFLAGS="$CFLAGS"
2166 CFLAGS=
2167 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2168 echo "configure:2169: checking whether ${CC-cc} accepts -g" >&5
2169 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2170   echo $ac_n "(cached) $ac_c" 1>&6
2171 else
2172   echo 'void f(){}' > conftest.c
2173 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2174   ac_cv_prog_cc_g=yes
2175 else
2176   ac_cv_prog_cc_g=no
2177 fi
2178 rm -f conftest*
2179
2180 fi
2181
2182 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2183 if test "$ac_test_CFLAGS" = set; then
2184   CFLAGS="$ac_save_CFLAGS"
2185 elif test $ac_cv_prog_cc_g = yes; then
2186   if test "$GCC" = yes; then
2187     CFLAGS="-g -O2"
2188   else
2189     CFLAGS="-g"
2190   fi
2191 else
2192   if test "$GCC" = yes; then
2193     CFLAGS="-O2"
2194   else
2195     CFLAGS=
2196   fi
2197 fi
2198
2199 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2200 if test "${with_gnu_ld+set}" = set; then
2201   withval="$with_gnu_ld"
2202   test "$withval" = no || with_gnu_ld=yes
2203 else
2204   with_gnu_ld=no
2205 fi
2206
2207
2208 ac_prog=ld
2209 if test "$ac_cv_prog_gcc" = yes; then
2210   # Check if gcc -print-prog-name=ld gives a path.
2211   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2212 echo "configure:2213: checking for ld used by GCC" >&5
2213   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2214   case "$ac_prog" in
2215   # Accept absolute paths.
2216   /* | A-Za-z:\\*)
2217     test -z "$LD" && LD="$ac_prog"
2218     ;;
2219   "")
2220     # If it fails, then pretend we aren't using GCC.
2221     ac_prog=ld
2222     ;;
2223   *)
2224     # If it is relative, then search for the first ld in PATH.
2225     with_gnu_ld=unknown
2226     ;;
2227   esac
2228 elif test "$with_gnu_ld" = yes; then
2229   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2230 echo "configure:2231: checking for GNU ld" >&5
2231 else
2232   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2233 echo "configure:2234: checking for non-GNU ld" >&5
2234 fi
2235 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2236   echo $ac_n "(cached) $ac_c" 1>&6
2237 else
2238   if test -z "$LD"; then
2239   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2240   for ac_dir in $PATH; do
2241     test -z "$ac_dir" && ac_dir=.
2242     if test -f "$ac_dir/$ac_prog"; then
2243       ac_cv_path_LD="$ac_dir/$ac_prog"
2244       # Check to see if the program is GNU ld.  I'd rather use --version,
2245       # but apparently some GNU ld's only accept -v.
2246       # Break only if it was the GNU/non-GNU ld that we prefer.
2247       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2248         test "$with_gnu_ld" != no && break
2249       else
2250         test "$with_gnu_ld" != yes && break
2251       fi
2252     fi
2253   done
2254   IFS="$ac_save_ifs"
2255 else
2256   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2257 fi
2258 fi
2259
2260 LD="$ac_cv_path_LD"
2261 if test -n "$LD"; then
2262   echo "$ac_t""$LD" 1>&6
2263 else
2264   echo "$ac_t""no" 1>&6
2265 fi
2266 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2267
2268 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2269 echo "configure:2270: checking if the linker ($LD) is GNU ld" >&5
2270 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2271   echo $ac_n "(cached) $ac_c" 1>&6
2272 else
2273   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2274 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2275   ac_cv_prog_gnu_ld=yes
2276 else
2277   ac_cv_prog_gnu_ld=no
2278 fi
2279 fi
2280
2281 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2282
2283
2284 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2285 echo "configure:2286: checking for BSD-compatible nm" >&5
2286 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2287   echo $ac_n "(cached) $ac_c" 1>&6
2288 else
2289   case "$NM" in
2290 /* | A-Za-z:\\*)
2291   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2292   ;;
2293 *)
2294   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2295   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2296     test -z "$ac_dir" && ac_dir=.
2297     if test -f $ac_dir/nm; then
2298       # Check to see if the nm accepts a BSD-compat flag.
2299       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2300       #   nm: unknown option "B" ignored
2301       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2302         ac_cv_path_NM="$ac_dir/nm -B"
2303       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2304         ac_cv_path_NM="$ac_dir/nm -p"
2305       else
2306         ac_cv_path_NM="$ac_dir/nm"
2307       fi
2308       break
2309     fi
2310   done
2311   IFS="$ac_save_ifs"
2312   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2313   ;;
2314 esac
2315 fi
2316
2317 NM="$ac_cv_path_NM"
2318 echo "$ac_t""$NM" 1>&6
2319
2320
2321 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2322 echo "configure:2323: checking whether ln -s works" >&5
2323 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2324   echo $ac_n "(cached) $ac_c" 1>&6
2325 else
2326   rm -f conftestdata
2327 if ln -s X conftestdata 2>/dev/null
2328 then
2329   rm -f conftestdata
2330   ac_cv_prog_LN_S="ln -s"
2331 else
2332   ac_cv_prog_LN_S=ln
2333 fi
2334 fi
2335 LN_S="$ac_cv_prog_LN_S"
2336 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2337   echo "$ac_t""yes" 1>&6
2338 else
2339   echo "$ac_t""no" 1>&6
2340 fi
2341
2342 # Always use our own libtool.
2343 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2344
2345 # Check for any special flags to pass to ltconfig.
2346 libtool_flags=
2347 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2348 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2349 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2350 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2351 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2352
2353 # Some flags need to be propagated to the compiler or linker for good
2354 # libtool support.
2355 case "$host" in
2356 *-*-irix6*)
2357   # Find out which ABI we are using.
2358   echo '#line 2359 "configure"' > conftest.$ac_ext
2359   if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2360     case "`/usr/bin/file conftest.o`" in
2361     *32-bit*)
2362       LD="${LD-ld} -32"
2363       ;;
2364     *N32*)
2365       LD="${LD-ld} -n32"
2366       ;;
2367     *64-bit*)
2368       LD="${LD-ld} -64"
2369       ;;
2370     esac
2371   fi
2372   rm -rf conftest*
2373   ;;
2374
2375 *-*-sco3.2v5*)
2376   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2377   CFLAGS="$CFLAGS -belf"
2378   ;;
2379 esac
2380
2381 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2382 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2383 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2384 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2385 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2386 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2387
2388
2389 for ac_prog in mawk gawk nawk awk
2390 do
2391 # Extract the first word of "$ac_prog", so it can be a program name with args.
2392 set dummy $ac_prog; ac_word=$2
2393 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2394 echo "configure:2395: checking for $ac_word" >&5
2395 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2396   echo $ac_n "(cached) $ac_c" 1>&6
2397 else
2398   if test -n "$AWK"; then
2399   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2400 else
2401   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2402   ac_dummy="$PATH"
2403   for ac_dir in $ac_dummy; do
2404     test -z "$ac_dir" && ac_dir=.
2405     if test -f $ac_dir/$ac_word; then
2406       ac_cv_prog_AWK="$ac_prog"
2407       break
2408     fi
2409   done
2410   IFS="$ac_save_ifs"
2411 fi
2412 fi
2413 AWK="$ac_cv_prog_AWK"
2414 if test -n "$AWK"; then
2415   echo "$ac_t""$AWK" 1>&6
2416 else
2417   echo "$ac_t""no" 1>&6
2418 fi
2419
2420 test -n "$AWK" && break
2421 done
2422
2423 # test for ln hardlink support
2424 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2425 echo "configure:2426: checking whether ln works" >&5
2426 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2427   echo $ac_n "(cached) $ac_c" 1>&6
2428 else
2429   rm -f conftest.src conftest.dst
2430 echo "conftest" > conftest.src
2431 if ln conftest.src conftest.dst 2>/dev/null
2432 then
2433   ol_cv_prog_LN_H="ln"
2434 else
2435   ol_cv_prog_LN_H="cp"
2436 fi
2437 rm -f conftest.src conftest.dst
2438
2439 fi
2440 LN_H="$ol_cv_prog_LN_H"
2441 if test "$ol_cv_prog_LN_H" = "ln"; then
2442         echo "$ac_t""yes" 1>&6
2443 else
2444         echo "$ac_t""no" 1>&6
2445 fi
2446
2447 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2448 echo "configure:2449: checking whether ln -s works" >&5
2449 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2450   echo $ac_n "(cached) $ac_c" 1>&6
2451 else
2452   rm -f conftestdata
2453 if ln -s X conftestdata 2>/dev/null
2454 then
2455   rm -f conftestdata
2456   ac_cv_prog_LN_S="ln -s"
2457 else
2458   ac_cv_prog_LN_S=ln
2459 fi
2460 fi
2461 LN_S="$ac_cv_prog_LN_S"
2462 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2463   echo "$ac_t""yes" 1>&6
2464 else
2465   echo "$ac_t""no" 1>&6
2466 fi
2467
2468
2469 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2470         LN_S="$LN_H"
2471 fi
2472
2473 # Extract the first word of "sendmail", so it can be a program name with args.
2474 set dummy sendmail; ac_word=$2
2475 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2476 echo "configure:2477: checking for $ac_word" >&5
2477 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   case "$SENDMAIL" in
2481   /*)
2482   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2483   ;;
2484   ?:/*)                  
2485   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2486   ;;
2487   *)
2488   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2489   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2490   for ac_dir in $ac_dummy; do 
2491     test -z "$ac_dir" && ac_dir=.
2492     if test -f $ac_dir/$ac_word; then
2493       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2494       break
2495     fi
2496   done
2497   IFS="$ac_save_ifs"
2498   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2499   ;;
2500 esac
2501 fi
2502 SENDMAIL="$ac_cv_path_SENDMAIL"
2503 if test -n "$SENDMAIL"; then
2504   echo "$ac_t""$SENDMAIL" 1>&6
2505 else
2506   echo "$ac_t""no" 1>&6
2507 fi
2508
2509 # Extract the first word of "vi", so it can be a program name with args.
2510 set dummy vi; ac_word=$2
2511 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2512 echo "configure:2513: checking for $ac_word" >&5
2513 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2514   echo $ac_n "(cached) $ac_c" 1>&6
2515 else
2516   case "$EDITOR" in
2517   /*)
2518   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2519   ;;
2520   ?:/*)                  
2521   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2522   ;;
2523   *)
2524   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2525   ac_dummy="$PATH:/usr/ucb"
2526   for ac_dir in $ac_dummy; do 
2527     test -z "$ac_dir" && ac_dir=.
2528     if test -f $ac_dir/$ac_word; then
2529       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2530       break
2531     fi
2532   done
2533   IFS="$ac_save_ifs"
2534   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2535   ;;
2536 esac
2537 fi
2538 EDITOR="$ac_cv_path_EDITOR"
2539 if test -n "$EDITOR"; then
2540   echo "$ac_t""$EDITOR" 1>&6
2541 else
2542   echo "$ac_t""no" 1>&6
2543 fi
2544
2545 # Extract the first word of "finger", so it can be a program name with args.
2546 set dummy finger; ac_word=$2
2547 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2548 echo "configure:2549: checking for $ac_word" >&5
2549 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2550   echo $ac_n "(cached) $ac_c" 1>&6
2551 else
2552   case "$FINGER" in
2553   /*)
2554   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2555   ;;
2556   ?:/*)                  
2557   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2558   ;;
2559   *)
2560   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2561   ac_dummy="$PATH:/usr/ucb"
2562   for ac_dir in $ac_dummy; do 
2563     test -z "$ac_dir" && ac_dir=.
2564     if test -f $ac_dir/$ac_word; then
2565       ac_cv_path_FINGER="$ac_dir/$ac_word"
2566       break
2567     fi
2568   done
2569   IFS="$ac_save_ifs"
2570   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2571   ;;
2572 esac
2573 fi
2574 FINGER="$ac_cv_path_FINGER"
2575 if test -n "$FINGER"; then
2576   echo "$ac_t""$FINGER" 1>&6
2577 else
2578   echo "$ac_t""no" 1>&6
2579 fi
2580
2581
2582 ol_link_modules=no
2583 if test $ol_enable_modules != no ; then
2584         # Extract the first word of "glib-config", so it can be a program name with args.
2585 set dummy glib-config; ac_word=$2
2586 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2587 echo "configure:2588: checking for $ac_word" >&5
2588 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2589   echo $ac_n "(cached) $ac_c" 1>&6
2590 else
2591   case "$GLIBCONFIG" in
2592   /*)
2593   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2594   ;;
2595   ?:/*)                  
2596   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2597   ;;
2598   *)
2599   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2600   ac_dummy="$PATH"
2601   for ac_dir in $ac_dummy; do 
2602     test -z "$ac_dir" && ac_dir=.
2603     if test -f $ac_dir/$ac_word; then
2604       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2605       break
2606     fi
2607   done
2608   IFS="$ac_save_ifs"
2609   ;;
2610 esac
2611 fi
2612 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2613 if test -n "$GLIBCONFIG"; then
2614   echo "$ac_t""$GLIBCONFIG" 1>&6
2615 else
2616   echo "$ac_t""no" 1>&6
2617 fi
2618
2619
2620         if test "no$GLIBCONFIG" = "no" ; then
2621                 if test $ol_enable_modules = yes ; then
2622                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2623                 fi
2624
2625         else
2626                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2627                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2628                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2629
2630                                 ol_link_modules=yes
2631         fi
2632 fi
2633
2634 ol_link_perl=no
2635 if test $ol_enable_perl != no ; then
2636         # Extract the first word of "perl", so it can be a program name with args.
2637 set dummy perl; ac_word=$2
2638 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2639 echo "configure:2640: checking for $ac_word" >&5
2640 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2641   echo $ac_n "(cached) $ac_c" 1>&6
2642 else
2643   case "$PERLBIN" in
2644   /*)
2645   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2646   ;;
2647   ?:/*)                  
2648   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2649   ;;
2650   *)
2651   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2652   ac_dummy="$PATH"
2653   for ac_dir in $ac_dummy; do 
2654     test -z "$ac_dir" && ac_dir=.
2655     if test -f $ac_dir/$ac_word; then
2656       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2657       break
2658     fi
2659   done
2660   IFS="$ac_save_ifs"
2661   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2662   ;;
2663 esac
2664 fi
2665 PERLBIN="$ac_cv_path_PERLBIN"
2666 if test -n "$PERLBIN"; then
2667   echo "$ac_t""$PERLBIN" 1>&6
2668 else
2669   echo "$ac_t""no" 1>&6
2670 fi
2671
2672
2673         if test "no$PERLBIN" = "no" ; then
2674                 if test $ol_enable_perl = yes ; then
2675                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2676                 fi
2677
2678         else
2679                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2680                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2681
2682                                 ol_link_perl=yes
2683         fi
2684 fi
2685
2686 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2687 echo "configure:2688: checking how to run the C preprocessor" >&5
2688 # On Suns, sometimes $CPP names a directory.
2689 if test -n "$CPP" && test -d "$CPP"; then
2690   CPP=
2691 fi
2692 if test -z "$CPP"; then
2693 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2694   echo $ac_n "(cached) $ac_c" 1>&6
2695 else
2696     # This must be in double quotes, not single quotes, because CPP may get
2697   # substituted into the Makefile and "${CC-cc}" will confuse make.
2698   CPP="${CC-cc} -E"
2699   # On the NeXT, cc -E runs the code through the compiler's parser,
2700   # not just through cpp.
2701   cat > conftest.$ac_ext <<EOF
2702 #line 2703 "configure"
2703 #include "confdefs.h"
2704 #include <assert.h>
2705 Syntax Error
2706 EOF
2707 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2708 { (eval echo configure:2709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2709 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2710 if test -z "$ac_err"; then
2711   :
2712 else
2713   echo "$ac_err" >&5
2714   echo "configure: failed program was:" >&5
2715   cat conftest.$ac_ext >&5
2716   rm -rf conftest*
2717   CPP="${CC-cc} -E -traditional-cpp"
2718   cat > conftest.$ac_ext <<EOF
2719 #line 2720 "configure"
2720 #include "confdefs.h"
2721 #include <assert.h>
2722 Syntax Error
2723 EOF
2724 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2725 { (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2726 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2727 if test -z "$ac_err"; then
2728   :
2729 else
2730   echo "$ac_err" >&5
2731   echo "configure: failed program was:" >&5
2732   cat conftest.$ac_ext >&5
2733   rm -rf conftest*
2734   CPP="${CC-cc} -nologo -E"
2735   cat > conftest.$ac_ext <<EOF
2736 #line 2737 "configure"
2737 #include "confdefs.h"
2738 #include <assert.h>
2739 Syntax Error
2740 EOF
2741 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2742 { (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2743 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2744 if test -z "$ac_err"; then
2745   :
2746 else
2747   echo "$ac_err" >&5
2748   echo "configure: failed program was:" >&5
2749   cat conftest.$ac_ext >&5
2750   rm -rf conftest*
2751   CPP=/lib/cpp
2752 fi
2753 rm -f conftest*
2754 fi
2755 rm -f conftest*
2756 fi
2757 rm -f conftest*
2758   ac_cv_prog_CPP="$CPP"
2759 fi
2760   CPP="$ac_cv_prog_CPP"
2761 else
2762   ac_cv_prog_CPP="$CPP"
2763 fi
2764 echo "$ac_t""$CPP" 1>&6
2765
2766
2767 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2768         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2769
2770 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2771         echo "configure: warning: programs compiled here do run here..." 1>&2
2772         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2773
2774 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2775         echo "configure: warning: programs compiled here do not run here..." 1>&2
2776         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2777 fi
2778
2779 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2780 echo "configure:2781: checking for AIX" >&5
2781 cat > conftest.$ac_ext <<EOF
2782 #line 2783 "configure"
2783 #include "confdefs.h"
2784 #ifdef _AIX
2785   yes
2786 #endif
2787
2788 EOF
2789 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2790   egrep "yes" >/dev/null 2>&1; then
2791   rm -rf conftest*
2792   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2793 #define _ALL_SOURCE 1
2794 EOF
2795
2796 else
2797   rm -rf conftest*
2798   echo "$ac_t""no" 1>&6
2799 fi
2800 rm -f conftest*
2801
2802
2803 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2804 echo "configure:2805: checking for POSIXized ISC" >&5
2805 if test -d /etc/conf/kconfig.d &&
2806   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2807 then
2808   echo "$ac_t""yes" 1>&6
2809   ISC=yes # If later tests want to check for ISC.
2810   cat >> confdefs.h <<\EOF
2811 #define _POSIX_SOURCE 1
2812 EOF
2813
2814   if test "$GCC" = yes; then
2815     CC="$CC -posix"
2816   else
2817     CC="$CC -Xp"
2818   fi
2819 else
2820   echo "$ac_t""no" 1>&6
2821   ISC=
2822 fi
2823
2824 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2825 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2826 echo "configure:2827: checking for minix/config.h" >&5
2827 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2828   echo $ac_n "(cached) $ac_c" 1>&6
2829 else
2830   cat > conftest.$ac_ext <<EOF
2831 #line 2832 "configure"
2832 #include "confdefs.h"
2833 #include <minix/config.h>
2834 EOF
2835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2836 { (eval echo configure:2837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2837 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2838 if test -z "$ac_err"; then
2839   rm -rf conftest*
2840   eval "ac_cv_header_$ac_safe=yes"
2841 else
2842   echo "$ac_err" >&5
2843   echo "configure: failed program was:" >&5
2844   cat conftest.$ac_ext >&5
2845   rm -rf conftest*
2846   eval "ac_cv_header_$ac_safe=no"
2847 fi
2848 rm -f conftest*
2849 fi
2850 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2851   echo "$ac_t""yes" 1>&6
2852   MINIX=yes
2853 else
2854   echo "$ac_t""no" 1>&6
2855 MINIX=
2856 fi
2857
2858 if test "$MINIX" = yes; then
2859   cat >> confdefs.h <<\EOF
2860 #define _POSIX_SOURCE 1
2861 EOF
2862
2863   cat >> confdefs.h <<\EOF
2864 #define _POSIX_1_SOURCE 2
2865 EOF
2866
2867   cat >> confdefs.h <<\EOF
2868 #define _MINIX 1
2869 EOF
2870
2871 fi
2872
2873
2874 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2875 echo "configure:2876: checking for be_app in -lbe" >&5
2876 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2877 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2878   echo $ac_n "(cached) $ac_c" 1>&6
2879 else
2880   ac_save_LIBS="$LIBS"
2881 LIBS="-lbe -lroot -lnet $LIBS"
2882 cat > conftest.$ac_ext <<EOF
2883 #line 2884 "configure"
2884 #include "confdefs.h"
2885 /* Override any gcc2 internal prototype to avoid an error.  */
2886 /* We use char because int might match the return type of a gcc2
2887     builtin and then its argument prototype would still apply.  */
2888 char be_app();
2889
2890 int main() {
2891 be_app()
2892 ; return 0; }
2893 EOF
2894 if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2895   rm -rf conftest*
2896   eval "ac_cv_lib_$ac_lib_var=yes"
2897 else
2898   echo "configure: failed program was:" >&5
2899   cat conftest.$ac_ext >&5
2900   rm -rf conftest*
2901   eval "ac_cv_lib_$ac_lib_var=no"
2902 fi
2903 rm -f conftest*
2904 LIBS="$ac_save_LIBS"
2905
2906 fi
2907 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2908   echo "$ac_t""yes" 1>&6
2909   LIBS="$LIBS -lbe -lroot -lnet"
2910 else
2911   echo "$ac_t""no" 1>&6
2912 :
2913 fi
2914
2915
2916 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2917 echo "configure:2918: checking for Cygwin environment" >&5
2918 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2919   echo $ac_n "(cached) $ac_c" 1>&6
2920 else
2921   cat > conftest.$ac_ext <<EOF
2922 #line 2923 "configure"
2923 #include "confdefs.h"
2924
2925 int main() {
2926
2927 #ifndef __CYGWIN__
2928 #define __CYGWIN__ __CYGWIN32__
2929 #endif
2930 return __CYGWIN__;
2931 ; return 0; }
2932 EOF
2933 if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2934   rm -rf conftest*
2935   ac_cv_cygwin=yes
2936 else
2937   echo "configure: failed program was:" >&5
2938   cat conftest.$ac_ext >&5
2939   rm -rf conftest*
2940   ac_cv_cygwin=no
2941 fi
2942 rm -f conftest*
2943 rm -f conftest*
2944 fi
2945
2946 echo "$ac_t""$ac_cv_cygwin" 1>&6
2947 CYGWIN=
2948 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2949 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2950 echo "configure:2951: checking for mingw32 environment" >&5
2951 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2952   echo $ac_n "(cached) $ac_c" 1>&6
2953 else
2954   cat > conftest.$ac_ext <<EOF
2955 #line 2956 "configure"
2956 #include "confdefs.h"
2957
2958 int main() {
2959 return __MINGW32__;
2960 ; return 0; }
2961 EOF
2962 if { (eval echo configure:2963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2963   rm -rf conftest*
2964   ac_cv_mingw32=yes
2965 else
2966   echo "configure: failed program was:" >&5
2967   cat conftest.$ac_ext >&5
2968   rm -rf conftest*
2969   ac_cv_mingw32=no
2970 fi
2971 rm -f conftest*
2972 rm -f conftest*
2973 fi
2974
2975 echo "$ac_t""$ac_cv_mingw32" 1>&6
2976 MINGW32=
2977 test "$ac_cv_mingw32" = yes && MINGW32=yes
2978
2979
2980 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2981 echo "configure:2982: checking for executable suffix" >&5
2982 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2983   echo $ac_n "(cached) $ac_c" 1>&6
2984 else
2985   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2986   ac_cv_exeext=.exe
2987 else
2988   rm -f conftest*
2989   echo 'int main () { return 0; }' > conftest.$ac_ext
2990   ac_cv_exeext=
2991   if { (eval echo configure:2992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2992     for file in conftest.*; do
2993       case $file in
2994       *.c | *.o | *.obj) ;;
2995       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2996       esac
2997     done
2998   else
2999     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3000   fi
3001   rm -f conftest*
3002   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3003 fi
3004 fi
3005
3006 EXEEXT=""
3007 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3008 echo "$ac_t""${ac_cv_exeext}" 1>&6
3009 ac_exeext=$EXEEXT
3010
3011 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3012 echo "configure:3013: checking for object suffix" >&5
3013 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
3014   echo $ac_n "(cached) $ac_c" 1>&6
3015 else
3016   rm -f conftest*
3017 echo 'int i = 1;' > conftest.$ac_ext
3018 if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3019   for ac_file in conftest.*; do
3020     case $ac_file in
3021     *.c) ;;
3022     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3023     esac
3024   done
3025 else
3026   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3027 fi
3028 rm -f conftest*
3029 fi
3030
3031 echo "$ac_t""$ac_cv_objext" 1>&6
3032 OBJEXT=$ac_cv_objext
3033 ac_objext=$ac_cv_objext
3034
3035
3036 cat >> confdefs.h <<EOF
3037 #define EXEEXT "${EXEEXT}"
3038 EOF
3039
3040
3041
3042
3043
3044 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3045 echo "configure:3046: checking for ${CC-cc} option to accept ANSI C" >&5
3046 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
3047   echo $ac_n "(cached) $ac_c" 1>&6
3048 else
3049   am_cv_prog_cc_stdc=no
3050 ac_save_CC="$CC"
3051 # Don't try gcc -ansi; that turns off useful extensions and
3052 # breaks some systems' header files.
3053 # AIX                   -qlanglvl=ansi
3054 # Ultrix and OSF/1      -std1
3055 # HP-UX                 -Aa -D_HPUX_SOURCE
3056 # SVR4                  -Xc -D__EXTENSIONS__
3057 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3058 do
3059   CC="$ac_save_CC $ac_arg"
3060   cat > conftest.$ac_ext <<EOF
3061 #line 3062 "configure"
3062 #include "confdefs.h"
3063 #include <stdarg.h>
3064 #include <stdio.h>
3065 #include <sys/types.h>
3066 #include <sys/stat.h>
3067 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3068 struct buf { int x; };
3069 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3070 static char *e (p, i)
3071      char **p;
3072      int i;
3073 {
3074   return p[i];
3075 }
3076 static char *f (char * (*g) (char **, int), char **p, ...)
3077 {
3078   char *s;
3079   va_list v;
3080   va_start (v,p);
3081   s = g (p, va_arg (v,int));
3082   va_end (v);
3083   return s;
3084 }
3085 int test (int i, double x);
3086 struct s1 {int (*f) (int a);};
3087 struct s2 {int (*f) (double a);};
3088 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3089 int argc;
3090 char **argv;
3091
3092 int main() {
3093
3094 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3095
3096 ; return 0; }
3097 EOF
3098 if { (eval echo configure:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3099   rm -rf conftest*
3100   am_cv_prog_cc_stdc="$ac_arg"; break
3101 else
3102   echo "configure: failed program was:" >&5
3103   cat conftest.$ac_ext >&5
3104 fi
3105 rm -f conftest*
3106 done
3107 CC="$ac_save_CC"
3108
3109 fi
3110
3111 if test -z "$am_cv_prog_cc_stdc"; then
3112   echo "$ac_t""none needed" 1>&6
3113 else
3114   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3115 fi
3116 case "x$am_cv_prog_cc_stdc" in
3117   x|xno) ;;
3118   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3119 esac
3120
3121 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3122         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3123 fi
3124
3125
3126 # test for make depend flag
3127 OL_MKDEP=
3128 OL_MKDEP_FLAGS=
3129 if test -z "${MKDEP}"; then
3130         OL_MKDEP="${CC-cc}"
3131         if test -z "${MKDEP_FLAGS}"; then
3132                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3133 echo "configure:3134: checking for ${OL_MKDEP} depend flag" >&5
3134 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
3135   echo $ac_n "(cached) $ac_c" 1>&6
3136 else
3137   
3138                         ol_cv_mkdep=no
3139                         for flag in "-M" "-xM"; do
3140                                 cat > conftest.c <<EOF
3141  noCode;
3142 EOF
3143                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3144                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3145                                 then
3146                                         if test ! -f conftest."${ac_object}" ; then
3147                                                 ol_cv_mkdep=$flag
3148                                                 OL_MKDEP_FLAGS="$flag"
3149                                                 break
3150                                         fi
3151                                 fi
3152                         done
3153                         rm -f conftest*
3154                 
3155 fi
3156
3157 echo "$ac_t""$ol_cv_mkdep" 1>&6
3158         else
3159                 cc_cv_mkdep=yes
3160                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3161         fi
3162 else
3163         cc_cv_mkdep=yes
3164         OL_MKDEP="${MKDEP}"
3165         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3166 fi
3167
3168
3169
3170 if test "${ol_cv_mkdep}" = no ; then
3171         # this will soon become an error
3172         echo "configure: warning: do not know how to generate dependencies" 1>&2
3173 fi
3174
3175
3176
3177 echo $ac_n "checking for socket""... $ac_c" 1>&6
3178 echo "configure:3179: checking for socket" >&5
3179 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3180   echo $ac_n "(cached) $ac_c" 1>&6
3181 else
3182   cat > conftest.$ac_ext <<EOF
3183 #line 3184 "configure"
3184 #include "confdefs.h"
3185 /* System header to define __stub macros and hopefully few prototypes,
3186     which can conflict with char socket(); below.  */
3187 #include <assert.h>
3188 /* Override any gcc2 internal prototype to avoid an error.  */
3189 /* We use char because int might match the return type of a gcc2
3190     builtin and then its argument prototype would still apply.  */
3191 char socket();
3192
3193 int main() {
3194
3195 /* The GNU C library defines this for functions which it implements
3196     to always fail with ENOSYS.  Some functions are actually named
3197     something starting with __ and the normal name is an alias.  */
3198 #if defined (__stub_socket) || defined (__stub___socket)
3199 choke me
3200 #else
3201 socket();
3202 #endif
3203
3204 ; return 0; }
3205 EOF
3206 if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3207   rm -rf conftest*
3208   eval "ac_cv_func_socket=yes"
3209 else
3210   echo "configure: failed program was:" >&5
3211   cat conftest.$ac_ext >&5
3212   rm -rf conftest*
3213   eval "ac_cv_func_socket=no"
3214 fi
3215 rm -f conftest*
3216 fi
3217
3218 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3219   echo "$ac_t""yes" 1>&6
3220   :
3221 else
3222   echo "$ac_t""no" 1>&6
3223         
3224         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3225 echo "configure:3226: checking for main in -lsocket" >&5
3226 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3227 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3228   echo $ac_n "(cached) $ac_c" 1>&6
3229 else
3230   ac_save_LIBS="$LIBS"
3231 LIBS="-lsocket  $LIBS"
3232 cat > conftest.$ac_ext <<EOF
3233 #line 3234 "configure"
3234 #include "confdefs.h"
3235
3236 int main() {
3237 main()
3238 ; return 0; }
3239 EOF
3240 if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3241   rm -rf conftest*
3242   eval "ac_cv_lib_$ac_lib_var=yes"
3243 else
3244   echo "configure: failed program was:" >&5
3245   cat conftest.$ac_ext >&5
3246   rm -rf conftest*
3247   eval "ac_cv_lib_$ac_lib_var=no"
3248 fi
3249 rm -f conftest*
3250 LIBS="$ac_save_LIBS"
3251
3252 fi
3253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3254   echo "$ac_t""yes" 1>&6
3255     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3256     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3257   cat >> confdefs.h <<EOF
3258 #define $ac_tr_lib 1
3259 EOF
3260
3261   LIBS="-lsocket $LIBS"
3262
3263 else
3264   echo "$ac_t""no" 1>&6
3265 fi
3266
3267         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3268 echo "configure:3269: checking for main in -lnet" >&5
3269 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3270 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3271   echo $ac_n "(cached) $ac_c" 1>&6
3272 else
3273   ac_save_LIBS="$LIBS"
3274 LIBS="-lnet  $LIBS"
3275 cat > conftest.$ac_ext <<EOF
3276 #line 3277 "configure"
3277 #include "confdefs.h"
3278
3279 int main() {
3280 main()
3281 ; return 0; }
3282 EOF
3283 if { (eval echo configure:3284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3284   rm -rf conftest*
3285   eval "ac_cv_lib_$ac_lib_var=yes"
3286 else
3287   echo "configure: failed program was:" >&5
3288   cat conftest.$ac_ext >&5
3289   rm -rf conftest*
3290   eval "ac_cv_lib_$ac_lib_var=no"
3291 fi
3292 rm -f conftest*
3293 LIBS="$ac_save_LIBS"
3294
3295 fi
3296 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3297   echo "$ac_t""yes" 1>&6
3298     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3299     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3300   cat >> confdefs.h <<EOF
3301 #define $ac_tr_lib 1
3302 EOF
3303
3304   LIBS="-lnet $LIBS"
3305
3306 else
3307   echo "$ac_t""no" 1>&6
3308 fi
3309
3310         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3311 echo "configure:3312: checking for socket in -lnet" >&5
3312 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3313 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3314   echo $ac_n "(cached) $ac_c" 1>&6
3315 else
3316   ac_save_LIBS="$LIBS"
3317 LIBS="-lnet  $LIBS"
3318 cat > conftest.$ac_ext <<EOF
3319 #line 3320 "configure"
3320 #include "confdefs.h"
3321 /* Override any gcc2 internal prototype to avoid an error.  */
3322 /* We use char because int might match the return type of a gcc2
3323     builtin and then its argument prototype would still apply.  */
3324 char socket();
3325
3326 int main() {
3327 socket()
3328 ; return 0; }
3329 EOF
3330 if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3331   rm -rf conftest*
3332   eval "ac_cv_lib_$ac_lib_var=yes"
3333 else
3334   echo "configure: failed program was:" >&5
3335   cat conftest.$ac_ext >&5
3336   rm -rf conftest*
3337   eval "ac_cv_lib_$ac_lib_var=no"
3338 fi
3339 rm -f conftest*
3340 LIBS="$ac_save_LIBS"
3341
3342 fi
3343 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3344   echo "$ac_t""yes" 1>&6
3345     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3346     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3347   cat >> confdefs.h <<EOF
3348 #define $ac_tr_lib 1
3349 EOF
3350
3351   LIBS="-lnet $LIBS"
3352
3353 else
3354   echo "$ac_t""no" 1>&6
3355 fi
3356
3357         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3358 echo "configure:3359: checking for main in -lnsl_s" >&5
3359 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3360 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3361   echo $ac_n "(cached) $ac_c" 1>&6
3362 else
3363   ac_save_LIBS="$LIBS"
3364 LIBS="-lnsl_s  $LIBS"
3365 cat > conftest.$ac_ext <<EOF
3366 #line 3367 "configure"
3367 #include "confdefs.h"
3368
3369 int main() {
3370 main()
3371 ; return 0; }
3372 EOF
3373 if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3374   rm -rf conftest*
3375   eval "ac_cv_lib_$ac_lib_var=yes"
3376 else
3377   echo "configure: failed program was:" >&5
3378   cat conftest.$ac_ext >&5
3379   rm -rf conftest*
3380   eval "ac_cv_lib_$ac_lib_var=no"
3381 fi
3382 rm -f conftest*
3383 LIBS="$ac_save_LIBS"
3384
3385 fi
3386 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3387   echo "$ac_t""yes" 1>&6
3388     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3389     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3390   cat >> confdefs.h <<EOF
3391 #define $ac_tr_lib 1
3392 EOF
3393
3394   LIBS="-lnsl_s $LIBS"
3395
3396 else
3397   echo "$ac_t""no" 1>&6
3398 fi
3399
3400         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3401 echo "configure:3402: checking for main in -lnsl" >&5
3402 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3403 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3404   echo $ac_n "(cached) $ac_c" 1>&6
3405 else
3406   ac_save_LIBS="$LIBS"
3407 LIBS="-lnsl  $LIBS"
3408 cat > conftest.$ac_ext <<EOF
3409 #line 3410 "configure"
3410 #include "confdefs.h"
3411
3412 int main() {
3413 main()
3414 ; return 0; }
3415 EOF
3416 if { (eval echo configure:3417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3417   rm -rf conftest*
3418   eval "ac_cv_lib_$ac_lib_var=yes"
3419 else
3420   echo "configure: failed program was:" >&5
3421   cat conftest.$ac_ext >&5
3422   rm -rf conftest*
3423   eval "ac_cv_lib_$ac_lib_var=no"
3424 fi
3425 rm -f conftest*
3426 LIBS="$ac_save_LIBS"
3427
3428 fi
3429 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3430   echo "$ac_t""yes" 1>&6
3431     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3432     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3433   cat >> confdefs.h <<EOF
3434 #define $ac_tr_lib 1
3435 EOF
3436
3437   LIBS="-lnsl $LIBS"
3438
3439 else
3440   echo "$ac_t""no" 1>&6
3441 fi
3442
3443         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3444 echo "configure:3445: checking for socket in -linet" >&5
3445 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3446 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3447   echo $ac_n "(cached) $ac_c" 1>&6
3448 else
3449   ac_save_LIBS="$LIBS"
3450 LIBS="-linet  $LIBS"
3451 cat > conftest.$ac_ext <<EOF
3452 #line 3453 "configure"
3453 #include "confdefs.h"
3454 /* Override any gcc2 internal prototype to avoid an error.  */
3455 /* We use char because int might match the return type of a gcc2
3456     builtin and then its argument prototype would still apply.  */
3457 char socket();
3458
3459 int main() {
3460 socket()
3461 ; return 0; }
3462 EOF
3463 if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3464   rm -rf conftest*
3465   eval "ac_cv_lib_$ac_lib_var=yes"
3466 else
3467   echo "configure: failed program was:" >&5
3468   cat conftest.$ac_ext >&5
3469   rm -rf conftest*
3470   eval "ac_cv_lib_$ac_lib_var=no"
3471 fi
3472 rm -f conftest*
3473 LIBS="$ac_save_LIBS"
3474
3475 fi
3476 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3477   echo "$ac_t""yes" 1>&6
3478     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3479     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3480   cat >> confdefs.h <<EOF
3481 #define $ac_tr_lib 1
3482 EOF
3483
3484   LIBS="-linet $LIBS"
3485
3486 else
3487   echo "$ac_t""no" 1>&6
3488 fi
3489
3490         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3491 echo "configure:3492: checking for main in -lgen" >&5
3492 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3493 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3494   echo $ac_n "(cached) $ac_c" 1>&6
3495 else
3496   ac_save_LIBS="$LIBS"
3497 LIBS="-lgen  $LIBS"
3498 cat > conftest.$ac_ext <<EOF
3499 #line 3500 "configure"
3500 #include "confdefs.h"
3501
3502 int main() {
3503 main()
3504 ; return 0; }
3505 EOF
3506 if { (eval echo configure:3507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3507   rm -rf conftest*
3508   eval "ac_cv_lib_$ac_lib_var=yes"
3509 else
3510   echo "configure: failed program was:" >&5
3511   cat conftest.$ac_ext >&5
3512   rm -rf conftest*
3513   eval "ac_cv_lib_$ac_lib_var=no"
3514 fi
3515 rm -f conftest*
3516 LIBS="$ac_save_LIBS"
3517
3518 fi
3519 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3520   echo "$ac_t""yes" 1>&6
3521     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3522     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3523   cat >> confdefs.h <<EOF
3524 #define $ac_tr_lib 1
3525 EOF
3526
3527   LIBS="-lgen $LIBS"
3528
3529 else
3530   echo "$ac_t""no" 1>&6
3531 fi
3532
3533
3534 fi
3535
3536
3537 for ac_func in res_search
3538 do
3539 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3540 echo "configure:3541: checking for $ac_func" >&5
3541 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3542   echo $ac_n "(cached) $ac_c" 1>&6
3543 else
3544   cat > conftest.$ac_ext <<EOF
3545 #line 3546 "configure"
3546 #include "confdefs.h"
3547 /* System header to define __stub macros and hopefully few prototypes,
3548     which can conflict with char $ac_func(); below.  */
3549 #include <assert.h>
3550 /* Override any gcc2 internal prototype to avoid an error.  */
3551 /* We use char because int might match the return type of a gcc2
3552     builtin and then its argument prototype would still apply.  */
3553 char $ac_func();
3554
3555 int main() {
3556
3557 /* The GNU C library defines this for functions which it implements
3558     to always fail with ENOSYS.  Some functions are actually named
3559     something starting with __ and the normal name is an alias.  */
3560 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3561 choke me
3562 #else
3563 $ac_func();
3564 #endif
3565
3566 ; return 0; }
3567 EOF
3568 if { (eval echo configure:3569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3569   rm -rf conftest*
3570   eval "ac_cv_func_$ac_func=yes"
3571 else
3572   echo "configure: failed program was:" >&5
3573   cat conftest.$ac_ext >&5
3574   rm -rf conftest*
3575   eval "ac_cv_func_$ac_func=no"
3576 fi
3577 rm -f conftest*
3578 fi
3579
3580 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3581   echo "$ac_t""yes" 1>&6
3582     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3583   cat >> confdefs.h <<EOF
3584 #define $ac_tr_func 1
3585 EOF
3586  
3587 else
3588   echo "$ac_t""no" 1>&6
3589 fi
3590 done
3591
3592 if test $ac_cv_func_res_search = "no" ; then 
3593         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3594 echo "configure:3595: checking for res_search in -lbind" >&5
3595 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3596 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3597   echo $ac_n "(cached) $ac_c" 1>&6
3598 else
3599   ac_save_LIBS="$LIBS"
3600 LIBS="-lbind  $LIBS"
3601 cat > conftest.$ac_ext <<EOF
3602 #line 3603 "configure"
3603 #include "confdefs.h"
3604 /* Override any gcc2 internal prototype to avoid an error.  */
3605 /* We use char because int might match the return type of a gcc2
3606     builtin and then its argument prototype would still apply.  */
3607 char res_search();
3608
3609 int main() {
3610 res_search()
3611 ; return 0; }
3612 EOF
3613 if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3614   rm -rf conftest*
3615   eval "ac_cv_lib_$ac_lib_var=yes"
3616 else
3617   echo "configure: failed program was:" >&5
3618   cat conftest.$ac_ext >&5
3619   rm -rf conftest*
3620   eval "ac_cv_lib_$ac_lib_var=no"
3621 fi
3622 rm -f conftest*
3623 LIBS="$ac_save_LIBS"
3624
3625 fi
3626 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3627   echo "$ac_t""yes" 1>&6
3628     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3629     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3630   cat >> confdefs.h <<EOF
3631 #define $ac_tr_lib 1
3632 EOF
3633
3634   LIBS="-lbind $LIBS"
3635
3636 else
3637   echo "$ac_t""no" 1>&6
3638 fi
3639
3640         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3641                 cat >> confdefs.h <<\EOF
3642 #define HAVE_RES_SEARCH 1
3643 EOF
3644
3645         else
3646                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3647 echo "configure:3648: checking for res_search in -lresolv" >&5
3648 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3649 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3650   echo $ac_n "(cached) $ac_c" 1>&6
3651 else
3652   ac_save_LIBS="$LIBS"
3653 LIBS="-lresolv  $LIBS"
3654 cat > conftest.$ac_ext <<EOF
3655 #line 3656 "configure"
3656 #include "confdefs.h"
3657 /* Override any gcc2 internal prototype to avoid an error.  */
3658 /* We use char because int might match the return type of a gcc2
3659     builtin and then its argument prototype would still apply.  */
3660 char res_search();
3661
3662 int main() {
3663 res_search()
3664 ; return 0; }
3665 EOF
3666 if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3667   rm -rf conftest*
3668   eval "ac_cv_lib_$ac_lib_var=yes"
3669 else
3670   echo "configure: failed program was:" >&5
3671   cat conftest.$ac_ext >&5
3672   rm -rf conftest*
3673   eval "ac_cv_lib_$ac_lib_var=no"
3674 fi
3675 rm -f conftest*
3676 LIBS="$ac_save_LIBS"
3677
3678 fi
3679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3680   echo "$ac_t""yes" 1>&6
3681     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3682     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3683   cat >> confdefs.h <<EOF
3684 #define $ac_tr_lib 1
3685 EOF
3686
3687   LIBS="-lresolv $LIBS"
3688
3689 else
3690   echo "$ac_t""no" 1>&6
3691 fi
3692
3693                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3694                         cat >> confdefs.h <<\EOF
3695 #define HAVE_RES_SEARCH 1
3696 EOF
3697
3698                 fi
3699         fi
3700 fi
3701
3702 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3703 echo "configure:3704: checking for sigset in -lV3" >&5
3704 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3705 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3706   echo $ac_n "(cached) $ac_c" 1>&6
3707 else
3708   ac_save_LIBS="$LIBS"
3709 LIBS="-lV3  $LIBS"
3710 cat > conftest.$ac_ext <<EOF
3711 #line 3712 "configure"
3712 #include "confdefs.h"
3713 /* Override any gcc2 internal prototype to avoid an error.  */
3714 /* We use char because int might match the return type of a gcc2
3715     builtin and then its argument prototype would still apply.  */
3716 char sigset();
3717
3718 int main() {
3719 sigset()
3720 ; return 0; }
3721 EOF
3722 if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3723   rm -rf conftest*
3724   eval "ac_cv_lib_$ac_lib_var=yes"
3725 else
3726   echo "configure: failed program was:" >&5
3727   cat conftest.$ac_ext >&5
3728   rm -rf conftest*
3729   eval "ac_cv_lib_$ac_lib_var=no"
3730 fi
3731 rm -f conftest*
3732 LIBS="$ac_save_LIBS"
3733
3734 fi
3735 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3736   echo "$ac_t""yes" 1>&6
3737     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3738     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3739   cat >> confdefs.h <<EOF
3740 #define $ac_tr_lib 1
3741 EOF
3742
3743   LIBS="-lV3 $LIBS"
3744
3745 else
3746   echo "$ac_t""no" 1>&6
3747 fi
3748
3749
3750 for ac_hdr in regex.h 
3751 do
3752 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3753 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3754 echo "configure:3755: checking for $ac_hdr" >&5
3755 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3756   echo $ac_n "(cached) $ac_c" 1>&6
3757 else
3758   cat > conftest.$ac_ext <<EOF
3759 #line 3760 "configure"
3760 #include "confdefs.h"
3761 #include <$ac_hdr>
3762 EOF
3763 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3764 { (eval echo configure:3765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3765 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3766 if test -z "$ac_err"; then
3767   rm -rf conftest*
3768   eval "ac_cv_header_$ac_safe=yes"
3769 else
3770   echo "$ac_err" >&5
3771   echo "configure: failed program was:" >&5
3772   cat conftest.$ac_ext >&5
3773   rm -rf conftest*
3774   eval "ac_cv_header_$ac_safe=no"
3775 fi
3776 rm -f conftest*
3777 fi
3778 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3779   echo "$ac_t""yes" 1>&6
3780     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3781   cat >> confdefs.h <<EOF
3782 #define $ac_tr_hdr 1
3783 EOF
3784  
3785 else
3786   echo "$ac_t""no" 1>&6
3787 fi
3788 done
3789
3790 if test "$ac_cv_header_regex_h" != yes ; then
3791         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
3792 fi
3793 echo $ac_n "checking for regfree""... $ac_c" 1>&6
3794 echo "configure:3795: checking for regfree" >&5
3795 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
3796   echo $ac_n "(cached) $ac_c" 1>&6
3797 else
3798   cat > conftest.$ac_ext <<EOF
3799 #line 3800 "configure"
3800 #include "confdefs.h"
3801 /* System header to define __stub macros and hopefully few prototypes,
3802     which can conflict with char regfree(); below.  */
3803 #include <assert.h>
3804 /* Override any gcc2 internal prototype to avoid an error.  */
3805 /* We use char because int might match the return type of a gcc2
3806     builtin and then its argument prototype would still apply.  */
3807 char regfree();
3808
3809 int main() {
3810
3811 /* The GNU C library defines this for functions which it implements
3812     to always fail with ENOSYS.  Some functions are actually named
3813     something starting with __ and the normal name is an alias.  */
3814 #if defined (__stub_regfree) || defined (__stub___regfree)
3815 choke me
3816 #else
3817 regfree();
3818 #endif
3819
3820 ; return 0; }
3821 EOF
3822 if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3823   rm -rf conftest*
3824   eval "ac_cv_func_regfree=yes"
3825 else
3826   echo "configure: failed program was:" >&5
3827   cat conftest.$ac_ext >&5
3828   rm -rf conftest*
3829   eval "ac_cv_func_regfree=no"
3830 fi
3831 rm -f conftest*
3832 fi
3833
3834 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
3835   echo "$ac_t""yes" 1>&6
3836   :
3837 else
3838   echo "$ac_t""no" 1>&6
3839 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
3840 fi
3841
3842
3843 echo $ac_n "checking for select""... $ac_c" 1>&6
3844 echo "configure:3845: checking for select" >&5
3845 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3846   echo $ac_n "(cached) $ac_c" 1>&6
3847 else
3848   cat > conftest.$ac_ext <<EOF
3849 #line 3850 "configure"
3850 #include "confdefs.h"
3851 /* System header to define __stub macros and hopefully few prototypes,
3852     which can conflict with char select(); below.  */
3853 #include <assert.h>
3854 /* Override any gcc2 internal prototype to avoid an error.  */
3855 /* We use char because int might match the return type of a gcc2
3856     builtin and then its argument prototype would still apply.  */
3857 char select();
3858
3859 int main() {
3860
3861 /* The GNU C library defines this for functions which it implements
3862     to always fail with ENOSYS.  Some functions are actually named
3863     something starting with __ and the normal name is an alias.  */
3864 #if defined (__stub_select) || defined (__stub___select)
3865 choke me
3866 #else
3867 select();
3868 #endif
3869
3870 ; return 0; }
3871 EOF
3872 if { (eval echo configure:3873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3873   rm -rf conftest*
3874   eval "ac_cv_func_select=yes"
3875 else
3876   echo "configure: failed program was:" >&5
3877   cat conftest.$ac_ext >&5
3878   rm -rf conftest*
3879   eval "ac_cv_func_select=no"
3880 fi
3881 rm -f conftest*
3882 fi
3883
3884 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3885   echo "$ac_t""yes" 1>&6
3886   :
3887 else
3888   echo "$ac_t""no" 1>&6
3889 { echo "configure: error: select() required." 1>&2; exit 1; }
3890 fi
3891
3892
3893 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3894 echo "configure:3895: checking types of arguments for select()" >&5
3895  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3896   echo $ac_n "(cached) $ac_c" 1>&6
3897 else
3898    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3899   echo $ac_n "(cached) $ac_c" 1>&6
3900 else
3901     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3902   echo $ac_n "(cached) $ac_c" 1>&6
3903 else
3904      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3905      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3906       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3907        cat > conftest.$ac_ext <<EOF
3908 #line 3909 "configure"
3909 #include "confdefs.h"
3910 #ifdef HAVE_SYS_TYPES_H
3911 #include <sys/types.h>
3912 #endif
3913 #ifdef HAVE_SYS_TIME_H
3914 #include <sys/time.h>
3915 #endif
3916 #ifdef HAVE_SYS_SELECT_H
3917 #include <sys/select.h>
3918 #endif
3919 #ifdef HAVE_SYS_SOCKET_H
3920 #include <sys/socket.h>
3921 #endif
3922 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);
3923 int main() {
3924
3925 ; return 0; }
3926 EOF
3927 if { (eval echo configure:3928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3928   rm -rf conftest*
3929           ac_not_found=no ; break 3
3930 else
3931   echo "configure: failed program was:" >&5
3932   cat conftest.$ac_ext >&5
3933   rm -rf conftest*
3934   ac_not_found=yes
3935 fi
3936 rm -f conftest*
3937       done
3938      done
3939     done
3940    
3941 fi
3942   
3943 fi
3944  
3945 fi
3946  if test "$ac_not_found" = yes; then
3947   ac_cv_func_select_arg1=int 
3948   ac_cv_func_select_arg234='int *' 
3949   ac_cv_func_select_arg5='struct timeval *'
3950  fi
3951  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3952  cat >> confdefs.h <<EOF
3953 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3954 EOF
3955
3956  cat >> confdefs.h <<EOF
3957 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3958 EOF
3959
3960  cat >> confdefs.h <<EOF
3961 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3962 EOF
3963
3964
3965
3966 # ISODE tests
3967 ol_link_isode=no
3968 if test $ol_enable_ldapd != no ; then
3969         echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
3970
3971                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3972 echo "configure:3973: checking for main in -lxtpp" >&5
3973 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3974 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3975   echo $ac_n "(cached) $ac_c" 1>&6
3976 else
3977   ac_save_LIBS="$LIBS"
3978 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3979 cat > conftest.$ac_ext <<EOF
3980 #line 3981 "configure"
3981 #include "confdefs.h"
3982
3983 int main() {
3984 main()
3985 ; return 0; }
3986 EOF
3987 if { (eval echo configure:3988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3988   rm -rf conftest*
3989   eval "ac_cv_lib_$ac_lib_var=yes"
3990 else
3991   echo "configure: failed program was:" >&5
3992   cat conftest.$ac_ext >&5
3993   rm -rf conftest*
3994   eval "ac_cv_lib_$ac_lib_var=no"
3995 fi
3996 rm -f conftest*
3997 LIBS="$ac_save_LIBS"
3998
3999 fi
4000 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4001   echo "$ac_t""yes" 1>&6
4002   
4003                 ol_link_isode=yes
4004                 cat >> confdefs.h <<\EOF
4005 #define HAVE_XTPP 1
4006 EOF
4007
4008                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
4009                 
4010 else
4011   echo "$ac_t""no" 1>&6
4012 :
4013 fi
4014
4015         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
4016 echo "configure:4017: checking for main in -ldsap" >&5
4017 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
4018 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4019   echo $ac_n "(cached) $ac_c" 1>&6
4020 else
4021   ac_save_LIBS="$LIBS"
4022 LIBS="-ldsap -lisode $LIBS"
4023 cat > conftest.$ac_ext <<EOF
4024 #line 4025 "configure"
4025 #include "confdefs.h"
4026
4027 int main() {
4028 main()
4029 ; return 0; }
4030 EOF
4031 if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4032   rm -rf conftest*
4033   eval "ac_cv_lib_$ac_lib_var=yes"
4034 else
4035   echo "configure: failed program was:" >&5
4036   cat conftest.$ac_ext >&5
4037   rm -rf conftest*
4038   eval "ac_cv_lib_$ac_lib_var=no"
4039 fi
4040 rm -f conftest*
4041 LIBS="$ac_save_LIBS"
4042
4043 fi
4044 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4045   echo "$ac_t""yes" 1>&6
4046   
4047                 ol_link_isode=yes
4048                 cat >> confdefs.h <<\EOF
4049 #define HAVE_DSAP 1
4050 EOF
4051
4052                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
4053                 
4054 else
4055   echo "$ac_t""no" 1>&6
4056 :
4057 fi
4058
4059         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
4060 echo "configure:4061: checking for main in -lisode" >&5
4061 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
4062 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4063   echo $ac_n "(cached) $ac_c" 1>&6
4064 else
4065   ac_save_LIBS="$LIBS"
4066 LIBS="-lisode  $LIBS"
4067 cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070
4071 int main() {
4072 main()
4073 ; return 0; }
4074 EOF
4075 if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4076   rm -rf conftest*
4077   eval "ac_cv_lib_$ac_lib_var=yes"
4078 else
4079   echo "configure: failed program was:" >&5
4080   cat conftest.$ac_ext >&5
4081   rm -rf conftest*
4082   eval "ac_cv_lib_$ac_lib_var=no"
4083 fi
4084 rm -f conftest*
4085 LIBS="$ac_save_LIBS"
4086
4087 fi
4088 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4089   echo "$ac_t""yes" 1>&6
4090   
4091                 ol_link_isode=yes
4092                 cat >> confdefs.h <<\EOF
4093 #define HAVE_ISODE 1
4094 EOF
4095
4096                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
4097                 
4098 else
4099   echo "$ac_t""no" 1>&6
4100 :
4101 fi
4102
4103 fi
4104
4105 if test $ol_link_isode != no; then
4106         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
4107 echo "configure:4108: checking for main in -lpp" >&5
4108 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
4109 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4110   echo $ac_n "(cached) $ac_c" 1>&6
4111 else
4112   ac_save_LIBS="$LIBS"
4113 LIBS="-lpp  $LIBS"
4114 cat > conftest.$ac_ext <<EOF
4115 #line 4116 "configure"
4116 #include "confdefs.h"
4117
4118 int main() {
4119 main()
4120 ; return 0; }
4121 EOF
4122 if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4123   rm -rf conftest*
4124   eval "ac_cv_lib_$ac_lib_var=yes"
4125 else
4126   echo "configure: failed program was:" >&5
4127   cat conftest.$ac_ext >&5
4128   rm -rf conftest*
4129   eval "ac_cv_lib_$ac_lib_var=no"
4130 fi
4131 rm -f conftest*
4132 LIBS="$ac_save_LIBS"
4133
4134 fi
4135 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4136   echo "$ac_t""yes" 1>&6
4137   
4138                 cat >> confdefs.h <<\EOF
4139 #define HAVE_PP 1
4140 EOF
4141
4142                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
4143                 
4144 else
4145   echo "$ac_t""no" 1>&6
4146 :
4147 fi
4148
4149
4150         # Extract the first word of "pepsy", so it can be a program name with args.
4151 set dummy pepsy; ac_word=$2
4152 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4153 echo "configure:4154: checking for $ac_word" >&5
4154 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
4155   echo $ac_n "(cached) $ac_c" 1>&6
4156 else
4157   case "$PEPSY" in
4158   /*)
4159   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
4160   ;;
4161   ?:/*)                  
4162   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
4163   ;;
4164   *)
4165   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4166   ac_dummy="$PATH"
4167   for ac_dir in $ac_dummy; do 
4168     test -z "$ac_dir" && ac_dir=.
4169     if test -f $ac_dir/$ac_word; then
4170       ac_cv_path_PEPSY="$ac_dir/$ac_word"
4171       break
4172     fi
4173   done
4174   IFS="$ac_save_ifs"
4175   ;;
4176 esac
4177 fi
4178 PEPSY="$ac_cv_path_PEPSY"
4179 if test -n "$PEPSY"; then
4180   echo "$ac_t""$PEPSY" 1>&6
4181 else
4182   echo "$ac_t""no" 1>&6
4183 fi
4184
4185 fi
4186
4187 ol_link_kerberos=no
4188
4189 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
4190         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
4191 do
4192 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4193 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4194 echo "configure:4195: checking for $ac_hdr" >&5
4195 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4196   echo $ac_n "(cached) $ac_c" 1>&6
4197 else
4198   cat > conftest.$ac_ext <<EOF
4199 #line 4200 "configure"
4200 #include "confdefs.h"
4201 #include <$ac_hdr>
4202 EOF
4203 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4204 { (eval echo configure:4205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4205 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4206 if test -z "$ac_err"; then
4207   rm -rf conftest*
4208   eval "ac_cv_header_$ac_safe=yes"
4209 else
4210   echo "$ac_err" >&5
4211   echo "configure: failed program was:" >&5
4212   cat conftest.$ac_ext >&5
4213   rm -rf conftest*
4214   eval "ac_cv_header_$ac_safe=no"
4215 fi
4216 rm -f conftest*
4217 fi
4218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4219   echo "$ac_t""yes" 1>&6
4220     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4221   cat >> confdefs.h <<EOF
4222 #define $ac_tr_hdr 1
4223 EOF
4224  
4225 else
4226   echo "$ac_t""no" 1>&6
4227 fi
4228 done
4229
4230
4231         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4232                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4233 echo "configure:4234: checking for main in -lkrb4" >&5
4234 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4235 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4236   echo $ac_n "(cached) $ac_c" 1>&6
4237 else
4238   ac_save_LIBS="$LIBS"
4239 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4240 cat > conftest.$ac_ext <<EOF
4241 #line 4242 "configure"
4242 #include "confdefs.h"
4243
4244 int main() {
4245 main()
4246 ; return 0; }
4247 EOF
4248 if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4249   rm -rf conftest*
4250   eval "ac_cv_lib_$ac_lib_var=yes"
4251 else
4252   echo "configure: failed program was:" >&5
4253   cat conftest.$ac_ext >&5
4254   rm -rf conftest*
4255   eval "ac_cv_lib_$ac_lib_var=no"
4256 fi
4257 rm -f conftest*
4258 LIBS="$ac_save_LIBS"
4259
4260 fi
4261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4262   echo "$ac_t""yes" 1>&6
4263   have_k5=yes
4264 else
4265   echo "$ac_t""no" 1>&6
4266 have_k5=no
4267 fi
4268
4269
4270                 if test $have_k5 = yes ; then
4271                         ol_with_kerberos=found
4272                         ol_link_kerberos=yes
4273
4274                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4275
4276                         LIBS="$KRB_LIBS $LIBS"
4277
4278                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4279 echo "configure:4280: checking for des_debug in Kerberos libraries" >&5
4280 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4281   echo $ac_n "(cached) $ac_c" 1>&6
4282 else
4283   
4284                                                                 save_LIBS="$LIBS"
4285                                 LIBS="$KRB_LIBS $LIBS"
4286                                 cat > conftest.$ac_ext <<EOF
4287 #line 4288 "configure"
4288 #include "confdefs.h"
4289
4290 #include <kerberosIV/krb.h>
4291 #include <kerberosIV/des.h>
4292 extern int des_debug;
4293
4294 int main() {
4295
4296 des_debug = 1;
4297
4298 ; return 0; }
4299 EOF
4300 if { (eval echo configure:4301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4301   rm -rf conftest*
4302   ol_cv_var_des_debug=yes
4303 else
4304   echo "configure: failed program was:" >&5
4305   cat conftest.$ac_ext >&5
4306   rm -rf conftest*
4307   ol_cv_var_des_debug=no
4308 fi
4309 rm -f conftest*
4310                                                                 LIBS="$save_LIBS"
4311                         
4312 fi
4313
4314 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4315
4316                         if test $ol_cv_var_des_debug = yes ; then
4317                                 cat >> confdefs.h <<\EOF
4318 #define HAVE_DES_DEBUG 1
4319 EOF
4320
4321                         fi
4322
4323                         LIBS="$save_LIBS"
4324                 fi
4325         fi
4326 fi
4327
4328 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4329         for ac_hdr in krb.h des.h
4330 do
4331 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4332 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4333 echo "configure:4334: checking for $ac_hdr" >&5
4334 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4335   echo $ac_n "(cached) $ac_c" 1>&6
4336 else
4337   cat > conftest.$ac_ext <<EOF
4338 #line 4339 "configure"
4339 #include "confdefs.h"
4340 #include <$ac_hdr>
4341 EOF
4342 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4343 { (eval echo configure:4344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4344 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4345 if test -z "$ac_err"; then
4346   rm -rf conftest*
4347   eval "ac_cv_header_$ac_safe=yes"
4348 else
4349   echo "$ac_err" >&5
4350   echo "configure: failed program was:" >&5
4351   cat conftest.$ac_ext >&5
4352   rm -rf conftest*
4353   eval "ac_cv_header_$ac_safe=no"
4354 fi
4355 rm -f conftest*
4356 fi
4357 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4358   echo "$ac_t""yes" 1>&6
4359     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4360   cat >> confdefs.h <<EOF
4361 #define $ac_tr_hdr 1
4362 EOF
4363  
4364 else
4365   echo "$ac_t""no" 1>&6
4366 fi
4367 done
4368
4369
4370         if test $ac_cv_header_krb_h = yes ; then
4371                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4372 echo "configure:4373: checking for main in -lkrb" >&5
4373 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4374 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4375   echo $ac_n "(cached) $ac_c" 1>&6
4376 else
4377   ac_save_LIBS="$LIBS"
4378 LIBS="-lkrb -ldes $LIBS"
4379 cat > conftest.$ac_ext <<EOF
4380 #line 4381 "configure"
4381 #include "confdefs.h"
4382
4383 int main() {
4384 main()
4385 ; return 0; }
4386 EOF
4387 if { (eval echo configure:4388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4388   rm -rf conftest*
4389   eval "ac_cv_lib_$ac_lib_var=yes"
4390 else
4391   echo "configure: failed program was:" >&5
4392   cat conftest.$ac_ext >&5
4393   rm -rf conftest*
4394   eval "ac_cv_lib_$ac_lib_var=no"
4395 fi
4396 rm -f conftest*
4397 LIBS="$ac_save_LIBS"
4398
4399 fi
4400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4401   echo "$ac_t""yes" 1>&6
4402   have_k4=yes
4403 else
4404   echo "$ac_t""no" 1>&6
4405 have_k4=no
4406 fi
4407
4408
4409                 if test $have_k4 = yes ; then
4410                         ol_with_kerberos=found
4411                         ol_link_kerberos=yes
4412
4413                         KRB_LIBS="-lkrb -ldes"
4414                 fi
4415         fi
4416 fi
4417
4418 if test $ol_link_kerberos = yes ; then
4419         cat >> confdefs.h <<\EOF
4420 #define HAVE_KERBEROS 1
4421 EOF
4422
4423 fi
4424
4425 ol_link_tls=no
4426 if test $ol_with_tls != no ; then
4427         
4428         for ac_hdr in ssl.h
4429 do
4430 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4431 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4432 echo "configure:4433: checking for $ac_hdr" >&5
4433 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4434   echo $ac_n "(cached) $ac_c" 1>&6
4435 else
4436   cat > conftest.$ac_ext <<EOF
4437 #line 4438 "configure"
4438 #include "confdefs.h"
4439 #include <$ac_hdr>
4440 EOF
4441 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4442 { (eval echo configure:4443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4443 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4444 if test -z "$ac_err"; then
4445   rm -rf conftest*
4446   eval "ac_cv_header_$ac_safe=yes"
4447 else
4448   echo "$ac_err" >&5
4449   echo "configure: failed program was:" >&5
4450   cat conftest.$ac_ext >&5
4451   rm -rf conftest*
4452   eval "ac_cv_header_$ac_safe=no"
4453 fi
4454 rm -f conftest*
4455 fi
4456 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4457   echo "$ac_t""yes" 1>&6
4458     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4459   cat >> confdefs.h <<EOF
4460 #define $ac_tr_hdr 1
4461 EOF
4462  
4463 else
4464   echo "$ac_t""no" 1>&6
4465 fi
4466 done
4467
4468         
4469         if test $ac_cv_header_ssl_h = yes ; then
4470                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4471 echo "configure:4472: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4472 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4473 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4474   echo $ac_n "(cached) $ac_c" 1>&6
4475 else
4476   ac_save_LIBS="$LIBS"
4477 LIBS="-lssl -lcrypto $LIBS"
4478 cat > conftest.$ac_ext <<EOF
4479 #line 4480 "configure"
4480 #include "confdefs.h"
4481 /* Override any gcc2 internal prototype to avoid an error.  */
4482 /* We use char because int might match the return type of a gcc2
4483     builtin and then its argument prototype would still apply.  */
4484 char SSLeay_add_ssl_algorithms();
4485
4486 int main() {
4487 SSLeay_add_ssl_algorithms()
4488 ; return 0; }
4489 EOF
4490 if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4491   rm -rf conftest*
4492   eval "ac_cv_lib_$ac_lib_var=yes"
4493 else
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496   rm -rf conftest*
4497   eval "ac_cv_lib_$ac_lib_var=no"
4498 fi
4499 rm -f conftest*
4500 LIBS="$ac_save_LIBS"
4501
4502 fi
4503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4504   echo "$ac_t""yes" 1>&6
4505   have_ssleay=yes
4506                         need_rsaref=no
4507 else
4508   echo "$ac_t""no" 1>&6
4509 have_ssleay=no
4510 fi
4511
4512                         
4513                 if test $have_ssleay = no ; then
4514                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4515 echo "configure:4516: checking for ssl3_accept in -lssl" >&5
4516 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4517 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4518   echo $ac_n "(cached) $ac_c" 1>&6
4519 else
4520   ac_save_LIBS="$LIBS"
4521 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4522 cat > conftest.$ac_ext <<EOF
4523 #line 4524 "configure"
4524 #include "confdefs.h"
4525 /* Override any gcc2 internal prototype to avoid an error.  */
4526 /* We use char because int might match the return type of a gcc2
4527     builtin and then its argument prototype would still apply.  */
4528 char ssl3_accept();
4529
4530 int main() {
4531 ssl3_accept()
4532 ; return 0; }
4533 EOF
4534 if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4535   rm -rf conftest*
4536   eval "ac_cv_lib_$ac_lib_var=yes"
4537 else
4538   echo "configure: failed program was:" >&5
4539   cat conftest.$ac_ext >&5
4540   rm -rf conftest*
4541   eval "ac_cv_lib_$ac_lib_var=no"
4542 fi
4543 rm -f conftest*
4544 LIBS="$ac_save_LIBS"
4545
4546 fi
4547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4548   echo "$ac_t""yes" 1>&6
4549   have_ssleay=yes
4550                                 need_rsaref=yes
4551 else
4552   echo "$ac_t""no" 1>&6
4553 have_ssleay=no
4554 fi
4555
4556                 fi
4557
4558                 if test $have_ssleay = yes ; then
4559                         ol_with_tls=found
4560                         ol_link_tls=yes
4561
4562                         cat >> confdefs.h <<\EOF
4563 #define HAVE_SSLEAY 1
4564 EOF
4565
4566
4567                         if test $need_rsaref = yes; then
4568                                 cat >> confdefs.h <<\EOF
4569 #define HAVE_RSAREF 1
4570 EOF
4571
4572
4573                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4574                         else
4575                                 TLS_LIBS="-lssl -lcrypto"
4576                         fi
4577                 fi
4578         fi
4579 fi
4580
4581 if test $ol_link_tls = yes ; then
4582         cat >> confdefs.h <<\EOF
4583 #define HAVE_TLS 1
4584 EOF
4585
4586 fi      
4587
4588 for ac_func in \
4589         ctime_r                 \
4590         gethostbyname_r gethostbyaddr_r \
4591
4592 do
4593 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4594 echo "configure:4595: checking for $ac_func" >&5
4595 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4596   echo $ac_n "(cached) $ac_c" 1>&6
4597 else
4598   cat > conftest.$ac_ext <<EOF
4599 #line 4600 "configure"
4600 #include "confdefs.h"
4601 /* System header to define __stub macros and hopefully few prototypes,
4602     which can conflict with char $ac_func(); below.  */
4603 #include <assert.h>
4604 /* Override any gcc2 internal prototype to avoid an error.  */
4605 /* We use char because int might match the return type of a gcc2
4606     builtin and then its argument prototype would still apply.  */
4607 char $ac_func();
4608
4609 int main() {
4610
4611 /* The GNU C library defines this for functions which it implements
4612     to always fail with ENOSYS.  Some functions are actually named
4613     something starting with __ and the normal name is an alias.  */
4614 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4615 choke me
4616 #else
4617 $ac_func();
4618 #endif
4619
4620 ; return 0; }
4621 EOF
4622 if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4623   rm -rf conftest*
4624   eval "ac_cv_func_$ac_func=yes"
4625 else
4626   echo "configure: failed program was:" >&5
4627   cat conftest.$ac_ext >&5
4628   rm -rf conftest*
4629   eval "ac_cv_func_$ac_func=no"
4630 fi
4631 rm -f conftest*
4632 fi
4633
4634 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4635   echo "$ac_t""yes" 1>&6
4636     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4637   cat >> confdefs.h <<EOF
4638 #define $ac_tr_func 1
4639 EOF
4640  
4641 else
4642   echo "$ac_t""no" 1>&6
4643 fi
4644 done
4645
4646
4647 if test "$ac_cv_func_ctime_r" = no ; then
4648         ol_cv_func_ctime_r_nargs=0
4649 else
4650         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4651 echo "configure:4652: checking number of arguments of ctime_r" >&5
4652 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4653   echo $ac_n "(cached) $ac_c" 1>&6
4654 else
4655   cat > conftest.$ac_ext <<EOF
4656 #line 4657 "configure"
4657 #include "confdefs.h"
4658 #include <time.h>
4659 int main() {
4660 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4661 ; return 0; }
4662 EOF
4663 if { (eval echo configure:4664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4664   rm -rf conftest*
4665   ol_cv_func_ctime_r_nargs=3
4666 else
4667   echo "configure: failed program was:" >&5
4668   cat conftest.$ac_ext >&5
4669   rm -rf conftest*
4670   cat > conftest.$ac_ext <<EOF
4671 #line 4672 "configure"
4672 #include "confdefs.h"
4673 #include <time.h>
4674 int main() {
4675 time_t ti; char *buffer; ctime_r(&ti,buffer);
4676 ; return 0; }
4677 EOF
4678 if { (eval echo configure:4679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4679   rm -rf conftest*
4680   ol_cv_func_ctime_r_nargs=2
4681 else
4682   echo "configure: failed program was:" >&5
4683   cat conftest.$ac_ext >&5
4684   rm -rf conftest*
4685   ol_cv_func_ctime_r_nargs=0
4686 fi
4687 rm -f conftest*
4688 fi
4689 rm -f conftest*
4690 fi
4691
4692 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4693   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4694     cat >> confdefs.h <<EOF
4695 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4696 EOF
4697
4698   fi
4699
4700 fi
4701
4702 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4703         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4704 echo "configure:4705: checking number of arguments of gethostbyname_r" >&5
4705 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4706   echo $ac_n "(cached) $ac_c" 1>&6
4707 else
4708   cat > conftest.$ac_ext <<EOF
4709 #line 4710 "configure"
4710 #include "confdefs.h"
4711 #include <sys/types.h>
4712 #include <sys/socket.h>
4713 #include <netinet/in.h>
4714 #include <netdb.h>
4715 #define BUFSIZE (sizeof(struct hostent)+10)
4716 int main() {
4717 struct hostent hent; char buffer[BUFSIZE];
4718                 int bufsize=BUFSIZE;int h_errno;
4719                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4720                         buffer, bufsize, &h_errno);
4721 ; return 0; }
4722 EOF
4723 if { (eval echo configure:4724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4724   rm -rf conftest*
4725   ol_cv_func_gethostbyname_r_nargs=5
4726 else
4727   echo "configure: failed program was:" >&5
4728   cat conftest.$ac_ext >&5
4729   rm -rf conftest*
4730   cat > conftest.$ac_ext <<EOF
4731 #line 4732 "configure"
4732 #include "confdefs.h"
4733 #include <sys/types.h>
4734 #include <sys/socket.h>
4735 #include <netinet/in.h>
4736 #include <netdb.h>
4737 #define BUFSIZE (sizeof(struct hostent)+10)
4738 int main() {
4739 struct hostent hent;struct hostent *rhent;
4740                         char buffer[BUFSIZE];
4741                         int bufsize=BUFSIZE;int h_errno;
4742                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4743                                 &rhent, &h_errno);
4744 ; return 0; }
4745 EOF
4746 if { (eval echo configure:4747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4747   rm -rf conftest*
4748   ol_cv_func_gethostbyname_r_nargs=6
4749 else
4750   echo "configure: failed program was:" >&5
4751   cat conftest.$ac_ext >&5
4752   rm -rf conftest*
4753   ol_cv_func_gethostbyname_r_nargs=0
4754 fi
4755 rm -f conftest*
4756 fi
4757 rm -f conftest*
4758 fi
4759
4760 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4761   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4762         cat >> confdefs.h <<EOF
4763 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4764 EOF
4765
4766   fi
4767
4768 else
4769         ol_cv_func_gethostbyname_r_nargs=0
4770 fi
4771  
4772 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4773         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4774 echo "configure:4775: checking number of arguments of gethostbyaddr_r" >&5
4775 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4776   echo $ac_n "(cached) $ac_c" 1>&6
4777 else
4778   cat > conftest.$ac_ext <<EOF
4779 #line 4780 "configure"
4780 #include "confdefs.h"
4781 #include <sys/types.h>
4782 #include <sys/socket.h>
4783 #include <netinet/in.h>
4784 #include <netdb.h>
4785 #define BUFSIZE (sizeof(struct hostent)+10)
4786 int main() {
4787 struct hostent hent; char buffer[BUFSIZE]; 
4788             struct in_addr add;
4789             size_t alen=sizeof(struct in_addr);
4790             int bufsize=BUFSIZE;int h_errno;
4791                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4792                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4793 ; return 0; }
4794 EOF
4795 if { (eval echo configure:4796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4796   rm -rf conftest*
4797   ol_cv_func_gethostbyaddr_r_nargs=7
4798 else
4799   echo "configure: failed program was:" >&5
4800   cat conftest.$ac_ext >&5
4801   rm -rf conftest*
4802   cat > conftest.$ac_ext <<EOF
4803 #line 4804 "configure"
4804 #include "confdefs.h"
4805 #include <sys/types.h>
4806 #include <sys/socket.h>
4807 #include <netinet/in.h>
4808 #include <netdb.h>
4809 #define BUFSIZE (sizeof(struct hostent)+10)
4810 int main() {
4811 struct hostent hent;
4812                         struct hostent *rhent; char buffer[BUFSIZE]; 
4813                         struct in_addr add;
4814                         size_t alen=sizeof(struct in_addr);
4815                         int bufsize=BUFSIZE;int h_errno;
4816                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4817                                 alen, AF_INET, &hent, buffer, bufsize, 
4818                                 &rhent, &h_errno);
4819 ; return 0; }
4820 EOF
4821 if { (eval echo configure:4822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4822   rm -rf conftest*
4823   ol_cv_func_gethostbyaddr_r_nargs=8
4824 else
4825   echo "configure: failed program was:" >&5
4826   cat conftest.$ac_ext >&5
4827   rm -rf conftest*
4828   ol_cv_func_gethostbyaddr_r_nargs=0
4829 fi
4830 rm -f conftest*
4831 fi
4832 rm -f conftest*
4833 fi
4834
4835 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4836   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4837     cat >> confdefs.h <<EOF
4838 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4839 EOF
4840
4841   fi
4842
4843 else
4844         ol_cv_func_gethostbyaddr_r_nargs=0
4845 fi
4846
4847 if test "$ac_cv_func_ctime_r" = yes \
4848         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4849         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4850         -a "$ac_cv_func_gethostbyname_r" = yes \
4851         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4852         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4853         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4854         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4855         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4856         ; then
4857  
4858         cat >> confdefs.h <<\EOF
4859 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4860 EOF
4861
4862 fi
4863
4864 ol_link_threads=no
4865 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4866         -o $ol_with_threads = posix ; then
4867
4868         for ac_hdr in pthread.h sched.h
4869 do
4870 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4871 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4872 echo "configure:4873: checking for $ac_hdr" >&5
4873 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4874   echo $ac_n "(cached) $ac_c" 1>&6
4875 else
4876   cat > conftest.$ac_ext <<EOF
4877 #line 4878 "configure"
4878 #include "confdefs.h"
4879 #include <$ac_hdr>
4880 EOF
4881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4882 { (eval echo configure:4883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4884 if test -z "$ac_err"; then
4885   rm -rf conftest*
4886   eval "ac_cv_header_$ac_safe=yes"
4887 else
4888   echo "$ac_err" >&5
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   eval "ac_cv_header_$ac_safe=no"
4893 fi
4894 rm -f conftest*
4895 fi
4896 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4897   echo "$ac_t""yes" 1>&6
4898     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4899   cat >> confdefs.h <<EOF
4900 #define $ac_tr_hdr 1
4901 EOF
4902  
4903 else
4904   echo "$ac_t""no" 1>&6
4905 fi
4906 done
4907
4908
4909         if test $ac_cv_header_pthread_h = yes ; then
4910                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4911 echo "configure:4912: checking POSIX thread version" >&5
4912 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4913   echo $ac_n "(cached) $ac_c" 1>&6
4914 else
4915   
4916         cat > conftest.$ac_ext <<EOF
4917 #line 4918 "configure"
4918 #include "confdefs.h"
4919
4920 #               include <pthread.h>
4921                 /* this check could be improved */
4922 #               ifdef PTHREAD_ONCE_INIT
4923                         pthread_version_final
4924 #               endif
4925         
4926 EOF
4927 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4928   egrep "pthread_version_final" >/dev/null 2>&1; then
4929   rm -rf conftest*
4930   ol_pthread_final=yes
4931 else
4932   rm -rf conftest*
4933   ol_pthread_final=no
4934 fi
4935 rm -f conftest*
4936
4937
4938         cat > conftest.$ac_ext <<EOF
4939 #line 4940 "configure"
4940 #include "confdefs.h"
4941
4942 #               include <pthread.h>
4943                 /* this check could be improved */
4944 #               ifdef pthread_once_init
4945                         pthread_version_draft4
4946 #               endif
4947         
4948 EOF
4949 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4950   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4951   rm -rf conftest*
4952   ol_pthread_draft4=yes
4953 else
4954   rm -rf conftest*
4955   ol_pthread_draft4=no
4956 fi
4957 rm -f conftest*
4958
4959
4960         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4961                 ol_cv_pthread_version=final
4962         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4963                 ol_cv_pthread_version=draft4
4964         else
4965                 ol_cv_pthread_version=unknown
4966         fi
4967
4968 fi
4969
4970 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4971
4972
4973                 if test $ol_cv_pthread_version = final ; then
4974                         cat >> confdefs.h <<\EOF
4975 #define HAVE_PTHREADS_FINAL 1
4976 EOF
4977
4978                 elif test $ol_cv_pthread_version = draft4 ; then
4979                         cat >> confdefs.h <<\EOF
4980 #define HAVE_PTHREADS_D4 1
4981 EOF
4982
4983                 else
4984                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4985                 fi
4986
4987                 # consider threads found
4988                 ol_with_threads=found
4989
4990                 
4991         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4992 echo "configure:4993: checking for LinuxThreads pthread.h" >&5
4993 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4994   echo $ac_n "(cached) $ac_c" 1>&6
4995 else
4996   cat > conftest.$ac_ext <<EOF
4997 #line 4998 "configure"
4998 #include "confdefs.h"
4999 #include <pthread.h>
5000 EOF
5001 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5002   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
5003   rm -rf conftest*
5004   ol_cv_header_linux_threads=yes
5005 else
5006   rm -rf conftest*
5007   ol_cv_header_linux_threads=no
5008 fi
5009 rm -f conftest*
5010
5011                 
5012 fi
5013
5014 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
5015         if test $ol_cv_header_linux_threads = yes; then
5016                 cat >> confdefs.h <<\EOF
5017 #define HAVE_LINUX_THREADS 1
5018 EOF
5019
5020         fi
5021
5022
5023                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5024                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
5025 echo "configure:5026: checking for pthread_create in default libraries" >&5
5026                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
5027   echo $ac_n "(cached) $ac_c" 1>&6
5028 else
5029   
5030                 if test "$cross_compiling" = yes; then
5031                         ol_cv_pthread_create=yes
5032 else
5033   cat > conftest.$ac_ext <<EOF
5034 #line 5035 "configure"
5035 #include "confdefs.h"
5036
5037 #include <pthread.h>
5038 #ifndef NULL
5039 #define NULL (void*)0
5040 #endif
5041
5042 static void *task(p)
5043         void *p;
5044 {
5045         return (void *) (p == NULL);
5046 }
5047
5048 int main(argc, argv)
5049         int argc;
5050         char **argv;
5051 {
5052         pthread_t t;
5053         int status;
5054
5055         /* make sure pthread_create() isn't just a stub */
5056 #if HAVE_PTHREADS_D4
5057         status = pthread_create(&t, pthread_attr_default, task, NULL);
5058 #else
5059         status = pthread_create(&t, NULL, task, NULL);
5060 #endif
5061
5062         if( status ) return status;
5063
5064         /* make sure pthread_detach() isn't just a stub */
5065 #if HAVE_PTHREADS_D4
5066         status = pthread_detach( &t );
5067 #else
5068         status = pthread_detach( t );
5069 #endif
5070
5071         if( status ) return status;
5072
5073         return status;
5074 }
5075
5076 EOF
5077 if { (eval echo configure:5078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5078 then
5079   ol_cv_pthread_create=yes
5080 else
5081   echo "configure: failed program was:" >&5
5082   cat conftest.$ac_ext >&5
5083   rm -fr conftest*
5084   ol_cv_pthread_create=no
5085 fi
5086 rm -fr conftest*
5087 fi
5088
5089 fi
5090
5091                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
5092
5093                 if test $ol_cv_pthread_create != no ; then
5094                         ol_link_threads=posix
5095                         ol_link_pthreads=""
5096                 fi
5097                 
5098                 # Pthread try link: -mt (ol_cv_pthread_mt)
5099         if test "$ol_link_threads" = no ; then
5100                 # try -mt
5101                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
5102 echo "configure:5103: checking for pthread link with -mt" >&5
5103 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
5104   echo $ac_n "(cached) $ac_c" 1>&6
5105 else
5106   
5107                         # save the flags
5108                         ol_LIBS="$LIBS"
5109                         LIBS="-mt $LIBS"
5110
5111                         cat > conftest.$ac_ext <<EOF
5112 #line 5113 "configure"
5113 #include "confdefs.h"
5114
5115 #include <pthread.h>
5116 #ifndef NULL
5117 #define NULL (void*)0
5118 #endif
5119
5120 int main() {
5121
5122         pthread_t t;
5123
5124 #if HAVE_PTHREADS_D4
5125         pthread_create(&t, pthread_attr_default, NULL, NULL);
5126         pthread_detach( &t );
5127 #else
5128         pthread_create(&t, NULL, NULL, NULL);
5129         pthread_detach( t );
5130 #endif
5131 #ifdef HAVE_LINUX_THREADS
5132         pthread_kill_other_threads_np();
5133 #endif
5134
5135 ; return 0; }
5136 EOF
5137 if { (eval echo configure:5138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5138   rm -rf conftest*
5139   ol_cv_pthread_mt=yes
5140 else
5141   echo "configure: failed program was:" >&5
5142   cat conftest.$ac_ext >&5
5143   rm -rf conftest*
5144   ol_cv_pthread_mt=no
5145 fi
5146 rm -f conftest*
5147
5148                 # restore the LIBS
5149                 LIBS="$ol_LIBS"
5150                 
5151 fi
5152
5153 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
5154
5155                 if test $ol_cv_pthread_mt = yes ; then
5156                         ol_link_pthreads="-mt"
5157                         ol_link_threads=posix
5158                 fi
5159         fi
5160
5161                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
5162         if test "$ol_link_threads" = no ; then
5163                 # try -kthread
5164                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
5165 echo "configure:5166: checking for pthread link with -kthread" >&5
5166 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
5167   echo $ac_n "(cached) $ac_c" 1>&6
5168 else
5169   
5170                         # save the flags
5171                         ol_LIBS="$LIBS"
5172                         LIBS="-kthread $LIBS"
5173
5174                         cat > conftest.$ac_ext <<EOF
5175 #line 5176 "configure"
5176 #include "confdefs.h"
5177
5178 #include <pthread.h>
5179 #ifndef NULL
5180 #define NULL (void*)0
5181 #endif
5182
5183 int main() {
5184
5185         pthread_t t;
5186
5187 #if HAVE_PTHREADS_D4
5188         pthread_create(&t, pthread_attr_default, NULL, NULL);
5189         pthread_detach( &t );
5190 #else
5191         pthread_create(&t, NULL, NULL, NULL);
5192         pthread_detach( t );
5193 #endif
5194 #ifdef HAVE_LINUX_THREADS
5195         pthread_kill_other_threads_np();
5196 #endif
5197
5198 ; return 0; }
5199 EOF
5200 if { (eval echo configure:5201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5201   rm -rf conftest*
5202   ol_cv_pthread_kthread=yes
5203 else
5204   echo "configure: failed program was:" >&5
5205   cat conftest.$ac_ext >&5
5206   rm -rf conftest*
5207   ol_cv_pthread_kthread=no
5208 fi
5209 rm -f conftest*
5210
5211                 # restore the LIBS
5212                 LIBS="$ol_LIBS"
5213                 
5214 fi
5215
5216 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5217
5218                 if test $ol_cv_pthread_kthread = yes ; then
5219                         ol_link_pthreads="-kthread"
5220                         ol_link_threads=posix
5221                 fi
5222         fi
5223
5224                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5225         if test "$ol_link_threads" = no ; then
5226                 # try -pthread
5227                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5228 echo "configure:5229: checking for pthread link with -pthread" >&5
5229 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5230   echo $ac_n "(cached) $ac_c" 1>&6
5231 else
5232   
5233                         # save the flags
5234                         ol_LIBS="$LIBS"
5235                         LIBS="-pthread $LIBS"
5236
5237                         cat > conftest.$ac_ext <<EOF
5238 #line 5239 "configure"
5239 #include "confdefs.h"
5240
5241 #include <pthread.h>
5242 #ifndef NULL
5243 #define NULL (void*)0
5244 #endif
5245
5246 int main() {
5247
5248         pthread_t t;
5249
5250 #if HAVE_PTHREADS_D4
5251         pthread_create(&t, pthread_attr_default, NULL, NULL);
5252         pthread_detach( &t );
5253 #else
5254         pthread_create(&t, NULL, NULL, NULL);
5255         pthread_detach( t );
5256 #endif
5257 #ifdef HAVE_LINUX_THREADS
5258         pthread_kill_other_threads_np();
5259 #endif
5260
5261 ; return 0; }
5262 EOF
5263 if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5264   rm -rf conftest*
5265   ol_cv_pthread_pthread=yes
5266 else
5267   echo "configure: failed program was:" >&5
5268   cat conftest.$ac_ext >&5
5269   rm -rf conftest*
5270   ol_cv_pthread_pthread=no
5271 fi
5272 rm -f conftest*
5273
5274                 # restore the LIBS
5275                 LIBS="$ol_LIBS"
5276                 
5277 fi
5278
5279 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5280
5281                 if test $ol_cv_pthread_pthread = yes ; then
5282                         ol_link_pthreads="-pthread"
5283                         ol_link_threads=posix
5284                 fi
5285         fi
5286
5287                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5288         if test "$ol_link_threads" = no ; then
5289                 # try -pthreads
5290                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5291 echo "configure:5292: checking for pthread link with -pthreads" >&5
5292 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5293   echo $ac_n "(cached) $ac_c" 1>&6
5294 else
5295   
5296                         # save the flags
5297                         ol_LIBS="$LIBS"
5298                         LIBS="-pthreads $LIBS"
5299
5300                         cat > conftest.$ac_ext <<EOF
5301 #line 5302 "configure"
5302 #include "confdefs.h"
5303
5304 #include <pthread.h>
5305 #ifndef NULL
5306 #define NULL (void*)0
5307 #endif
5308
5309 int main() {
5310
5311         pthread_t t;
5312
5313 #if HAVE_PTHREADS_D4
5314         pthread_create(&t, pthread_attr_default, NULL, NULL);
5315         pthread_detach( &t );
5316 #else
5317         pthread_create(&t, NULL, NULL, NULL);
5318         pthread_detach( t );
5319 #endif
5320 #ifdef HAVE_LINUX_THREADS
5321         pthread_kill_other_threads_np();
5322 #endif
5323
5324 ; return 0; }
5325 EOF
5326 if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5327   rm -rf conftest*
5328   ol_cv_pthread_pthreads=yes
5329 else
5330   echo "configure: failed program was:" >&5
5331   cat conftest.$ac_ext >&5
5332   rm -rf conftest*
5333   ol_cv_pthread_pthreads=no
5334 fi
5335 rm -f conftest*
5336
5337                 # restore the LIBS
5338                 LIBS="$ol_LIBS"
5339                 
5340 fi
5341
5342 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5343
5344                 if test $ol_cv_pthread_pthreads = yes ; then
5345                         ol_link_pthreads="-pthreads"
5346                         ol_link_threads=posix
5347                 fi
5348         fi
5349
5350                 # Pthread try link: -thread (ol_cv_pthread_thread)
5351         if test "$ol_link_threads" = no ; then
5352                 # try -thread
5353                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5354 echo "configure:5355: checking for pthread link with -thread" >&5
5355 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5356   echo $ac_n "(cached) $ac_c" 1>&6
5357 else
5358   
5359                         # save the flags
5360                         ol_LIBS="$LIBS"
5361                         LIBS="-thread $LIBS"
5362
5363                         cat > conftest.$ac_ext <<EOF
5364 #line 5365 "configure"
5365 #include "confdefs.h"
5366
5367 #include <pthread.h>
5368 #ifndef NULL
5369 #define NULL (void*)0
5370 #endif
5371
5372 int main() {
5373
5374         pthread_t t;
5375
5376 #if HAVE_PTHREADS_D4
5377         pthread_create(&t, pthread_attr_default, NULL, NULL);
5378         pthread_detach( &t );
5379 #else
5380         pthread_create(&t, NULL, NULL, NULL);
5381         pthread_detach( t );
5382 #endif
5383 #ifdef HAVE_LINUX_THREADS
5384         pthread_kill_other_threads_np();
5385 #endif
5386
5387 ; return 0; }
5388 EOF
5389 if { (eval echo configure:5390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5390   rm -rf conftest*
5391   ol_cv_pthread_thread=yes
5392 else
5393   echo "configure: failed program was:" >&5
5394   cat conftest.$ac_ext >&5
5395   rm -rf conftest*
5396   ol_cv_pthread_thread=no
5397 fi
5398 rm -f conftest*
5399
5400                 # restore the LIBS
5401                 LIBS="$ol_LIBS"
5402                 
5403 fi
5404
5405 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5406
5407                 if test $ol_cv_pthread_thread = yes ; then
5408                         ol_link_pthreads="-thread"
5409                         ol_link_threads=posix
5410                 fi
5411         fi
5412
5413
5414                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5415         if test "$ol_link_threads" = no ; then
5416                 # try -lpthread -lmach -lexc -lc_r
5417                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5418 echo "configure:5419: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5419 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5420   echo $ac_n "(cached) $ac_c" 1>&6
5421 else
5422   
5423                         # save the flags
5424                         ol_LIBS="$LIBS"
5425                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5426
5427                         cat > conftest.$ac_ext <<EOF
5428 #line 5429 "configure"
5429 #include "confdefs.h"
5430
5431 #include <pthread.h>
5432 #ifndef NULL
5433 #define NULL (void*)0
5434 #endif
5435
5436 int main() {
5437
5438         pthread_t t;
5439
5440 #if HAVE_PTHREADS_D4
5441         pthread_create(&t, pthread_attr_default, NULL, NULL);
5442         pthread_detach( &t );
5443 #else
5444         pthread_create(&t, NULL, NULL, NULL);
5445         pthread_detach( t );
5446 #endif
5447 #ifdef HAVE_LINUX_THREADS
5448         pthread_kill_other_threads_np();
5449 #endif
5450
5451 ; return 0; }
5452 EOF
5453 if { (eval echo configure:5454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5454   rm -rf conftest*
5455   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5456 else
5457   echo "configure: failed program was:" >&5
5458   cat conftest.$ac_ext >&5
5459   rm -rf conftest*
5460   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5461 fi
5462 rm -f conftest*
5463
5464                 # restore the LIBS
5465                 LIBS="$ol_LIBS"
5466                 
5467 fi
5468
5469 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5470
5471                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5472                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5473                         ol_link_threads=posix
5474                 fi
5475         fi
5476
5477                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5478         if test "$ol_link_threads" = no ; then
5479                 # try -lpthread -lmach -lexc
5480                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5481 echo "configure:5482: checking for pthread link with -lpthread -lmach -lexc" >&5
5482 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5483   echo $ac_n "(cached) $ac_c" 1>&6
5484 else
5485   
5486                         # save the flags
5487                         ol_LIBS="$LIBS"
5488                         LIBS="-lpthread -lmach -lexc $LIBS"
5489
5490                         cat > conftest.$ac_ext <<EOF
5491 #line 5492 "configure"
5492 #include "confdefs.h"
5493
5494 #include <pthread.h>
5495 #ifndef NULL
5496 #define NULL (void*)0
5497 #endif
5498
5499 int main() {
5500
5501         pthread_t t;
5502
5503 #if HAVE_PTHREADS_D4
5504         pthread_create(&t, pthread_attr_default, NULL, NULL);
5505         pthread_detach( &t );
5506 #else
5507         pthread_create(&t, NULL, NULL, NULL);
5508         pthread_detach( t );
5509 #endif
5510 #ifdef HAVE_LINUX_THREADS
5511         pthread_kill_other_threads_np();
5512 #endif
5513
5514 ; return 0; }
5515 EOF
5516 if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5517   rm -rf conftest*
5518   ol_cv_pthread_lpthread_lmach_lexc=yes
5519 else
5520   echo "configure: failed program was:" >&5
5521   cat conftest.$ac_ext >&5
5522   rm -rf conftest*
5523   ol_cv_pthread_lpthread_lmach_lexc=no
5524 fi
5525 rm -f conftest*
5526
5527                 # restore the LIBS
5528                 LIBS="$ol_LIBS"
5529                 
5530 fi
5531
5532 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5533
5534                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5535                         ol_link_pthreads="-lpthread -lmach -lexc"
5536                         ol_link_threads=posix
5537                 fi
5538         fi
5539
5540
5541                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5542         if test "$ol_link_threads" = no ; then
5543                 # try -lpthread -Wl,-woff,85
5544                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5545 echo "configure:5546: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5546 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5547   echo $ac_n "(cached) $ac_c" 1>&6
5548 else
5549   
5550                         # save the flags
5551                         ol_LIBS="$LIBS"
5552                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5553
5554                         cat > conftest.$ac_ext <<EOF
5555 #line 5556 "configure"
5556 #include "confdefs.h"
5557
5558 #include <pthread.h>
5559 #ifndef NULL
5560 #define NULL (void*)0
5561 #endif
5562
5563 int main() {
5564
5565         pthread_t t;
5566
5567 #if HAVE_PTHREADS_D4
5568         pthread_create(&t, pthread_attr_default, NULL, NULL);
5569         pthread_detach( &t );
5570 #else
5571         pthread_create(&t, NULL, NULL, NULL);
5572         pthread_detach( t );
5573 #endif
5574 #ifdef HAVE_LINUX_THREADS
5575         pthread_kill_other_threads_np();
5576 #endif
5577
5578 ; return 0; }
5579 EOF
5580 if { (eval echo configure:5581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5581   rm -rf conftest*
5582   ol_cv_pthread_lib_lpthread_woff=yes
5583 else
5584   echo "configure: failed program was:" >&5
5585   cat conftest.$ac_ext >&5
5586   rm -rf conftest*
5587   ol_cv_pthread_lib_lpthread_woff=no
5588 fi
5589 rm -f conftest*
5590
5591                 # restore the LIBS
5592                 LIBS="$ol_LIBS"
5593                 
5594 fi
5595
5596 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5597
5598                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5599                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5600                         ol_link_threads=posix
5601                 fi
5602         fi
5603
5604
5605                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5606         if test "$ol_link_threads" = no ; then
5607                 # try -lpthread
5608                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5609 echo "configure:5610: checking for pthread link with -lpthread" >&5
5610 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5611   echo $ac_n "(cached) $ac_c" 1>&6
5612 else
5613   
5614                         # save the flags
5615                         ol_LIBS="$LIBS"
5616                         LIBS="-lpthread $LIBS"
5617
5618                         cat > conftest.$ac_ext <<EOF
5619 #line 5620 "configure"
5620 #include "confdefs.h"
5621
5622 #include <pthread.h>
5623 #ifndef NULL
5624 #define NULL (void*)0
5625 #endif
5626
5627 int main() {
5628
5629         pthread_t t;
5630
5631 #if HAVE_PTHREADS_D4
5632         pthread_create(&t, pthread_attr_default, NULL, NULL);
5633         pthread_detach( &t );
5634 #else
5635         pthread_create(&t, NULL, NULL, NULL);
5636         pthread_detach( t );
5637 #endif
5638 #ifdef HAVE_LINUX_THREADS
5639         pthread_kill_other_threads_np();
5640 #endif
5641
5642 ; return 0; }
5643 EOF
5644 if { (eval echo configure:5645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5645   rm -rf conftest*
5646   ol_cv_pthread_lpthread=yes
5647 else
5648   echo "configure: failed program was:" >&5
5649   cat conftest.$ac_ext >&5
5650   rm -rf conftest*
5651   ol_cv_pthread_lpthread=no
5652 fi
5653 rm -f conftest*
5654
5655                 # restore the LIBS
5656                 LIBS="$ol_LIBS"
5657                 
5658 fi
5659
5660 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5661
5662                 if test $ol_cv_pthread_lpthread = yes ; then
5663                         ol_link_pthreads="-lpthread"
5664                         ol_link_threads=posix
5665                 fi
5666         fi
5667
5668                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5669         if test "$ol_link_threads" = no ; then
5670                 # try -lc_r
5671                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5672 echo "configure:5673: checking for pthread link with -lc_r" >&5
5673 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5674   echo $ac_n "(cached) $ac_c" 1>&6
5675 else
5676   
5677                         # save the flags
5678                         ol_LIBS="$LIBS"
5679                         LIBS="-lc_r $LIBS"
5680
5681                         cat > conftest.$ac_ext <<EOF
5682 #line 5683 "configure"
5683 #include "confdefs.h"
5684
5685 #include <pthread.h>
5686 #ifndef NULL
5687 #define NULL (void*)0
5688 #endif
5689
5690 int main() {
5691
5692         pthread_t t;
5693
5694 #if HAVE_PTHREADS_D4
5695         pthread_create(&t, pthread_attr_default, NULL, NULL);
5696         pthread_detach( &t );
5697 #else
5698         pthread_create(&t, NULL, NULL, NULL);
5699         pthread_detach( t );
5700 #endif
5701 #ifdef HAVE_LINUX_THREADS
5702         pthread_kill_other_threads_np();
5703 #endif
5704
5705 ; return 0; }
5706 EOF
5707 if { (eval echo configure:5708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5708   rm -rf conftest*
5709   ol_cv_pthread_lc_r=yes
5710 else
5711   echo "configure: failed program was:" >&5
5712   cat conftest.$ac_ext >&5
5713   rm -rf conftest*
5714   ol_cv_pthread_lc_r=no
5715 fi
5716 rm -f conftest*
5717
5718                 # restore the LIBS
5719                 LIBS="$ol_LIBS"
5720                 
5721 fi
5722
5723 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5724
5725                 if test $ol_cv_pthread_lc_r = yes ; then
5726                         ol_link_pthreads="-lc_r"
5727                         ol_link_threads=posix
5728                 fi
5729         fi
5730
5731
5732                 # Pthread try link: -threads (ol_cv_pthread_threads)
5733         if test "$ol_link_threads" = no ; then
5734                 # try -threads
5735                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5736 echo "configure:5737: checking for pthread link with -threads" >&5
5737 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5738   echo $ac_n "(cached) $ac_c" 1>&6
5739 else
5740   
5741                         # save the flags
5742                         ol_LIBS="$LIBS"
5743                         LIBS="-threads $LIBS"
5744
5745                         cat > conftest.$ac_ext <<EOF
5746 #line 5747 "configure"
5747 #include "confdefs.h"
5748
5749 #include <pthread.h>
5750 #ifndef NULL
5751 #define NULL (void*)0
5752 #endif
5753
5754 int main() {
5755
5756         pthread_t t;
5757
5758 #if HAVE_PTHREADS_D4
5759         pthread_create(&t, pthread_attr_default, NULL, NULL);
5760         pthread_detach( &t );
5761 #else
5762         pthread_create(&t, NULL, NULL, NULL);
5763         pthread_detach( t );
5764 #endif
5765 #ifdef HAVE_LINUX_THREADS
5766         pthread_kill_other_threads_np();
5767 #endif
5768
5769 ; return 0; }
5770 EOF
5771 if { (eval echo configure:5772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5772   rm -rf conftest*
5773   ol_cv_pthread_threads=yes
5774 else
5775   echo "configure: failed program was:" >&5
5776   cat conftest.$ac_ext >&5
5777   rm -rf conftest*
5778   ol_cv_pthread_threads=no
5779 fi
5780 rm -f conftest*
5781
5782                 # restore the LIBS
5783                 LIBS="$ol_LIBS"
5784                 
5785 fi
5786
5787 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5788
5789                 if test $ol_cv_pthread_threads = yes ; then
5790                         ol_link_pthreads="-threads"
5791                         ol_link_threads=posix
5792                 fi
5793         fi
5794
5795
5796                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5797         if test "$ol_link_threads" = no ; then
5798                 # try -lpthreads -lmach -lexc -lc_r
5799                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5800 echo "configure:5801: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5801 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5802   echo $ac_n "(cached) $ac_c" 1>&6
5803 else
5804   
5805                         # save the flags
5806                         ol_LIBS="$LIBS"
5807                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5808
5809                         cat > conftest.$ac_ext <<EOF
5810 #line 5811 "configure"
5811 #include "confdefs.h"
5812
5813 #include <pthread.h>
5814 #ifndef NULL
5815 #define NULL (void*)0
5816 #endif
5817
5818 int main() {
5819
5820         pthread_t t;
5821
5822 #if HAVE_PTHREADS_D4
5823         pthread_create(&t, pthread_attr_default, NULL, NULL);
5824         pthread_detach( &t );
5825 #else
5826         pthread_create(&t, NULL, NULL, NULL);
5827         pthread_detach( t );
5828 #endif
5829 #ifdef HAVE_LINUX_THREADS
5830         pthread_kill_other_threads_np();
5831 #endif
5832
5833 ; return 0; }
5834 EOF
5835 if { (eval echo configure:5836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5836   rm -rf conftest*
5837   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5838 else
5839   echo "configure: failed program was:" >&5
5840   cat conftest.$ac_ext >&5
5841   rm -rf conftest*
5842   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5843 fi
5844 rm -f conftest*
5845
5846                 # restore the LIBS
5847                 LIBS="$ol_LIBS"
5848                 
5849 fi
5850
5851 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5852
5853                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5854                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5855                         ol_link_threads=posix
5856                 fi
5857         fi
5858
5859                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5860         if test "$ol_link_threads" = no ; then
5861                 # try -lpthreads -lmach -lexc
5862                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5863 echo "configure:5864: checking for pthread link with -lpthreads -lmach -lexc" >&5
5864 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5865   echo $ac_n "(cached) $ac_c" 1>&6
5866 else
5867   
5868                         # save the flags
5869                         ol_LIBS="$LIBS"
5870                         LIBS="-lpthreads -lmach -lexc $LIBS"
5871
5872                         cat > conftest.$ac_ext <<EOF
5873 #line 5874 "configure"
5874 #include "confdefs.h"
5875
5876 #include <pthread.h>
5877 #ifndef NULL
5878 #define NULL (void*)0
5879 #endif
5880
5881 int main() {
5882
5883         pthread_t t;
5884
5885 #if HAVE_PTHREADS_D4
5886         pthread_create(&t, pthread_attr_default, NULL, NULL);
5887         pthread_detach( &t );
5888 #else
5889         pthread_create(&t, NULL, NULL, NULL);
5890         pthread_detach( t );
5891 #endif
5892 #ifdef HAVE_LINUX_THREADS
5893         pthread_kill_other_threads_np();
5894 #endif
5895
5896 ; return 0; }
5897 EOF
5898 if { (eval echo configure:5899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5899   rm -rf conftest*
5900   ol_cv_pthread_lpthreads_lmach_lexc=yes
5901 else
5902   echo "configure: failed program was:" >&5
5903   cat conftest.$ac_ext >&5
5904   rm -rf conftest*
5905   ol_cv_pthread_lpthreads_lmach_lexc=no
5906 fi
5907 rm -f conftest*
5908
5909                 # restore the LIBS
5910                 LIBS="$ol_LIBS"
5911                 
5912 fi
5913
5914 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5915
5916                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5917                         ol_link_pthreads="-lpthreads -lmach -lexc"
5918                         ol_link_threads=posix
5919                 fi
5920         fi
5921
5922                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5923         if test "$ol_link_threads" = no ; then
5924                 # try -lpthreads -lexc
5925                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5926 echo "configure:5927: checking for pthread link with -lpthreads -lexc" >&5
5927 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5928   echo $ac_n "(cached) $ac_c" 1>&6
5929 else
5930   
5931                         # save the flags
5932                         ol_LIBS="$LIBS"
5933                         LIBS="-lpthreads -lexc $LIBS"
5934
5935                         cat > conftest.$ac_ext <<EOF
5936 #line 5937 "configure"
5937 #include "confdefs.h"
5938
5939 #include <pthread.h>
5940 #ifndef NULL
5941 #define NULL (void*)0
5942 #endif
5943
5944 int main() {
5945
5946         pthread_t t;
5947
5948 #if HAVE_PTHREADS_D4
5949         pthread_create(&t, pthread_attr_default, NULL, NULL);
5950         pthread_detach( &t );
5951 #else
5952         pthread_create(&t, NULL, NULL, NULL);
5953         pthread_detach( t );
5954 #endif
5955 #ifdef HAVE_LINUX_THREADS
5956         pthread_kill_other_threads_np();
5957 #endif
5958
5959 ; return 0; }
5960 EOF
5961 if { (eval echo configure:5962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5962   rm -rf conftest*
5963   ol_cv_pthread_lpthreads_lexc=yes
5964 else
5965   echo "configure: failed program was:" >&5
5966   cat conftest.$ac_ext >&5
5967   rm -rf conftest*
5968   ol_cv_pthread_lpthreads_lexc=no
5969 fi
5970 rm -f conftest*
5971
5972                 # restore the LIBS
5973                 LIBS="$ol_LIBS"
5974                 
5975 fi
5976
5977 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5978
5979                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5980                         ol_link_pthreads="-lpthreads -lexc"
5981                         ol_link_threads=posix
5982                 fi
5983         fi
5984
5985
5986                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5987         if test "$ol_link_threads" = no ; then
5988                 # try -lpthreads
5989                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5990 echo "configure:5991: checking for pthread link with -lpthreads" >&5
5991 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5992   echo $ac_n "(cached) $ac_c" 1>&6
5993 else
5994   
5995                         # save the flags
5996                         ol_LIBS="$LIBS"
5997                         LIBS="-lpthreads $LIBS"
5998
5999                         cat > conftest.$ac_ext <<EOF
6000 #line 6001 "configure"
6001 #include "confdefs.h"
6002
6003 #include <pthread.h>
6004 #ifndef NULL
6005 #define NULL (void*)0
6006 #endif
6007
6008 int main() {
6009
6010         pthread_t t;
6011
6012 #if HAVE_PTHREADS_D4
6013         pthread_create(&t, pthread_attr_default, NULL, NULL);
6014         pthread_detach( &t );
6015 #else
6016         pthread_create(&t, NULL, NULL, NULL);
6017         pthread_detach( t );
6018 #endif
6019 #ifdef HAVE_LINUX_THREADS
6020         pthread_kill_other_threads_np();
6021 #endif
6022
6023 ; return 0; }
6024 EOF
6025 if { (eval echo configure:6026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6026   rm -rf conftest*
6027   ol_cv_pthread_lib_lpthreads=yes
6028 else
6029   echo "configure: failed program was:" >&5
6030   cat conftest.$ac_ext >&5
6031   rm -rf conftest*
6032   ol_cv_pthread_lib_lpthreads=no
6033 fi
6034 rm -f conftest*
6035
6036                 # restore the LIBS
6037                 LIBS="$ol_LIBS"
6038                 
6039 fi
6040
6041 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
6042
6043                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
6044                         ol_link_pthreads="-lpthreads"
6045                         ol_link_threads=posix
6046                 fi
6047         fi
6048
6049
6050                 if test $ol_link_threads != no ; then
6051                         cat >> confdefs.h <<\EOF
6052 #define HAVE_PTHREADS 1
6053 EOF
6054
6055
6056                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
6057
6058                                                 save_CPPFLAGS="$CPPFLAGS"
6059                         save_LIBS="$LIBS"
6060                         LIBS="$LTHREAD_LIBS $LIBS"
6061
6062                                                                                                 for ac_func in sched_yield pthread_yield
6063 do
6064 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6065 echo "configure:6066: checking for $ac_func" >&5
6066 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6067   echo $ac_n "(cached) $ac_c" 1>&6
6068 else
6069   cat > conftest.$ac_ext <<EOF
6070 #line 6071 "configure"
6071 #include "confdefs.h"
6072 /* System header to define __stub macros and hopefully few prototypes,
6073     which can conflict with char $ac_func(); below.  */
6074 #include <assert.h>
6075 /* Override any gcc2 internal prototype to avoid an error.  */
6076 /* We use char because int might match the return type of a gcc2
6077     builtin and then its argument prototype would still apply.  */
6078 char $ac_func();
6079
6080 int main() {
6081
6082 /* The GNU C library defines this for functions which it implements
6083     to always fail with ENOSYS.  Some functions are actually named
6084     something starting with __ and the normal name is an alias.  */
6085 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6086 choke me
6087 #else
6088 $ac_func();
6089 #endif
6090
6091 ; return 0; }
6092 EOF
6093 if { (eval echo configure:6094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6094   rm -rf conftest*
6095   eval "ac_cv_func_$ac_func=yes"
6096 else
6097   echo "configure: failed program was:" >&5
6098   cat conftest.$ac_ext >&5
6099   rm -rf conftest*
6100   eval "ac_cv_func_$ac_func=no"
6101 fi
6102 rm -f conftest*
6103 fi
6104
6105 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6106   echo "$ac_t""yes" 1>&6
6107     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6108   cat >> confdefs.h <<EOF
6109 #define $ac_tr_func 1
6110 EOF
6111  
6112 else
6113   echo "$ac_t""no" 1>&6
6114 fi
6115 done
6116
6117
6118                         if test $ac_cv_func_sched_yield = no -a \
6119                                 $ac_cv_func_pthread_yield = no ; then
6120                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
6121 echo "configure:6122: checking for sched_yield in -lrt" >&5
6122 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
6123 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6124   echo $ac_n "(cached) $ac_c" 1>&6
6125 else
6126   ac_save_LIBS="$LIBS"
6127 LIBS="-lrt  $LIBS"
6128 cat > conftest.$ac_ext <<EOF
6129 #line 6130 "configure"
6130 #include "confdefs.h"
6131 /* Override any gcc2 internal prototype to avoid an error.  */
6132 /* We use char because int might match the return type of a gcc2
6133     builtin and then its argument prototype would still apply.  */
6134 char sched_yield();
6135
6136 int main() {
6137 sched_yield()
6138 ; return 0; }
6139 EOF
6140 if { (eval echo configure:6141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6141   rm -rf conftest*
6142   eval "ac_cv_lib_$ac_lib_var=yes"
6143 else
6144   echo "configure: failed program was:" >&5
6145   cat conftest.$ac_ext >&5
6146   rm -rf conftest*
6147   eval "ac_cv_lib_$ac_lib_var=no"
6148 fi
6149 rm -f conftest*
6150 LIBS="$ac_save_LIBS"
6151
6152 fi
6153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6154   echo "$ac_t""yes" 1>&6
6155   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
6156                                         cat >> confdefs.h <<\EOF
6157 #define HAVE_SCHED_YIELD 1
6158 EOF
6159
6160                                         ac_cv_func_sched_yield=yes
6161 else
6162   echo "$ac_t""no" 1>&6
6163 ac_cv_func_sched_yield=no
6164 fi
6165
6166                         fi
6167                         if test $ac_cv_func_sched_yield = no -a \
6168                                 $ac_cv_func_pthread_yield = no ; then
6169                                                                                                 for ac_func in thr_yield
6170 do
6171 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6172 echo "configure:6173: checking for $ac_func" >&5
6173 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6174   echo $ac_n "(cached) $ac_c" 1>&6
6175 else
6176   cat > conftest.$ac_ext <<EOF
6177 #line 6178 "configure"
6178 #include "confdefs.h"
6179 /* System header to define __stub macros and hopefully few prototypes,
6180     which can conflict with char $ac_func(); below.  */
6181 #include <assert.h>
6182 /* Override any gcc2 internal prototype to avoid an error.  */
6183 /* We use char because int might match the return type of a gcc2
6184     builtin and then its argument prototype would still apply.  */
6185 char $ac_func();
6186
6187 int main() {
6188
6189 /* The GNU C library defines this for functions which it implements
6190     to always fail with ENOSYS.  Some functions are actually named
6191     something starting with __ and the normal name is an alias.  */
6192 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6193 choke me
6194 #else
6195 $ac_func();
6196 #endif
6197
6198 ; return 0; }
6199 EOF
6200 if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6201   rm -rf conftest*
6202   eval "ac_cv_func_$ac_func=yes"
6203 else
6204   echo "configure: failed program was:" >&5
6205   cat conftest.$ac_ext >&5
6206   rm -rf conftest*
6207   eval "ac_cv_func_$ac_func=no"
6208 fi
6209 rm -f conftest*
6210 fi
6211
6212 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6213   echo "$ac_t""yes" 1>&6
6214     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6215   cat >> confdefs.h <<EOF
6216 #define $ac_tr_func 1
6217 EOF
6218  
6219 else
6220   echo "$ac_t""no" 1>&6
6221 fi
6222 done
6223
6224                         fi
6225                         if test $ac_cv_func_sched_yield = no -a \
6226                                 $ac_cv_func_pthread_yield = no -a \
6227                                 "$ac_cv_func_thr_yield" = no ; then
6228                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6229                         fi
6230
6231                                                 for ac_func in pthread_kill
6232 do
6233 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6234 echo "configure:6235: checking for $ac_func" >&5
6235 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6236   echo $ac_n "(cached) $ac_c" 1>&6
6237 else
6238   cat > conftest.$ac_ext <<EOF
6239 #line 6240 "configure"
6240 #include "confdefs.h"
6241 /* System header to define __stub macros and hopefully few prototypes,
6242     which can conflict with char $ac_func(); below.  */
6243 #include <assert.h>
6244 /* Override any gcc2 internal prototype to avoid an error.  */
6245 /* We use char because int might match the return type of a gcc2
6246     builtin and then its argument prototype would still apply.  */
6247 char $ac_func();
6248
6249 int main() {
6250
6251 /* The GNU C library defines this for functions which it implements
6252     to always fail with ENOSYS.  Some functions are actually named
6253     something starting with __ and the normal name is an alias.  */
6254 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6255 choke me
6256 #else
6257 $ac_func();
6258 #endif
6259
6260 ; return 0; }
6261 EOF
6262 if { (eval echo configure:6263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6263   rm -rf conftest*
6264   eval "ac_cv_func_$ac_func=yes"
6265 else
6266   echo "configure: failed program was:" >&5
6267   cat conftest.$ac_ext >&5
6268   rm -rf conftest*
6269   eval "ac_cv_func_$ac_func=no"
6270 fi
6271 rm -f conftest*
6272 fi
6273
6274 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6275   echo "$ac_t""yes" 1>&6
6276     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6277   cat >> confdefs.h <<EOF
6278 #define $ac_tr_func 1
6279 EOF
6280  
6281 else
6282   echo "$ac_t""no" 1>&6
6283 fi
6284 done
6285
6286
6287                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6288 echo "configure:6289: checking for pthread_detach with <pthread.h>" >&5
6289 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6290   echo $ac_n "(cached) $ac_c" 1>&6
6291 else
6292   
6293                                                                 cat > conftest.$ac_ext <<EOF
6294 #line 6295 "configure"
6295 #include "confdefs.h"
6296
6297 #include <pthread.h>
6298 #ifndef NULL
6299 #define NULL (void*)0
6300 #endif
6301
6302 int main() {
6303 pthread_detach(NULL);
6304 ; return 0; }
6305 EOF
6306 if { (eval echo configure:6307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6307   rm -rf conftest*
6308   ol_cv_func_pthread_detach=yes
6309 else
6310   echo "configure: failed program was:" >&5
6311   cat conftest.$ac_ext >&5
6312   rm -rf conftest*
6313   ol_cv_func_pthread_detach=no
6314 fi
6315 rm -f conftest*
6316                         
6317 fi
6318
6319 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6320
6321                         if test $ol_cv_func_pthread_detach = no ; then
6322                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6323                         fi
6324
6325                         cat >> confdefs.h <<\EOF
6326 #define HAVE_PTHREAD_DETACH 1
6327 EOF
6328
6329
6330                                                 for ac_func in \
6331                                 pthread_setconcurrency \
6332                                 pthread_getconcurrency \
6333                                 thr_setconcurrency \
6334                                 thr_getconcurrency \
6335                         
6336 do
6337 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6338 echo "configure:6339: checking for $ac_func" >&5
6339 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6340   echo $ac_n "(cached) $ac_c" 1>&6
6341 else
6342   cat > conftest.$ac_ext <<EOF
6343 #line 6344 "configure"
6344 #include "confdefs.h"
6345 /* System header to define __stub macros and hopefully few prototypes,
6346     which can conflict with char $ac_func(); below.  */
6347 #include <assert.h>
6348 /* Override any gcc2 internal prototype to avoid an error.  */
6349 /* We use char because int might match the return type of a gcc2
6350     builtin and then its argument prototype would still apply.  */
6351 char $ac_func();
6352
6353 int main() {
6354
6355 /* The GNU C library defines this for functions which it implements
6356     to always fail with ENOSYS.  Some functions are actually named
6357     something starting with __ and the normal name is an alias.  */
6358 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6359 choke me
6360 #else
6361 $ac_func();
6362 #endif
6363
6364 ; return 0; }
6365 EOF
6366 if { (eval echo configure:6367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6367   rm -rf conftest*
6368   eval "ac_cv_func_$ac_func=yes"
6369 else
6370   echo "configure: failed program was:" >&5
6371   cat conftest.$ac_ext >&5
6372   rm -rf conftest*
6373   eval "ac_cv_func_$ac_func=no"
6374 fi
6375 rm -f conftest*
6376 fi
6377
6378 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6379   echo "$ac_t""yes" 1>&6
6380     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6381   cat >> confdefs.h <<EOF
6382 #define $ac_tr_func 1
6383 EOF
6384  
6385 else
6386   echo "$ac_t""no" 1>&6
6387 fi
6388 done
6389
6390
6391                         
6392         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6393 echo "configure:6394: checking for pthread_kill_other_threads_np" >&5
6394 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6395   echo $ac_n "(cached) $ac_c" 1>&6
6396 else
6397   cat > conftest.$ac_ext <<EOF
6398 #line 6399 "configure"
6399 #include "confdefs.h"
6400 /* System header to define __stub macros and hopefully few prototypes,
6401     which can conflict with char pthread_kill_other_threads_np(); below.  */
6402 #include <assert.h>
6403 /* Override any gcc2 internal prototype to avoid an error.  */
6404 /* We use char because int might match the return type of a gcc2
6405     builtin and then its argument prototype would still apply.  */
6406 char pthread_kill_other_threads_np();
6407
6408 int main() {
6409
6410 /* The GNU C library defines this for functions which it implements
6411     to always fail with ENOSYS.  Some functions are actually named
6412     something starting with __ and the normal name is an alias.  */
6413 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6414 choke me
6415 #else
6416 pthread_kill_other_threads_np();
6417 #endif
6418
6419 ; return 0; }
6420 EOF
6421 if { (eval echo configure:6422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6422   rm -rf conftest*
6423   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6424 else
6425   echo "configure: failed program was:" >&5
6426   cat conftest.$ac_ext >&5
6427   rm -rf conftest*
6428   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6429 fi
6430 rm -f conftest*
6431 fi
6432
6433 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6434   echo "$ac_t""yes" 1>&6
6435   :
6436 else
6437   echo "$ac_t""no" 1>&6
6438 fi
6439
6440         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6441 echo "configure:6442: checking for LinuxThreads implementation" >&5
6442 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6443   echo $ac_n "(cached) $ac_c" 1>&6
6444 else
6445   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6446 fi
6447
6448 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6449
6450                         
6451         
6452         
6453         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6454 echo "configure:6455: checking for LinuxThreads consistency" >&5
6455 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6456   echo $ac_n "(cached) $ac_c" 1>&6
6457 else
6458   
6459                 if test $ol_cv_header_linux_threads = yes -a \
6460                         $ol_cv_sys_linux_threads = yes; then
6461                         ol_cv_linux_threads=yes
6462                 elif test $ol_cv_header_linux_threads = no -a \
6463                         $ol_cv_sys_linux_threads = no; then
6464                         ol_cv_linux_threads=no
6465                 else
6466                         ol_cv_linux_threads=error
6467                 fi
6468         
6469 fi
6470
6471 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6472
6473
6474                         if test $ol_cv_linux_threads = error; then
6475                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6476                         fi
6477
6478                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6479 echo "configure:6480: checking if pthread_create() works" >&5
6480                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483   
6484                         if test "$cross_compiling" = yes; then
6485                                 ol_cv_pthread_create_works=yes
6486 else
6487   cat > conftest.$ac_ext <<EOF
6488 #line 6489 "configure"
6489 #include "confdefs.h"
6490
6491 #include <pthread.h>
6492 #ifndef NULL
6493 #define NULL (void*)0
6494 #endif
6495
6496 static void *task(p)
6497         void *p;
6498 {
6499         return (void *) (p == NULL);
6500 }
6501
6502 int main(argc, argv)
6503         int argc;
6504         char **argv;
6505 {
6506         pthread_t t;
6507 #if HAVE_PTHREADS_D4
6508         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6509 #else
6510         exit(pthread_create(&t, NULL, task, NULL));
6511 #endif
6512 }
6513
6514 EOF
6515 if { (eval echo configure:6516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6516 then
6517   ol_cv_pthread_create_works=yes
6518 else
6519   echo "configure: failed program was:" >&5
6520   cat conftest.$ac_ext >&5
6521   rm -fr conftest*
6522   ol_cv_pthread_create_works=no
6523 fi
6524 rm -fr conftest*
6525 fi
6526
6527 fi
6528
6529                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6530
6531                         if test $ol_cv_pthread_create_works = no ; then
6532                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6533                         fi
6534
6535                                                 if test $ol_with_yielding_select = auto ; then
6536                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6537 echo "configure:6538: checking if select yields when using pthreads" >&5
6538                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6539   echo $ac_n "(cached) $ac_c" 1>&6
6540 else
6541   
6542                                 if test "$cross_compiling" = yes; then
6543   
6544                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6545 else
6546   cat > conftest.$ac_ext <<EOF
6547 #line 6548 "configure"
6548 #include "confdefs.h"
6549
6550 #include <sys/types.h>
6551 #include <sys/time.h>
6552 #include <unistd.h>
6553 #include <pthread.h>
6554 #ifndef NULL
6555 #define NULL (void*) 0
6556 #endif
6557
6558 static int fildes[2];
6559
6560 static void *task(p)
6561         void *p;
6562 {
6563         int i;
6564         struct timeval tv;
6565
6566         fd_set rfds;
6567
6568         tv.tv_sec=10;
6569         tv.tv_usec=0;
6570
6571         FD_ZERO(&rfds);
6572         FD_SET(fildes[0], &rfds);
6573
6574         /* we're not interested in any fds */
6575         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6576
6577         if(i < 0) {
6578                 perror("select");
6579                 exit(10);
6580         }
6581
6582         exit(0); /* if we exit here, the select blocked the whole process */
6583 }
6584
6585 int main(argc, argv)
6586         int argc;
6587         char **argv;
6588 {
6589         pthread_t t;
6590
6591         /* create a pipe to select */
6592         if(pipe(&fildes[0])) {
6593                 perror("select");
6594                 exit(1);
6595         }
6596
6597 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6598         (void) pthread_setconcurrency(2);
6599 #else
6600 #ifdef HAVE_THR_SETCONCURRENCY
6601         /* Set Solaris LWP concurrency to 2 */
6602         thr_setconcurrency(2);
6603 #endif
6604 #endif
6605
6606 #if HAVE_PTHREADS_D4
6607         pthread_create(&t, pthread_attr_default, task, NULL);
6608 #else
6609         pthread_create(&t, NULL, task, NULL);
6610 #endif
6611
6612 #if HAVE_SCHED_YIELD
6613         sched_yield();  /* make sure task runs first */
6614 #else
6615 #ifdef HAVE_PTHREAD_YIELD
6616         pthread_yield();        /* make sure task runs first */
6617 #endif
6618 #endif
6619
6620         exit(2);
6621 }
6622 EOF
6623 if { (eval echo configure:6624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6624 then
6625   ol_cv_pthread_select_yields=no
6626 else
6627   echo "configure: failed program was:" >&5
6628   cat conftest.$ac_ext >&5
6629   rm -fr conftest*
6630   ol_cv_pthread_select_yields=yes
6631 fi
6632 rm -fr conftest*
6633 fi
6634
6635 fi
6636
6637                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6638
6639                                 if test $ol_cv_pthread_select_yields = yes ; then
6640                                         ol_with_yielding_select=yes
6641                                 fi
6642                         fi
6643
6644                                                 CPPFLAGS="$save_CPPFLAGS"
6645                         LIBS="$save_LIBS"
6646                 else
6647                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6648                 fi
6649         fi
6650
6651         if test $ol_with_threads = posix ; then
6652                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6653         fi
6654 fi
6655
6656 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6657         -o $ol_with_threads = mach ; then
6658
6659                 for ac_hdr in mach/cthreads.h
6660 do
6661 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6662 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6663 echo "configure:6664: checking for $ac_hdr" >&5
6664 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6665   echo $ac_n "(cached) $ac_c" 1>&6
6666 else
6667   cat > conftest.$ac_ext <<EOF
6668 #line 6669 "configure"
6669 #include "confdefs.h"
6670 #include <$ac_hdr>
6671 EOF
6672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6673 { (eval echo configure:6674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6675 if test -z "$ac_err"; then
6676   rm -rf conftest*
6677   eval "ac_cv_header_$ac_safe=yes"
6678 else
6679   echo "$ac_err" >&5
6680   echo "configure: failed program was:" >&5
6681   cat conftest.$ac_ext >&5
6682   rm -rf conftest*
6683   eval "ac_cv_header_$ac_safe=no"
6684 fi
6685 rm -f conftest*
6686 fi
6687 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6688   echo "$ac_t""yes" 1>&6
6689     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6690   cat >> confdefs.h <<EOF
6691 #define $ac_tr_hdr 1
6692 EOF
6693  
6694 else
6695   echo "$ac_t""no" 1>&6
6696 fi
6697 done
6698
6699         if test $ac_cv_header_mach_cthreads_h = yes ; then
6700                 ol_with_threads=found
6701
6702                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6703 echo "configure:6704: checking for cthread_fork" >&5
6704 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6705   echo $ac_n "(cached) $ac_c" 1>&6
6706 else
6707   cat > conftest.$ac_ext <<EOF
6708 #line 6709 "configure"
6709 #include "confdefs.h"
6710 /* System header to define __stub macros and hopefully few prototypes,
6711     which can conflict with char cthread_fork(); below.  */
6712 #include <assert.h>
6713 /* Override any gcc2 internal prototype to avoid an error.  */
6714 /* We use char because int might match the return type of a gcc2
6715     builtin and then its argument prototype would still apply.  */
6716 char cthread_fork();
6717
6718 int main() {
6719
6720 /* The GNU C library defines this for functions which it implements
6721     to always fail with ENOSYS.  Some functions are actually named
6722     something starting with __ and the normal name is an alias.  */
6723 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6724 choke me
6725 #else
6726 cthread_fork();
6727 #endif
6728
6729 ; return 0; }
6730 EOF
6731 if { (eval echo configure:6732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6732   rm -rf conftest*
6733   eval "ac_cv_func_cthread_fork=yes"
6734 else
6735   echo "configure: failed program was:" >&5
6736   cat conftest.$ac_ext >&5
6737   rm -rf conftest*
6738   eval "ac_cv_func_cthread_fork=no"
6739 fi
6740 rm -f conftest*
6741 fi
6742
6743 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6744   echo "$ac_t""yes" 1>&6
6745   ol_link_threads=yes
6746 else
6747   echo "$ac_t""no" 1>&6
6748 fi
6749
6750
6751                 if test $ol_link_threads = no ; then
6752                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6753 echo "configure:6754: checking for cthread_fork with -all_load" >&5
6754 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6755   echo $ac_n "(cached) $ac_c" 1>&6
6756 else
6757   
6758                                                                 save_LIBS="$LIBS"
6759                                 LIBS="-all_load $LIBS"
6760                                 cat > conftest.$ac_ext <<EOF
6761 #line 6762 "configure"
6762 #include "confdefs.h"
6763 #include <mach/cthreads.h>
6764 int main() {
6765
6766                                         cthread_fork((void *)0, (void *)0);
6767                                         
6768 ; return 0; }
6769 EOF
6770 if { (eval echo configure:6771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6771   rm -rf conftest*
6772   ol_cv_cthread_all_load=yes
6773 else
6774   echo "configure: failed program was:" >&5
6775   cat conftest.$ac_ext >&5
6776   rm -rf conftest*
6777   ol_cv_cthread_all_load=no
6778 fi
6779 rm -f conftest*
6780                                                                 LIBS="$save_LIBS"
6781                         
6782 fi
6783
6784 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6785
6786                         if test $ol_cv_cthread_all_load = yes ; then
6787                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6788                                 ol_link_threads=mach
6789                         fi
6790                 fi
6791
6792                 if test $ol_link_threads != no ; then
6793                         : check for cthread specific functionality here
6794                         cat >> confdefs.h <<\EOF
6795 #define HAVE_MACH_CTHREADS 1
6796 EOF
6797
6798                 else
6799                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6800                 fi
6801         fi
6802
6803         if test $ol_with_threads = mach ; then
6804                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6805         fi
6806 fi
6807
6808 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6809         -o $ol_with_threads = lwp ; then
6810
6811                 for ac_hdr in thread.h synch.h
6812 do
6813 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6814 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6815 echo "configure:6816: checking for $ac_hdr" >&5
6816 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6817   echo $ac_n "(cached) $ac_c" 1>&6
6818 else
6819   cat > conftest.$ac_ext <<EOF
6820 #line 6821 "configure"
6821 #include "confdefs.h"
6822 #include <$ac_hdr>
6823 EOF
6824 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6825 { (eval echo configure:6826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6826 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6827 if test -z "$ac_err"; then
6828   rm -rf conftest*
6829   eval "ac_cv_header_$ac_safe=yes"
6830 else
6831   echo "$ac_err" >&5
6832   echo "configure: failed program was:" >&5
6833   cat conftest.$ac_ext >&5
6834   rm -rf conftest*
6835   eval "ac_cv_header_$ac_safe=no"
6836 fi
6837 rm -f conftest*
6838 fi
6839 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6840   echo "$ac_t""yes" 1>&6
6841     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6842   cat >> confdefs.h <<EOF
6843 #define $ac_tr_hdr 1
6844 EOF
6845  
6846 else
6847   echo "$ac_t""no" 1>&6
6848 fi
6849 done
6850
6851         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6852                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6853 echo "configure:6854: checking for thr_create in -lthread" >&5
6854 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6855 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6856   echo $ac_n "(cached) $ac_c" 1>&6
6857 else
6858   ac_save_LIBS="$LIBS"
6859 LIBS="-lthread  $LIBS"
6860 cat > conftest.$ac_ext <<EOF
6861 #line 6862 "configure"
6862 #include "confdefs.h"
6863 /* Override any gcc2 internal prototype to avoid an error.  */
6864 /* We use char because int might match the return type of a gcc2
6865     builtin and then its argument prototype would still apply.  */
6866 char thr_create();
6867
6868 int main() {
6869 thr_create()
6870 ; return 0; }
6871 EOF
6872 if { (eval echo configure:6873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6873   rm -rf conftest*
6874   eval "ac_cv_lib_$ac_lib_var=yes"
6875 else
6876   echo "configure: failed program was:" >&5
6877   cat conftest.$ac_ext >&5
6878   rm -rf conftest*
6879   eval "ac_cv_lib_$ac_lib_var=no"
6880 fi
6881 rm -f conftest*
6882 LIBS="$ac_save_LIBS"
6883
6884 fi
6885 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6886   echo "$ac_t""yes" 1>&6
6887   have_thr=yes
6888 else
6889   echo "$ac_t""no" 1>&6
6890 have_thr=no
6891 fi
6892
6893
6894                 if test $have_thr = yes ; then
6895                         cat >> confdefs.h <<\EOF
6896 #define HAVE_THR 1
6897 EOF
6898
6899                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6900                         ol_link_threads=thr
6901
6902                         if test $ol_with_yielding_select = auto ; then
6903                                 ol_with_yielding_select=yes
6904                         fi
6905
6906                                                 for ac_func in \
6907                                 thr_setconcurrency \
6908                                 thr_getconcurrency \
6909                         
6910 do
6911 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6912 echo "configure:6913: checking for $ac_func" >&5
6913 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6914   echo $ac_n "(cached) $ac_c" 1>&6
6915 else
6916   cat > conftest.$ac_ext <<EOF
6917 #line 6918 "configure"
6918 #include "confdefs.h"
6919 /* System header to define __stub macros and hopefully few prototypes,
6920     which can conflict with char $ac_func(); below.  */
6921 #include <assert.h>
6922 /* Override any gcc2 internal prototype to avoid an error.  */
6923 /* We use char because int might match the return type of a gcc2
6924     builtin and then its argument prototype would still apply.  */
6925 char $ac_func();
6926
6927 int main() {
6928
6929 /* The GNU C library defines this for functions which it implements
6930     to always fail with ENOSYS.  Some functions are actually named
6931     something starting with __ and the normal name is an alias.  */
6932 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6933 choke me
6934 #else
6935 $ac_func();
6936 #endif
6937
6938 ; return 0; }
6939 EOF
6940 if { (eval echo configure:6941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6941   rm -rf conftest*
6942   eval "ac_cv_func_$ac_func=yes"
6943 else
6944   echo "configure: failed program was:" >&5
6945   cat conftest.$ac_ext >&5
6946   rm -rf conftest*
6947   eval "ac_cv_func_$ac_func=no"
6948 fi
6949 rm -f conftest*
6950 fi
6951
6952 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6953   echo "$ac_t""yes" 1>&6
6954     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6955   cat >> confdefs.h <<EOF
6956 #define $ac_tr_func 1
6957 EOF
6958  
6959 else
6960   echo "$ac_t""no" 1>&6
6961 fi
6962 done
6963
6964                 fi
6965         fi
6966
6967                 for ac_hdr in lwp/lwp.h
6968 do
6969 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6970 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6971 echo "configure:6972: checking for $ac_hdr" >&5
6972 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6973   echo $ac_n "(cached) $ac_c" 1>&6
6974 else
6975   cat > conftest.$ac_ext <<EOF
6976 #line 6977 "configure"
6977 #include "confdefs.h"
6978 #include <$ac_hdr>
6979 EOF
6980 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6981 { (eval echo configure:6982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6982 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6983 if test -z "$ac_err"; then
6984   rm -rf conftest*
6985   eval "ac_cv_header_$ac_safe=yes"
6986 else
6987   echo "$ac_err" >&5
6988   echo "configure: failed program was:" >&5
6989   cat conftest.$ac_ext >&5
6990   rm -rf conftest*
6991   eval "ac_cv_header_$ac_safe=no"
6992 fi
6993 rm -f conftest*
6994 fi
6995 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6996   echo "$ac_t""yes" 1>&6
6997     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6998   cat >> confdefs.h <<EOF
6999 #define $ac_tr_hdr 1
7000 EOF
7001  
7002 else
7003   echo "$ac_t""no" 1>&6
7004 fi
7005 done
7006
7007         if test $ac_cv_header_lwp_lwp_h = yes ; then
7008                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
7009 echo "configure:7010: checking for lwp_create in -llwp" >&5
7010 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
7011 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7012   echo $ac_n "(cached) $ac_c" 1>&6
7013 else
7014   ac_save_LIBS="$LIBS"
7015 LIBS="-llwp  $LIBS"
7016 cat > conftest.$ac_ext <<EOF
7017 #line 7018 "configure"
7018 #include "confdefs.h"
7019 /* Override any gcc2 internal prototype to avoid an error.  */
7020 /* We use char because int might match the return type of a gcc2
7021     builtin and then its argument prototype would still apply.  */
7022 char lwp_create();
7023
7024 int main() {
7025 lwp_create()
7026 ; return 0; }
7027 EOF
7028 if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7029   rm -rf conftest*
7030   eval "ac_cv_lib_$ac_lib_var=yes"
7031 else
7032   echo "configure: failed program was:" >&5
7033   cat conftest.$ac_ext >&5
7034   rm -rf conftest*
7035   eval "ac_cv_lib_$ac_lib_var=no"
7036 fi
7037 rm -f conftest*
7038 LIBS="$ac_save_LIBS"
7039
7040 fi
7041 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7042   echo "$ac_t""yes" 1>&6
7043   have_lwp=yes
7044 else
7045   echo "$ac_t""no" 1>&6
7046 have_lwp=no
7047 fi
7048
7049
7050                 if test $have_lwp = yes ; then
7051                         cat >> confdefs.h <<\EOF
7052 #define HAVE_LWP 1
7053 EOF
7054
7055                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
7056                         ol_link_threads=lwp
7057
7058                         if test $ol_with_yielding_select = auto ; then
7059                                 ol_with_yielding_select=no
7060                         fi
7061                 fi
7062         fi
7063 fi
7064
7065 if test $ol_with_yielding_select = yes ; then
7066         cat >> confdefs.h <<\EOF
7067 #define HAVE_YIELDING_SELECT 1
7068 EOF
7069
7070 fi
7071
7072 if test $ol_with_threads = manual ; then
7073                 ol_link_threads=yes
7074
7075         echo "configure: warning: thread defines and link options must be set manually" 1>&2
7076
7077         for ac_hdr in pthread.h sched.h
7078 do
7079 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7080 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7081 echo "configure:7082: checking for $ac_hdr" >&5
7082 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7083   echo $ac_n "(cached) $ac_c" 1>&6
7084 else
7085   cat > conftest.$ac_ext <<EOF
7086 #line 7087 "configure"
7087 #include "confdefs.h"
7088 #include <$ac_hdr>
7089 EOF
7090 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7091 { (eval echo configure:7092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7092 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7093 if test -z "$ac_err"; then
7094   rm -rf conftest*
7095   eval "ac_cv_header_$ac_safe=yes"
7096 else
7097   echo "$ac_err" >&5
7098   echo "configure: failed program was:" >&5
7099   cat conftest.$ac_ext >&5
7100   rm -rf conftest*
7101   eval "ac_cv_header_$ac_safe=no"
7102 fi
7103 rm -f conftest*
7104 fi
7105 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7106   echo "$ac_t""yes" 1>&6
7107     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7108   cat >> confdefs.h <<EOF
7109 #define $ac_tr_hdr 1
7110 EOF
7111  
7112 else
7113   echo "$ac_t""no" 1>&6
7114 fi
7115 done
7116
7117         for ac_func in sched_yield pthread_yield
7118 do
7119 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7120 echo "configure:7121: checking for $ac_func" >&5
7121 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7122   echo $ac_n "(cached) $ac_c" 1>&6
7123 else
7124   cat > conftest.$ac_ext <<EOF
7125 #line 7126 "configure"
7126 #include "confdefs.h"
7127 /* System header to define __stub macros and hopefully few prototypes,
7128     which can conflict with char $ac_func(); below.  */
7129 #include <assert.h>
7130 /* Override any gcc2 internal prototype to avoid an error.  */
7131 /* We use char because int might match the return type of a gcc2
7132     builtin and then its argument prototype would still apply.  */
7133 char $ac_func();
7134
7135 int main() {
7136
7137 /* The GNU C library defines this for functions which it implements
7138     to always fail with ENOSYS.  Some functions are actually named
7139     something starting with __ and the normal name is an alias.  */
7140 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7141 choke me
7142 #else
7143 $ac_func();
7144 #endif
7145
7146 ; return 0; }
7147 EOF
7148 if { (eval echo configure:7149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7149   rm -rf conftest*
7150   eval "ac_cv_func_$ac_func=yes"
7151 else
7152   echo "configure: failed program was:" >&5
7153   cat conftest.$ac_ext >&5
7154   rm -rf conftest*
7155   eval "ac_cv_func_$ac_func=no"
7156 fi
7157 rm -f conftest*
7158 fi
7159
7160 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7161   echo "$ac_t""yes" 1>&6
7162     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7163   cat >> confdefs.h <<EOF
7164 #define $ac_tr_func 1
7165 EOF
7166  
7167 else
7168   echo "$ac_t""no" 1>&6
7169 fi
7170 done
7171
7172         
7173         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7174 echo "configure:7175: checking for LinuxThreads pthread.h" >&5
7175 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7176   echo $ac_n "(cached) $ac_c" 1>&6
7177 else
7178   cat > conftest.$ac_ext <<EOF
7179 #line 7180 "configure"
7180 #include "confdefs.h"
7181 #include <pthread.h>
7182 EOF
7183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7184   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7185   rm -rf conftest*
7186   ol_cv_header_linux_threads=yes
7187 else
7188   rm -rf conftest*
7189   ol_cv_header_linux_threads=no
7190 fi
7191 rm -f conftest*
7192
7193                 
7194 fi
7195
7196 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7197         if test $ol_cv_header_linux_threads = yes; then
7198                 cat >> confdefs.h <<\EOF
7199 #define HAVE_LINUX_THREADS 1
7200 EOF
7201
7202         fi
7203
7204
7205         for ac_hdr in mach/cthreads.h
7206 do
7207 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7208 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7209 echo "configure:7210: checking for $ac_hdr" >&5
7210 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7211   echo $ac_n "(cached) $ac_c" 1>&6
7212 else
7213   cat > conftest.$ac_ext <<EOF
7214 #line 7215 "configure"
7215 #include "confdefs.h"
7216 #include <$ac_hdr>
7217 EOF
7218 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7219 { (eval echo configure:7220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7220 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7221 if test -z "$ac_err"; then
7222   rm -rf conftest*
7223   eval "ac_cv_header_$ac_safe=yes"
7224 else
7225   echo "$ac_err" >&5
7226   echo "configure: failed program was:" >&5
7227   cat conftest.$ac_ext >&5
7228   rm -rf conftest*
7229   eval "ac_cv_header_$ac_safe=no"
7230 fi
7231 rm -f conftest*
7232 fi
7233 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7234   echo "$ac_t""yes" 1>&6
7235     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7236   cat >> confdefs.h <<EOF
7237 #define $ac_tr_hdr 1
7238 EOF
7239  
7240 else
7241   echo "$ac_t""no" 1>&6
7242 fi
7243 done
7244
7245         for ac_hdr in lwp/lwp.h
7246 do
7247 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7248 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7249 echo "configure:7250: checking for $ac_hdr" >&5
7250 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7251   echo $ac_n "(cached) $ac_c" 1>&6
7252 else
7253   cat > conftest.$ac_ext <<EOF
7254 #line 7255 "configure"
7255 #include "confdefs.h"
7256 #include <$ac_hdr>
7257 EOF
7258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7259 { (eval echo configure:7260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7260 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7261 if test -z "$ac_err"; then
7262   rm -rf conftest*
7263   eval "ac_cv_header_$ac_safe=yes"
7264 else
7265   echo "$ac_err" >&5
7266   echo "configure: failed program was:" >&5
7267   cat conftest.$ac_ext >&5
7268   rm -rf conftest*
7269   eval "ac_cv_header_$ac_safe=no"
7270 fi
7271 rm -f conftest*
7272 fi
7273 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7274   echo "$ac_t""yes" 1>&6
7275     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7276   cat >> confdefs.h <<EOF
7277 #define $ac_tr_hdr 1
7278 EOF
7279  
7280 else
7281   echo "$ac_t""no" 1>&6
7282 fi
7283 done
7284
7285         for ac_hdr in thread.h synch.h
7286 do
7287 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7288 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7289 echo "configure:7290: checking for $ac_hdr" >&5
7290 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7291   echo $ac_n "(cached) $ac_c" 1>&6
7292 else
7293   cat > conftest.$ac_ext <<EOF
7294 #line 7295 "configure"
7295 #include "confdefs.h"
7296 #include <$ac_hdr>
7297 EOF
7298 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7299 { (eval echo configure:7300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7300 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7301 if test -z "$ac_err"; then
7302   rm -rf conftest*
7303   eval "ac_cv_header_$ac_safe=yes"
7304 else
7305   echo "$ac_err" >&5
7306   echo "configure: failed program was:" >&5
7307   cat conftest.$ac_ext >&5
7308   rm -rf conftest*
7309   eval "ac_cv_header_$ac_safe=no"
7310 fi
7311 rm -f conftest*
7312 fi
7313 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7314   echo "$ac_t""yes" 1>&6
7315     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7316   cat >> confdefs.h <<EOF
7317 #define $ac_tr_hdr 1
7318 EOF
7319  
7320 else
7321   echo "$ac_t""no" 1>&6
7322 fi
7323 done
7324
7325 fi
7326
7327 if test $ol_link_threads != no ; then  
7328                         cat >> confdefs.h <<\EOF
7329 #define REENTRANT 1
7330 EOF
7331
7332         cat >> confdefs.h <<\EOF
7333 #define _REENTRANT 1
7334 EOF
7335
7336         cat >> confdefs.h <<\EOF
7337 #define THREAD_SAFE 1
7338 EOF
7339
7340         cat >> confdefs.h <<\EOF
7341 #define _THREAD_SAFE 1
7342 EOF
7343
7344         cat >> confdefs.h <<\EOF
7345 #define THREADSAFE 1
7346 EOF
7347
7348         cat >> confdefs.h <<\EOF
7349 #define _THREADSAFE 1
7350 EOF
7351
7352
7353                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7354 echo "configure:7355: checking for thread specific errno" >&5
7355 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7356   echo $ac_n "(cached) $ac_c" 1>&6
7357 else
7358   
7359                 cat > conftest.$ac_ext <<EOF
7360 #line 7361 "configure"
7361 #include "confdefs.h"
7362 #include <errno.h>
7363 int main() {
7364 errno = 0;
7365 ; return 0; }
7366 EOF
7367 if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7368   rm -rf conftest*
7369   ol_cv_errno_thread_specific=yes
7370 else
7371   echo "configure: failed program was:" >&5
7372   cat conftest.$ac_ext >&5
7373   rm -rf conftest*
7374   ol_cv_errno_thread_specific=no
7375 fi
7376 rm -f conftest*
7377         
7378 fi
7379
7380 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7381
7382                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
7383 echo "configure:7384: checking for thread specific h_errno" >&5
7384 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
7385   echo $ac_n "(cached) $ac_c" 1>&6
7386 else
7387   
7388                 cat > conftest.$ac_ext <<EOF
7389 #line 7390 "configure"
7390 #include "confdefs.h"
7391 #include <netdb.h>
7392 int main() {
7393 h_errno = 0;
7394 ; return 0; }
7395 EOF
7396 if { (eval echo configure:7397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7397   rm -rf conftest*
7398   ol_cv_h_errno_thread_specific=yes
7399 else
7400   echo "configure: failed program was:" >&5
7401   cat conftest.$ac_ext >&5
7402   rm -rf conftest*
7403   ol_cv_h_errno_thread_specific=no
7404 fi
7405 rm -f conftest*
7406         
7407 fi
7408
7409 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
7410
7411         if test $ol_cv_errno_thread_specific != yes \
7412                 -o $ol_cv_h_errno_thread_specific != yes ; then
7413                 LIBS="$LTHREAD_LIBS $LIBS"
7414                 LTHREAD_LIBS=""
7415         fi
7416
7417 fi  
7418
7419 if test $ol_link_threads = no ; then
7420         if test $ol_with_threads = yes ; then
7421                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7422         fi
7423
7424         if test $ol_with_threads = auto ; then
7425                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7426                 ol_with_threads=no
7427         fi
7428
7429         cat >> confdefs.h <<\EOF
7430 #define NO_THREADS 1
7431 EOF
7432
7433         LTHREAD_LIBS=""
7434 fi
7435
7436 if test $ol_link_threads != no ; then
7437         cat >> confdefs.h <<\EOF
7438 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7439 EOF
7440
7441 fi
7442
7443
7444 ol_link_ldbm=no 
7445 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7446         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7447 echo "configure:7448: checking for DB2 library" >&5
7448 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7449   echo $ac_n "(cached) $ac_c" 1>&6
7450 else
7451         ol_LIBS="$LIBS"
7452         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7453 echo "configure:7454: checking for db_open in -ldb" >&5
7454 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7455 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7456   echo $ac_n "(cached) $ac_c" 1>&6
7457 else
7458   ac_save_LIBS="$LIBS"
7459 LIBS="-ldb  $LIBS"
7460 cat > conftest.$ac_ext <<EOF
7461 #line 7462 "configure"
7462 #include "confdefs.h"
7463 /* Override any gcc2 internal prototype to avoid an error.  */
7464 /* We use char because int might match the return type of a gcc2
7465     builtin and then its argument prototype would still apply.  */
7466 char db_open();
7467
7468 int main() {
7469 db_open()
7470 ; return 0; }
7471 EOF
7472 if { (eval echo configure:7473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7473   rm -rf conftest*
7474   eval "ac_cv_lib_$ac_lib_var=yes"
7475 else
7476   echo "configure: failed program was:" >&5
7477   cat conftest.$ac_ext >&5
7478   rm -rf conftest*
7479   eval "ac_cv_lib_$ac_lib_var=no"
7480 fi
7481 rm -f conftest*
7482 LIBS="$ac_save_LIBS"
7483
7484 fi
7485 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7486   echo "$ac_t""yes" 1>&6
7487   ol_cv_lib_db2=-ldb
7488 else
7489   echo "$ac_t""no" 1>&6
7490 ol_cv_lib_db2=no
7491 fi
7492
7493         LIBS="$ol_LIBS"
7494
7495 fi
7496
7497 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7498
7499 for ac_hdr in db.h
7500 do
7501 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7502 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7503 echo "configure:7504: checking for $ac_hdr" >&5
7504 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7505   echo $ac_n "(cached) $ac_c" 1>&6
7506 else
7507   cat > conftest.$ac_ext <<EOF
7508 #line 7509 "configure"
7509 #include "confdefs.h"
7510 #include <$ac_hdr>
7511 EOF
7512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7513 { (eval echo configure:7514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7514 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7515 if test -z "$ac_err"; then
7516   rm -rf conftest*
7517   eval "ac_cv_header_$ac_safe=yes"
7518 else
7519   echo "$ac_err" >&5
7520   echo "configure: failed program was:" >&5
7521   cat conftest.$ac_ext >&5
7522   rm -rf conftest*
7523   eval "ac_cv_header_$ac_safe=no"
7524 fi
7525 rm -f conftest*
7526 fi
7527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7528   echo "$ac_t""yes" 1>&6
7529     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7530   cat >> confdefs.h <<EOF
7531 #define $ac_tr_hdr 1
7532 EOF
7533  
7534 else
7535   echo "$ac_t""no" 1>&6
7536 fi
7537 done
7538
7539 if test $ac_cv_header_db_h = yes ; then
7540         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7541 echo "configure:7542: checking if db.h is DB2" >&5
7542 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7543   echo $ac_n "(cached) $ac_c" 1>&6
7544 else
7545   
7546                 cat > conftest.$ac_ext <<EOF
7547 #line 7548 "configure"
7548 #include "confdefs.h"
7549
7550 #                       include <db.h>
7551                         /* this check could be improved */
7552 #                       ifdef DB_VERSION_MAJOR
7553 #                               if DB_VERSION_MAJOR == 2
7554                                         __db_version_2
7555 #                               endif
7556 #                       endif
7557                 
7558 EOF
7559 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7560   egrep "__db_version_2" >/dev/null 2>&1; then
7561   rm -rf conftest*
7562   ol_cv_header_db2=yes
7563 else
7564   rm -rf conftest*
7565   ol_cv_header_db2=no
7566 fi
7567 rm -f conftest*
7568
7569 fi
7570
7571 echo "$ac_t""$ol_cv_header_db2" 1>&6
7572 else
7573         ol_cv_header_db2=no
7574 fi
7575
7576
7577  
7578  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7579 echo "configure:7580: checking for Berkeley DB2" >&5
7580 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7581   echo $ac_n "(cached) $ac_c" 1>&6
7582 else
7583   
7584         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7585                 ol_cv_berkeley_db2=no
7586         else
7587                 ol_cv_berkeley_db2=yes
7588         fi
7589
7590 fi
7591
7592 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7593  if test $ol_cv_berkeley_db2 = yes ; then
7594         cat >> confdefs.h <<\EOF
7595 #define HAVE_BERKELEY_DB2 1
7596 EOF
7597
7598  fi
7599
7600
7601         if test $ol_cv_berkeley_db2 = yes ; then
7602                 ol_link_ldbm=db2
7603                 ol_with_ldbm_api=db2
7604
7605                 if test $ol_with_ldbm_type = hash ; then
7606                         cat >> confdefs.h <<\EOF
7607 #define LDBM_USE_DBHASH 1
7608 EOF
7609
7610                 else
7611                         cat >> confdefs.h <<\EOF
7612 #define LDBM_USE_DBBTREE 1
7613 EOF
7614
7615                 fi
7616
7617                                                 if test $ol_cv_lib_db2 != yes ; then
7618                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7619                 fi
7620         fi
7621 fi
7622
7623 ol_link_bdb2=no
7624 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7625         ol_link_bdb2=yes
7626 fi
7627
7628 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7629         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7630 echo "configure:7631: checking for Berkeley DB library" >&5
7631 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7632   echo $ac_n "(cached) $ac_c" 1>&6
7633 else
7634   
7635         for ac_hdr in db1/db.h
7636 do
7637 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7638 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7639 echo "configure:7640: checking for $ac_hdr" >&5
7640 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7641   echo $ac_n "(cached) $ac_c" 1>&6
7642 else
7643   cat > conftest.$ac_ext <<EOF
7644 #line 7645 "configure"
7645 #include "confdefs.h"
7646 #include <$ac_hdr>
7647 EOF
7648 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7649 { (eval echo configure:7650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7650 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7651 if test -z "$ac_err"; then
7652   rm -rf conftest*
7653   eval "ac_cv_header_$ac_safe=yes"
7654 else
7655   echo "$ac_err" >&5
7656   echo "configure: failed program was:" >&5
7657   cat conftest.$ac_ext >&5
7658   rm -rf conftest*
7659   eval "ac_cv_header_$ac_safe=no"
7660 fi
7661 rm -f conftest*
7662 fi
7663 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7664   echo "$ac_t""yes" 1>&6
7665     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7666   cat >> confdefs.h <<EOF
7667 #define $ac_tr_hdr 1
7668 EOF
7669  
7670 else
7671   echo "$ac_t""no" 1>&6
7672 fi
7673 done
7674
7675         ol_LIBS="$LIBS"
7676         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7677 echo "configure:7678: checking for dbopen" >&5
7678 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
7679   echo $ac_n "(cached) $ac_c" 1>&6
7680 else
7681   cat > conftest.$ac_ext <<EOF
7682 #line 7683 "configure"
7683 #include "confdefs.h"
7684 /* System header to define __stub macros and hopefully few prototypes,
7685     which can conflict with char dbopen(); below.  */
7686 #include <assert.h>
7687 /* Override any gcc2 internal prototype to avoid an error.  */
7688 /* We use char because int might match the return type of a gcc2
7689     builtin and then its argument prototype would still apply.  */
7690 char dbopen();
7691
7692 int main() {
7693
7694 /* The GNU C library defines this for functions which it implements
7695     to always fail with ENOSYS.  Some functions are actually named
7696     something starting with __ and the normal name is an alias.  */
7697 #if defined (__stub_dbopen) || defined (__stub___dbopen)
7698 choke me
7699 #else
7700 dbopen();
7701 #endif
7702
7703 ; return 0; }
7704 EOF
7705 if { (eval echo configure:7706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7706   rm -rf conftest*
7707   eval "ac_cv_func_dbopen=yes"
7708 else
7709   echo "configure: failed program was:" >&5
7710   cat conftest.$ac_ext >&5
7711   rm -rf conftest*
7712   eval "ac_cv_func_dbopen=no"
7713 fi
7714 rm -f conftest*
7715 fi
7716
7717 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7718   echo "$ac_t""yes" 1>&6
7719   ol_cv_lib_db=yes
7720 else
7721   echo "$ac_t""no" 1>&6
7722
7723                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7724 echo "configure:7725: checking for dbopen in -ldb1" >&5
7725 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7726 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7727   echo $ac_n "(cached) $ac_c" 1>&6
7728 else
7729   ac_save_LIBS="$LIBS"
7730 LIBS="-ldb1  $LIBS"
7731 cat > conftest.$ac_ext <<EOF
7732 #line 7733 "configure"
7733 #include "confdefs.h"
7734 /* Override any gcc2 internal prototype to avoid an error.  */
7735 /* We use char because int might match the return type of a gcc2
7736     builtin and then its argument prototype would still apply.  */
7737 char dbopen();
7738
7739 int main() {
7740 dbopen()
7741 ; return 0; }
7742 EOF
7743 if { (eval echo configure:7744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7744   rm -rf conftest*
7745   eval "ac_cv_lib_$ac_lib_var=yes"
7746 else
7747   echo "configure: failed program was:" >&5
7748   cat conftest.$ac_ext >&5
7749   rm -rf conftest*
7750   eval "ac_cv_lib_$ac_lib_var=no"
7751 fi
7752 rm -f conftest*
7753 LIBS="$ac_save_LIBS"
7754
7755 fi
7756 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7757   echo "$ac_t""yes" 1>&6
7758   ol_cv_lib_db=-ldb1
7759 else
7760   echo "$ac_t""no" 1>&6
7761
7762                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7763 echo "configure:7764: checking for dbopen in -ldb" >&5
7764 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7765 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7766   echo $ac_n "(cached) $ac_c" 1>&6
7767 else
7768   ac_save_LIBS="$LIBS"
7769 LIBS="-ldb  $LIBS"
7770 cat > conftest.$ac_ext <<EOF
7771 #line 7772 "configure"
7772 #include "confdefs.h"
7773 /* Override any gcc2 internal prototype to avoid an error.  */
7774 /* We use char because int might match the return type of a gcc2
7775     builtin and then its argument prototype would still apply.  */
7776 char dbopen();
7777
7778 int main() {
7779 dbopen()
7780 ; return 0; }
7781 EOF
7782 if { (eval echo configure:7783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7783   rm -rf conftest*
7784   eval "ac_cv_lib_$ac_lib_var=yes"
7785 else
7786   echo "configure: failed program was:" >&5
7787   cat conftest.$ac_ext >&5
7788   rm -rf conftest*
7789   eval "ac_cv_lib_$ac_lib_var=no"
7790 fi
7791 rm -f conftest*
7792 LIBS="$ac_save_LIBS"
7793
7794 fi
7795 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7796   echo "$ac_t""yes" 1>&6
7797   ol_cv_lib_db=-ldb
7798 else
7799   echo "$ac_t""no" 1>&6
7800 ol_cv_lib_db=no
7801 fi
7802
7803                 
7804 fi
7805
7806         
7807 fi
7808
7809         LIBS="$ol_LIBS"
7810
7811 fi
7812
7813 echo "$ac_t""$ol_cv_lib_db" 1>&6
7814
7815
7816 for ac_hdr in db_185.h
7817 do
7818 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7819 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7820 echo "configure:7821: checking for $ac_hdr" >&5
7821 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7822   echo $ac_n "(cached) $ac_c" 1>&6
7823 else
7824   cat > conftest.$ac_ext <<EOF
7825 #line 7826 "configure"
7826 #include "confdefs.h"
7827 #include <$ac_hdr>
7828 EOF
7829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7830 { (eval echo configure:7831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7831 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7832 if test -z "$ac_err"; then
7833   rm -rf conftest*
7834   eval "ac_cv_header_$ac_safe=yes"
7835 else
7836   echo "$ac_err" >&5
7837   echo "configure: failed program was:" >&5
7838   cat conftest.$ac_ext >&5
7839   rm -rf conftest*
7840   eval "ac_cv_header_$ac_safe=no"
7841 fi
7842 rm -f conftest*
7843 fi
7844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7845   echo "$ac_t""yes" 1>&6
7846     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7847   cat >> confdefs.h <<EOF
7848 #define $ac_tr_hdr 1
7849 EOF
7850  
7851 else
7852   echo "$ac_t""no" 1>&6
7853 fi
7854 done
7855
7856 if test "$ol_cv_header_db2" = yes ; then
7857         
7858         ol_cv_header_db=$ac_cv_header_db_185_h
7859 else
7860         ol_cv_header_db=$ac_cv_header_db_h
7861 fi
7862
7863
7864  
7865  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7866 echo "configure:7867: checking for Berkeley DB" >&5
7867 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7868   echo $ac_n "(cached) $ac_c" 1>&6
7869 else
7870   
7871         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7872                 ol_cv_berkeley_db=no
7873         else
7874                 ol_cv_berkeley_db=yes
7875         fi
7876
7877 fi
7878
7879 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7880  if test $ol_cv_berkeley_db = yes ; then
7881         cat >> confdefs.h <<\EOF
7882 #define HAVE_BERKELEY_DB 1
7883 EOF
7884
7885  fi
7886
7887
7888         if test $ol_cv_berkeley_db = yes ; then
7889                 ol_link_ldbm=db
7890                 ol_with_ldbm_api=db
7891
7892                 if test $ol_with_ldbm_type = hash ; then
7893                         cat >> confdefs.h <<\EOF
7894 #define LDBM_USE_DBHASH 1
7895 EOF
7896
7897                 else
7898                         cat >> confdefs.h <<\EOF
7899 #define LDBM_USE_DBBTREE 1
7900 EOF
7901
7902                 fi
7903
7904                                                 if test $ol_cv_lib_db != yes ; then
7905                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7906                 fi
7907         fi
7908 fi
7909
7910 if test $ol_with_ldbm_api = manual ; then
7911                 ol_link_ldbm=yes
7912
7913         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7914
7915         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7916 do
7917 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7918 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7919 echo "configure:7920: checking for $ac_hdr" >&5
7920 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7921   echo $ac_n "(cached) $ac_c" 1>&6
7922 else
7923   cat > conftest.$ac_ext <<EOF
7924 #line 7925 "configure"
7925 #include "confdefs.h"
7926 #include <$ac_hdr>
7927 EOF
7928 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7929 { (eval echo configure:7930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7930 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7931 if test -z "$ac_err"; then
7932   rm -rf conftest*
7933   eval "ac_cv_header_$ac_safe=yes"
7934 else
7935   echo "$ac_err" >&5
7936   echo "configure: failed program was:" >&5
7937   cat conftest.$ac_ext >&5
7938   rm -rf conftest*
7939   eval "ac_cv_header_$ac_safe=no"
7940 fi
7941 rm -f conftest*
7942 fi
7943 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7944   echo "$ac_t""yes" 1>&6
7945     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7946   cat >> confdefs.h <<EOF
7947 #define $ac_tr_hdr 1
7948 EOF
7949  
7950 else
7951   echo "$ac_t""no" 1>&6
7952 fi
7953 done
7954
7955 fi
7956
7957 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7958         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7959         ol_with_ldbm_api=none
7960 fi
7961
7962 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7963         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7964 echo "configure:7965: checking for MDBM library" >&5
7965 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7966   echo $ac_n "(cached) $ac_c" 1>&6
7967 else
7968         ol_LIBS="$LIBS"
7969         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7970 echo "configure:7971: checking for mdbm_set_chain" >&5
7971 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7972   echo $ac_n "(cached) $ac_c" 1>&6
7973 else
7974   cat > conftest.$ac_ext <<EOF
7975 #line 7976 "configure"
7976 #include "confdefs.h"
7977 /* System header to define __stub macros and hopefully few prototypes,
7978     which can conflict with char mdbm_set_chain(); below.  */
7979 #include <assert.h>
7980 /* Override any gcc2 internal prototype to avoid an error.  */
7981 /* We use char because int might match the return type of a gcc2
7982     builtin and then its argument prototype would still apply.  */
7983 char mdbm_set_chain();
7984
7985 int main() {
7986
7987 /* The GNU C library defines this for functions which it implements
7988     to always fail with ENOSYS.  Some functions are actually named
7989     something starting with __ and the normal name is an alias.  */
7990 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7991 choke me
7992 #else
7993 mdbm_set_chain();
7994 #endif
7995
7996 ; return 0; }
7997 EOF
7998 if { (eval echo configure:7999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7999   rm -rf conftest*
8000   eval "ac_cv_func_mdbm_set_chain=yes"
8001 else
8002   echo "configure: failed program was:" >&5
8003   cat conftest.$ac_ext >&5
8004   rm -rf conftest*
8005   eval "ac_cv_func_mdbm_set_chain=no"
8006 fi
8007 rm -f conftest*
8008 fi
8009
8010 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
8011   echo "$ac_t""yes" 1>&6
8012   ol_cv_lib_mdbm=yes
8013 else
8014   echo "$ac_t""no" 1>&6
8015
8016                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
8017 echo "configure:8018: checking for mdbm_set_chain in -lmdbm" >&5
8018 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
8019 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8020   echo $ac_n "(cached) $ac_c" 1>&6
8021 else
8022   ac_save_LIBS="$LIBS"
8023 LIBS="-lmdbm  $LIBS"
8024 cat > conftest.$ac_ext <<EOF
8025 #line 8026 "configure"
8026 #include "confdefs.h"
8027 /* Override any gcc2 internal prototype to avoid an error.  */
8028 /* We use char because int might match the return type of a gcc2
8029     builtin and then its argument prototype would still apply.  */
8030 char mdbm_set_chain();
8031
8032 int main() {
8033 mdbm_set_chain()
8034 ; return 0; }
8035 EOF
8036 if { (eval echo configure:8037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8037   rm -rf conftest*
8038   eval "ac_cv_lib_$ac_lib_var=yes"
8039 else
8040   echo "configure: failed program was:" >&5
8041   cat conftest.$ac_ext >&5
8042   rm -rf conftest*
8043   eval "ac_cv_lib_$ac_lib_var=no"
8044 fi
8045 rm -f conftest*
8046 LIBS="$ac_save_LIBS"
8047
8048 fi
8049 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8050   echo "$ac_t""yes" 1>&6
8051   ol_cv_lib_mdbm=-lmdbm
8052 else
8053   echo "$ac_t""no" 1>&6
8054 ol_cv_lib_mdbm=no
8055 fi
8056
8057         
8058 fi
8059
8060         LIBS="$ol_LIBS"
8061
8062 fi
8063
8064 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
8065
8066
8067  for ac_hdr in mdbm.h
8068 do
8069 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8070 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8071 echo "configure:8072: checking for $ac_hdr" >&5
8072 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8073   echo $ac_n "(cached) $ac_c" 1>&6
8074 else
8075   cat > conftest.$ac_ext <<EOF
8076 #line 8077 "configure"
8077 #include "confdefs.h"
8078 #include <$ac_hdr>
8079 EOF
8080 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8081 { (eval echo configure:8082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8082 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8083 if test -z "$ac_err"; then
8084   rm -rf conftest*
8085   eval "ac_cv_header_$ac_safe=yes"
8086 else
8087   echo "$ac_err" >&5
8088   echo "configure: failed program was:" >&5
8089   cat conftest.$ac_ext >&5
8090   rm -rf conftest*
8091   eval "ac_cv_header_$ac_safe=no"
8092 fi
8093 rm -f conftest*
8094 fi
8095 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8096   echo "$ac_t""yes" 1>&6
8097     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8098   cat >> confdefs.h <<EOF
8099 #define $ac_tr_hdr 1
8100 EOF
8101  
8102 else
8103   echo "$ac_t""no" 1>&6
8104 fi
8105 done
8106
8107  echo $ac_n "checking for db""... $ac_c" 1>&6
8108 echo "configure:8109: checking for db" >&5
8109 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
8110   echo $ac_n "(cached) $ac_c" 1>&6
8111 else
8112   
8113         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
8114                 ol_cv_mdbm=no
8115         else
8116                 ol_cv_mdbm=yes
8117         fi
8118
8119 fi
8120
8121 echo "$ac_t""$ol_cv_mdbm" 1>&6
8122  if test $ol_cv_mdbm = yes ; then
8123         cat >> confdefs.h <<\EOF
8124 #define HAVE_MDBM 1
8125 EOF
8126
8127  fi
8128
8129
8130         if test $ol_cv_mdbm = yes ; then
8131                 ol_link_ldbm=mdbm
8132                 ol_with_ldbm_api=mdbm
8133                 if test $ol_cv_lib_mdbm != yes ; then
8134                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
8135                 fi
8136         fi
8137 fi
8138
8139 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
8140         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
8141 echo "configure:8142: checking for GDBM library" >&5
8142 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
8143   echo $ac_n "(cached) $ac_c" 1>&6
8144 else
8145         ol_LIBS="$LIBS"
8146         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
8147 echo "configure:8148: checking for gdbm_open" >&5
8148 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
8149   echo $ac_n "(cached) $ac_c" 1>&6
8150 else
8151   cat > conftest.$ac_ext <<EOF
8152 #line 8153 "configure"
8153 #include "confdefs.h"
8154 /* System header to define __stub macros and hopefully few prototypes,
8155     which can conflict with char gdbm_open(); below.  */
8156 #include <assert.h>
8157 /* Override any gcc2 internal prototype to avoid an error.  */
8158 /* We use char because int might match the return type of a gcc2
8159     builtin and then its argument prototype would still apply.  */
8160 char gdbm_open();
8161
8162 int main() {
8163
8164 /* The GNU C library defines this for functions which it implements
8165     to always fail with ENOSYS.  Some functions are actually named
8166     something starting with __ and the normal name is an alias.  */
8167 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
8168 choke me
8169 #else
8170 gdbm_open();
8171 #endif
8172
8173 ; return 0; }
8174 EOF
8175 if { (eval echo configure:8176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8176   rm -rf conftest*
8177   eval "ac_cv_func_gdbm_open=yes"
8178 else
8179   echo "configure: failed program was:" >&5
8180   cat conftest.$ac_ext >&5
8181   rm -rf conftest*
8182   eval "ac_cv_func_gdbm_open=no"
8183 fi
8184 rm -f conftest*
8185 fi
8186
8187 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
8188   echo "$ac_t""yes" 1>&6
8189   ol_cv_lib_gdbm=yes
8190 else
8191   echo "$ac_t""no" 1>&6
8192
8193                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
8194 echo "configure:8195: checking for gdbm_open in -lgdbm" >&5
8195 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
8196 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8197   echo $ac_n "(cached) $ac_c" 1>&6
8198 else
8199   ac_save_LIBS="$LIBS"
8200 LIBS="-lgdbm  $LIBS"
8201 cat > conftest.$ac_ext <<EOF
8202 #line 8203 "configure"
8203 #include "confdefs.h"
8204 /* Override any gcc2 internal prototype to avoid an error.  */
8205 /* We use char because int might match the return type of a gcc2
8206     builtin and then its argument prototype would still apply.  */
8207 char gdbm_open();
8208
8209 int main() {
8210 gdbm_open()
8211 ; return 0; }
8212 EOF
8213 if { (eval echo configure:8214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8214   rm -rf conftest*
8215   eval "ac_cv_lib_$ac_lib_var=yes"
8216 else
8217   echo "configure: failed program was:" >&5
8218   cat conftest.$ac_ext >&5
8219   rm -rf conftest*
8220   eval "ac_cv_lib_$ac_lib_var=no"
8221 fi
8222 rm -f conftest*
8223 LIBS="$ac_save_LIBS"
8224
8225 fi
8226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8227   echo "$ac_t""yes" 1>&6
8228   ol_cv_lib_gdbm=-lgdbm
8229 else
8230   echo "$ac_t""no" 1>&6
8231 ol_cv_lib_gdbm=no
8232 fi
8233
8234         
8235 fi
8236
8237         LIBS="$ol_LIBS"
8238
8239 fi
8240
8241 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8242
8243
8244  for ac_hdr in gdbm.h
8245 do
8246 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8247 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8248 echo "configure:8249: checking for $ac_hdr" >&5
8249 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8250   echo $ac_n "(cached) $ac_c" 1>&6
8251 else
8252   cat > conftest.$ac_ext <<EOF
8253 #line 8254 "configure"
8254 #include "confdefs.h"
8255 #include <$ac_hdr>
8256 EOF
8257 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8258 { (eval echo configure:8259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8259 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8260 if test -z "$ac_err"; then
8261   rm -rf conftest*
8262   eval "ac_cv_header_$ac_safe=yes"
8263 else
8264   echo "$ac_err" >&5
8265   echo "configure: failed program was:" >&5
8266   cat conftest.$ac_ext >&5
8267   rm -rf conftest*
8268   eval "ac_cv_header_$ac_safe=no"
8269 fi
8270 rm -f conftest*
8271 fi
8272 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8273   echo "$ac_t""yes" 1>&6
8274     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8275   cat >> confdefs.h <<EOF
8276 #define $ac_tr_hdr 1
8277 EOF
8278  
8279 else
8280   echo "$ac_t""no" 1>&6
8281 fi
8282 done
8283
8284  echo $ac_n "checking for db""... $ac_c" 1>&6
8285 echo "configure:8286: checking for db" >&5
8286 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8287   echo $ac_n "(cached) $ac_c" 1>&6
8288 else
8289   
8290         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8291                 ol_cv_gdbm=no
8292         else
8293                 ol_cv_gdbm=yes
8294         fi
8295
8296 fi
8297
8298 echo "$ac_t""$ol_cv_gdbm" 1>&6
8299  if test $ol_cv_gdbm = yes ; then
8300         cat >> confdefs.h <<\EOF
8301 #define HAVE_GDBM 1
8302 EOF
8303
8304  fi
8305
8306
8307         if test $ol_cv_gdbm = yes ; then
8308                 ol_link_ldbm=gdbm
8309                 ol_with_ldbm_api=gdbm
8310
8311                 if test $ol_cv_lib_gdbm != yes ; then
8312                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8313                 fi
8314         fi
8315 fi
8316
8317 if test $ol_with_ldbm_api = auto ; then
8318         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8319 elif test $ol_with_ldbm_api = ndbm ; then
8320         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8321 echo "configure:8322: checking for NDBM library" >&5
8322 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8323   echo $ac_n "(cached) $ac_c" 1>&6
8324 else
8325         ol_LIBS="$LIBS"
8326         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8327 echo "configure:8328: checking for dbm_open" >&5
8328 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8329   echo $ac_n "(cached) $ac_c" 1>&6
8330 else
8331   cat > conftest.$ac_ext <<EOF
8332 #line 8333 "configure"
8333 #include "confdefs.h"
8334 /* System header to define __stub macros and hopefully few prototypes,
8335     which can conflict with char dbm_open(); below.  */
8336 #include <assert.h>
8337 /* Override any gcc2 internal prototype to avoid an error.  */
8338 /* We use char because int might match the return type of a gcc2
8339     builtin and then its argument prototype would still apply.  */
8340 char dbm_open();
8341
8342 int main() {
8343
8344 /* The GNU C library defines this for functions which it implements
8345     to always fail with ENOSYS.  Some functions are actually named
8346     something starting with __ and the normal name is an alias.  */
8347 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8348 choke me
8349 #else
8350 dbm_open();
8351 #endif
8352
8353 ; return 0; }
8354 EOF
8355 if { (eval echo configure:8356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8356   rm -rf conftest*
8357   eval "ac_cv_func_dbm_open=yes"
8358 else
8359   echo "configure: failed program was:" >&5
8360   cat conftest.$ac_ext >&5
8361   rm -rf conftest*
8362   eval "ac_cv_func_dbm_open=no"
8363 fi
8364 rm -f conftest*
8365 fi
8366
8367 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8368   echo "$ac_t""yes" 1>&6
8369   ol_cv_lib_ndbm=yes
8370 else
8371   echo "$ac_t""no" 1>&6
8372
8373                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8374 echo "configure:8375: checking for dbm_open in -lndbm" >&5
8375 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8376 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8377   echo $ac_n "(cached) $ac_c" 1>&6
8378 else
8379   ac_save_LIBS="$LIBS"
8380 LIBS="-lndbm  $LIBS"
8381 cat > conftest.$ac_ext <<EOF
8382 #line 8383 "configure"
8383 #include "confdefs.h"
8384 /* Override any gcc2 internal prototype to avoid an error.  */
8385 /* We use char because int might match the return type of a gcc2
8386     builtin and then its argument prototype would still apply.  */
8387 char dbm_open();
8388
8389 int main() {
8390 dbm_open()
8391 ; return 0; }
8392 EOF
8393 if { (eval echo configure:8394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8394   rm -rf conftest*
8395   eval "ac_cv_lib_$ac_lib_var=yes"
8396 else
8397   echo "configure: failed program was:" >&5
8398   cat conftest.$ac_ext >&5
8399   rm -rf conftest*
8400   eval "ac_cv_lib_$ac_lib_var=no"
8401 fi
8402 rm -f conftest*
8403 LIBS="$ac_save_LIBS"
8404
8405 fi
8406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8407   echo "$ac_t""yes" 1>&6
8408   ol_cv_lib_ndbm=-lndbm
8409 else
8410   echo "$ac_t""no" 1>&6
8411
8412                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8413 echo "configure:8414: checking for dbm_open in -ldbm" >&5
8414 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8415 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8416   echo $ac_n "(cached) $ac_c" 1>&6
8417 else
8418   ac_save_LIBS="$LIBS"
8419 LIBS="-ldbm  $LIBS"
8420 cat > conftest.$ac_ext <<EOF
8421 #line 8422 "configure"
8422 #include "confdefs.h"
8423 /* Override any gcc2 internal prototype to avoid an error.  */
8424 /* We use char because int might match the return type of a gcc2
8425     builtin and then its argument prototype would still apply.  */
8426 char dbm_open();
8427
8428 int main() {
8429 dbm_open()
8430 ; return 0; }
8431 EOF
8432 if { (eval echo configure:8433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8433   rm -rf conftest*
8434   eval "ac_cv_lib_$ac_lib_var=yes"
8435 else
8436   echo "configure: failed program was:" >&5
8437   cat conftest.$ac_ext >&5
8438   rm -rf conftest*
8439   eval "ac_cv_lib_$ac_lib_var=no"
8440 fi
8441 rm -f conftest*
8442 LIBS="$ac_save_LIBS"
8443
8444 fi
8445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8446   echo "$ac_t""yes" 1>&6
8447   ol_cv_lib_ndbm=-ldbm
8448 else
8449   echo "$ac_t""no" 1>&6
8450 ol_cv_lib_ndbm=no
8451 fi
8452                 
8453 fi
8454
8455         
8456 fi
8457
8458         LIBS="$ol_LIBS"
8459
8460 fi
8461
8462 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8463
8464
8465  for ac_hdr in ndbm.h
8466 do
8467 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8468 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8469 echo "configure:8470: checking for $ac_hdr" >&5
8470 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8471   echo $ac_n "(cached) $ac_c" 1>&6
8472 else
8473   cat > conftest.$ac_ext <<EOF
8474 #line 8475 "configure"
8475 #include "confdefs.h"
8476 #include <$ac_hdr>
8477 EOF
8478 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8479 { (eval echo configure:8480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8480 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8481 if test -z "$ac_err"; then
8482   rm -rf conftest*
8483   eval "ac_cv_header_$ac_safe=yes"
8484 else
8485   echo "$ac_err" >&5
8486   echo "configure: failed program was:" >&5
8487   cat conftest.$ac_ext >&5
8488   rm -rf conftest*
8489   eval "ac_cv_header_$ac_safe=no"
8490 fi
8491 rm -f conftest*
8492 fi
8493 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8494   echo "$ac_t""yes" 1>&6
8495     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8496   cat >> confdefs.h <<EOF
8497 #define $ac_tr_hdr 1
8498 EOF
8499  
8500 else
8501   echo "$ac_t""no" 1>&6
8502 fi
8503 done
8504
8505  echo $ac_n "checking for db""... $ac_c" 1>&6
8506 echo "configure:8507: checking for db" >&5
8507 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8508   echo $ac_n "(cached) $ac_c" 1>&6
8509 else
8510   
8511         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8512                 ol_cv_ndbm=no
8513         else
8514                 ol_cv_ndbm=yes
8515         fi
8516
8517 fi
8518
8519 echo "$ac_t""$ol_cv_ndbm" 1>&6
8520  if test $ol_cv_ndbm = yes ; then
8521         cat >> confdefs.h <<\EOF
8522 #define HAVE_NDBM 1
8523 EOF
8524
8525  fi
8526
8527
8528         if test $ol_cv_ndbm = yes ; then
8529                 ol_link_ldbm=ndbm
8530                 ol_with_ldbm_api=ndbm
8531
8532                 if test $ol_cv_lib_ndbm != yes ; then
8533                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8534                 fi
8535         fi
8536 fi
8537
8538 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8539         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8540         if test $ol_enable_ldbm = yes ; then
8541                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8542         fi
8543
8544         echo "configure: warning: disabling LDBM" 1>&2
8545         ol_enable_ldbm=no
8546 fi
8547
8548 if test $ol_enable_wrappers != no ; then
8549         for ac_hdr in tcpd.h
8550 do
8551 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8552 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8553 echo "configure:8554: checking for $ac_hdr" >&5
8554 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8555   echo $ac_n "(cached) $ac_c" 1>&6
8556 else
8557   cat > conftest.$ac_ext <<EOF
8558 #line 8559 "configure"
8559 #include "confdefs.h"
8560 #include <$ac_hdr>
8561 EOF
8562 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8563 { (eval echo configure:8564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8564 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8565 if test -z "$ac_err"; then
8566   rm -rf conftest*
8567   eval "ac_cv_header_$ac_safe=yes"
8568 else
8569   echo "$ac_err" >&5
8570   echo "configure: failed program was:" >&5
8571   cat conftest.$ac_ext >&5
8572   rm -rf conftest*
8573   eval "ac_cv_header_$ac_safe=no"
8574 fi
8575 rm -f conftest*
8576 fi
8577 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8578   echo "$ac_t""yes" 1>&6
8579     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8580   cat >> confdefs.h <<EOF
8581 #define $ac_tr_hdr 1
8582 EOF
8583  
8584 else
8585   echo "$ac_t""no" 1>&6
8586 fi
8587 done
8588
8589
8590         if test $ac_cv_header_tcpd_h != yes ; then
8591                 have_wrappers=no
8592         else
8593                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8594 echo "configure:8595: checking for main in -lwrap" >&5
8595 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8596 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8597   echo $ac_n "(cached) $ac_c" 1>&6
8598 else
8599   ac_save_LIBS="$LIBS"
8600 LIBS="-lwrap  $LIBS"
8601 cat > conftest.$ac_ext <<EOF
8602 #line 8603 "configure"
8603 #include "confdefs.h"
8604
8605 int main() {
8606 main()
8607 ; return 0; }
8608 EOF
8609 if { (eval echo configure:8610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8610   rm -rf conftest*
8611   eval "ac_cv_lib_$ac_lib_var=yes"
8612 else
8613   echo "configure: failed program was:" >&5
8614   cat conftest.$ac_ext >&5
8615   rm -rf conftest*
8616   eval "ac_cv_lib_$ac_lib_var=no"
8617 fi
8618 rm -f conftest*
8619 LIBS="$ac_save_LIBS"
8620
8621 fi
8622 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8623   echo "$ac_t""yes" 1>&6
8624   have_wrappers=yes
8625 else
8626   echo "$ac_t""no" 1>&6
8627 have_wrappers=no
8628 fi
8629
8630         fi
8631
8632         if test $have_wrappers = yes ; then
8633                 cat >> confdefs.h <<\EOF
8634 #define HAVE_TCPD 1
8635 EOF
8636
8637                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8638
8639                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8640 echo "configure:8641: checking for main in -lnsl" >&5
8641 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8642 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8643   echo $ac_n "(cached) $ac_c" 1>&6
8644 else
8645   ac_save_LIBS="$LIBS"
8646 LIBS="-lnsl  $LIBS"
8647 cat > conftest.$ac_ext <<EOF
8648 #line 8649 "configure"
8649 #include "confdefs.h"
8650
8651 int main() {
8652 main()
8653 ; return 0; }
8654 EOF
8655 if { (eval echo configure:8656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8656   rm -rf conftest*
8657   eval "ac_cv_lib_$ac_lib_var=yes"
8658 else
8659   echo "configure: failed program was:" >&5
8660   cat conftest.$ac_ext >&5
8661   rm -rf conftest*
8662   eval "ac_cv_lib_$ac_lib_var=no"
8663 fi
8664 rm -f conftest*
8665 LIBS="$ac_save_LIBS"
8666
8667 fi
8668 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8669   echo "$ac_t""yes" 1>&6
8670     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8671     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8672   cat >> confdefs.h <<EOF
8673 #define $ac_tr_lib 1
8674 EOF
8675
8676   LIBS="-lnsl $LIBS"
8677
8678 else
8679   echo "$ac_t""no" 1>&6
8680 fi
8681
8682         else
8683                 echo "configure: warning: could not find -lwrap" 1>&2
8684                 if test $ol_enable_wrappers = yes ; then
8685                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8686                 fi
8687
8688                 echo "configure: warning: disabling wrappers support" 1>&2
8689                 ol_enable_wrappers=no
8690         fi
8691 fi
8692
8693 if test $ol_enable_syslog != no ; then
8694         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8695 echo "configure:8696: checking for openlog" >&5
8696 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8697   echo $ac_n "(cached) $ac_c" 1>&6
8698 else
8699   cat > conftest.$ac_ext <<EOF
8700 #line 8701 "configure"
8701 #include "confdefs.h"
8702 /* System header to define __stub macros and hopefully few prototypes,
8703     which can conflict with char openlog(); below.  */
8704 #include <assert.h>
8705 /* Override any gcc2 internal prototype to avoid an error.  */
8706 /* We use char because int might match the return type of a gcc2
8707     builtin and then its argument prototype would still apply.  */
8708 char openlog();
8709
8710 int main() {
8711
8712 /* The GNU C library defines this for functions which it implements
8713     to always fail with ENOSYS.  Some functions are actually named
8714     something starting with __ and the normal name is an alias.  */
8715 #if defined (__stub_openlog) || defined (__stub___openlog)
8716 choke me
8717 #else
8718 openlog();
8719 #endif
8720
8721 ; return 0; }
8722 EOF
8723 if { (eval echo configure:8724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8724   rm -rf conftest*
8725   eval "ac_cv_func_openlog=yes"
8726 else
8727   echo "configure: failed program was:" >&5
8728   cat conftest.$ac_ext >&5
8729   rm -rf conftest*
8730   eval "ac_cv_func_openlog=no"
8731 fi
8732 rm -f conftest*
8733 fi
8734
8735 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8736   echo "$ac_t""yes" 1>&6
8737   :
8738 else
8739   echo "$ac_t""no" 1>&6
8740 fi
8741
8742         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8743                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8744         fi
8745         ol_enable_syslog=$ac_cv_func_openlog
8746 fi
8747
8748 if test $ol_enable_dmalloc != no ; then
8749         for ac_hdr in dmalloc.h
8750 do
8751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8753 echo "configure:8754: checking for $ac_hdr" >&5
8754 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8755   echo $ac_n "(cached) $ac_c" 1>&6
8756 else
8757   cat > conftest.$ac_ext <<EOF
8758 #line 8759 "configure"
8759 #include "confdefs.h"
8760 #include <$ac_hdr>
8761 EOF
8762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8763 { (eval echo configure:8764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8765 if test -z "$ac_err"; then
8766   rm -rf conftest*
8767   eval "ac_cv_header_$ac_safe=yes"
8768 else
8769   echo "$ac_err" >&5
8770   echo "configure: failed program was:" >&5
8771   cat conftest.$ac_ext >&5
8772   rm -rf conftest*
8773   eval "ac_cv_header_$ac_safe=no"
8774 fi
8775 rm -f conftest*
8776 fi
8777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8778   echo "$ac_t""yes" 1>&6
8779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8780   cat >> confdefs.h <<EOF
8781 #define $ac_tr_hdr 1
8782 EOF
8783  
8784 else
8785   echo "$ac_t""no" 1>&6
8786 fi
8787 done
8788
8789         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8790 echo "configure:8791: checking for dmalloc_shutdown in -ldmalloc" >&5
8791 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8792 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8793   echo $ac_n "(cached) $ac_c" 1>&6
8794 else
8795   ac_save_LIBS="$LIBS"
8796 LIBS="-ldmalloc  $LIBS"
8797 cat > conftest.$ac_ext <<EOF
8798 #line 8799 "configure"
8799 #include "confdefs.h"
8800 /* Override any gcc2 internal prototype to avoid an error.  */
8801 /* We use char because int might match the return type of a gcc2
8802     builtin and then its argument prototype would still apply.  */
8803 char dmalloc_shutdown();
8804
8805 int main() {
8806 dmalloc_shutdown()
8807 ; return 0; }
8808 EOF
8809 if { (eval echo configure:8810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8810   rm -rf conftest*
8811   eval "ac_cv_lib_$ac_lib_var=yes"
8812 else
8813   echo "configure: failed program was:" >&5
8814   cat conftest.$ac_ext >&5
8815   rm -rf conftest*
8816   eval "ac_cv_lib_$ac_lib_var=no"
8817 fi
8818 rm -f conftest*
8819 LIBS="$ac_save_LIBS"
8820
8821 fi
8822 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8823   echo "$ac_t""yes" 1>&6
8824     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8825     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8826   cat >> confdefs.h <<EOF
8827 #define $ac_tr_lib 1
8828 EOF
8829
8830   LIBS="-ldmalloc $LIBS"
8831
8832 else
8833   echo "$ac_t""no" 1>&6
8834 fi
8835
8836 fi
8837
8838 if test $ol_enable_tcl != no ; then
8839         for ac_hdr in tcl.h
8840 do
8841 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8842 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8843 echo "configure:8844: checking for $ac_hdr" >&5
8844 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8845   echo $ac_n "(cached) $ac_c" 1>&6
8846 else
8847   cat > conftest.$ac_ext <<EOF
8848 #line 8849 "configure"
8849 #include "confdefs.h"
8850 #include <$ac_hdr>
8851 EOF
8852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8853 { (eval echo configure:8854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8854 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8855 if test -z "$ac_err"; then
8856   rm -rf conftest*
8857   eval "ac_cv_header_$ac_safe=yes"
8858 else
8859   echo "$ac_err" >&5
8860   echo "configure: failed program was:" >&5
8861   cat conftest.$ac_ext >&5
8862   rm -rf conftest*
8863   eval "ac_cv_header_$ac_safe=no"
8864 fi
8865 rm -f conftest*
8866 fi
8867 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8868   echo "$ac_t""yes" 1>&6
8869     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8870   cat >> confdefs.h <<EOF
8871 #define $ac_tr_hdr 1
8872 EOF
8873  
8874 else
8875   echo "$ac_t""no" 1>&6
8876 fi
8877 done
8878
8879
8880         if test $ac_cv_header_tcl_h != yes ; then
8881                 have_tcl=no
8882         else
8883                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8884 echo "configure:8885: checking for main in -ltcl" >&5
8885 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8886 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8887   echo $ac_n "(cached) $ac_c" 1>&6
8888 else
8889   ac_save_LIBS="$LIBS"
8890 LIBS="-ltcl  $LIBS"
8891 cat > conftest.$ac_ext <<EOF
8892 #line 8893 "configure"
8893 #include "confdefs.h"
8894
8895 int main() {
8896 main()
8897 ; return 0; }
8898 EOF
8899 if { (eval echo configure:8900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8900   rm -rf conftest*
8901   eval "ac_cv_lib_$ac_lib_var=yes"
8902 else
8903   echo "configure: failed program was:" >&5
8904   cat conftest.$ac_ext >&5
8905   rm -rf conftest*
8906   eval "ac_cv_lib_$ac_lib_var=no"
8907 fi
8908 rm -f conftest*
8909 LIBS="$ac_save_LIBS"
8910
8911 fi
8912 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8913   echo "$ac_t""yes" 1>&6
8914   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8915 else
8916   echo "$ac_t""no" 1>&6
8917 have_tcl=no
8918 fi
8919
8920
8921                 if test $have_tcl != yes; then
8922                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8923 echo "configure:8924: checking for main in -ltcl7.6" >&5
8924 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8925 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8926   echo $ac_n "(cached) $ac_c" 1>&6
8927 else
8928   ac_save_LIBS="$LIBS"
8929 LIBS="-ltcl7.6  $LIBS"
8930 cat > conftest.$ac_ext <<EOF
8931 #line 8932 "configure"
8932 #include "confdefs.h"
8933
8934 int main() {
8935 main()
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   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8954 else
8955   echo "$ac_t""no" 1>&6
8956 have_tcl=no
8957 fi
8958
8959                 fi
8960
8961                 if test $have_tcl != yes; then
8962                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8963 echo "configure:8964: checking for main in -ltcl8.0" >&5
8964 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8965 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8966   echo $ac_n "(cached) $ac_c" 1>&6
8967 else
8968   ac_save_LIBS="$LIBS"
8969 LIBS="-ltcl8.0  $LIBS"
8970 cat > conftest.$ac_ext <<EOF
8971 #line 8972 "configure"
8972 #include "confdefs.h"
8973
8974 int main() {
8975 main()
8976 ; return 0; }
8977 EOF
8978 if { (eval echo configure:8979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8979   rm -rf conftest*
8980   eval "ac_cv_lib_$ac_lib_var=yes"
8981 else
8982   echo "configure: failed program was:" >&5
8983   cat conftest.$ac_ext >&5
8984   rm -rf conftest*
8985   eval "ac_cv_lib_$ac_lib_var=no"
8986 fi
8987 rm -f conftest*
8988 LIBS="$ac_save_LIBS"
8989
8990 fi
8991 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8992   echo "$ac_t""yes" 1>&6
8993   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8994 else
8995   echo "$ac_t""no" 1>&6
8996 have_tcl=no
8997 fi
8998
8999                 fi
9000         fi
9001
9002         if test $have_tcl != yes ; then
9003                 echo "configure: warning: could not find -ltcl" 1>&2
9004                 if test $ol_enable_tcl = yes ; then
9005                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
9006                 fi
9007
9008                 ol_enable_tcl=no
9009         fi
9010 fi
9011
9012 # ud needs termcap (should insert check here)
9013 ol_link_termcap=no
9014 for ac_hdr in termcap.h ncurses.h
9015 do
9016 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9017 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9018 echo "configure:9019: checking for $ac_hdr" >&5
9019 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9020   echo $ac_n "(cached) $ac_c" 1>&6
9021 else
9022   cat > conftest.$ac_ext <<EOF
9023 #line 9024 "configure"
9024 #include "confdefs.h"
9025 #include <$ac_hdr>
9026 EOF
9027 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9028 { (eval echo configure:9029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9029 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9030 if test -z "$ac_err"; then
9031   rm -rf conftest*
9032   eval "ac_cv_header_$ac_safe=yes"
9033 else
9034   echo "$ac_err" >&5
9035   echo "configure: failed program was:" >&5
9036   cat conftest.$ac_ext >&5
9037   rm -rf conftest*
9038   eval "ac_cv_header_$ac_safe=no"
9039 fi
9040 rm -f conftest*
9041 fi
9042 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9043   echo "$ac_t""yes" 1>&6
9044     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9045   cat >> confdefs.h <<EOF
9046 #define $ac_tr_hdr 1
9047 EOF
9048  
9049 else
9050   echo "$ac_t""no" 1>&6
9051 fi
9052 done
9053
9054
9055 if test $ol_link_termcap = no ; then
9056         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
9057 echo "configure:9058: checking for tputs in -ltermcap" >&5
9058 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
9059 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9060   echo $ac_n "(cached) $ac_c" 1>&6
9061 else
9062   ac_save_LIBS="$LIBS"
9063 LIBS="-ltermcap  $LIBS"
9064 cat > conftest.$ac_ext <<EOF
9065 #line 9066 "configure"
9066 #include "confdefs.h"
9067 /* Override any gcc2 internal prototype to avoid an error.  */
9068 /* We use char because int might match the return type of a gcc2
9069     builtin and then its argument prototype would still apply.  */
9070 char tputs();
9071
9072 int main() {
9073 tputs()
9074 ; return 0; }
9075 EOF
9076 if { (eval echo configure:9077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9077   rm -rf conftest*
9078   eval "ac_cv_lib_$ac_lib_var=yes"
9079 else
9080   echo "configure: failed program was:" >&5
9081   cat conftest.$ac_ext >&5
9082   rm -rf conftest*
9083   eval "ac_cv_lib_$ac_lib_var=no"
9084 fi
9085 rm -f conftest*
9086 LIBS="$ac_save_LIBS"
9087
9088 fi
9089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9090   echo "$ac_t""yes" 1>&6
9091   have_termcap=yes
9092 else
9093   echo "$ac_t""no" 1>&6
9094 have_termcap=no
9095 fi
9096
9097         if test $have_termcap = yes ; then
9098                 cat >> confdefs.h <<\EOF
9099 #define HAVE_TERMCAP 1
9100 EOF
9101
9102                 ol_link_termcap=yes
9103                 TERMCAP_LIBS=-ltermcap
9104         fi
9105 fi
9106
9107 if test $ol_link_termcap = no ; then
9108         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
9109 echo "configure:9110: checking for initscr in -lncurses" >&5
9110 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
9111 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9112   echo $ac_n "(cached) $ac_c" 1>&6
9113 else
9114   ac_save_LIBS="$LIBS"
9115 LIBS="-lncurses  $LIBS"
9116 cat > conftest.$ac_ext <<EOF
9117 #line 9118 "configure"
9118 #include "confdefs.h"
9119 /* Override any gcc2 internal prototype to avoid an error.  */
9120 /* We use char because int might match the return type of a gcc2
9121     builtin and then its argument prototype would still apply.  */
9122 char initscr();
9123
9124 int main() {
9125 initscr()
9126 ; return 0; }
9127 EOF
9128 if { (eval echo configure:9129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9129   rm -rf conftest*
9130   eval "ac_cv_lib_$ac_lib_var=yes"
9131 else
9132   echo "configure: failed program was:" >&5
9133   cat conftest.$ac_ext >&5
9134   rm -rf conftest*
9135   eval "ac_cv_lib_$ac_lib_var=no"
9136 fi
9137 rm -f conftest*
9138 LIBS="$ac_save_LIBS"
9139
9140 fi
9141 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9142   echo "$ac_t""yes" 1>&6
9143   have_ncurses=yes
9144 else
9145   echo "$ac_t""no" 1>&6
9146 have_ncurses=no
9147 fi
9148
9149         if test $have_ncurses = yes ; then
9150                 cat >> confdefs.h <<\EOF
9151 #define HAVE_NCURSES 1
9152 EOF
9153
9154                 ol_link_termcap=yes
9155                 TERMCAP_LIBS=-lncurses
9156         fi
9157 fi
9158
9159 if test $ol_link_termcap = no ; then
9160         cat >> confdefs.h <<\EOF
9161 #define NO_TERMCAP 1
9162 EOF
9163
9164         TERMCAP_LIBS=
9165 fi
9166
9167 ol_link_readline=no
9168 if test $ol_with_readline != no ; then
9169         for ac_hdr in readline/readline.h readline/history.h
9170 do
9171 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9172 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9173 echo "configure:9174: checking for $ac_hdr" >&5
9174 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9175   echo $ac_n "(cached) $ac_c" 1>&6
9176 else
9177   cat > conftest.$ac_ext <<EOF
9178 #line 9179 "configure"
9179 #include "confdefs.h"
9180 #include <$ac_hdr>
9181 EOF
9182 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9183 { (eval echo configure:9184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9184 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9185 if test -z "$ac_err"; then
9186   rm -rf conftest*
9187   eval "ac_cv_header_$ac_safe=yes"
9188 else
9189   echo "$ac_err" >&5
9190   echo "configure: failed program was:" >&5
9191   cat conftest.$ac_ext >&5
9192   rm -rf conftest*
9193   eval "ac_cv_header_$ac_safe=no"
9194 fi
9195 rm -f conftest*
9196 fi
9197 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9198   echo "$ac_t""yes" 1>&6
9199     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9200   cat >> confdefs.h <<EOF
9201 #define $ac_tr_hdr 1
9202 EOF
9203  
9204 else
9205   echo "$ac_t""no" 1>&6
9206 fi
9207 done
9208
9209
9210         if test $ac_cv_header_readline_readline_h = yes ; then
9211                 save_LIBS="$LIBS"
9212                 LIBS="$TERMCAP_LIBS $LIBS"
9213                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
9214 echo "configure:9215: checking for readline in -lreadline" >&5
9215 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
9216 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9217   echo $ac_n "(cached) $ac_c" 1>&6
9218 else
9219   ac_save_LIBS="$LIBS"
9220 LIBS="-lreadline  $LIBS"
9221 cat > conftest.$ac_ext <<EOF
9222 #line 9223 "configure"
9223 #include "confdefs.h"
9224 /* Override any gcc2 internal prototype to avoid an error.  */
9225 /* We use char because int might match the return type of a gcc2
9226     builtin and then its argument prototype would still apply.  */
9227 char readline();
9228
9229 int main() {
9230 readline()
9231 ; return 0; }
9232 EOF
9233 if { (eval echo configure:9234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9234   rm -rf conftest*
9235   eval "ac_cv_lib_$ac_lib_var=yes"
9236 else
9237   echo "configure: failed program was:" >&5
9238   cat conftest.$ac_ext >&5
9239   rm -rf conftest*
9240   eval "ac_cv_lib_$ac_lib_var=no"
9241 fi
9242 rm -f conftest*
9243 LIBS="$ac_save_LIBS"
9244
9245 fi
9246 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9247   echo "$ac_t""yes" 1>&6
9248   have_readline=yes
9249 else
9250   echo "$ac_t""no" 1>&6
9251 have_readline=no
9252 fi
9253
9254                 LIBS="$save_LIBS"
9255                         
9256                 if test $have_readline = yes ; then
9257                         ol_with_readline=found
9258                         ol_link_readline=yes
9259
9260                         READLINE_LIBS="-lreadline"
9261                 fi
9262         fi
9263 fi
9264
9265 if test $ol_link_readline = yes ; then
9266         cat >> confdefs.h <<\EOF
9267 #define HAVE_READLINE 1
9268 EOF
9269
9270 fi
9271
9272
9273 # FreeBSD (and others) have crypt(3) in -lcrypt
9274 if test $ol_enable_crypt != no ; then
9275         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9276 echo "configure:9277: checking for crypt" >&5
9277 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9278   echo $ac_n "(cached) $ac_c" 1>&6
9279 else
9280   cat > conftest.$ac_ext <<EOF
9281 #line 9282 "configure"
9282 #include "confdefs.h"
9283 /* System header to define __stub macros and hopefully few prototypes,
9284     which can conflict with char crypt(); below.  */
9285 #include <assert.h>
9286 /* Override any gcc2 internal prototype to avoid an error.  */
9287 /* We use char because int might match the return type of a gcc2
9288     builtin and then its argument prototype would still apply.  */
9289 char crypt();
9290
9291 int main() {
9292
9293 /* The GNU C library defines this for functions which it implements
9294     to always fail with ENOSYS.  Some functions are actually named
9295     something starting with __ and the normal name is an alias.  */
9296 #if defined (__stub_crypt) || defined (__stub___crypt)
9297 choke me
9298 #else
9299 crypt();
9300 #endif
9301
9302 ; return 0; }
9303 EOF
9304 if { (eval echo configure:9305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9305   rm -rf conftest*
9306   eval "ac_cv_func_crypt=yes"
9307 else
9308   echo "configure: failed program was:" >&5
9309   cat conftest.$ac_ext >&5
9310   rm -rf conftest*
9311   eval "ac_cv_func_crypt=no"
9312 fi
9313 rm -f conftest*
9314 fi
9315
9316 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9317   echo "$ac_t""yes" 1>&6
9318   have_crypt=yes
9319 else
9320   echo "$ac_t""no" 1>&6
9321
9322                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9323 echo "configure:9324: checking for crypt in -lcrypt" >&5
9324 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9325 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9326   echo $ac_n "(cached) $ac_c" 1>&6
9327 else
9328   ac_save_LIBS="$LIBS"
9329 LIBS="-lcrypt  $LIBS"
9330 cat > conftest.$ac_ext <<EOF
9331 #line 9332 "configure"
9332 #include "confdefs.h"
9333 /* Override any gcc2 internal prototype to avoid an error.  */
9334 /* We use char because int might match the return type of a gcc2
9335     builtin and then its argument prototype would still apply.  */
9336 char crypt();
9337
9338 int main() {
9339 crypt()
9340 ; return 0; }
9341 EOF
9342 if { (eval echo configure:9343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9343   rm -rf conftest*
9344   eval "ac_cv_lib_$ac_lib_var=yes"
9345 else
9346   echo "configure: failed program was:" >&5
9347   cat conftest.$ac_ext >&5
9348   rm -rf conftest*
9349   eval "ac_cv_lib_$ac_lib_var=no"
9350 fi
9351 rm -f conftest*
9352 LIBS="$ac_save_LIBS"
9353
9354 fi
9355 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9356   echo "$ac_t""yes" 1>&6
9357   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9358                         have_crypt=yes
9359 else
9360   echo "$ac_t""no" 1>&6
9361 have_crypt=no
9362 fi
9363
9364 fi
9365
9366
9367         if test $have_crypt = yes ; then
9368                 cat >> confdefs.h <<\EOF
9369 #define HAVE_CRYPT 1
9370 EOF
9371
9372         else
9373                 echo "configure: warning: could not find crypt" 1>&2
9374                 if test $ol_enable_crypt = yes ; then
9375                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9376                 fi
9377
9378                 echo "configure: warning: disabling crypt support" 1>&2
9379                 ol_enable_crypt=no
9380         fi
9381 fi
9382
9383 # FreeBSD (and others) have setproctitle(3) in -lutil
9384 if test $ol_enable_proctitle != no ; then
9385         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9386 echo "configure:9387: checking for setproctitle" >&5
9387 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9388   echo $ac_n "(cached) $ac_c" 1>&6
9389 else
9390   cat > conftest.$ac_ext <<EOF
9391 #line 9392 "configure"
9392 #include "confdefs.h"
9393 /* System header to define __stub macros and hopefully few prototypes,
9394     which can conflict with char setproctitle(); below.  */
9395 #include <assert.h>
9396 /* Override any gcc2 internal prototype to avoid an error.  */
9397 /* We use char because int might match the return type of a gcc2
9398     builtin and then its argument prototype would still apply.  */
9399 char setproctitle();
9400
9401 int main() {
9402
9403 /* The GNU C library defines this for functions which it implements
9404     to always fail with ENOSYS.  Some functions are actually named
9405     something starting with __ and the normal name is an alias.  */
9406 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9407 choke me
9408 #else
9409 setproctitle();
9410 #endif
9411
9412 ; return 0; }
9413 EOF
9414 if { (eval echo configure:9415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9415   rm -rf conftest*
9416   eval "ac_cv_func_setproctitle=yes"
9417 else
9418   echo "configure: failed program was:" >&5
9419   cat conftest.$ac_ext >&5
9420   rm -rf conftest*
9421   eval "ac_cv_func_setproctitle=no"
9422 fi
9423 rm -f conftest*
9424 fi
9425
9426 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9427   echo "$ac_t""yes" 1>&6
9428   have_setproctitle=yes
9429 else
9430   echo "$ac_t""no" 1>&6
9431
9432                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9433 echo "configure:9434: checking for setproctitle in -lutil" >&5
9434 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9435 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9436   echo $ac_n "(cached) $ac_c" 1>&6
9437 else
9438   ac_save_LIBS="$LIBS"
9439 LIBS="-lutil  $LIBS"
9440 cat > conftest.$ac_ext <<EOF
9441 #line 9442 "configure"
9442 #include "confdefs.h"
9443 /* Override any gcc2 internal prototype to avoid an error.  */
9444 /* We use char because int might match the return type of a gcc2
9445     builtin and then its argument prototype would still apply.  */
9446 char setproctitle();
9447
9448 int main() {
9449 setproctitle()
9450 ; return 0; }
9451 EOF
9452 if { (eval echo configure:9453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9453   rm -rf conftest*
9454   eval "ac_cv_lib_$ac_lib_var=yes"
9455 else
9456   echo "configure: failed program was:" >&5
9457   cat conftest.$ac_ext >&5
9458   rm -rf conftest*
9459   eval "ac_cv_lib_$ac_lib_var=no"
9460 fi
9461 rm -f conftest*
9462 LIBS="$ac_save_LIBS"
9463
9464 fi
9465 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9466   echo "$ac_t""yes" 1>&6
9467   have_setproctitle=yes
9468                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9469 else
9470   echo "$ac_t""no" 1>&6
9471 have_setproctitle=no
9472                         LIBOBJS="$LIBOBJS setproctitle.o"
9473 fi
9474
9475 fi
9476
9477
9478         if test $have_setproctitle = yes ; then
9479                 cat >> confdefs.h <<\EOF
9480 #define HAVE_SETPROCTITLE 1
9481 EOF
9482
9483         fi
9484 fi
9485
9486 # test for EBCDIC
9487 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9488 echo "configure:9489: checking for EBCDIC" >&5
9489 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9490   echo $ac_n "(cached) $ac_c" 1>&6
9491 else
9492   
9493         cat > conftest.$ac_ext <<EOF
9494 #line 9495 "configure"
9495 #include "confdefs.h"
9496
9497 #if !('M' == 0xd4)
9498 #include <__ASCII__/generate_error.h>
9499 #endif
9500
9501 EOF
9502 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9503 { (eval echo configure:9504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9504 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9505 if test -z "$ac_err"; then
9506   rm -rf conftest*
9507   ol_cv_cpp_ebcdic=yes
9508 else
9509   echo "$ac_err" >&5
9510   echo "configure: failed program was:" >&5
9511   cat conftest.$ac_ext >&5
9512   rm -rf conftest*
9513   ol_cv_cpp_ebcdic=no
9514 fi
9515 rm -f conftest*
9516 fi
9517
9518 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9519 if test $ol_cv_cpp_ebcdic = yes ; then
9520         cat >> confdefs.h <<\EOF
9521 #define HAVE_EBCDIC 1
9522 EOF
9523
9524 fi
9525
9526 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9527 echo "configure:9528: checking for ANSI C header files" >&5
9528 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9529   echo $ac_n "(cached) $ac_c" 1>&6
9530 else
9531   cat > conftest.$ac_ext <<EOF
9532 #line 9533 "configure"
9533 #include "confdefs.h"
9534 #include <stdlib.h>
9535 #include <stdarg.h>
9536 #include <string.h>
9537 #include <float.h>
9538 EOF
9539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9540 { (eval echo configure:9541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9542 if test -z "$ac_err"; then
9543   rm -rf conftest*
9544   ol_cv_header_stdc=yes
9545 else
9546   echo "$ac_err" >&5
9547   echo "configure: failed program was:" >&5
9548   cat conftest.$ac_ext >&5
9549   rm -rf conftest*
9550   ol_cv_header_stdc=no
9551 fi
9552 rm -f conftest*
9553
9554 if test $ol_cv_header_stdc = yes; then
9555   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9556 cat > conftest.$ac_ext <<EOF
9557 #line 9558 "configure"
9558 #include "confdefs.h"
9559 #include <string.h>
9560 EOF
9561 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9562   egrep "memchr" >/dev/null 2>&1; then
9563   :
9564 else
9565   rm -rf conftest*
9566   ol_cv_header_stdc=no
9567 fi
9568 rm -f conftest*
9569
9570 fi
9571
9572 if test $ol_cv_header_stdc = yes; then
9573   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9574 cat > conftest.$ac_ext <<EOF
9575 #line 9576 "configure"
9576 #include "confdefs.h"
9577 #include <stdlib.h>
9578 EOF
9579 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9580   egrep "free" >/dev/null 2>&1; then
9581   :
9582 else
9583   rm -rf conftest*
9584   ol_cv_header_stdc=no
9585 fi
9586 rm -f conftest*
9587
9588 fi
9589
9590 if test $ol_cv_header_stdc = yes; then
9591   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9592 if test "$cross_compiling" = yes; then
9593   :
9594 else
9595   cat > conftest.$ac_ext <<EOF
9596 #line 9597 "configure"
9597 #include "confdefs.h"
9598 #include <ctype.h>
9599 #ifndef HAVE_EBCDIC
9600 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9601 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9602 #else
9603 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9604                 || ('j' <= (c) && (c) <= 'r') \
9605                 || ('s' <= (c) && (c) <= 'z'))
9606 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9607 #endif
9608 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9609 int main () { int i; for (i = 0; i < 256; i++)
9610 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9611 exit (0); }
9612
9613 EOF
9614 if { (eval echo configure:9615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9615 then
9616   :
9617 else
9618   echo "configure: failed program was:" >&5
9619   cat conftest.$ac_ext >&5
9620   rm -fr conftest*
9621   ol_cv_header_stdc=no
9622 fi
9623 rm -fr conftest*
9624 fi
9625
9626 fi
9627 fi
9628
9629 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9630 if test $ol_cv_header_stdc = yes; then
9631   cat >> confdefs.h <<\EOF
9632 #define STDC_HEADERS 1
9633 EOF
9634
9635 fi
9636 ac_cv_header_stdc=disable
9637
9638
9639 if test $ol_cv_header_stdc != yes; then
9640         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9641 fi
9642
9643 ac_header_dirent=no
9644 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9645 do
9646 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9647 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9648 echo "configure:9649: checking for $ac_hdr that defines DIR" >&5
9649 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9650   echo $ac_n "(cached) $ac_c" 1>&6
9651 else
9652   cat > conftest.$ac_ext <<EOF
9653 #line 9654 "configure"
9654 #include "confdefs.h"
9655 #include <sys/types.h>
9656 #include <$ac_hdr>
9657 int main() {
9658 DIR *dirp = 0;
9659 ; return 0; }
9660 EOF
9661 if { (eval echo configure:9662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9662   rm -rf conftest*
9663   eval "ac_cv_header_dirent_$ac_safe=yes"
9664 else
9665   echo "configure: failed program was:" >&5
9666   cat conftest.$ac_ext >&5
9667   rm -rf conftest*
9668   eval "ac_cv_header_dirent_$ac_safe=no"
9669 fi
9670 rm -f conftest*
9671 fi
9672 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9673   echo "$ac_t""yes" 1>&6
9674     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9675   cat >> confdefs.h <<EOF
9676 #define $ac_tr_hdr 1
9677 EOF
9678  ac_header_dirent=$ac_hdr; break
9679 else
9680   echo "$ac_t""no" 1>&6
9681 fi
9682 done
9683 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9684 if test $ac_header_dirent = dirent.h; then
9685 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9686 echo "configure:9687: checking for opendir in -ldir" >&5
9687 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9688 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9689   echo $ac_n "(cached) $ac_c" 1>&6
9690 else
9691   ac_save_LIBS="$LIBS"
9692 LIBS="-ldir  $LIBS"
9693 cat > conftest.$ac_ext <<EOF
9694 #line 9695 "configure"
9695 #include "confdefs.h"
9696 /* Override any gcc2 internal prototype to avoid an error.  */
9697 /* We use char because int might match the return type of a gcc2
9698     builtin and then its argument prototype would still apply.  */
9699 char opendir();
9700
9701 int main() {
9702 opendir()
9703 ; return 0; }
9704 EOF
9705 if { (eval echo configure:9706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9706   rm -rf conftest*
9707   eval "ac_cv_lib_$ac_lib_var=yes"
9708 else
9709   echo "configure: failed program was:" >&5
9710   cat conftest.$ac_ext >&5
9711   rm -rf conftest*
9712   eval "ac_cv_lib_$ac_lib_var=no"
9713 fi
9714 rm -f conftest*
9715 LIBS="$ac_save_LIBS"
9716
9717 fi
9718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9719   echo "$ac_t""yes" 1>&6
9720   LIBS="$LIBS -ldir"
9721 else
9722   echo "$ac_t""no" 1>&6
9723 fi
9724
9725 else
9726 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9727 echo "configure:9728: checking for opendir in -lx" >&5
9728 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9729 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9730   echo $ac_n "(cached) $ac_c" 1>&6
9731 else
9732   ac_save_LIBS="$LIBS"
9733 LIBS="-lx  $LIBS"
9734 cat > conftest.$ac_ext <<EOF
9735 #line 9736 "configure"
9736 #include "confdefs.h"
9737 /* Override any gcc2 internal prototype to avoid an error.  */
9738 /* We use char because int might match the return type of a gcc2
9739     builtin and then its argument prototype would still apply.  */
9740 char opendir();
9741
9742 int main() {
9743 opendir()
9744 ; return 0; }
9745 EOF
9746 if { (eval echo configure:9747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9747   rm -rf conftest*
9748   eval "ac_cv_lib_$ac_lib_var=yes"
9749 else
9750   echo "configure: failed program was:" >&5
9751   cat conftest.$ac_ext >&5
9752   rm -rf conftest*
9753   eval "ac_cv_lib_$ac_lib_var=no"
9754 fi
9755 rm -f conftest*
9756 LIBS="$ac_save_LIBS"
9757
9758 fi
9759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9760   echo "$ac_t""yes" 1>&6
9761   LIBS="$LIBS -lx"
9762 else
9763   echo "$ac_t""no" 1>&6
9764 fi
9765
9766 fi
9767
9768 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9769 echo "configure:9770: checking for sys/wait.h that is POSIX.1 compatible" >&5
9770 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9771   echo $ac_n "(cached) $ac_c" 1>&6
9772 else
9773   cat > conftest.$ac_ext <<EOF
9774 #line 9775 "configure"
9775 #include "confdefs.h"
9776 #include <sys/types.h>
9777 #include <sys/wait.h>
9778 #ifndef WEXITSTATUS
9779 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9780 #endif
9781 #ifndef WIFEXITED
9782 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9783 #endif
9784 int main() {
9785 int s;
9786 wait (&s);
9787 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9788 ; return 0; }
9789 EOF
9790 if { (eval echo configure:9791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9791   rm -rf conftest*
9792   ac_cv_header_sys_wait_h=yes
9793 else
9794   echo "configure: failed program was:" >&5
9795   cat conftest.$ac_ext >&5
9796   rm -rf conftest*
9797   ac_cv_header_sys_wait_h=no
9798 fi
9799 rm -f conftest*
9800 fi
9801
9802 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9803 if test $ac_cv_header_sys_wait_h = yes; then
9804   cat >> confdefs.h <<\EOF
9805 #define HAVE_SYS_WAIT_H 1
9806 EOF
9807
9808 fi
9809
9810 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9811 echo "configure:9812: checking POSIX termios" >&5
9812 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9813   echo $ac_n "(cached) $ac_c" 1>&6
9814 else
9815   cat > conftest.$ac_ext <<EOF
9816 #line 9817 "configure"
9817 #include "confdefs.h"
9818 #include <sys/types.h>
9819 #include <unistd.h>
9820 #include <termios.h>
9821 int main() {
9822 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9823    tcgetattr(0, 0);
9824 ; return 0; }
9825 EOF
9826 if { (eval echo configure:9827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9827   rm -rf conftest*
9828   am_cv_sys_posix_termios=yes
9829 else
9830   echo "configure: failed program was:" >&5
9831   cat conftest.$ac_ext >&5
9832   rm -rf conftest*
9833   am_cv_sys_posix_termios=no
9834 fi
9835 rm -f conftest*
9836 fi
9837
9838 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9839
9840
9841  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9842 echo "configure:9843: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9843 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9844   echo $ac_n "(cached) $ac_c" 1>&6
9845 else
9846   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9847
9848   gwinsz_in_termios_h=no
9849   if test $am_cv_sys_posix_termios = yes; then
9850     cat > conftest.$ac_ext <<EOF
9851 #line 9852 "configure"
9852 #include "confdefs.h"
9853 #include <sys/types.h>
9854 #     include <termios.h>
9855 #     ifdef TIOCGWINSZ
9856         yes
9857 #     endif
9858     
9859 EOF
9860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9861   egrep "yes" >/dev/null 2>&1; then
9862   rm -rf conftest*
9863   gwinsz_in_termios_h=yes
9864 fi
9865 rm -f conftest*
9866
9867   fi
9868
9869   if test $gwinsz_in_termios_h = no; then
9870     cat > conftest.$ac_ext <<EOF
9871 #line 9872 "configure"
9872 #include "confdefs.h"
9873 #include <sys/types.h>
9874 #     include <sys/ioctl.h>
9875 #     ifdef TIOCGWINSZ
9876         yes
9877 #     endif
9878     
9879 EOF
9880 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9881   egrep "yes" >/dev/null 2>&1; then
9882   rm -rf conftest*
9883   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9884 fi
9885 rm -f conftest*
9886
9887   fi
9888   
9889 fi
9890
9891 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9892   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9893     cat >> confdefs.h <<\EOF
9894 #define GWINSZ_IN_SYS_IOCTL 1
9895 EOF
9896
9897   fi
9898
9899 if test $am_cv_sys_posix_termios = yes ; then
9900         cat >> confdefs.h <<\EOF
9901 #define HAVE_POSIX_TERMIOS 1
9902 EOF
9903
9904 fi
9905
9906 for ac_hdr in \
9907         arpa/inet.h             \
9908         arpa/nameser.h  \
9909         assert.h                \
9910         crypt.h                 \
9911         errno.h                 \
9912         fcntl.h                 \
9913         filio.h                 \
9914         getopt.h                \
9915         grp.h                   \
9916         libutil.h               \
9917         limits.h                \
9918         locale.h                \
9919         malloc.h                \
9920         memory.h                \
9921         psap.h                  \
9922         pwd.h                   \
9923         resolv.h                \
9924         sgtty.h                 \
9925         stdarg.h                \
9926         stddef.h                \
9927         string.h                \
9928         strings.h               \
9929         sysexits.h              \
9930         sys/file.h              \
9931         sys/filio.h             \
9932         sys/errno.h             \
9933         sys/ioctl.h             \
9934         sys/param.h             \
9935         sys/resource.h  \
9936         sys/select.h    \
9937         sys/socket.h    \
9938         sys/syslog.h    \
9939         sys/time.h              \
9940         sys/types.h             \
9941         syslog.h                \
9942         termios.h               \
9943         unistd.h                \
9944
9945 do
9946 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9947 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9948 echo "configure:9949: checking for $ac_hdr" >&5
9949 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9950   echo $ac_n "(cached) $ac_c" 1>&6
9951 else
9952   cat > conftest.$ac_ext <<EOF
9953 #line 9954 "configure"
9954 #include "confdefs.h"
9955 #include <$ac_hdr>
9956 EOF
9957 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9958 { (eval echo configure:9959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9959 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9960 if test -z "$ac_err"; then
9961   rm -rf conftest*
9962   eval "ac_cv_header_$ac_safe=yes"
9963 else
9964   echo "$ac_err" >&5
9965   echo "configure: failed program was:" >&5
9966   cat conftest.$ac_ext >&5
9967   rm -rf conftest*
9968   eval "ac_cv_header_$ac_safe=no"
9969 fi
9970 rm -f conftest*
9971 fi
9972 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9973   echo "$ac_t""yes" 1>&6
9974     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9975   cat >> confdefs.h <<EOF
9976 #define $ac_tr_hdr 1
9977 EOF
9978  
9979 else
9980   echo "$ac_t""no" 1>&6
9981 fi
9982 done
9983
9984
9985 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9986 echo "configure:9987: checking for uid_t in sys/types.h" >&5
9987 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9988   echo $ac_n "(cached) $ac_c" 1>&6
9989 else
9990   cat > conftest.$ac_ext <<EOF
9991 #line 9992 "configure"
9992 #include "confdefs.h"
9993 #include <sys/types.h>
9994 EOF
9995 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9996   egrep "uid_t" >/dev/null 2>&1; then
9997   rm -rf conftest*
9998   ac_cv_type_uid_t=yes
9999 else
10000   rm -rf conftest*
10001   ac_cv_type_uid_t=no
10002 fi
10003 rm -f conftest*
10004
10005 fi
10006
10007 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10008 if test $ac_cv_type_uid_t = no; then
10009   cat >> confdefs.h <<\EOF
10010 #define uid_t int
10011 EOF
10012
10013   cat >> confdefs.h <<\EOF
10014 #define gid_t int
10015 EOF
10016
10017 fi
10018
10019 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10020 echo "configure:10021: checking type of array argument to getgroups" >&5
10021 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
10022   echo $ac_n "(cached) $ac_c" 1>&6
10023 else
10024   if test "$cross_compiling" = yes; then
10025   ac_cv_type_getgroups=cross
10026 else
10027   cat > conftest.$ac_ext <<EOF
10028 #line 10029 "configure"
10029 #include "confdefs.h"
10030
10031 /* Thanks to Mike Rendell for this test.  */
10032 #include <sys/types.h>
10033 #define NGID 256
10034 #undef MAX
10035 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10036 main()
10037 {
10038   gid_t gidset[NGID];
10039   int i, n;
10040   union { gid_t gval; long lval; }  val;
10041
10042   val.lval = -1;
10043   for (i = 0; i < NGID; i++)
10044     gidset[i] = val.gval;
10045   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10046                  gidset);
10047   /* Exit non-zero if getgroups seems to require an array of ints.  This
10048      happens when gid_t is short but getgroups modifies an array of ints.  */
10049   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10050 }
10051
10052 EOF
10053 if { (eval echo configure:10054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10054 then
10055     ac_cv_type_getgroups=gid_t
10056 else
10057   echo "configure: failed program was:" >&5
10058   cat conftest.$ac_ext >&5
10059   rm -fr conftest*
10060   ac_cv_type_getgroups=int
10061 fi
10062 rm -fr conftest*
10063 fi
10064
10065 if test $ac_cv_type_getgroups = cross; then
10066         cat > conftest.$ac_ext <<EOF
10067 #line 10068 "configure"
10068 #include "confdefs.h"
10069 #include <unistd.h>
10070 EOF
10071 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10072   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10073   rm -rf conftest*
10074   ac_cv_type_getgroups=gid_t
10075 else
10076   rm -rf conftest*
10077   ac_cv_type_getgroups=int
10078 fi
10079 rm -f conftest*
10080
10081 fi
10082 fi
10083
10084 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10085 cat >> confdefs.h <<EOF
10086 #define GETGROUPS_T $ac_cv_type_getgroups
10087 EOF
10088
10089  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10090 echo "configure:10091: checking for ANSI C header files" >&5
10091 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
10092   echo $ac_n "(cached) $ac_c" 1>&6
10093 else
10094   cat > conftest.$ac_ext <<EOF
10095 #line 10096 "configure"
10096 #include "confdefs.h"
10097 #include <stdlib.h>
10098 #include <stdarg.h>
10099 #include <string.h>
10100 #include <float.h>
10101 EOF
10102 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10103 { (eval echo configure:10104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10104 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10105 if test -z "$ac_err"; then
10106   rm -rf conftest*
10107   ac_cv_header_stdc=yes
10108 else
10109   echo "$ac_err" >&5
10110   echo "configure: failed program was:" >&5
10111   cat conftest.$ac_ext >&5
10112   rm -rf conftest*
10113   ac_cv_header_stdc=no
10114 fi
10115 rm -f conftest*
10116
10117 if test $ac_cv_header_stdc = yes; then
10118   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10119 cat > conftest.$ac_ext <<EOF
10120 #line 10121 "configure"
10121 #include "confdefs.h"
10122 #include <string.h>
10123 EOF
10124 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10125   egrep "memchr" >/dev/null 2>&1; then
10126   :
10127 else
10128   rm -rf conftest*
10129   ac_cv_header_stdc=no
10130 fi
10131 rm -f conftest*
10132
10133 fi
10134
10135 if test $ac_cv_header_stdc = yes; then
10136   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10137 cat > conftest.$ac_ext <<EOF
10138 #line 10139 "configure"
10139 #include "confdefs.h"
10140 #include <stdlib.h>
10141 EOF
10142 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10143   egrep "free" >/dev/null 2>&1; then
10144   :
10145 else
10146   rm -rf conftest*
10147   ac_cv_header_stdc=no
10148 fi
10149 rm -f conftest*
10150
10151 fi
10152
10153 if test $ac_cv_header_stdc = yes; then
10154   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10155 if test "$cross_compiling" = yes; then
10156   :
10157 else
10158   cat > conftest.$ac_ext <<EOF
10159 #line 10160 "configure"
10160 #include "confdefs.h"
10161 #include <ctype.h>
10162 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10163 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10164 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10165 int main () { int i; for (i = 0; i < 256; i++)
10166 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10167 exit (0); }
10168
10169 EOF
10170 if { (eval echo configure:10171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10171 then
10172   :
10173 else
10174   echo "configure: failed program was:" >&5
10175   cat conftest.$ac_ext >&5
10176   rm -fr conftest*
10177   ac_cv_header_stdc=no
10178 fi
10179 rm -fr conftest*
10180 fi
10181
10182 fi
10183 fi
10184
10185 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10186 if test $ac_cv_header_stdc = yes; then
10187   cat >> confdefs.h <<\EOF
10188 #define STDC_HEADERS 1
10189 EOF
10190
10191 fi
10192
10193 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10194 echo "configure:10195: checking for mode_t" >&5
10195 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
10196   echo $ac_n "(cached) $ac_c" 1>&6
10197 else
10198   cat > conftest.$ac_ext <<EOF
10199 #line 10200 "configure"
10200 #include "confdefs.h"
10201 #include <sys/types.h>
10202 #if STDC_HEADERS
10203 #include <stdlib.h>
10204 #include <stddef.h>
10205 #endif
10206 EOF
10207 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10208   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10209   rm -rf conftest*
10210   ac_cv_type_mode_t=yes
10211 else
10212   rm -rf conftest*
10213   ac_cv_type_mode_t=no
10214 fi
10215 rm -f conftest*
10216
10217 fi
10218 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
10219 if test $ac_cv_type_mode_t = no; then
10220   cat >> confdefs.h <<\EOF
10221 #define mode_t int
10222 EOF
10223
10224 fi
10225
10226 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10227 echo "configure:10228: checking for off_t" >&5
10228 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10229   echo $ac_n "(cached) $ac_c" 1>&6
10230 else
10231   cat > conftest.$ac_ext <<EOF
10232 #line 10233 "configure"
10233 #include "confdefs.h"
10234 #include <sys/types.h>
10235 #if STDC_HEADERS
10236 #include <stdlib.h>
10237 #include <stddef.h>
10238 #endif
10239 EOF
10240 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10241   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10242   rm -rf conftest*
10243   ac_cv_type_off_t=yes
10244 else
10245   rm -rf conftest*
10246   ac_cv_type_off_t=no
10247 fi
10248 rm -f conftest*
10249
10250 fi
10251 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10252 if test $ac_cv_type_off_t = no; then
10253   cat >> confdefs.h <<\EOF
10254 #define off_t long
10255 EOF
10256
10257 fi
10258
10259 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10260 echo "configure:10261: checking for pid_t" >&5
10261 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10262   echo $ac_n "(cached) $ac_c" 1>&6
10263 else
10264   cat > conftest.$ac_ext <<EOF
10265 #line 10266 "configure"
10266 #include "confdefs.h"
10267 #include <sys/types.h>
10268 #if STDC_HEADERS
10269 #include <stdlib.h>
10270 #include <stddef.h>
10271 #endif
10272 EOF
10273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10274   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10275   rm -rf conftest*
10276   ac_cv_type_pid_t=yes
10277 else
10278   rm -rf conftest*
10279   ac_cv_type_pid_t=no
10280 fi
10281 rm -f conftest*
10282
10283 fi
10284 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10285 if test $ac_cv_type_pid_t = no; then
10286   cat >> confdefs.h <<\EOF
10287 #define pid_t int
10288 EOF
10289
10290 fi
10291
10292 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10293 echo "configure:10294: checking for ptrdiff_t" >&5
10294 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10295   echo $ac_n "(cached) $ac_c" 1>&6
10296 else
10297   cat > conftest.$ac_ext <<EOF
10298 #line 10299 "configure"
10299 #include "confdefs.h"
10300 #include <stddef.h>
10301 int main() {
10302 ptrdiff_t p
10303 ; return 0; }
10304 EOF
10305 if { (eval echo configure:10306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10306   rm -rf conftest*
10307   am_cv_type_ptrdiff_t=yes
10308 else
10309   echo "configure: failed program was:" >&5
10310   cat conftest.$ac_ext >&5
10311   rm -rf conftest*
10312   am_cv_type_ptrdiff_t=no
10313 fi
10314 rm -f conftest*
10315 fi
10316
10317 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10318    if test $am_cv_type_ptrdiff_t = yes; then
10319      cat >> confdefs.h <<\EOF
10320 #define HAVE_PTRDIFF_T 1
10321 EOF
10322
10323    fi
10324
10325 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10326 echo "configure:10327: checking return type of signal handlers" >&5
10327 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10328   echo $ac_n "(cached) $ac_c" 1>&6
10329 else
10330   cat > conftest.$ac_ext <<EOF
10331 #line 10332 "configure"
10332 #include "confdefs.h"
10333 #include <sys/types.h>
10334 #include <signal.h>
10335 #ifdef signal
10336 #undef signal
10337 #endif
10338 #ifdef __cplusplus
10339 extern "C" void (*signal (int, void (*)(int)))(int);
10340 #else
10341 void (*signal ()) ();
10342 #endif
10343
10344 int main() {
10345 int i;
10346 ; return 0; }
10347 EOF
10348 if { (eval echo configure:10349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10349   rm -rf conftest*
10350   ac_cv_type_signal=void
10351 else
10352   echo "configure: failed program was:" >&5
10353   cat conftest.$ac_ext >&5
10354   rm -rf conftest*
10355   ac_cv_type_signal=int
10356 fi
10357 rm -f conftest*
10358 fi
10359
10360 echo "$ac_t""$ac_cv_type_signal" 1>&6
10361 cat >> confdefs.h <<EOF
10362 #define RETSIGTYPE $ac_cv_type_signal
10363 EOF
10364
10365
10366 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10367 echo "configure:10368: checking for sig_atomic_t" >&5
10368 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10369   echo $ac_n "(cached) $ac_c" 1>&6
10370 else
10371   cat > conftest.$ac_ext <<EOF
10372 #line 10373 "configure"
10373 #include "confdefs.h"
10374 #include <signal.h>
10375 int main() {
10376 sig_atomic_t atomic;
10377 ; return 0; }
10378 EOF
10379 if { (eval echo configure:10380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10380   rm -rf conftest*
10381   ol_cv_type_sig_atomic_t=yes
10382 else
10383   echo "configure: failed program was:" >&5
10384   cat conftest.$ac_ext >&5
10385   rm -rf conftest*
10386   ol_cv_type_sig_atomic_t=no
10387 fi
10388 rm -f conftest*
10389 fi
10390
10391 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10392   if test $ol_cv_type_sig_atomic_t = no; then
10393     cat >> confdefs.h <<\EOF
10394 #define sig_atomic_t int
10395 EOF
10396
10397   fi
10398  
10399 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10400 echo "configure:10401: checking for size_t" >&5
10401 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10402   echo $ac_n "(cached) $ac_c" 1>&6
10403 else
10404   cat > conftest.$ac_ext <<EOF
10405 #line 10406 "configure"
10406 #include "confdefs.h"
10407 #include <sys/types.h>
10408 #if STDC_HEADERS
10409 #include <stdlib.h>
10410 #include <stddef.h>
10411 #endif
10412 EOF
10413 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10414   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10415   rm -rf conftest*
10416   ac_cv_type_size_t=yes
10417 else
10418   rm -rf conftest*
10419   ac_cv_type_size_t=no
10420 fi
10421 rm -f conftest*
10422
10423 fi
10424 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10425 if test $ac_cv_type_size_t = no; then
10426   cat >> confdefs.h <<\EOF
10427 #define size_t unsigned
10428 EOF
10429
10430 fi
10431
10432 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10433 echo "configure:10434: checking for st_blksize in struct stat" >&5
10434 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10435   echo $ac_n "(cached) $ac_c" 1>&6
10436 else
10437   cat > conftest.$ac_ext <<EOF
10438 #line 10439 "configure"
10439 #include "confdefs.h"
10440 #include <sys/types.h>
10441 #include <sys/stat.h>
10442 int main() {
10443 struct stat s; s.st_blksize;
10444 ; return 0; }
10445 EOF
10446 if { (eval echo configure:10447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10447   rm -rf conftest*
10448   ac_cv_struct_st_blksize=yes
10449 else
10450   echo "configure: failed program was:" >&5
10451   cat conftest.$ac_ext >&5
10452   rm -rf conftest*
10453   ac_cv_struct_st_blksize=no
10454 fi
10455 rm -f conftest*
10456 fi
10457
10458 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10459 if test $ac_cv_struct_st_blksize = yes; then
10460   cat >> confdefs.h <<\EOF
10461 #define HAVE_ST_BLKSIZE 1
10462 EOF
10463
10464 fi
10465
10466 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10467 echo "configure:10468: checking whether time.h and sys/time.h may both be included" >&5
10468 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10469   echo $ac_n "(cached) $ac_c" 1>&6
10470 else
10471   cat > conftest.$ac_ext <<EOF
10472 #line 10473 "configure"
10473 #include "confdefs.h"
10474 #include <sys/types.h>
10475 #include <sys/time.h>
10476 #include <time.h>
10477 int main() {
10478 struct tm *tp;
10479 ; return 0; }
10480 EOF
10481 if { (eval echo configure:10482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10482   rm -rf conftest*
10483   ac_cv_header_time=yes
10484 else
10485   echo "configure: failed program was:" >&5
10486   cat conftest.$ac_ext >&5
10487   rm -rf conftest*
10488   ac_cv_header_time=no
10489 fi
10490 rm -f conftest*
10491 fi
10492
10493 echo "$ac_t""$ac_cv_header_time" 1>&6
10494 if test $ac_cv_header_time = yes; then
10495   cat >> confdefs.h <<\EOF
10496 #define TIME_WITH_SYS_TIME 1
10497 EOF
10498
10499 fi
10500
10501 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10502 echo "configure:10503: checking whether struct tm is in sys/time.h or time.h" >&5
10503 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10504   echo $ac_n "(cached) $ac_c" 1>&6
10505 else
10506   cat > conftest.$ac_ext <<EOF
10507 #line 10508 "configure"
10508 #include "confdefs.h"
10509 #include <sys/types.h>
10510 #include <time.h>
10511 int main() {
10512 struct tm *tp; tp->tm_sec;
10513 ; return 0; }
10514 EOF
10515 if { (eval echo configure:10516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10516   rm -rf conftest*
10517   ac_cv_struct_tm=time.h
10518 else
10519   echo "configure: failed program was:" >&5
10520   cat conftest.$ac_ext >&5
10521   rm -rf conftest*
10522   ac_cv_struct_tm=sys/time.h
10523 fi
10524 rm -f conftest*
10525 fi
10526
10527 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10528 if test $ac_cv_struct_tm = sys/time.h; then
10529   cat >> confdefs.h <<\EOF
10530 #define TM_IN_SYS_TIME 1
10531 EOF
10532
10533 fi
10534
10535 # test for pw_gecos in struct passwd
10536 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10537 echo "configure:10538: checking struct passwd for pw_gecos" >&5
10538 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10539   echo $ac_n "(cached) $ac_c" 1>&6
10540 else
10541   
10542         cat > conftest.$ac_ext <<EOF
10543 #line 10544 "configure"
10544 #include "confdefs.h"
10545 #include <pwd.h>
10546 int main() {
10547
10548         struct passwd pwd;
10549         pwd.pw_gecos = pwd.pw_name;
10550
10551 ; return 0; }
10552 EOF
10553 if { (eval echo configure:10554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10554   rm -rf conftest*
10555   ol_cv_struct_passwd_pw_gecos=yes
10556 else
10557   echo "configure: failed program was:" >&5
10558   cat conftest.$ac_ext >&5
10559   rm -rf conftest*
10560   ol_cv_struct_passwd_pw_gecos=no
10561 fi
10562 rm -f conftest*
10563 fi
10564
10565 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10566 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10567         cat >> confdefs.h <<\EOF
10568 #define HAVE_PW_GECOS 1
10569 EOF
10570
10571 fi
10572
10573
10574
10575 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10576 echo "configure:10577: checking if toupper() requires islower()" >&5
10577 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10578   echo $ac_n "(cached) $ac_c" 1>&6
10579 else
10580   
10581         if test "$cross_compiling" = yes; then
10582   ol_cv_c_upper_lower=safe
10583 else
10584   cat > conftest.$ac_ext <<EOF
10585 #line 10586 "configure"
10586 #include "confdefs.h"
10587
10588 #include <ctype.h>
10589 main()
10590 {
10591         if ('C' == toupper('C'))
10592                 exit(0);
10593         else
10594                 exit(1);
10595 }
10596 EOF
10597 if { (eval echo configure:10598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10598 then
10599   ol_cv_c_upper_lower=no
10600 else
10601   echo "configure: failed program was:" >&5
10602   cat conftest.$ac_ext >&5
10603   rm -fr conftest*
10604   ol_cv_c_upper_lower=yes
10605 fi
10606 rm -fr conftest*
10607 fi
10608
10609 fi
10610
10611 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10612 if test $ol_cv_c_upper_lower != no ; then
10613         cat >> confdefs.h <<\EOF
10614 #define C_UPPER_LOWER 1
10615 EOF
10616
10617 fi
10618
10619 echo $ac_n "checking for working const""... $ac_c" 1>&6
10620 echo "configure:10621: checking for working const" >&5
10621 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10622   echo $ac_n "(cached) $ac_c" 1>&6
10623 else
10624   cat > conftest.$ac_ext <<EOF
10625 #line 10626 "configure"
10626 #include "confdefs.h"
10627
10628 int main() {
10629
10630 /* Ultrix mips cc rejects this.  */
10631 typedef int charset[2]; const charset x;
10632 /* SunOS 4.1.1 cc rejects this.  */
10633 char const *const *ccp;
10634 char **p;
10635 /* NEC SVR4.0.2 mips cc rejects this.  */
10636 struct point {int x, y;};
10637 static struct point const zero = {0,0};
10638 /* AIX XL C 1.02.0.0 rejects this.
10639    It does not let you subtract one const X* pointer from another in an arm
10640    of an if-expression whose if-part is not a constant expression */
10641 const char *g = "string";
10642 ccp = &g + (g ? g-g : 0);
10643 /* HPUX 7.0 cc rejects these. */
10644 ++ccp;
10645 p = (char**) ccp;
10646 ccp = (char const *const *) p;
10647 { /* SCO 3.2v4 cc rejects this.  */
10648   char *t;
10649   char const *s = 0 ? (char *) 0 : (char const *) 0;
10650
10651   *t++ = 0;
10652 }
10653 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10654   int x[] = {25, 17};
10655   const int *foo = &x[0];
10656   ++foo;
10657 }
10658 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10659   typedef const int *iptr;
10660   iptr p = 0;
10661   ++p;
10662 }
10663 { /* AIX XL C 1.02.0.0 rejects this saying
10664      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10665   struct s { int j; const int *ap[3]; };
10666   struct s *b; b->j = 5;
10667 }
10668 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10669   const int foo = 10;
10670 }
10671
10672 ; return 0; }
10673 EOF
10674 if { (eval echo configure:10675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10675   rm -rf conftest*
10676   ac_cv_c_const=yes
10677 else
10678   echo "configure: failed program was:" >&5
10679   cat conftest.$ac_ext >&5
10680   rm -rf conftest*
10681   ac_cv_c_const=no
10682 fi
10683 rm -f conftest*
10684 fi
10685
10686 echo "$ac_t""$ac_cv_c_const" 1>&6
10687 if test $ac_cv_c_const = no; then
10688   cat >> confdefs.h <<\EOF
10689 #define const 
10690 EOF
10691
10692 fi
10693
10694 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10695 echo "configure:10696: checking if compiler understands volatile" >&5
10696 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10697   echo $ac_n "(cached) $ac_c" 1>&6
10698 else
10699   cat > conftest.$ac_ext <<EOF
10700 #line 10701 "configure"
10701 #include "confdefs.h"
10702 int x, y, z;
10703 int main() {
10704 volatile int a; int * volatile b = x ? &y : &z;
10705       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10706       *b = 0;
10707 ; return 0; }
10708 EOF
10709 if { (eval echo configure:10710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10710   rm -rf conftest*
10711   ol_cv_c_volatile=yes
10712 else
10713   echo "configure: failed program was:" >&5
10714   cat conftest.$ac_ext >&5
10715   rm -rf conftest*
10716   ol_cv_c_volatile=no
10717 fi
10718 rm -f conftest*
10719 fi
10720
10721 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10722   if test $ol_cv_c_volatile = yes; then
10723     : 
10724   else
10725     cat >> confdefs.h <<\EOF
10726 #define volatile 
10727 EOF
10728
10729   fi
10730  
10731
10732 if test $cross_compiling = yes ; then
10733         cat >> confdefs.h <<\EOF
10734 #define CROSS_COMPILING 1
10735 EOF
10736
10737 else
10738         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10739 echo "configure:10740: checking whether byte ordering is bigendian" >&5
10740 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10741   echo $ac_n "(cached) $ac_c" 1>&6
10742 else
10743   ac_cv_c_bigendian=unknown
10744 # See if sys/param.h defines the BYTE_ORDER macro.
10745 cat > conftest.$ac_ext <<EOF
10746 #line 10747 "configure"
10747 #include "confdefs.h"
10748 #include <sys/types.h>
10749 #include <sys/param.h>
10750 int main() {
10751
10752 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10753  bogus endian macros
10754 #endif
10755 ; return 0; }
10756 EOF
10757 if { (eval echo configure:10758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10758   rm -rf conftest*
10759   # It does; now see whether it defined to BIG_ENDIAN or not.
10760 cat > conftest.$ac_ext <<EOF
10761 #line 10762 "configure"
10762 #include "confdefs.h"
10763 #include <sys/types.h>
10764 #include <sys/param.h>
10765 int main() {
10766
10767 #if BYTE_ORDER != BIG_ENDIAN
10768  not big endian
10769 #endif
10770 ; return 0; }
10771 EOF
10772 if { (eval echo configure:10773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10773   rm -rf conftest*
10774   ac_cv_c_bigendian=yes
10775 else
10776   echo "configure: failed program was:" >&5
10777   cat conftest.$ac_ext >&5
10778   rm -rf conftest*
10779   ac_cv_c_bigendian=no
10780 fi
10781 rm -f conftest*
10782 else
10783   echo "configure: failed program was:" >&5
10784   cat conftest.$ac_ext >&5
10785 fi
10786 rm -f conftest*
10787 if test $ac_cv_c_bigendian = unknown; then
10788 if test "$cross_compiling" = yes; then
10789     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10790 else
10791   cat > conftest.$ac_ext <<EOF
10792 #line 10793 "configure"
10793 #include "confdefs.h"
10794 main () {
10795   /* Are we little or big endian?  From Harbison&Steele.  */
10796   union
10797   {
10798     long l;
10799     char c[sizeof (long)];
10800   } u;
10801   u.l = 1;
10802   exit (u.c[sizeof (long) - 1] == 1);
10803 }
10804 EOF
10805 if { (eval echo configure:10806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10806 then
10807   ac_cv_c_bigendian=no
10808 else
10809   echo "configure: failed program was:" >&5
10810   cat conftest.$ac_ext >&5
10811   rm -fr conftest*
10812   ac_cv_c_bigendian=yes
10813 fi
10814 rm -fr conftest*
10815 fi
10816
10817 fi
10818 fi
10819
10820 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10821 if test $ac_cv_c_bigendian = yes; then
10822   cat >> confdefs.h <<\EOF
10823 #define WORDS_BIGENDIAN 1
10824 EOF
10825
10826 fi
10827
10828         echo $ac_n "checking size of short""... $ac_c" 1>&6
10829 echo "configure:10830: checking size of short" >&5
10830 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10831   echo $ac_n "(cached) $ac_c" 1>&6
10832 else
10833   if test "$cross_compiling" = yes; then
10834     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10835 else
10836   cat > conftest.$ac_ext <<EOF
10837 #line 10838 "configure"
10838 #include "confdefs.h"
10839 #include <stdio.h>
10840 main()
10841 {
10842   FILE *f=fopen("conftestval", "w");
10843   if (!f) exit(1);
10844   fprintf(f, "%d\n", sizeof(short));
10845   exit(0);
10846 }
10847 EOF
10848 if { (eval echo configure:10849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10849 then
10850   ac_cv_sizeof_short=`cat conftestval`
10851 else
10852   echo "configure: failed program was:" >&5
10853   cat conftest.$ac_ext >&5
10854   rm -fr conftest*
10855   ac_cv_sizeof_short=0
10856 fi
10857 rm -fr conftest*
10858 fi
10859
10860 fi
10861 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10862 cat >> confdefs.h <<EOF
10863 #define SIZEOF_SHORT $ac_cv_sizeof_short
10864 EOF
10865
10866  
10867         echo $ac_n "checking size of int""... $ac_c" 1>&6
10868 echo "configure:10869: checking size of int" >&5
10869 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10870   echo $ac_n "(cached) $ac_c" 1>&6
10871 else
10872   if test "$cross_compiling" = yes; then
10873     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10874 else
10875   cat > conftest.$ac_ext <<EOF
10876 #line 10877 "configure"
10877 #include "confdefs.h"
10878 #include <stdio.h>
10879 main()
10880 {
10881   FILE *f=fopen("conftestval", "w");
10882   if (!f) exit(1);
10883   fprintf(f, "%d\n", sizeof(int));
10884   exit(0);
10885 }
10886 EOF
10887 if { (eval echo configure:10888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10888 then
10889   ac_cv_sizeof_int=`cat conftestval`
10890 else
10891   echo "configure: failed program was:" >&5
10892   cat conftest.$ac_ext >&5
10893   rm -fr conftest*
10894   ac_cv_sizeof_int=0
10895 fi
10896 rm -fr conftest*
10897 fi
10898
10899 fi
10900 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10901 cat >> confdefs.h <<EOF
10902 #define SIZEOF_INT $ac_cv_sizeof_int
10903 EOF
10904
10905  
10906         echo $ac_n "checking size of long""... $ac_c" 1>&6
10907 echo "configure:10908: checking size of long" >&5
10908 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10909   echo $ac_n "(cached) $ac_c" 1>&6
10910 else
10911   if test "$cross_compiling" = yes; then
10912     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10913 else
10914   cat > conftest.$ac_ext <<EOF
10915 #line 10916 "configure"
10916 #include "confdefs.h"
10917 #include <stdio.h>
10918 main()
10919 {
10920   FILE *f=fopen("conftestval", "w");
10921   if (!f) exit(1);
10922   fprintf(f, "%d\n", sizeof(long));
10923   exit(0);
10924 }
10925 EOF
10926 if { (eval echo configure:10927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10927 then
10928   ac_cv_sizeof_long=`cat conftestval`
10929 else
10930   echo "configure: failed program was:" >&5
10931   cat conftest.$ac_ext >&5
10932   rm -fr conftest*
10933   ac_cv_sizeof_long=0
10934 fi
10935 rm -fr conftest*
10936 fi
10937
10938 fi
10939 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10940 cat >> confdefs.h <<EOF
10941 #define SIZEOF_LONG $ac_cv_sizeof_long
10942 EOF
10943
10944
10945
10946         if test "$ac_cv_sizeof_int" -lt 4 ; then
10947                 { echo "configure: error: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2; exit 1; }
10948         fi
10949 fi
10950
10951 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10952 echo "configure:10953: checking for 8-bit clean memcmp" >&5
10953 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10954   echo $ac_n "(cached) $ac_c" 1>&6
10955 else
10956   if test "$cross_compiling" = yes; then
10957   ac_cv_func_memcmp_clean=no
10958 else
10959   cat > conftest.$ac_ext <<EOF
10960 #line 10961 "configure"
10961 #include "confdefs.h"
10962
10963 main()
10964 {
10965   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10966   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10967 }
10968
10969 EOF
10970 if { (eval echo configure:10971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10971 then
10972   ac_cv_func_memcmp_clean=yes
10973 else
10974   echo "configure: failed program was:" >&5
10975   cat conftest.$ac_ext >&5
10976   rm -fr conftest*
10977   ac_cv_func_memcmp_clean=no
10978 fi
10979 rm -fr conftest*
10980 fi
10981
10982 fi
10983
10984 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10985 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10986
10987 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10988 echo "configure:10989: checking for strftime" >&5
10989 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10990   echo $ac_n "(cached) $ac_c" 1>&6
10991 else
10992   cat > conftest.$ac_ext <<EOF
10993 #line 10994 "configure"
10994 #include "confdefs.h"
10995 /* System header to define __stub macros and hopefully few prototypes,
10996     which can conflict with char strftime(); below.  */
10997 #include <assert.h>
10998 /* Override any gcc2 internal prototype to avoid an error.  */
10999 /* We use char because int might match the return type of a gcc2
11000     builtin and then its argument prototype would still apply.  */
11001 char strftime();
11002
11003 int main() {
11004
11005 /* The GNU C library defines this for functions which it implements
11006     to always fail with ENOSYS.  Some functions are actually named
11007     something starting with __ and the normal name is an alias.  */
11008 #if defined (__stub_strftime) || defined (__stub___strftime)
11009 choke me
11010 #else
11011 strftime();
11012 #endif
11013
11014 ; return 0; }
11015 EOF
11016 if { (eval echo configure:11017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11017   rm -rf conftest*
11018   eval "ac_cv_func_strftime=yes"
11019 else
11020   echo "configure: failed program was:" >&5
11021   cat conftest.$ac_ext >&5
11022   rm -rf conftest*
11023   eval "ac_cv_func_strftime=no"
11024 fi
11025 rm -f conftest*
11026 fi
11027
11028 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11029   echo "$ac_t""yes" 1>&6
11030   cat >> confdefs.h <<\EOF
11031 #define HAVE_STRFTIME 1
11032 EOF
11033
11034 else
11035   echo "$ac_t""no" 1>&6
11036 # strftime is in -lintl on SCO UNIX.
11037 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11038 echo "configure:11039: checking for strftime in -lintl" >&5
11039 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
11040 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11041   echo $ac_n "(cached) $ac_c" 1>&6
11042 else
11043   ac_save_LIBS="$LIBS"
11044 LIBS="-lintl  $LIBS"
11045 cat > conftest.$ac_ext <<EOF
11046 #line 11047 "configure"
11047 #include "confdefs.h"
11048 /* Override any gcc2 internal prototype to avoid an error.  */
11049 /* We use char because int might match the return type of a gcc2
11050     builtin and then its argument prototype would still apply.  */
11051 char strftime();
11052
11053 int main() {
11054 strftime()
11055 ; return 0; }
11056 EOF
11057 if { (eval echo configure:11058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11058   rm -rf conftest*
11059   eval "ac_cv_lib_$ac_lib_var=yes"
11060 else
11061   echo "configure: failed program was:" >&5
11062   cat conftest.$ac_ext >&5
11063   rm -rf conftest*
11064   eval "ac_cv_lib_$ac_lib_var=no"
11065 fi
11066 rm -f conftest*
11067 LIBS="$ac_save_LIBS"
11068
11069 fi
11070 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11071   echo "$ac_t""yes" 1>&6
11072   cat >> confdefs.h <<\EOF
11073 #define HAVE_STRFTIME 1
11074 EOF
11075
11076 LIBS="-lintl $LIBS"
11077 else
11078   echo "$ac_t""no" 1>&6
11079 fi
11080
11081 fi
11082
11083
11084 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11085 echo "configure:11086: checking for vprintf" >&5
11086 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
11087   echo $ac_n "(cached) $ac_c" 1>&6
11088 else
11089   cat > conftest.$ac_ext <<EOF
11090 #line 11091 "configure"
11091 #include "confdefs.h"
11092 /* System header to define __stub macros and hopefully few prototypes,
11093     which can conflict with char vprintf(); below.  */
11094 #include <assert.h>
11095 /* Override any gcc2 internal prototype to avoid an error.  */
11096 /* We use char because int might match the return type of a gcc2
11097     builtin and then its argument prototype would still apply.  */
11098 char vprintf();
11099
11100 int main() {
11101
11102 /* The GNU C library defines this for functions which it implements
11103     to always fail with ENOSYS.  Some functions are actually named
11104     something starting with __ and the normal name is an alias.  */
11105 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11106 choke me
11107 #else
11108 vprintf();
11109 #endif
11110
11111 ; return 0; }
11112 EOF
11113 if { (eval echo configure:11114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11114   rm -rf conftest*
11115   eval "ac_cv_func_vprintf=yes"
11116 else
11117   echo "configure: failed program was:" >&5
11118   cat conftest.$ac_ext >&5
11119   rm -rf conftest*
11120   eval "ac_cv_func_vprintf=no"
11121 fi
11122 rm -f conftest*
11123 fi
11124
11125 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11126   echo "$ac_t""yes" 1>&6
11127   cat >> confdefs.h <<\EOF
11128 #define HAVE_VPRINTF 1
11129 EOF
11130
11131 else
11132   echo "$ac_t""no" 1>&6
11133 fi
11134
11135 if test "$ac_cv_func_vprintf" != yes; then
11136 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11137 echo "configure:11138: checking for _doprnt" >&5
11138 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
11139   echo $ac_n "(cached) $ac_c" 1>&6
11140 else
11141   cat > conftest.$ac_ext <<EOF
11142 #line 11143 "configure"
11143 #include "confdefs.h"
11144 /* System header to define __stub macros and hopefully few prototypes,
11145     which can conflict with char _doprnt(); below.  */
11146 #include <assert.h>
11147 /* Override any gcc2 internal prototype to avoid an error.  */
11148 /* We use char because int might match the return type of a gcc2
11149     builtin and then its argument prototype would still apply.  */
11150 char _doprnt();
11151
11152 int main() {
11153
11154 /* The GNU C library defines this for functions which it implements
11155     to always fail with ENOSYS.  Some functions are actually named
11156     something starting with __ and the normal name is an alias.  */
11157 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11158 choke me
11159 #else
11160 _doprnt();
11161 #endif
11162
11163 ; return 0; }
11164 EOF
11165 if { (eval echo configure:11166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11166   rm -rf conftest*
11167   eval "ac_cv_func__doprnt=yes"
11168 else
11169   echo "configure: failed program was:" >&5
11170   cat conftest.$ac_ext >&5
11171   rm -rf conftest*
11172   eval "ac_cv_func__doprnt=no"
11173 fi
11174 rm -f conftest*
11175 fi
11176
11177 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
11178   echo "$ac_t""yes" 1>&6
11179   cat >> confdefs.h <<\EOF
11180 #define HAVE_DOPRNT 1
11181 EOF
11182
11183 else
11184   echo "$ac_t""no" 1>&6
11185 fi
11186
11187 fi
11188
11189
11190 if test $ac_cv_func_vprintf = yes ; then
11191                 for ac_func in vsnprintf vsprintf
11192 do
11193 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11194 echo "configure:11195: checking for $ac_func" >&5
11195 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11196   echo $ac_n "(cached) $ac_c" 1>&6
11197 else
11198   cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 /* System header to define __stub macros and hopefully few prototypes,
11202     which can conflict with char $ac_func(); below.  */
11203 #include <assert.h>
11204 /* Override any gcc2 internal prototype to avoid an error.  */
11205 /* We use char because int might match the return type of a gcc2
11206     builtin and then its argument prototype would still apply.  */
11207 char $ac_func();
11208
11209 int main() {
11210
11211 /* The GNU C library defines this for functions which it implements
11212     to always fail with ENOSYS.  Some functions are actually named
11213     something starting with __ and the normal name is an alias.  */
11214 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11215 choke me
11216 #else
11217 $ac_func();
11218 #endif
11219
11220 ; return 0; }
11221 EOF
11222 if { (eval echo configure:11223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11223   rm -rf conftest*
11224   eval "ac_cv_func_$ac_func=yes"
11225 else
11226   echo "configure: failed program was:" >&5
11227   cat conftest.$ac_ext >&5
11228   rm -rf conftest*
11229   eval "ac_cv_func_$ac_func=no"
11230 fi
11231 rm -f conftest*
11232 fi
11233
11234 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11235   echo "$ac_t""yes" 1>&6
11236     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11237   cat >> confdefs.h <<EOF
11238 #define $ac_tr_func 1
11239 EOF
11240  
11241 else
11242   echo "$ac_t""no" 1>&6
11243 fi
11244 done
11245
11246 fi
11247
11248 for ac_func in \
11249         bcopy                   \
11250         closesocket             \
11251         endgrent                \
11252         endpwent                \
11253         flock                   \
11254         getdtablesize   \
11255         getgrgid                \
11256         gethostname             \
11257         getpass                 \
11258         getpwuid                \
11259         gettimeofday    \
11260         initgroups              \
11261         lockf                   \
11262         memcpy                  \
11263         memmove                 \
11264         mkstemp                 \
11265         recv                    \
11266         recvfrom                \
11267         setpwfile               \
11268         setgid                  \
11269         setegid                 \
11270         setsid                  \
11271         setuid                  \
11272         seteuid                 \
11273         signal                  \
11274         sigset                  \
11275         snprintf                \
11276         strdup                  \
11277         strerror                \
11278         strpbrk                 \
11279         strrchr                 \
11280         strsep                  \
11281         strstr                  \
11282         strtol                  \
11283         strtoul                 \
11284         strspn                  \
11285         sysconf                 \
11286         waitpid                 \
11287         wait4                   \
11288
11289 do
11290 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11291 echo "configure:11292: checking for $ac_func" >&5
11292 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11293   echo $ac_n "(cached) $ac_c" 1>&6
11294 else
11295   cat > conftest.$ac_ext <<EOF
11296 #line 11297 "configure"
11297 #include "confdefs.h"
11298 /* System header to define __stub macros and hopefully few prototypes,
11299     which can conflict with char $ac_func(); below.  */
11300 #include <assert.h>
11301 /* Override any gcc2 internal prototype to avoid an error.  */
11302 /* We use char because int might match the return type of a gcc2
11303     builtin and then its argument prototype would still apply.  */
11304 char $ac_func();
11305
11306 int main() {
11307
11308 /* The GNU C library defines this for functions which it implements
11309     to always fail with ENOSYS.  Some functions are actually named
11310     something starting with __ and the normal name is an alias.  */
11311 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11312 choke me
11313 #else
11314 $ac_func();
11315 #endif
11316
11317 ; return 0; }
11318 EOF
11319 if { (eval echo configure:11320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11320   rm -rf conftest*
11321   eval "ac_cv_func_$ac_func=yes"
11322 else
11323   echo "configure: failed program was:" >&5
11324   cat conftest.$ac_ext >&5
11325   rm -rf conftest*
11326   eval "ac_cv_func_$ac_func=no"
11327 fi
11328 rm -f conftest*
11329 fi
11330
11331 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11332   echo "$ac_t""yes" 1>&6
11333     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11334   cat >> confdefs.h <<EOF
11335 #define $ac_tr_func 1
11336 EOF
11337  
11338 else
11339   echo "$ac_t""no" 1>&6
11340 fi
11341 done
11342
11343
11344 for ac_func in getopt tempnam
11345 do
11346 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11347 echo "configure:11348: checking for $ac_func" >&5
11348 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11349   echo $ac_n "(cached) $ac_c" 1>&6
11350 else
11351   cat > conftest.$ac_ext <<EOF
11352 #line 11353 "configure"
11353 #include "confdefs.h"
11354 /* System header to define __stub macros and hopefully few prototypes,
11355     which can conflict with char $ac_func(); below.  */
11356 #include <assert.h>
11357 /* Override any gcc2 internal prototype to avoid an error.  */
11358 /* We use char because int might match the return type of a gcc2
11359     builtin and then its argument prototype would still apply.  */
11360 char $ac_func();
11361
11362 int main() {
11363
11364 /* The GNU C library defines this for functions which it implements
11365     to always fail with ENOSYS.  Some functions are actually named
11366     something starting with __ and the normal name is an alias.  */
11367 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11368 choke me
11369 #else
11370 $ac_func();
11371 #endif
11372
11373 ; return 0; }
11374 EOF
11375 if { (eval echo configure:11376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11376   rm -rf conftest*
11377   eval "ac_cv_func_$ac_func=yes"
11378 else
11379   echo "configure: failed program was:" >&5
11380   cat conftest.$ac_ext >&5
11381   rm -rf conftest*
11382   eval "ac_cv_func_$ac_func=no"
11383 fi
11384 rm -f conftest*
11385 fi
11386
11387 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11388   echo "$ac_t""yes" 1>&6
11389     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11390   cat >> confdefs.h <<EOF
11391 #define $ac_tr_func 1
11392 EOF
11393  
11394 else
11395   echo "$ac_t""no" 1>&6
11396 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11397 fi
11398 done
11399
11400
11401
11402 # Check Configuration
11403
11404 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11405 echo "configure:11406: checking declaration of sys_errlist" >&5
11406 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11407   echo $ac_n "(cached) $ac_c" 1>&6
11408 else
11409   
11410         cat > conftest.$ac_ext <<EOF
11411 #line 11412 "configure"
11412 #include "confdefs.h"
11413
11414 #include <stdio.h>
11415 #include <sys/types.h>
11416 #include <errno.h> 
11417 int main() {
11418 char *c = (char *) *sys_errlist
11419 ; return 0; }
11420 EOF
11421 if { (eval echo configure:11422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11422   rm -rf conftest*
11423   ol_cv_dcl_sys_errlist=yes
11424 else
11425   echo "configure: failed program was:" >&5
11426   cat conftest.$ac_ext >&5
11427   rm -rf conftest*
11428   ol_cv_dcl_sys_errlist=no
11429 fi
11430 rm -f conftest*
11431 fi
11432
11433 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11434 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11435 if test $ol_cv_dcl_sys_errlist = no ; then
11436         cat >> confdefs.h <<\EOF
11437 #define DECL_SYS_ERRLIST 1
11438 EOF
11439
11440         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11441 echo "configure:11442: checking existence of sys_errlist" >&5
11442         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11443   echo $ac_n "(cached) $ac_c" 1>&6
11444 else
11445   
11446                 cat > conftest.$ac_ext <<EOF
11447 #line 11448 "configure"
11448 #include "confdefs.h"
11449 #include <errno.h>
11450 int main() {
11451 char *c = (char *) *sys_errlist
11452 ; return 0; }
11453 EOF
11454 if { (eval echo configure:11455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11455   rm -rf conftest*
11456   ol_cv_have_sys_errlist=yes
11457 else
11458   echo "configure: failed program was:" >&5
11459   cat conftest.$ac_ext >&5
11460   rm -rf conftest*
11461   ol_cv_have_sys_errlist=no
11462 fi
11463 rm -f conftest*
11464 fi
11465
11466         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11467         if test $ol_cv_have_sys_errlist = yes ; then
11468                 cat >> confdefs.h <<\EOF
11469 #define HAVE_SYS_ERRLIST 1
11470 EOF
11471
11472         fi
11473 fi
11474
11475
11476
11477 if test "$ol_enable_debug" != no ; then
11478         cat >> confdefs.h <<\EOF
11479 #define LDAP_DEBUG 1
11480 EOF
11481
11482 fi
11483 if test "$ol_enable_syslog" = yes ; then
11484         cat >> confdefs.h <<\EOF
11485 #define LDAP_SYSLOG 1
11486 EOF
11487
11488 fi
11489 if test "$ol_enable_libui" = yes ; then
11490         cat >> confdefs.h <<\EOF
11491 #define LDAP_LIBUI 1
11492 EOF
11493
11494 fi
11495 if test "$ol_enable_cache" = no ; then
11496         cat >> confdefs.h <<\EOF
11497 #define LDAP_NOCACHE 1
11498 EOF
11499
11500 fi
11501 if test "$ol_enable_dns" != no ; then
11502         cat >> confdefs.h <<\EOF
11503 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11504 EOF
11505
11506 fi
11507 if test "$ol_enable_proctitle" != no ; then
11508         cat >> confdefs.h <<\EOF
11509 #define LDAP_PROCTITLE 1
11510 EOF
11511
11512 fi
11513 if test "$ol_enable_referrals" != no ; then
11514         cat >> confdefs.h <<\EOF
11515 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11516 EOF
11517
11518 fi
11519 if test "$ol_enable_cldap" != no ; then
11520         cat >> confdefs.h <<\EOF
11521 #define LDAP_CONNECTIONLESS 1
11522 EOF
11523
11524 fi
11525
11526 if test "$ol_enable_aclgroups" != no ; then
11527         cat >> confdefs.h <<\EOF
11528 #define SLAPD_ACLGROUPS 1
11529 EOF
11530
11531 fi
11532 if test "$ol_enable_crypt" != no ; then
11533         cat >> confdefs.h <<\EOF
11534 #define SLAPD_CRYPT 1
11535 EOF
11536
11537 fi
11538 if test "$ol_enable_cleartext" != no ; then
11539         cat >> confdefs.h <<\EOF
11540 #define SLAPD_CLEARTEXT 1
11541 EOF
11542
11543 fi
11544 if test "$ol_enable_phonetic" != no ; then
11545         cat >> confdefs.h <<\EOF
11546 #define SLAPD_PHONETIC 1
11547 EOF
11548
11549 fi
11550 if test "$ol_enable_rlookups" != no ; then
11551         cat >> confdefs.h <<\EOF
11552 #define SLAPD_RLOOKUPS 1
11553 EOF
11554
11555 fi
11556
11557 if test "$ol_link_modules" != no ; then
11558         cat >> confdefs.h <<\EOF
11559 #define SLAPD_MODULES 1
11560 EOF
11561
11562         BUILD_SLAPD=yes
11563 fi
11564
11565 if test "$ol_link_bdb2" != no ; then
11566         cat >> confdefs.h <<\EOF
11567 #define SLAPD_BDB2 1
11568 EOF
11569
11570         BUILD_SLAPD=yes
11571         BUILD_BDB2=yes
11572 fi
11573
11574 if test "$ol_enable_ldap" != no ; then
11575         cat >> confdefs.h <<\EOF
11576 #define SLAPD_LDAP 1
11577 EOF
11578
11579         BUILD_SLAPD=yes
11580         BUILD_LDAP=yes
11581 fi
11582
11583 if test "$ol_link_ldbm" != no ; then
11584         cat >> confdefs.h <<\EOF
11585 #define SLAPD_LDBM 1
11586 EOF
11587
11588         BUILD_SLAPD=yes
11589         BUILD_LDBM=yes
11590 fi
11591
11592 if test "$ol_enable_passwd" != no ; then
11593         cat >> confdefs.h <<\EOF
11594 #define SLAPD_PASSWD 1
11595 EOF
11596
11597         BUILD_SLAPD=yes
11598         BUILD_PASSWD=yes
11599 fi
11600
11601 if test "$ol_link_perl" != no ; then
11602         cat >> confdefs.h <<\EOF
11603 #define SLAPD_PERL 1
11604 EOF
11605
11606         BUILD_SLAPD=yes
11607         BUILD_PERL=yes
11608 fi
11609
11610 if test "$ol_enable_shell" != no ; then
11611         cat >> confdefs.h <<\EOF
11612 #define SLAPD_SHELL 1
11613 EOF
11614
11615         BUILD_SLAPD=yes
11616         BUILD_SHELL=yes
11617 fi
11618
11619 if test "$ol_enable_tcl" != no ; then
11620         cat >> confdefs.h <<\EOF
11621 #define SLAPD_TCL 1
11622 EOF
11623
11624         BUILD_SLAPD=yes
11625         BUILD_TCL=yes
11626 fi
11627
11628 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11629         $BUILD_SLAPD = yes ; then
11630         BUILD_SLURPD=yes
11631 fi
11632
11633 if test "$ol_link_isode" != no ; then
11634         BUILD_LDAPD=yes
11635 fi
11636
11637
11638
11639
11640   
11641   
11642   
11643   
11644   
11645   
11646   
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669 trap '' 1 2 15
11670
11671 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11672
11673 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11674 # Let make expand exec_prefix.
11675 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11676
11677 # Any assignment to VPATH causes Sun make to only execute
11678 # the first set of double-colon rules, so remove it if not needed.
11679 # If there is a colon in the path, we need to keep it.
11680 if test "x$srcdir" = x.; then
11681   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11682 fi
11683
11684 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11685
11686 DEFS=-DHAVE_CONFIG_H
11687
11688 # Without the "./", some shells look in PATH for config.status.
11689 : ${CONFIG_STATUS=./config.status}
11690
11691 echo creating $CONFIG_STATUS
11692 rm -f $CONFIG_STATUS
11693 cat > $CONFIG_STATUS <<EOF
11694 #! /bin/sh
11695 # Generated automatically by configure.
11696 # Run this file to recreate the current configuration.
11697 # This directory was configured as follows,
11698 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11699 #
11700 # $0 $ac_configure_args
11701 #
11702 # Compiler output produced by configure, useful for debugging
11703 # configure, is in ./config.log if it exists.
11704
11705 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11706 for ac_option
11707 do
11708   case "\$ac_option" in
11709   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11710     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11711     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11712   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11713     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11714     exit 0 ;;
11715   -help | --help | --hel | --he | --h)
11716     echo "\$ac_cs_usage"; exit 0 ;;
11717   *) echo "\$ac_cs_usage"; exit 1 ;;
11718   esac
11719 done
11720
11721 ac_given_srcdir=$srcdir
11722 ac_given_INSTALL="$INSTALL"
11723
11724 trap 'rm -fr `echo "\
11725 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11726 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11727 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11728 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11729 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11730 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11731 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11732 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11733 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11734 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11735 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11736 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11737 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11738 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11739 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11740 include/Makefile:build/top.mk:include/Makefile.in \
11741 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11742 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11743 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11744 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11745 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11746 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11747 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11748 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11749 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11750 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11751 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11752 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11753 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11754 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11755 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11756 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11757 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11758 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11759 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11760 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11761 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11762 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11763 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11764 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11765 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11766 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11767  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11768 EOF
11769 cat >> $CONFIG_STATUS <<EOF
11770
11771 # Protect against being on the right side of a sed subst in config.status.
11772 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11773  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11774 $ac_vpsub
11775 $extrasub
11776 s%@SHELL@%$SHELL%g
11777 s%@CFLAGS@%$CFLAGS%g
11778 s%@CPPFLAGS@%$CPPFLAGS%g
11779 s%@CXXFLAGS@%$CXXFLAGS%g
11780 s%@FFLAGS@%$FFLAGS%g
11781 s%@DEFS@%$DEFS%g
11782 s%@LDFLAGS@%$LDFLAGS%g
11783 s%@LIBS@%$LIBS%g
11784 s%@exec_prefix@%$exec_prefix%g
11785 s%@prefix@%$prefix%g
11786 s%@program_transform_name@%$program_transform_name%g
11787 s%@bindir@%$bindir%g
11788 s%@sbindir@%$sbindir%g
11789 s%@libexecdir@%$libexecdir%g
11790 s%@datadir@%$datadir%g
11791 s%@sysconfdir@%$sysconfdir%g
11792 s%@sharedstatedir@%$sharedstatedir%g
11793 s%@localstatedir@%$localstatedir%g
11794 s%@libdir@%$libdir%g
11795 s%@includedir@%$includedir%g
11796 s%@oldincludedir@%$oldincludedir%g
11797 s%@infodir@%$infodir%g
11798 s%@mandir@%$mandir%g
11799 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11800 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11801 s%@INSTALL_DATA@%$INSTALL_DATA%g
11802 s%@PACKAGE@%$PACKAGE%g
11803 s%@VERSION@%$VERSION%g
11804 s%@ACLOCAL@%$ACLOCAL%g
11805 s%@AUTOCONF@%$AUTOCONF%g
11806 s%@AUTOMAKE@%$AUTOMAKE%g
11807 s%@AUTOHEADER@%$AUTOHEADER%g
11808 s%@MAKEINFO@%$MAKEINFO%g
11809 s%@SET_MAKE@%$SET_MAKE%g
11810 s%@top_builddir@%$top_builddir%g
11811 s%@ldap_subdir@%$ldap_subdir%g
11812 s%@CC@%$CC%g
11813 s%@host@%$host%g
11814 s%@host_alias@%$host_alias%g
11815 s%@host_cpu@%$host_cpu%g
11816 s%@host_vendor@%$host_vendor%g
11817 s%@host_os@%$host_os%g
11818 s%@RANLIB@%$RANLIB%g
11819 s%@LD@%$LD%g
11820 s%@NM@%$NM%g
11821 s%@LN_S@%$LN_S%g
11822 s%@LIBTOOL@%$LIBTOOL%g
11823 s%@AWK@%$AWK%g
11824 s%@LN_H@%$LN_H%g
11825 s%@SENDMAIL@%$SENDMAIL%g
11826 s%@EDITOR@%$EDITOR%g
11827 s%@FINGER@%$FINGER%g
11828 s%@GLIBCONFIG@%$GLIBCONFIG%g
11829 s%@PERLBIN@%$PERLBIN%g
11830 s%@CPP@%$CPP%g
11831 s%@EXEEXT@%$EXEEXT%g
11832 s%@OBJEXT@%$OBJEXT%g
11833 s%@OL_MKDEP@%$OL_MKDEP%g
11834 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
11835 s%@PEPSY@%$PEPSY%g
11836 s%@LIBOBJS@%$LIBOBJS%g
11837 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11838 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11839 s%@BUILD_BDB2@%$BUILD_BDB2%g
11840 s%@BUILD_LDAP@%$BUILD_LDAP%g
11841 s%@BUILD_LDBM@%$BUILD_LDBM%g
11842 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11843 s%@BUILD_PERL@%$BUILD_PERL%g
11844 s%@BUILD_SHELL@%$BUILD_SHELL%g
11845 s%@BUILD_TCL@%$BUILD_TCL%g
11846 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11847 s%@LDAP_LIBS@%$LDAP_LIBS%g
11848 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11849 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11850 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11851 s%@LDBM_LIBS@%$LDBM_LIBS%g
11852 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11853 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11854 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11855 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11856 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11857 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11858 s%@KRB_LIBS@%$KRB_LIBS%g
11859 s%@READLINE_LIBS@%$READLINE_LIBS%g
11860 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11861 s%@TLS_LIBS@%$TLS_LIBS%g
11862
11863 CEOF
11864 EOF
11865
11866 cat >> $CONFIG_STATUS <<\EOF
11867
11868 # Split the substitutions into bite-sized pieces for seds with
11869 # small command number limits, like on Digital OSF/1 and HP-UX.
11870 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11871 ac_file=1 # Number of current file.
11872 ac_beg=1 # First line for current file.
11873 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11874 ac_more_lines=:
11875 ac_sed_cmds=""
11876 while $ac_more_lines; do
11877   if test $ac_beg -gt 1; then
11878     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11879   else
11880     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11881   fi
11882   if test ! -s conftest.s$ac_file; then
11883     ac_more_lines=false
11884     rm -f conftest.s$ac_file
11885   else
11886     if test -z "$ac_sed_cmds"; then
11887       ac_sed_cmds="sed -f conftest.s$ac_file"
11888     else
11889       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11890     fi
11891     ac_file=`expr $ac_file + 1`
11892     ac_beg=$ac_end
11893     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11894   fi
11895 done
11896 if test -z "$ac_sed_cmds"; then
11897   ac_sed_cmds=cat
11898 fi
11899 EOF
11900
11901 cat >> $CONFIG_STATUS <<EOF
11902
11903 CONFIG_FILES=\${CONFIG_FILES-"\
11904 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11905 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11906 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11907 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11908 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11909 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11910 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11911 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11912 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11913 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11914 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11915 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11916 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11917 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11918 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11919 include/Makefile:build/top.mk:include/Makefile.in \
11920 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11921 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11922 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11923 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11924 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11925 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11926 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11927 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11928 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11929 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11930 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11931 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11932 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
11933 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11934 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11935 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11936 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11937 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11938 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11939 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11940 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11941 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11942 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11943 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11944 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11945 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11946 "}
11947 EOF
11948 cat >> $CONFIG_STATUS <<\EOF
11949 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11950   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11951   case "$ac_file" in
11952   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11953        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11954   *) ac_file_in="${ac_file}.in" ;;
11955   esac
11956
11957   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11958
11959   # Remove last slash and all that follows it.  Not all systems have dirname.
11960   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11961   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11962     # The file is in a subdirectory.
11963     test ! -d "$ac_dir" && mkdir "$ac_dir"
11964     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11965     # A "../" for each directory in $ac_dir_suffix.
11966     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11967   else
11968     ac_dir_suffix= ac_dots=
11969   fi
11970
11971   case "$ac_given_srcdir" in
11972   .)  srcdir=.
11973       if test -z "$ac_dots"; then top_srcdir=.
11974       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11975   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11976   *) # Relative path.
11977     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11978     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11979   esac
11980
11981   case "$ac_given_INSTALL" in
11982   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11983   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11984   esac
11985
11986   echo creating "$ac_file"
11987   rm -f "$ac_file"
11988   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11989   case "$ac_file" in
11990   *Makefile*) ac_comsub="1i\\
11991 # $configure_input" ;;
11992   *) ac_comsub= ;;
11993   esac
11994
11995   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11996   sed -e "$ac_comsub
11997 s%@configure_input@%$configure_input%g
11998 s%@srcdir@%$srcdir%g
11999 s%@top_srcdir@%$top_srcdir%g
12000 s%@INSTALL@%$INSTALL%g
12001 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12002 fi; done
12003 rm -f conftest.s*
12004
12005 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12006 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12007 #
12008 # ac_d sets the value in "#define NAME VALUE" lines.
12009 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12010 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12011 ac_dC='\3'
12012 ac_dD='%g'
12013 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12014 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12015 ac_uB='\([      ]\)%\1#\2define\3'
12016 ac_uC=' '
12017 ac_uD='\4%g'
12018 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12019 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12020 ac_eB='$%\1#\2define\3'
12021 ac_eC=' '
12022 ac_eD='%g'
12023
12024 if test "${CONFIG_HEADERS+set}" != set; then
12025 EOF
12026 cat >> $CONFIG_STATUS <<EOF
12027   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
12028 EOF
12029 cat >> $CONFIG_STATUS <<\EOF
12030 fi
12031 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12032   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12033   case "$ac_file" in
12034   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12035        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12036   *) ac_file_in="${ac_file}.in" ;;
12037   esac
12038
12039   echo creating $ac_file
12040
12041   rm -f conftest.frag conftest.in conftest.out
12042   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12043   cat $ac_file_inputs > conftest.in
12044
12045 EOF
12046
12047 # Transform confdefs.h into a sed script conftest.vals that substitutes
12048 # the proper values into config.h.in to produce config.h.  And first:
12049 # Protect against being on the right side of a sed subst in config.status.
12050 # Protect against being in an unquoted here document in config.status.
12051 rm -f conftest.vals
12052 cat > conftest.hdr <<\EOF
12053 s/[\\&%]/\\&/g
12054 s%[\\$`]%\\&%g
12055 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12056 s%ac_d%ac_u%gp
12057 s%ac_u%ac_e%gp
12058 EOF
12059 sed -n -f conftest.hdr confdefs.h > conftest.vals
12060 rm -f conftest.hdr
12061
12062 # This sed command replaces #undef with comments.  This is necessary, for
12063 # example, in the case of _POSIX_SOURCE, which is predefined and required
12064 # on some systems where configure will not decide to define it.
12065 cat >> conftest.vals <<\EOF
12066 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12067 EOF
12068
12069 # Break up conftest.vals because some shells have a limit on
12070 # the size of here documents, and old seds have small limits too.
12071
12072 rm -f conftest.tail
12073 while :
12074 do
12075   ac_lines=`grep -c . conftest.vals`
12076   # grep -c gives empty output for an empty file on some AIX systems.
12077   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12078   # Write a limited-size here document to conftest.frag.
12079   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12080   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12081   echo 'CEOF
12082   sed -f conftest.frag conftest.in > conftest.out
12083   rm -f conftest.in
12084   mv conftest.out conftest.in
12085 ' >> $CONFIG_STATUS
12086   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12087   rm -f conftest.vals
12088   mv conftest.tail conftest.vals
12089 done
12090 rm -f conftest.vals
12091
12092 cat >> $CONFIG_STATUS <<\EOF
12093   rm -f conftest.frag conftest.h
12094   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12095   cat conftest.in >> conftest.h
12096   rm -f conftest.in
12097   if cmp -s $ac_file conftest.h 2>/dev/null; then
12098     echo "$ac_file is unchanged"
12099     rm -f conftest.h
12100   else
12101     # Remove last slash and all that follows it.  Not all systems have dirname.
12102       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12103       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12104       # The file is in a subdirectory.
12105       test ! -d "$ac_dir" && mkdir "$ac_dir"
12106     fi
12107     rm -f $ac_file
12108     mv conftest.h $ac_file
12109   fi
12110 fi; done
12111
12112 EOF
12113 cat >> $CONFIG_STATUS <<EOF
12114
12115 EOF
12116 cat >> $CONFIG_STATUS <<\EOF
12117
12118 date > stamp-h
12119 echo Please \"make depend\" to build dependencies
12120
12121 exit 0
12122 EOF
12123 chmod +x $CONFIG_STATUS
12124 rm -fr confdefs* $ac_clean_files
12125 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12126