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